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

Error: resource name may not be empty #1096

Closed
abergmeier opened this issue Jul 17, 2019 · 7 comments
Closed

Error: resource name may not be empty #1096

abergmeier opened this issue Jul 17, 2019 · 7 comments
Labels
kind/question Issues or PRs that are questions around the project or a particular feature

Comments

@abergmeier
Copy link

abergmeier commented Jul 17, 2019

Expected Behavior

It should work

Actual Behavior

Complains in log:

{"level":"error","logger":"controller.taskrun-controller","caller":"controller/controller.go:345","msg":"Reconcile error","knative.dev/controller":"taskrun-controller","error":"resource name may not be empty","stacktrace":"github.com/tektoncd/pipeline/vendor/github.com/knative/pkg/controller.(*Impl).handleErr\n\t/workspace/go/src/github.com/tektoncd/pipeline/vendor/github.com/knative/pkg/controller/controller.go:345\ngithub.com/tektoncd/pipeline/vendor/github.com/knative/pkg/controller.(*Impl).processNextWorkItem\n\t/workspace/go/src/github.com/tektoncd/pipeline/vendor/github.com/knative/pkg/controller/controller.go:331\ngithub.com/tektoncd/pipeline/vendor/github.com/knative/pkg/controller.(*Impl).Run.func1\n\t/workspace/go/src/github.com/tektoncd/pipeline/vendor/github.com/knative/pkg/controller/controller.go:282"}

Steps to Reproduce the Problem

  1. Add TaskRun
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
  name: git-mirror-run
spec:
  serviceAccount: git-mirror
  taskRef:
    name: git-mirror-task
  inputs:
    params:
      - name: srcRepo
        value: ssh://git@bitbucket.foo.bar/foo/bar.git
      - name: destRepo
        value: git@github.com:foo/bar_common.git

Additional Info

Seems to be similar to https://github.com/tektoncd/pipeline/blob/master/examples/taskruns/private-taskrun.yaml. By now I am worried whether it is ensured, that all examples actually work.

It might be related to #685.
Although this is a TaskRun that was created before - and has never been successfully run yet.

Even removing the TaskRun and creating anew (with different name) leads to the same problem.

@vdemeester
Copy link
Member

@abergmeier thx for the issue. Can you attach the task definition used for the taskrun ?

There was some validation problems on the example, that are fixed by #1081

@vdemeester
Copy link
Member

/kind question

@tekton-robot tekton-robot added the kind/question Issues or PRs that are questions around the project or a particular feature label Jul 17, 2019
@abergmeier
Copy link
Author

Can you attach the task definition used for the taskrun

There you go:

apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
  name: git-mirror-task
spec:
  inputs:
    params:
    - name: srcRepo
      description: The repo to pull from
    - name: destRepo
      description: The repo to push to
    - name: ws
      description: The workspace to use
      default: /workspace
  steps:
  - name: pull
    image: alpine/git
    command: ["sh"]
    args:
    - "-c"
    - "git -C ${inputs.params.ws} fetch --prune --all || git clone -n --mirror ${inputs.params.srcRepo} ${inputs.params.ws}"
  - name: push
    image: alpine/git
    command: ["git"]
    args: ["-C", "${inputs.params.ws}", "push", "--mirror", "${inputs.params.destRepo}"]

@abergmeier
Copy link
Author

There was some validation problems on the example, that are fixed by #1081

If there is something wrong with the CRD, I cannot for the life of me figure it out :(

@abergmeier
Copy link
Author

So I now boiled this down to:

---
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
  name: git-mirror-run1
spec:
  taskSpec:
    steps:
    - image: busybox
      command: ['/bin/sh']
      args: ['-c', 'sleep 3 && touch foo']

And still get the same error. So either the example is wrong, or this is not a question but a bug IMO.

@EliZucker
Copy link
Member

EliZucker commented Jul 24, 2019

I was curious and just manually ran that yaml you posted in the most recent comment and I don't think I got an error.

Are you seeing

Message:               All Steps have completed executing
    Reason:                Succeeded
    Status:                True
    Type:                  Succeeded

when describing the taskrun?

@abergmeier
Copy link
Author

The problem is probably related to some special handling in OpenShift.
For us we decided to no longer try to get Tekton running on OpenShift <=3.11 and instead rather go with Google Cloud Build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Issues or PRs that are questions around the project or a particular feature
Projects
None yet
Development

No branches or pull requests

4 participants