1
0
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:
moelsayed
2017-12-20 03:51:07 +02:00
parent 04a137b097
commit 2011a2cf01
10 changed files with 268 additions and 3 deletions

View File

@@ -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)
}