Getting parameter appears more than once: spec.params[DOCKER_IMAGE_NAME] error while running the pipeline

Viewed 52

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

1 Answers

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

image: $(params.DOCKER_IMAGE_NAME)
Related