-
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
fix: resolve pod creation failure on retry when using workspace.<name>.volume
#7887
fix: resolve pod creation failure on retry when using workspace.<name>.volume
#7887
Conversation
Hi @l-qing. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@l-qing: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@l-qing: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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.
/ok-to-test
The following is the coverage report on the affected files.
|
80a5b77
to
aa6f3f2
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
aa6f3f2
to
510e26a
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
510e26a
to
c59e049
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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.
Thanks for this!
A couple of NITs, nothing blocking.
/approve
pkg/workspace/apply.go
Outdated
@@ -42,15 +45,47 @@ func (nvm nameVolumeMap) setVolumeSource(workspaceName string, volumeName string | |||
} | |||
} | |||
|
|||
// GenerateHashedName generates a unique name for a volume based on the workspace name. |
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.
NIT: there is nothing specific to volumes or workspaces in this function
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.
NIT: this could have lived in the pkg/names
even though the interface is slightly different. Using this with a different prefix and length might get names that are too long for k8s. Of course it is not going to happen with the code as it is today, but it might be worth adopting an approach similar to that in pkg/names
where the overall length is restricted.
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.
Thank you for your suggestion, I will adjust this part of the code.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli 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 |
c59e049
to
804b66a
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
…e>.volume` fix tektoncd#7886 Change the naming method of the workspace volume from completely random to hashed, ensuring that the name generated during a single taskRun lifecycle is consistent each time, and is unique within all current workspaces. This way, we can reuse the logic of retrieving the taskSpec from the status, and also store the content after variable expansion in the taskSpec of the status for easy debugging; it will also not affect the reconstruction of the pod when retrying.
804b66a
to
f60b5c3
Compare
/lgtm |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
fix #7886
Change the naming method of the workspace volume from completely random to hashed, ensuring that the name generated during a single taskRun lifecycle is consistent each time, and is unique within all current workspaces.
This way, we can reuse the logic of retrieving the taskSpec from the status, and also store the content after variable expansion in the taskSpec of the status for easy debugging; it will also not affect the reconstruction of the pod when retrying.
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep/kind bug
Release Notes