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

[Bug] Can't use generateName in pipelineRun #2170

Closed
yuwenma opened this issue Mar 6, 2020 · 3 comments
Closed

[Bug] Can't use generateName in pipelineRun #2170

yuwenma opened this issue Mar 6, 2020 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@yuwenma
Copy link

yuwenma commented Mar 6, 2020

Expected Behavior

a new random pipelinerun name is automatically created.

Actual Behavior

raises "resource name may not be empty"

Steps to Reproduce the Problem

  1. Apply the tekton CRDs to my cluster:
kubectl apply -filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
  1. Run kubectl apply to create a tekton pipelinerun using "name" (with value "run"), "namespace" (with value "ci-test1") in metadata field
apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
metadata:
  name: 'run'
  namespace: 'ci-test1'
spec:
...
  1. Make sure the pipeline run succeeds. (kubectl get -n ci-test1 pipelineruns.tekton.dev)
  2. Change metadata.name to metadata.generateName with value "run1-". Got the following error
error: error when retrieving current configuration of:
Resource: "tekton.dev/v1alpha1, Resource=pipelineruns", GroupVersionKind: "tekton.dev/v1alpha1, Kind=PipelineRun"
Name: "", Namespace: "ci-test1"
Object: &{map["apiVersion":"tekton.dev/v1alpha1" "kind":"PipelineRun" "metadata":map["annotations":map["kubectl.kubernetes.io/last-applied-configuration":""] "generateName":"run1-" "namespace":"ci-test1"] "spec":map["pipelineRef":map["name":"demo-pipeline"] "resources":[map["name":"source-repo" "resourceRef":map["name":"app-git-repo"]] map["name":"web-image" "resourceRef":map["name":"guestbook-web-image"]] map["name":"app-image" "resourceRef":map["name":"guestbook-app-image"]]] "serviceAccountName":"default"]]}
from server for: "ci/run/pipelinerun.yaml": resource name may not be empty
@yuwenma
Copy link
Author

yuwenma commented Mar 6, 2020

/kind bug

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

@yuwenma You need to use kubectl create -f with generateName. There is an issue open to improve the error message (#2113). Sorry for the confusion.

@yuwenma
Copy link
Author

yuwenma commented Mar 6, 2020

I see, thanks!

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

No branches or pull requests

3 participants