()
| 74 | } |
| 75 | |
| 76 | func 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. |
no outgoing calls