-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(apps/prod/tekton/setup): fix the issue arm64 image for prune (#644)
Signed-off-by: wuhuizuo <wuhuizuo@126.com>
- Loading branch information
Showing
3 changed files
with
1,079 additions
and
1 deletion.
There are no files selected for viewing
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,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
function main() { | ||
local ns=$1 | ||
local account=$2 | ||
local saSecretName=$(kubectl -n $ns get sa/${account} -o jsonpath='{.secrets[0].name}') | ||
local saToken=$(kubectl -n $ns get secret/${saSecretName} -o jsonpath='{.data.token}' | base64 -d) | ||
local kubeServer=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}') | ||
local kubeCA=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.certificate-authority-data}') | ||
|
||
kubectl config set-cluster "${ns}-${account}" --server=$kubeServer --certificate-authority=<(echo $kubeCA | base64 -d) --embed-certs=true --kubeconfig=${ns}-${account}.conf | ||
kubectl config set-credentials ${account} --token=$saToken --kubeconfig=${ns}-${account}.conf | ||
kubectl config set-context "${ns}-${account}" --cluster="${ns}-${account}" --user=${account} --namespace=$ns --kubeconfig=${ns}-${account}.conf | ||
kubectl config use-context "${ns}-${account}" --kubeconfig="${ns}-${account}".conf | ||
} | ||
|
||
main "$@" |
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
Oops, something went wrong.