2

Getting error like this:

Pipeline could not run, resource failed to apply - Kind: "Task", Name: "versions-push-task"

admission webhook "validation.webhook.pipeline.tekton.dev" denied the request: validation failed: parameter appears more than once: spec.params[DOCKER_IMAGE_NAME]

The tekton yaml code is like this:

apiVersion: tekton.dev/v1beta1

kind: Task

metadata:

  name: versions-push-task

spec:

  params:
    - name: DESTINATION
    - name: DOCKER_IMAGE_NAME
    - name: REGISTRY_REGION_ID
    - name: INPUT_GIT_BRANCH
    - name: GIT_REPO
    - name: VERSIONS_GIT_BRANCH
    - name: IBMCLOUD_HOME
  workspaces:
  - name: task-pvc
    mountPath: /artifacts
  steps:
    - name: push-versions
      securityContext:
        privileged: true
      image: $(params["DOCKER_IMAGE_NAME"])
      command: ["/bin/sh", "-c"]
      args:
        - set -e &&
          set -x &&
          cd /artifacts &&
          pwd &&
          mv git .git &&
          git config --global user.email "toolchain@cloud.ibm.com" &&
          git config --global user.name "IBM Cloud DevOps Toochain" &&
          ibm-bifrost versions --push ${VERSIONS_GIT_BRANCH}
      env:
        - name: DESTINATION
          value: $(params.DESTINATION)
        - name: REGISTRY_REGION_ID
          value: $(params.REGISTRY_REGION_ID)
        - name: INPUT_GIT_BRANCH
          value: $(params.INPUT_GIT_BRANCH)
        - name: GIT_REPO
          value: $(params.GIT_REPO)
        - name: VERSIONS_GIT_BRANCH
          value: $(params.VERSIONS_GIT_BRANCH)
        - name: IBMCLOUD_HOME
          value: $(params.IBMCLOUD_HOME)

Tekton version: 0.36

data_henrik
  • 16,724
  • 2
  • 28
  • 49
  • 1
    What environment variables were passed on to that task? Which process ran that task? Please add details. If a process is configured to pass on the same stuff multiple times (see error message), the receiver gets confused. – data_henrik Jul 19 '22 at 11:23

1 Answers1

1

Try updating the line with image: $(params["DOCKER_IMAGE_NAME"]) to be

image: $(params.DOCKER_IMAGE_NAME)