microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.51k stars 2.62k forks source link

[BUG]: HelmDeploy@0 ignores environment #20011

Open PAKalucki opened 5 months ago

PAKalucki commented 5 months ago

New issue checklist

Task name

HelmDeploy@0

Task version

0.238.1

Issue Description

I have environment with resources created and I have confirmed that it created service connection. HelmDeploy@0 ignores environment and requires kubernetesServiceEndpoint. This is inconsistent with other kubernetes related tasks like Kubernetes@1 where it automatically picks up the service connection from environment. image

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

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu

Relevant log output

Starting: Helm upgrade
==============================================================================
Task         : Package and deploy Helm charts
Description  : Deploy, configure, update a Kubernetes cluster in Azure Container Service by running helm commands
Version      : 0.238.1
Author       : Microsoft Corporation
Help         : https://aka.ms/azpipes-helm-tsg
==============================================================================
##[error]Error: Input required: kubernetesServiceEndpoint
Finishing: Helm upgrade

Full task logs with system.debug enabled

No response

Repro steps

jobs:
  - deployment: Deploy
    displayName: Deploy to Kubernetes
    pool:
      vmImage: ubuntu-latest
    environment: 
      name: ${{ parameters.environment }}
    strategy:
      runOnce:
        deploy:
          steps:
          - checkout: self

          - task: HelmDeploy@0
            displayName: Helm upgrade
            inputs:
              namespace: ${{ parameters.namespace }}
              command: upgrade
              chartType: filepath
              chartPath: ./charts/${{ parameters.project_name }}
              releaseName: ${{ parameters.project_name }}
              install: true
              waitForExecution: true
              valueFile: ./charts/${{ parameters.project_name }}/${{ parameters.values }}
              overrideValues: |
                image.repository=${{ parameters.repository }}
                image.tag=${{ parameters.tag }}
                env=${{ parameters.env_name }}