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

Confusing error when same volume name used twice #1402

Closed
bobcatfish opened this issue Oct 9, 2019 · 0 comments · Fixed by #1404
Closed

Confusing error when same volume name used twice #1402

bobcatfish opened this issue Oct 9, 2019 · 0 comments · Fixed by #1404
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@bobcatfish
Copy link
Collaborator

Expected Behavior

If you try to use a volume name in a Task that is either already being used internally by Tekton (e.g. workspace) or you have already specified it yourself (resulting in a pod that is invalid), you should get an informative and helpful error.

Actual Behavior

Instead you get this cryptic error:

TaskRun volume-output-pipeline-run-then-check-and-write-wl4lv has failed (Missing or invalid Task default/files-exist-and-add-new: translating Build to Pod: expected exactly one, got both: name)

Steps to Reproduce the Problem

  1. Create a Task and add a volume called workspace
  2. Create a TaskRun that invokes the Task
  3. Watch it fail and look at the error in the status

Additional Info

The error is coming from

func ValidateVolumes(volumes []corev1.Volume) *apis.FieldError {
which is being called by
if err := v1alpha1.ValidateVolumes(volumes); err != nil {

@bobcatfish bobcatfish added kind/bug Categorizes issue or PR as related to a bug. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Oct 9, 2019
imjasonh added a commit to imjasonh/pipeline that referenced this issue Oct 9, 2019
Before this, if a user wanted to attach a Volume named "workspace"
they'd get a confusing error message (tektoncd#1402). tektoncd#1404 improves the error
message, but it would be nice to not have an error at all and just allow
user-defined volumes named "workspace"
imjasonh added a commit to imjasonh/pipeline that referenced this issue Nov 15, 2019
Before this, if a user wanted to attach a Volume named "workspace"
they'd get a confusing error message (tektoncd#1402). tektoncd#1404 improves the error
message, but it would be nice to not have an error at all and just allow
user-defined volumes named "workspace"
imjasonh added a commit to imjasonh/pipeline that referenced this issue Nov 15, 2019
Before this, if a user wanted to attach a Volume named "workspace"
they'd get a confusing error message (tektoncd#1402). tektoncd#1404 improves the error
message, but it would be nice to not have an error at all and just allow
user-defined volumes named "workspace"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant