microsoft / azure-pipelines-tasks

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

'%' is replaced to '%25' in output variable for the Kubernetes@1 #17536

Closed tomaeda closed 1 year ago

tomaeda commented 1 year ago

Question, Bug, or Feature?
Type: Bug

Enter Task Name: KubernetesV1 https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/KubernetesV1

Environment

Issue Description

I used get command with Kubernetes@1 to output variable for yaml format. When % is included in the output, it is replaced by %25 in the output variable. The same result if the output format is JSON.

I set job level variable DECODE_PERCENTS to true with reference to #14302, but the result didn't change.

image

The red line should have been 25%, but has been replaced with 25%25.

Task logs

logs_2505.zip

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Error logs

[Insert error from the logs here for a quick overview]

tomaeda commented 1 year ago

I may be missing my explanation, so I will supplement it. I think this is a issue with ##vso[task.setvariable] which set output variable.

Please look at the 6_kubetest.txt from the I attached log file. Of the information retrieved by the kubectl get command, lines 202 and 203 show 25%.

image

However, in lines 398 and 399 with it set as an output variable, 25% changes to 25%25.

image

Line 469 shows the ##vso[task.setvariable variable=KubectlOutput;issecret=false;] processed. I can seen that 25% has already changed to 25% 25 in it.

image

When I display the output variable of task with the echo command, it still stays at 25%25. This can be seen in 7_CmdLine.txt. Please let me know if there are any unclear in my explanation.

tomaeda commented 1 year ago

Is this the expected behavior of task? If so, is there a workaround for me to get the correct output variable?

rikat-ms commented 1 year ago

The issue was resolved by #17267 - version 1.214.0. So, the issue no longer occurs.

github-actions[bot] commented 1 year 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