Skip to content
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

vSphere: Fix security context of VDDK validation pod #776

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

ahadas
Copy link
Member

@ahadas ahadas commented Mar 3, 2024

The previous attempt to fix the execution of the VDDK validation pod didn't succeed - it allowed to run it on the 'default' namespace but its execution failed on other restricted namespaces in which the QEMU user (107) is not included in the allowed range.

In order to fix this properly, we differentiate OpenShift from k8s: in case of OpenShift we don't specify RunAsNonRoot and RunAsUser in order to let the platform choose an appropriate user, and in case of k8s, we specify the QEMU user (107)

Copy link

codecov bot commented Mar 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 16.89%. Comparing base (a55e08e) to head (d6c724d).
Report is 231 commits behind head on main.

Files Patch % Lines
pkg/controller/plan/validation.go 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main     #776       +/-   ##
=========================================
+ Coverage      0   16.89%   +16.89%     
=========================================
  Files         0       88       +88     
  Lines         0    17933    +17933     
=========================================
+ Hits          0     3030     +3030     
- Misses        0    14658    +14658     
- Partials      0      245      +245     
Flag Coverage Δ
unittests 16.89% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ahadas
Copy link
Member Author

ahadas commented Mar 4, 2024

ok, apparently on k8s we can't avoid setting it so we'd need to differentiate k8s from OpenShift....

The previous attempt to fix the execution of the VDDK validation pod
didn't succeed - it allowed to run it on the 'default' namespace but its
execution failed on other retricted namespaces in which the QEMU user
(107) is not included in the allowed range.

In order to fix this properly on OpenShift, we drop RunAsNonRoot and
RunAsUser so that OpenShift would pick a proper user based on the
configuration of the namespace.

Signed-off-by: Arik Hadas <ahadas@redhat.com>
@ahadas ahadas force-pushed the vddk_validation_drop_security_context branch from 5d9984a to cf0d402 Compare March 5, 2024 16:37
@ahadas
Copy link
Member Author

ahadas commented Mar 5, 2024

I don't expect the latest changes to pass our CI, need additional changes for k8s

Signed-off-by: Arik Hadas <ahadas@redhat.com>
Copy link

sonarcloud bot commented Mar 5, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
7.9% Duplication on New Code

See analysis details on SonarCloud

@ahadas ahadas added this to the 2.6.0 milestone Mar 5, 2024
@ahadas ahadas merged commit 1524f2b into kubev2v:main Mar 5, 2024
12 checks passed
@ahadas ahadas deleted the vddk_validation_drop_security_context branch March 5, 2024 21:27
@ahadas ahadas mentioned this pull request Mar 5, 2024
@ahadas ahadas removed this from the 2.6.0 milestone Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant