-
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 issue where workspace volume variable and pod volume conf differ #3315
Conversation
Prior to this commit the volumes that were generated for workspace bindings did not have names that matched the values injected through workspaces.<name>.volume variables. This occurred because we called the GetVolumes workspace function twice during TaskRun Pod initialization and each execution generated different random names. This commit updates the TaskRun reconciler to generate the random volume names only once and then pass those generated volumes to the two functions that need them. Additionally the function generating those volumes is renamed to make clear that volume creation is its purpose. A e2e test is added to ensure that the workspace volume and variable value matches.
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.
/lgtm
volumeNames := []string{} | ||
for _, volume := range p.Spec.Volumes { | ||
if volume.Name == workspaceVariableValue { | ||
return |
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.
the idea here is to declare a test success once volume name matches with the workspace from containers args list. Without such match, test would fail with error on 318, took a little bit of reading to understand 😜
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 @sbwsg 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pritidesai 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 |
Changes
Fixes #3312
Prior to this commit the volumes that were generated for workspace bindings did not have names that matched the values injected through
workspaces.<name>.volume
variables. This occurred because we called the GetVolumes workspace function twice during TaskRun Pod initialization and each execution generated different random names.This commit updates the TaskRun reconciler to generate the random volume names only once and then pass those generated volumes to the two functions that need them. Additionally the function generating those volumes is renamed to make clear that volume creation is its purpose. A e2e test is added to ensure that the workspace volume and variable value matches.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes