-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move fuction to get kubelet path into
util
package (#365)
This function will be reused in upcoming `PodMounter` and `util` package seems like a better place. --- By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. Signed-off-by: Burak Varlı <[email protected]>
- Loading branch information
Showing
2 changed files
with
17 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package util | ||
|
||
import "os" | ||
|
||
const defaultKubeletPath = "/var/lib/kubelet" | ||
|
||
// KubeletPath returns path of the kubelet. | ||
// It looks for `KUBELET_PATH` variable, and returns a default path if its not defined. | ||
func KubeletPath() string { | ||
kubeletPath := os.Getenv("KUBELET_PATH") | ||
if kubeletPath == "" { | ||
return defaultKubeletPath | ||
} | ||
return kubeletPath | ||
} |