Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Resource Names Doesn't Error Out #2241

Closed
andrewballantyne opened this issue Mar 18, 2020 · 3 comments · Fixed by #2266
Closed

Duplicate Resource Names Doesn't Error Out #2241

andrewballantyne opened this issue Mar 18, 2020 · 3 comments · Fixed by #2266
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@andrewballantyne
Copy link

andrewballantyne commented Mar 18, 2020

Expected Behavior

To get an error - how would I reference the correct resource? $(resources.<my-resource-name>) would be ambiguous.

Actual Behavior

It successfully added the Pipeline(s)

Steps to Reproduce the Problem

  1. Have a Pipeline with duplicate resource names (I did both being the same type and a different types)

Additional Info

  • Kubernetes version:

    Output of kubectl version:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T12:36:28Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"17+", GitVersion:"v1.17.1", GitCommit:"71cbecd", GitTreeState:"clean", BuildDate:"2020-03-17T19:38:24Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
  • Tekton Pipeline version:

    Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

$ tkn version
Client version: 0.8.0
Pipeline version: unknown

I noticed this on an OpenShift cluster while developing... the versions of the operator and the cluster are:

OpenShift 4.5
OpenShift Pipelines Operator 0.10.7

Sample files:

# duplicate-resource-names-same-types.yaml
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
  name: duplicate-resource-names-same-types
spec:
  resources:
    - name: test
      type: git
    - name: test
      type: git
  tasks:
    - name: dummy-task
      taskRef:
        name: dummy-task
# duplicate-resource-names-different-types.yaml
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
  name: duplicate-resource-names-different-types
spec:
  resources:
    - name: test
      type: git
    - name: test
      type: image
  tasks:
    - name: dummy-task
      taskRef:
        name: dummy-task

Both were successfully applied without errors:

$ oc apply -f duplicate-resource-names-different-types.yaml
pipeline.tekton.dev/duplicate-resource-names-different-types created

$ oc apply -f duplicate-resource-names-same-types.yaml
pipeline.tekton.dev/duplicate-resource-names-same-types created
@vdemeester
Copy link
Member

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 18, 2020
@GregDritschler
Copy link
Contributor

I can fix this.

@vdemeester
Copy link
Member

/assign @GregDritschler

nikhil-thomas pushed a commit to nikhil-thomas/pipeline that referenced this issue Apr 6, 2020
nikhil-thomas pushed a commit to nikhil-thomas/pipeline that referenced this issue Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants