feat: implement scheduler-k3s:show-config
This commit is contained in:
1 parent
a2504fadd2
commit
6b85374857
3 files changed
+21
-1
No files matched your search
@@ -116,3 +116,19 @@ func CommandSet(appName string, property string, value string) error {
|
||||
common.CommandPropertySet("scheduler-k3s", appName, property, value, DefaultProperties, GlobalProperties)
|
||||
return nil
|
||||
}
|
||||
|
||||
// CommandShowKubeconfig displays the kubeconfig file contents
|
||||
func CommandShowKubeconfig() error {
|
||||
if !common.FileExists(KubeConfigPath) {
|
||||
return fmt.Errorf("Kubeconfig file does not exist: %s", KubeConfigPath)
|
||||
}
|
||||
|
||||
b, err := os.ReadFile(KubeConfigPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Unable to read kubeconfig file: %w", err)
|
||||
}
|
||||
|
||||
fmt.Println(string(b))
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user