-
Notifications
You must be signed in to change notification settings - Fork 55
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
Check edge cases for automounted configmaps/secrets #495
Conversation
Move functions related to automounting configmaps and secrets to a separate file to make reading deployment.go easier. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Check edge cases in automount that can result in collisions: 1. automounted volumes collide on name 2. automounted volumes collide on mountPath 3. devworkspace volumes collide with automounted volume on name 4. devworkspace volume mountPath in a container collides with automounted volume's mountPath Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Prefix automounted configmaps and secrets with "automount-[secret|configmap]" to avoid collisions with volumes defined on DevWorkspaces. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
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 haven't tested but changes look meaningful.
Ideally, we should have unit tests for covered use-cases, but it's not mandatory.
I'll look into this -- I've generally been avoidant of adding tests for things that require the k8s API, so maybe it's time to dive into fakeClient :) |
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.
Changes make sense to me 👍
/test v7-devworkspaces-operator-e2e, v7-devworkspace-happy-path |
/test v7-devworkspace-happy-path |
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk, JPinkney, sleshchenko 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 |
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
8b2d95d
to
1a7e714
Compare
New changes are detected. LGTM label has been removed. |
/test v7-devworkspaces-operator-e2e, v7-devworkspace-happy-path |
What does this PR do?
Checks some edge cases in automounted secrets and volumes that can cause workspace startup to hang
Also prefixes automounted volumes with
automount-[secret|configmap]
to avoid collisions with each other and with DevWorkspace volumes (e.g. you can't automount a configmap named "project" currently).Note: prefixing volume names as above can lead to issues, so it may be worth it to drop the last commit in this PR. If a secret/configmap's name is very long and the prefix pushes it over 63 chars, workspace start will fail.
What issues does this PR fix or reference?
Minor issue I happened to run into while checking #455 where my secrets shared a mountPath and no error was shown (except in logs)
Is it tested? How?
Here comes a long testing doc:
PR Checklist
/test v7-devworkspaces-operator-e2e, v7-devworkspace-happy-path
to trigger)v7-devworkspaces-operator-e2e
: DevWorkspace e2e testv7-devworkspace-happy-path
: DevWorkspace e2e test