mirror of
https://github.com/rancher/rke.git
synced 2025-09-17 07:30:01 +00:00
Enable PodSecurityPolicy support
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package k8s
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
yamlutil "k8s.io/apimachinery/pkg/util/yaml"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
)
|
||||
@@ -17,3 +20,8 @@ func NewClient(kubeConfigPath string) (*kubernetes.Clientset, error) {
|
||||
}
|
||||
return K8sClientSet, nil
|
||||
}
|
||||
|
||||
func decodeYamlResource(resource interface{}, yamlManifest string) error {
|
||||
decoder := yamlutil.NewYAMLToJSONDecoder(bytes.NewReader([]byte(yamlManifest)))
|
||||
return decoder.Decode(&resource)
|
||||
}
|
||||
|
Reference in New Issue
Block a user