MCPcopy Create free account
hub / github.com/conforma/cli / createK8SClient

Function createK8SClient

internal/kubernetes/client.go:76–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74}
75
76func createK8SClient() (client dynamic.Interface, err error) {
77 rules := clientcmd.NewDefaultClientConfigLoadingRules()
78 if kubeconfig != "" {
79 rules.ExplicitPath = kubeconfig
80 }
81
82 clientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(rules, nil)
83
84 var config *rest.Config
85 config, err = clientConfig.ClientConfig()
86 if err != nil {
87 return
88 }
89
90 client, err = dynamic.NewForConfig(config)
91
92 return
93}
94
95// FetchEnterpriseContractPolicy gets the Enterprise Contract Policy from the given
96// reference in a Kubernetes cluster.

Callers 2

NewClientFunction · 0.85

Calls

no outgoing calls

Tested by 1