部署到kubernetes的Azure管道不适用于单引号

时间:2019-04-19 19:01:26

标签: azure azure-devops azure-pipelines azure-pipelines-release-pipeline

似乎代理上安装的kubectl不允许在pod名称上使用单引号。当我不使用引号时,它会起作用。

2019-04-19T18:48:42.5271806Z ##[section]Starting: kubectl exec copy
2019-04-19T18:48:42.5279597Z ==============================================================================
2019-04-19T18:48:42.5279703Z Task         : Deploy to Kubernetes
2019-04-19T18:48:42.5279798Z Description  : Deploy, configure, update your Kubernetes cluster in Azure Container Service by running kubectl commands.
2019-04-19T18:48:42.5279903Z Version      : 1.150.8
2019-04-19T18:48:42.5279976Z Author       : Microsoft Corporation
2019-04-19T18:48:42.5280044Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=851275)
2019-04-19T18:48:42.5280141Z ==============================================================================
2019-04-19T18:48:43.3986893Z Downloading: https://storage.googleapis.com/kubernetes-release/release/v1.13.3/bin/linux/amd64/kubectl
2019-04-19T18:48:44.0419669Z Caching tool: kubectl 1.13.3 x64
2019-04-19T18:48:44.1159178Z Prepending PATH environment variable with directory: /opt/hostedtoolcache/kubectl/1.13.3/x64
2019-04-19T18:48:44.1454719Z [command]/opt/hostedtoolcache/kubectl/1.13.3/x64/kubectl exec -n namespace -it 'pod-name' -c container -- hostname
2019-04-19T18:48:44.3492926Z Error from server (NotFound): pods "'pod-name'" not found
2019-04-19T18:48:44.3584168Z ##[error]Error from server (NotFound): pods "'pod-name'" not found
2019-04-19T18:48:44.3598314Z ##[error]/opt/hostedtoolcache/kubectl/1.13.3/x64/kubectl failed with return code: 1

我想动态获取吊舱名称,并且从以前的“获取吊舱输出变量”中获取它,但是当我在exec args中使用它时,它会设置单引号,然后由于单引号而失败。

0 个答案:

没有答案
相关问题