microsoft / azure-pipelines-tasks

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

[BUG]: Behavior mismatch when using scale command between pipeline and regular powershell terminal #19040

Open ricardomomm opened 11 months ago

ricardomomm commented 11 months ago

Task name

Kubernetes

Task version

1

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

Windows 10

Task log

Starting: Resume XYZ Service
==============================================================================
Task         : Kubectl
Description  : Deploy, configure, update a Kubernetes cluster in Azure Container Service by running kubectl commands
Version      : 1.227.0
Author       : Microsoft Corporation
Help         : https://aka.ms/azpipes-kubectl-tsg
==============================================================================
==============================================================================
            Kubectl Client Version: v1.27.2
            Kubectl Server Version: v1.24.15
==============================================================================
"F:\AzureAgents\Agent 2\_work\_tool\kubectl\1.27.2\x64\kubectl.exe" scale -n mynamespace --replicas='1' deployment/mydeployment -o json
error: invalid argument "'1'" for "--replicas" flag: strconv.ParseInt: parsing "'1'": invalid syntax
See 'kubectl scale --help' for usage.
commandOutput
##[error]The process 'F:\AzureAgents\Agent 2\_work\_tool\kubectl\1.27.2\x64\kubectl.exe' failed with exit code 1
Finishing: Resume XYZ Service

Relevant log output

error: invalid argument "'1'" for "--replicas" flag: strconv.ParseInt: parsing "'1'": invalid syntax

Aditional info

When executing locally, same kubectl version against the same aks cluster it works as expected with either '1' (single quotes), "1" (double quotes) or 1 (no quotes):

PS C:\Users\RM> kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.27.2
Kustomize Version: v5.0.1
Server Version: v1.24.15
PS C:\Users\RM> kubectl scale -n mynamespace --replicas="1" deployment/mydeployment
deployment.apps/mydeployment scaled
PS C:\Users\RM> kubectl scale -n mynamespace --replicas='1' deployment/mydeployment
deployment.apps/mydeployment scaled

Local environment:
Windows 11
PSVersion 5.1.22621.1778
github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

ricardomomm commented 5 months ago

Bump

ricardomomm commented 3 months ago

Bump