-
Notifications
You must be signed in to change notification settings - Fork 273
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(kubernetes-plugin): sanitize volumes configuration for helm and kubernetes type pod runners #6251
Merged
+261
−52
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
twelvemo
force-pushed
the
fix-helm-pod-runner
branch
4 times, most recently
from
July 4, 2024 12:30
872f8fb
to
7b49c00
Compare
vvagaytsev
force-pushed
the
fix-helm-pod-runner
branch
from
July 4, 2024 15:44
7b49c00
to
12f1a33
Compare
Loading status checks…
…ubernetes type pod runners
Use immediate returns to avoid arrow-style code.
To call it only in one place, for all action types.
vvagaytsev
force-pushed
the
fix-helm-pod-runner
branch
from
July 5, 2024 10:36
3347cb4
to
2e58c54
Compare
vvagaytsev
force-pushed
the
fix-helm-pod-runner
branch
from
July 5, 2024 11:56
d52d194
to
4bd7da8
Compare
vvagaytsev
approved these changes
Jul 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The kubernetes-type and helm pod runners for
Run
andTest
actions are using thepodSpec
from a Kubernetes manifest or helm chart if aresource
is specified. If these resources e.g. astatefulSet
include volumes, these pods may fail to be deployed, because the volumes are already attached (most volumes are read-write-once).We therefore sanitize the
podSpec
by removing all volumes exceptconfigMaps
andsecrets
which may be crucial for the pod to contain the correct configuration or credentials to run. These volume types can also be mounted several times and are less likely to cause issues.In case of
configMaps
we also make sure that thedefaultMode
of the file permission is in octal.If the
podSpec
is explicitly configured in a kubernetes-pod we keep all kinds of volumes, evenpersistentVolumeClaims
since the user has explicitly configured them and can make sure they exist and can be mounted. This PR only removespersistentVolumeClaim
type volumes if they are implicitly set through a helm chart or Kubernetes manifest.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Volume mounts in pod runners were allowed in #6112. We might need to re-visit those changes and apply the necessary amendments and restrictions.