-
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
Stop populating resourceName in git-init image #6310
Conversation
Skipping CI for Draft Pull Request. |
Will need to wait until #6150 is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vaguely remember this being used by the termination message decoder to distinguish resource outputs from param outputs. Would the removal of this cause conflicts if a param happened to share the same name? 🤔
If we're completely removing the Git pipeline resource, we might be able to rip out git-init entirely starting from the controller. AFAICT from code search this is only used in examples, and I'm pretty sure that was mostly done from convenience.
There might be some catalog usage copied from the examples, but I think we should push the maintenance burden onto the catalog tasks if they want to continue using it.
The git PipelineResource was removed in #6150. git-init is still going to be used by two catalog tasks that will be moved to the verified catalog, and this code is going to be pulled out of the pipelines repo into the tektoncd-catalog org (https://github.com/tektoncd/community/blob/main/teps/0074-deprecate-pipelineresources.md#images-used-in-pipelineresources). For now it's easier to just make this change to help unblock v1 related changes than it is to move the git-init code out. /retest |
The git-init image writes a git commit SHA and URL to a pod's termination message. Prior to this commit, if these values came from the output of a PipelineResource, it would also write the name of that PipelineResource to the pod's termination message. Since PipelineResources have been removed, the environment variable TEKTON_RESOURCE_NAME is never populated, and the PipelineResource name is never written to termination messages. This commit removes the check for this environment variable and stops writing this value to the termination message. The termination message will still be parseable by other code. Removing this functionality will make it easier to migrate to v1, by allowing us to remove fields not relevant to our v1 API. Refactoring/renaming PipelineResourceResult will happen in a separate commit.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JeromeJu, jerop The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
/retest |
Key string `json:"key"` | ||
Value string `json:"value"` | ||
// ResourceName may be used in tests, but it is not populated in termination messages. | ||
// It is preserved here for backwards compatibility and will not be ported to v1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to mark it as deprecated ? // Deprecated: It is preserved …
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we would want to rename the PipelineResoruceType
to a new Struct as it is no longer meaningful without PipelineResources. and I could do the marking of deprecation while leaving the old Struct there in v1beta1 with backward compatibility if that sounds good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also noted and tracked here at #6197 (comment)
The git-init image writes a git commit SHA and URL to a pod's termination message. Prior to this commit, if these values came from the output of a PipelineResource, it would also write the name of that PipelineResource to the pod's termination message.
Since PipelineResources have been removed, the environment variable TEKTON_RESOURCE_NAME is never populated, and the PipelineResource name is never written to termination messages. This commit removes the check for this environment variable and stops writing this value to the termination message. The termination message will still be parseable by other code.
Removing this functionality will make it easier to migrate to v1, by allowing us to remove fields not relevant to our v1 API. Refactoring/renaming PipelineResourceResult will happen in a separate commit.
Part of #6197
/kind cleanup
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes