@@ -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.
123120func (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
142138func (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.
149144func (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.
178171func (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