-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conceptual bug: Wrong resource names used #2694
Comments
This commit changes the names used throughout PipelineResource handling. PipelineResources have two names when used in a TaskRun: - The name of the PipelineResource entity - The name given to the resource inside the Task definition Task code is currently using the external names everywhere, but should be using the internal names. Ref: tektoncd#2694
I'm trying to understand but I'm not sure I understood the problem fully. The struct that holds all pipeline/pkg/apis/resource/v1alpha1/git/git_resource.go Lines 37 to 53 in 4d62948
Name is not parsed from parameters: pipeline/pkg/apis/resource/v1alpha1/git/git_resource.go Lines 68 to 87 in 4d62948
Name is taken instead from the PipelineResource CRD "Name" field. I think this is what you refer to as the "external" name. A The In both cases, a pipeline/pkg/reconciler/taskrun/taskrun.go Lines 618 to 619 in 232dea7
I think your point is that the results in the It makes sense to me. I think fixing that would imply changing the |
/kind bug |
This commit changes the names used throughout PipelineResource handling. PipelineResources have two names when used in a TaskRun: - The name of the PipelineResource entity - The name given to the resource inside the Task definition Task code is currently using the external names everywhere, but should be using the internal names. Ref: tektoncd#2694
Yes, that's exactly correct, and a much more succinct way of putting it. I left this as a Ref, but since it's no longer a Ref you're probably right that we should change this to just be a Name. |
I'll also add that it's not only because they are not necessarily unique - the resources referred to by the resourceRefs may not actually exist at all! They could have been defined inline in the TaskRun/PipelineRun. Our handling here gets a little funky... |
I just added a second commit that stores the name in a ResourcesResult.ResourceName field, in addition to the resourceRef. This is an API addition, although it really should be a break since we should delete the resourceRef (it doesn't make semantic sense). Any thoughts on how to stage this? My suggestion is to add the new field, then remove the old one the next time we change the API version. |
This commit changes the names used throughout PipelineResource handling. PipelineResources have two names when used in a TaskRun: - The name of the PipelineResource entity - The name given to the resource inside the Task definition Task code is currently using the external names everywhere, but should be using the internal names. Ref: tektoncd#2694
This commit changes the names used throughout PipelineResource handling. PipelineResources have two names when used in a TaskRun: - The name of the PipelineResource entity - The name given to the resource inside the Task definition Task code is currently using the external names everywhere, but should be using the internal names. Ref: tektoncd#2694
This commit changes the names used throughout PipelineResource handling. PipelineResources have two names when used in a TaskRun: - The name of the PipelineResource entity (external name) - The name given to the resource inside the Task definition (internal name) Task code is currently using the external names everywhere, but should be using the internal names. This adds a new field for the internal name to PipelineResourceResult, and deprecates the existing PipelineResourceResult.ResourceRef field. Ref: tektoncd#2694
This commit changes the names used throughout PipelineResource handling. PipelineResources have two names when used in a TaskRun: - The name of the PipelineResource entity (external name) - The name given to the resource inside the Task definition (internal name) Task code is currently using the external names everywhere, but should be using the internal names. This adds a new field for the internal name to PipelineResourceResult, and deprecates the existing PipelineResourceResult.ResourceRef field. Ref: tektoncd#2694
This commit changes the names used throughout PipelineResource handling. PipelineResources have two names when used in a TaskRun: - The name of the PipelineResource entity (external name) - The name given to the resource inside the Task definition (internal name) Task code is currently using the external names everywhere, but should be using the internal names. This adds a new field for the internal name to PipelineResourceResult, and deprecates the existing PipelineResourceResult.ResourceRef field. Ref: tektoncd#2694
This commit changes the names used throughout PipelineResource handling. PipelineResources have two names when used in a TaskRun: - The name of the PipelineResource entity (external name) - The name given to the resource inside the Task definition (internal name) Task code is currently using the external names everywhere, but should be using the internal names. This adds a new field for the internal name to PipelineResourceResult, and deprecates the existing PipelineResourceResult.ResourceRef field. Ref: tektoncd#2694
This commit changes the names used throughout PipelineResource handling. PipelineResources have two names when used in a TaskRun: - The name of the PipelineResource entity (external name) - The name given to the resource inside the Task definition (internal name) Task code is currently using the external names everywhere, but should be using the internal names. This adds a new field for the internal name to PipelineResourceResult, and deprecates the existing PipelineResourceResult.ResourceRef field. Ref: #2694
…release. This is a cleanup commit that should go in after 0.14.0 is cut. It was introduced in tektoncd#2697, to fix tektoncd#2694.
See tektoncd#2694. The `TaskRun.Status.ResourceResults.ResourceRef` field was only ever used for its own `Name` field, and as part of tektoncd#2694, a new field, `TaskRun.Status.ResourceResults.ResourceName` was added to replace `...ResourceRef.Name`. This change finishes the work by removing the deprecated `TaskRun.Status.ResourceResults.ResourceRef`. This has been scheduled for removal since April 2021. Signed-off-by: Andrew Bayer <[email protected]>
See tektoncd#2694. The `TaskRun.Status.ResourceResults.ResourceRef` field was only ever used for its own `Name` field, and as part of tektoncd#2694, a new field, `TaskRun.Status.ResourceResults.ResourceName` was added to replace `...ResourceRef.Name` with a more semantically appropriate field. This change finishes the work by removing the deprecated `TaskRun.Status.ResourceResults.ResourceRef`. This has been scheduled for removal since April 2021. Signed-off-by: Andrew Bayer <[email protected]>
See #2694. The `TaskRun.Status.ResourceResults.ResourceRef` field was only ever used for its own `Name` field, and as part of #2694, a new field, `TaskRun.Status.ResourceResults.ResourceName` was added to replace `...ResourceRef.Name` with a more semantically appropriate field. This change finishes the work by removing the deprecated `TaskRun.Status.ResourceResults.ResourceRef`. This has been scheduled for removal since April 2021. Signed-off-by: Andrew Bayer <[email protected]>
This is a conceptual bug in the way resource names are handled in Tekton today. I'm working on a fix, but wanted to discuss the actual issue here first.
PipelineResources right now can be referred to by two different names:
This name can be thought of as a way to refer to the external object the PipelineResource refers to.
Right now, we pass the external 'Name' field to the resource containers via the 'TEKTON_RESOURCE_NAME' env var. This is only used in a few locations right now:
We should be using the 'internal' name field here - the external names are not always set and can change/not be unique. Internal names are unique within a Task/TaskRun.
The text was updated successfully, but these errors were encountered: