-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moves kubeconfig creation logic inside svc account service
- Loading branch information
1 parent
4cacf94
commit 8cea90b
Showing
7 changed files
with
92 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package resources | ||
|
||
import ( | ||
"encoding/base64" | ||
"log" | ||
runtime "sigs.k8s.io/controller-runtime" | ||
) | ||
|
||
// getCaBase64 returns the base64 encoding of the Kubernetes cluster api-server CA | ||
func getCaBase64() string { | ||
|
||
kConfig, err := runtime.GetConfig() | ||
|
||
if err != nil { | ||
log.Fatalf("Unable to get kubeconfig.\n%v", err) | ||
} | ||
|
||
return base64.StdEncoding.EncodeToString(kConfig.CAData) | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ package resources | |
|
||
import ( | ||
"context" | ||
|
||
k8sclient "k8s.io/client-go/kubernetes" | ||
) | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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