Skip to content

Commit 357a297

Browse files
feat: use binary-name instead of .binary-name (#224)
inside the .config we should be using binary-name and not .binary-name.
1 parent 80feaf5 commit 357a297

File tree

7 files changed

+20
-28
lines changed

7 files changed

+20
-28
lines changed

e2e/scripts/embed-and-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,6 @@ main() {
143143
}
144144

145145
export EMBEDDED_CLUSTER_METRICS_BASEURL="https://staging.replicated.app"
146-
export KUBECONFIG=/root/.config/.embedded-cluster/etc/kubeconfig
147-
export PATH=$PATH:/root/.config/.embedded-cluster/bin
146+
export KUBECONFIG=/root/.config/embedded-cluster/etc/kubeconfig
147+
export PATH=$PATH:/root/.config/embedded-cluster/bin
148148
main

e2e/scripts/embedded-preflight.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,6 @@ main() {
189189
}
190190

191191
export EMBEDDED_CLUSTER_METRICS_BASEURL="https://staging.replicated.app"
192-
export KUBECONFIG=/root/.config/.embedded-cluster/etc/kubeconfig
193-
export PATH=$PATH:/root/.config/.embedded-cluster/bin
192+
export KUBECONFIG=/root/.config/embedded-cluster/etc/kubeconfig
193+
export PATH=$PATH:/root/.config/embedded-cluster/bin
194194
main

e2e/scripts/install-with-disabled-addons.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ main() {
9494
}
9595

9696
export EMBEDDED_CLUSTER_METRICS_BASEURL="https://staging.replicated.app"
97-
export KUBECONFIG=/root/.config/.embedded-cluster/etc/kubeconfig
98-
export PATH=$PATH:/root/.config/.embedded-cluster/bin
97+
export KUBECONFIG=/root/.config/embedded-cluster/etc/kubeconfig
98+
export PATH=$PATH:/root/.config/embedded-cluster/bin
9999
main

e2e/scripts/single-node-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ main() {
8787
}
8888

8989
export EMBEDDED_CLUSTER_METRICS_BASEURL="https://staging.replicated.app"
90-
export KUBECONFIG=/root/.config/.embedded-cluster/etc/kubeconfig
91-
export PATH=$PATH:/root/.config/.embedded-cluster/bin
90+
export KUBECONFIG=/root/.config/embedded-cluster/etc/kubeconfig
91+
export PATH=$PATH:/root/.config/embedded-cluster/bin
9292
main

e2e/scripts/unsupported-overrides.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ main() {
7272
}
7373

7474
export EMBEDDED_CLUSTER_METRICS_BASEURL="https://staging.replicated.app"
75-
export KUBECONFIG=/root/.config/.embedded-cluster/etc/kubeconfig
76-
export K0SCTLCONFIG=/root/.config/.embedded-cluster/etc/k0sctl.yaml
77-
export PATH=$PATH:/root/.config/.embedded-cluster/bin
75+
export KUBECONFIG=/root/.config/embedded-cluster/etc/kubeconfig
76+
export K0SCTLCONFIG=/root/.config/embedded-cluster/etc/k0sctl.yaml
77+
export PATH=$PATH:/root/.config/embedded-cluster/bin
7878
main

e2e/scripts/wait-for-ready-nodes.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ main() {
2222
}
2323

2424
export EMBEDDED_CLUSTER_METRICS_BASEURL="https://staging.replicated.app"
25-
export KUBECONFIG=/root/.config/.embedded-cluster/etc/kubeconfig
26-
export PATH=$PATH:/root/.config/.embedded-cluster/bin
25+
export KUBECONFIG=/root/.config/embedded-cluster/etc/kubeconfig
26+
export PATH=$PATH:/root/.config/embedded-cluster/bin
2727
main "$@"

pkg/defaults/provider.go

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,14 @@ func (d *Provider) config() string {
7171
if err != nil {
7272
logrus.Fatalf("unable to get user home dir: %s", err)
7373
}
74-
7574
// use the XDG_CONFIG_HOME environment variable if set
7675
if xdgConfigHome := os.Getenv("XDG_CONFIG_HOME"); xdgConfigHome != "" {
7776
return xdgConfigHome
7877
}
79-
8078
// otherwise, default to $HOME/.config on linux
8179
if runtime.GOOS == "linux" {
8280
return filepath.Join(home, ".config")
8381
}
84-
8582
return home
8683
}
8784

@@ -119,10 +116,9 @@ func (d *Provider) BinaryName() string {
119116
}
120117

121118
// EmbeddedClusterLogsSubDir returns the path to the directory where embedded-cluster logs are
122-
// stored. This is a subdirectory of the user's home directory.
119+
// stored.
123120
func (d *Provider) EmbeddedClusterLogsSubDir() string {
124-
hidden := fmt.Sprintf(".%s", d.BinaryName())
125-
return filepath.Join(d.Base, d.state(), hidden, "logs")
121+
return filepath.Join(d.Base, d.state(), d.BinaryName(), "logs")
126122
}
127123

128124
// PathToLog returns the full path to a log file. This function does not check
@@ -140,15 +136,13 @@ func (d *Provider) K0sctlBinsSubDir() string {
140136

141137
// HelmChartSubDir returns the path to the directory where helm charts are stored
142138
func (d *Provider) HelmChartSubDir() string {
143-
hidden := fmt.Sprintf(".%s", d.BinaryName())
144-
return filepath.Join(d.Base, d.home(), hidden, "charts")
139+
return filepath.Join(d.Base, d.config(), d.BinaryName(), "charts")
145140
}
146141

147142
// EmbeddedClusterBinsSubDir returns the path to the directory where embedded-cluster binaries
148-
// are stored. This is a subdirectory of the user's home directory.
143+
// are stored.
149144
func (d *Provider) EmbeddedClusterBinsSubDir() string {
150-
hidden := fmt.Sprintf(".%s", d.BinaryName())
151-
return filepath.Join(d.Base, d.config(), hidden, "bin")
145+
return filepath.Join(d.Base, d.config(), d.BinaryName(), "bin")
152146
}
153147

154148
// K0sctlApplyLogPath returns the path to the k0sctl apply log file.
@@ -173,11 +167,9 @@ func (d *Provider) SSHConfigSubDir() string {
173167
}
174168

175169
// ConfigSubDir returns the path to the directory where k0sctl configuration
176-
// files are stored. This is a subdirectory of the user's home directory.
177-
// TODO update
170+
// files are stored.
178171
func (d *Provider) ConfigSubDir() string {
179-
hidden := fmt.Sprintf(".%s", d.BinaryName())
180-
return filepath.Join(d.Base, d.config(), hidden, "etc")
172+
return filepath.Join(d.Base, d.config(), d.BinaryName(), "etc")
181173
}
182174

183175
// K0sBinaryPath returns the path to the k0s binary.

0 commit comments

Comments
 (0)