Skip to content
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

use-kubelogin option does not work properly #66

Closed
illinar opened this issue Jun 8, 2022 · 4 comments
Closed

use-kubelogin option does not work properly #66

illinar opened this issue Jun 8, 2022 · 4 comments
Assignees
Labels
waiting-for-customer Waiting for inputs from customer

Comments

@illinar
Copy link

illinar commented Jun 8, 2022

Setting use-kubelogin does indeed executes kubelogin, but it seems to modify wrong kubeconfig file.

Run azure/[email protected]
  with:
    cluster-name: xxx
    resource-group: xxx
    admin: false
    use-kubelogin: true
/usr/bin/az aks get-credentials --resource-group xxx --name xxx -f /home/runner/work/_temp/kubeconfig_1654654112792
WARNING: Merged "xxx" as current context in /home/runner/work/_temp/kubeconfig_1654654112792
/usr/local/bin/kubelogin convert-kubeconfig -l azurecli

Yet subsequent actions do not see updated kubeconfig. For instance,

Run azure/[email protected]
Deploying manifests
/usr/local/bin/kubectl apply -f /tmp/baked-template-1654654116421.yaml --insecure-skip-tls-verify --namespace xxx
WARNING: the azure auth plugin is deprecated in v1.22+, unavailable in v1.25+; use https://github.com/Azure/kubelogin instead.
...

At the same time running /usr/local/bin/kubelogin convert-kubeconfig -l azurecli manually as a separate step after aks-set-context has finished executing seems to work fine.

After looking at the source code I suspect the problem is that kubelogin is executed before $KUBECONFIG environment variable has been exported. As such it does not "see" the right file to kubeloginify.

@illinar illinar added the need-to-triage Requires investigation label Jun 8, 2022
@OliverMKing OliverMKing removed the need-to-triage Requires investigation label Jun 13, 2022
@davidgamero
Copy link
Collaborator

fix is merged. let me know if it works for you @illinar

@davidgamero davidgamero added the waiting-for-customer Waiting for inputs from customer label Jun 13, 2022
@illinar
Copy link
Author

illinar commented Jun 14, 2022

Thanks, but how can we test it without the released action?

@davidgamero
Copy link
Collaborator

davidgamero commented Jun 16, 2022

good point. I'm releasing v2.3 now with the fix

@illinar
Copy link
Author

illinar commented Jun 17, 2022

Confirmed. v2.3 works.

@illinar illinar closed this as completed Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-customer Waiting for inputs from customer
Projects
None yet
Development

No branches or pull requests

3 participants