update vault integration
This commit is contained in:
21
internal/config/kubernetes.go
Normal file
21
internal/config/kubernetes.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
)
|
||||
|
||||
var kubernetesConfig *rest.Config
|
||||
|
||||
func GetKubernetesConfig() *rest.Config {
|
||||
appConfig := GetConfig()
|
||||
kubeconfigPath := filepath.Join(appConfig.WorkDir, "k8s-admin.conf")
|
||||
|
||||
kubernetesConfig, err := clientcmd.BuildConfigFromFlags("", kubeconfigPath)
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
return kubernetesConfig
|
||||
}
|
||||
Reference in New Issue
Block a user