-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to rename the generated kubectl context #86
Comments
Thanks for the FR @abonander |
I was going to suggest that, though I was concerned about possibly breaking existing workflows. |
Currently we use a random name and set KUBECONFIG, so I think we should be okay. |
Really? Cause it looks like it uses the cluster name: https://github.com/google-github-actions/get-gke-credentials/blob/main/src/gkeClient.ts#L187 |
@abonander ah yes, you are right. I was thinking about the filename. I think we can add the context_name first and evaluate defaulting later. Considering this is pre 1.0, we could have an upgrade guide showing how to get that behavior. /cc @averikitsch any thoughts? with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}
+ context_name: ${{ env.GKE_CLUSTER }} |
Copied description from https://github.com/google-github-actions/get-gke-credentials/blob/ddd7b291443a04993b1497fc36583a21ec67a5fe/action.yaml#L58-L62 #86 #159 Signed-off-by: Chenyu Zhao <[email protected]>
TL;DR
We have local build-and-deploy shell scripts that I'm trying to incorporate into a Github Actions workflow, and these scripts use
kubectl --context=<context name>
so as to ensure the correct context is used even if the current-context is different.However, the context name you get locally when you run
gcloud container clusters get-credentials
looks something like this:Whereas this Action names the context the same as the cluster, which means having to rename the context before invoking our script:
Design
I'd just like to be able to pass the name that should be used for the generated context:
The text was updated successfully, but these errors were encountered: