microsoft / azure-pipelines-tasks

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

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

Open ricardomomm opened 1 year ago

ricardomomm commented 1 year 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 8 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 8 months ago

Bump

ricardomomm commented 6 months ago

Bump

github-actions[bot] commented 2 weeks 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 2 weeks ago

bump