Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions etcd/cmd/microshift-etcd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ func (s *EtcdService) configure(cfg *config.Config) {
s.maxFragmentedPercentage = cfg.Etcd.MaxFragmentedPercentage
s.defragCheckFreq = cfg.Etcd.DefragCheckFreq

microshiftDataDir := config.GetDataDir()
certsDir := cryptomaterial.CertsDirectory(microshiftDataDir)
certsDir := cryptomaterial.CertsDirectory(config.DataDir)

etcdServingCertDir := cryptomaterial.EtcdServingCertDir(certsDir)
etcdPeerCertDir := cryptomaterial.EtcdPeerCertDir(certsDir)
etcdSignerCertPath := cryptomaterial.CACertPath(cryptomaterial.EtcdSignerDir(certsDir))
dataDir := filepath.Join(microshiftDataDir, s.Name())
dataDir := filepath.Join(config.DataDir, s.Name())

// based on https://github.com/openshift/cluster-etcd-operator/blob/master/bindata/bootkube/bootstrap-manifests/etcd-member-pod.yaml#L19
s.etcdCfg = etcd.NewConfig()
Expand Down
21 changes: 0 additions & 21 deletions etcd/vendor/github.com/mitchellh/go-homedir/LICENSE

This file was deleted.

14 changes: 0 additions & 14 deletions etcd/vendor/github.com/mitchellh/go-homedir/README.md

This file was deleted.

167 changes: 0 additions & 167 deletions etcd/vendor/github.com/mitchellh/go-homedir/homedir.go

This file was deleted.

27 changes: 2 additions & 25 deletions etcd/vendor/github.com/openshift/microshift/pkg/config/files.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions etcd/vendor/github.com/openshift/microshift/pkg/config/node.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion etcd/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ github.com/mailru/easyjson/jwriter
github.com/matttproud/golang_protobuf_extensions/pbutil
# github.com/mitchellh/go-homedir v1.1.0
## explicit
github.com/mitchellh/go-homedir
# github.com/mitchellh/go-wordwrap v1.0.0
## explicit
github.com/mitchellh/go-wordwrap
Expand Down
10 changes: 4 additions & 6 deletions pkg/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ import (
"github.com/openshift/microshift/pkg/util/cryptomaterial/certchains"
)

var microshiftDataDir = config.GetDataDir()

func initCerts(cfg *config.Config) (*certchains.CertificateChains, error) {
certChains, err := certSetup(cfg)
if err != nil {
Expand Down Expand Up @@ -86,7 +84,7 @@ func certSetup(cfg *config.Config) (*certchains.CertificateChains, error) {
externalCertNames = append(externalCertNames, cfg.Node.NodeIP)
}

certsDir := cryptomaterial.CertsDirectory(microshiftDataDir)
certsDir := cryptomaterial.CertsDirectory(config.DataDir)

certChains, err := certchains.NewCertificateChains(
// ------------------------------
Expand Down Expand Up @@ -350,7 +348,7 @@ func certSetup(cfg *config.Config) (*certchains.CertificateChains, error) {
return nil, err
}

saKeyDir := filepath.Join(microshiftDataDir, "/resources/kube-apiserver/secrets/service-account-key")
saKeyDir := filepath.Join(config.DataDir, "/resources/kube-apiserver/secrets/service-account-key")
if err := util.EnsureKeyPair(
filepath.Join(saKeyDir, "service-account.pub"),
filepath.Join(saKeyDir, "service-account.key"),
Expand All @@ -370,11 +368,11 @@ func initKubeconfigs(
cfg *config.Config,
certChains *certchains.CertificateChains,
) error {
externalTrustPEM, err := os.ReadFile(cryptomaterial.CACertPath(cryptomaterial.KubeAPIServerExternalSigner(cryptomaterial.CertsDirectory(microshiftDataDir))))
externalTrustPEM, err := os.ReadFile(cryptomaterial.CACertPath(cryptomaterial.KubeAPIServerExternalSigner(cryptomaterial.CertsDirectory(config.DataDir))))
if err != nil {
return fmt.Errorf("failed to load the external trust signer: %v", err)
}
internalTrustPEM, err := os.ReadFile(cryptomaterial.CACertPath(cryptomaterial.KubeAPIServerLocalhostSigner(cryptomaterial.CertsDirectory(microshiftDataDir))))
internalTrustPEM, err := os.ReadFile(cryptomaterial.CACertPath(cryptomaterial.KubeAPIServerLocalhostSigner(cryptomaterial.CertsDirectory(config.DataDir))))
if err != nil {
return fmt.Errorf("failed to load the internal trust signer: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func RunMicroshift(cfg *config.Config) error {
klog.Fatal(err)
}

os.MkdirAll(microshiftDataDir, 0700)
os.MkdirAll(config.DataDir, 0700)

// TODO: change to only initialize what is strictly necessary for the selected role(s)
certChains, err := initCerts(cfg)
Expand Down
2 changes: 0 additions & 2 deletions pkg/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"k8s.io/klog/v2"
)

var microshiftDataDir = config.GetDataDir()

func StartComponents(cfg *config.Config) error {
kubeAdminConfig := cfg.KubeConfigPath(config.KubeAdmin)

Expand Down
Loading