由于工作流程文件中的“时间”表达式无效,因此无法执行Argo工作流程

时间:2019-11-13 09:37:04

标签: kubernetes kubernetes-helm argo

错误:-

  

我收到无效的“当”表达式“ {{steps.check-channel-exists.outputs.result}}”的错误:无效的令牌:“ {{”。

我正在尝试执行工作流程。有人可以指出我正确的方向以便我解决这个问题吗?

<pre>
Name:                hlf-peer-orgs-mzl4r
Namespace:           default
ServiceAccount:      default
Status:              Failed
Message:             child &apos;hlf-peer-orgs-mzl4r-1496023914&apos; failed
Created:             Wed Nov 13 14:38:16 +0530 (3 seconds ago)
Started:             Wed Nov 13 14:38:16 +0530 (3 seconds ago)
Finished:            Wed Nov 13 14:38:19 +0530 (now)
Duration:            3 seconds

STEP                                                                   PODNAME                         DURATION  MESSAGE
 <font color="#CC0000">✖</font> hlf-peer-orgs-mzl4r (peer-orgs)                                                                               child &apos;hlf-peer-orgs-mzl4r-1496023914&apos; failed
 └---<font color="#CC0000">✖</font> channels (channels)                                                                                       child &apos;hlf-peer-orgs-mzl4r-1274747783&apos; failed
     └---<font color="#CC0000">✖</font> common (channel--common)                                                                              Invalid &apos;when&apos; expression &apos;{{steps.check-channel-exists.outputs.result}}&apos;: Invalid token: &apos;{{&apos;
         ├---<font color="#4E9A06">✔</font> check-channel-exists(0) (check-channel-exists--common)  hlf-peer-orgs-mzl4r-3099390573  1s        
         └---<font color="#CC0000">⚠</font> channel-orgs (channel-orgs--common)                                                               Invalid &apos;when&apos; expression &apos;{{steps.check-channel-exists.outputs.result}}&apos;: Invalid token: &apos;{{&apos;
</pre>

Argo:

v2.4.0

头盔版本:

Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}

kubectl版本:-

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.8", GitCommit:"211047e9a1922595eaa3a1127ed365e9299a6c23", GitTreeState:"clean", BuildDate:"2019-10-15T12:02:12Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}

出现错误的代码块。

# fourth level: consortium-org templates
{{- if $.Values.flow.consortium.enabled }}
{{- range $i, $consortium := $consortiums }}
{{- if or (not $.Values.flow.consortium.include) (has $consortium $.Values.flow.consortium.include) }}
{{- range $i, $org := (index $genesisProfile.Consortiums $consortium).Organizations }}
{{- $orgName := $org.Name | trimSuffix "MSP" }}
  - name: consortium-org--{{ $consortium }}--{{ $orgName }}
    steps:
    - - name: check-org-in-consortium
        template: check-org-in-consortium--{{ $consortium }}--{{ $orgName }}
    - - name: add-org-to-consortium
        template: add-org-to-consortium--{{ $consortium }}--{{ $orgName }}
        when: "!{{ "{{" }}steps.check-org-in-consortium.outputs.result{{ "}}" }}"
{{- end }} {{- /* consortium.orgs */ -}}
{{- end }} {{- /* if consortium included */ -}}
{{- end }} {{- /* consortiums */ -}}
{{- end }} {{- /* if consortium.enabled */ -}}{{""}}

Link to code file

1 个答案:

答案 0 :(得分:0)

解决了它:) 看起来Argo无法获得POD输出。我的解决方法是授予角色:

kubectl create rolebinding default-admin --clusterrole=admin --serviceaccount=argo:default