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

[BUG]: Kubernetes@1 with kubernetesServiceEndpoint tries to use azureServiceEndpoint #20797

Open
3 tasks done
mluker opened this issue Jan 21, 2025 · 0 comments
Open
3 tasks done

Comments

@mluker
Copy link
Member

mluker commented Jan 21, 2025

New issue checklist

Task name

Kubernetes

Task version

@1

Issue Description

The following task using kubernetesServiceEndpoint seems to be using azureSubscriptionEndpoint based on the pipeline logs.

I need a way to use the kubernetesServiceConnection to login and be able to write out a .kube/config so it can be used later in a terraform provider block.

- task: Kubernetes@1
    inputs:
      connectionType: 'Kubernetes Service Connection'
      kubernetesServiceEndpoint: ${{ parameters.aksServiceConnection }}
      command: login
    displayName: 🔓 AKS Login
##[debug]found: '/mnt/vss/_work/_temp/*/bin/linux_amd64/kubelogin'
##[debug]Kubelogin is installed. Converting kubeconfig.
**##[debug]azureSubscriptionEndpoint=undefined**
##[debug]undefined auth scheme = undefined
##[debug]Kubelogin authentication scheme undefined
##[debug]Kubelogin authentication failed. Exception: TypeError: Cannot read properties of undefined (reading 'toLowerCase')
    at Kubelogin.<anonymous> (/mnt/vss/_work/_tasks/Kubernetes_cbc*/1.247.3/node_modules/azure-pipelines-tasks-kubernetes-common/kubelogin.js:37:28)
    at Generator.next (<anonymous>)
    at /mnt/vss/_work/_tasks/Kubernetes_*/1.247.3/node_modules/azure-pipelines-tasks-kubernetes-common/kubelogin.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/mnt/vss/_work/_tasks/Kubernetes_cbc*/1.247.3/node_modules/azure-pipelines-tasks-kubernetes-common/kubelogin.js:4:12)
    at Kubelogin.login (/mnt/vss/_work/_tasks/Kubernetes_cbc*/1.247.3/node_modules/azure-pipelines-tasks-kubernetes-common/kubelogin.js:34:16)
    at ClusterConnection.<anonymous> (/mnt/vss/_work/_tasks/Kubernetes_cbc316a2-586f-4def-be79-488a1f503564/1.247.3/src/clusterconnection.js:79:41)
    at Generator.next (<anonymous>)
    at /mnt/vss/_work/_tasks/Kubernetes_cbc*/1.247.3/src/clusterconnection.js:8:71
    at new Promise (<anonymous>)
##[debug]which '/usr/bin/kubectl'
##[debug]found: '/usr/bin/kubectl'
##[debug]/usr/bin/kubectl arg: version
##[debug]/usr/bin/kubectl arg: ["-o","json"]
##[debug]exec tool: /usr/bin/kubectl
##[debug]arguments:
##[debug]   version
##[debug]   -o
##[debug]   json```

### Environment type (Please select at least one enviroment where you face this issue)

- [ ] Self-Hosted
- [x] Managed DevOps Pools
- [ ] VMSS Pool
- [ ] Container

### Operation system

ubuntu-latest

### Relevant log output

```shell
##[debug]which 'kubelogin'
##[debug]found: '/mnt/vss/_work/_temp/*/bin/linux_amd64/kubelogin'
##[debug]Kubelogin is installed. Converting kubeconfig.
**##[debug]azureSubscriptionEndpoint=undefined**
##[debug]undefined auth scheme = undefined
##[debug]Kubelogin authentication scheme undefined
##[debug]Kubelogin authentication failed. Exception: TypeError: Cannot read properties of undefined (reading 'toLowerCase')
    at Kubelogin.<anonymous> (/mnt/vss/_work/_tasks/Kubernetes_cbc*/1.247.3/node_modules/azure-pipelines-tasks-kubernetes-common/kubelogin.js:37:28)
    at Generator.next (<anonymous>)
    at /mnt/vss/_work/_tasks/Kubernetes_*/1.247.3/node_modules/azure-pipelines-tasks-kubernetes-common/kubelogin.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/mnt/vss/_work/_tasks/Kubernetes_cbc*/1.247.3/node_modules/azure-pipelines-tasks-kubernetes-common/kubelogin.js:4:12)
    at Kubelogin.login (/mnt/vss/_work/_tasks/Kubernetes_cbc*/1.247.3/node_modules/azure-pipelines-tasks-kubernetes-common/kubelogin.js:34:16)
    at ClusterConnection.<anonymous> (/mnt/vss/_work/_tasks/Kubernetes_cbc316a2-586f-4def-be79-488a1f503564/1.247.3/src/clusterconnection.js:79:41)
    at Generator.next (<anonymous>)
    at /mnt/vss/_work/_tasks/Kubernetes_cbc*/1.247.3/src/clusterconnection.js:8:71
    at new Promise (<anonymous>)
##[debug]which '/usr/bin/kubectl'
##[debug]found: '/usr/bin/kubectl'
##[debug]/usr/bin/kubectl arg: version
##[debug]/usr/bin/kubectl arg: ["-o","json"]
##[debug]exec tool: /usr/bin/kubectl
##[debug]arguments:
##[debug]   version
##[debug]   -o
##[debug]   json
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant