Last active
June 1, 2020 10:45
-
-
Save abohmeed/f6d1dbb4f542f1628c2914f6d9d313f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config, err := clientcmd.BuildConfigFromFlags("", kubeconfig) | |
| clientset, err := kubernetes.NewForConfig(config) | |
| check("The following error occured while loading the Kube Config file", err) | |
| csr := &certificates.CertificateSigningRequest{ | |
| ObjectMeta: v1.ObjectMeta{ | |
| Name: "tempcsr", | |
| }, | |
| Spec: certificates.CertificateSigningRequestSpec{ | |
| Groups: []string{ | |
| "system:authenticated", | |
| }, | |
| Request: pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE REQUEST", Bytes: bytes}), | |
| }, | |
| } | |
| _, err = clientset.CertificatesV1beta1().CertificateSigningRequests().Create(context.TODO(), csr, v1.CreateOptions{}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment