ROX-14946: change PSP auto-sensing in e2e tests#6567
Merged
johannes94 merged 5 commits intomasterfrom Jun 20, 2023
Merged
Conversation
|
Images are ready for the commit at 61a9316. To use with deploy scripts, first |
SimonBaeumer
approved these changes
Jun 20, 2023
msugakov
requested changes
Jun 20, 2023
tests/e2e/lib.sh
Outdated
Comment on lines
+371
to
+373
| available_api_resources=$(kubectl api-resources -o name) | ||
|
|
||
| if echo "$available_api_resources" | grep -q podsecuritypolicies.policy; |
Contributor
There was a problem hiding this comment.
- I find a few examples of a slightly different pattern
stackrox/deploy/common/k8sbased.sh
Lines 198 to 202 in 8f0e805
Would be good to standardize on some approach and use it consistently. Please choose either your or other approach and make sure all instances look and work similarly.
- [Nitpicking] There's no point to declare
available_api_resourcesand abandon it later. It can be just inlined:
if kubectl api-resources -o name | grep -q podsecuritypolicies.policy;
Contributor
Author
There was a problem hiding this comment.
Thanks for the hint, I changed my code to use the existing pattern.
msugakov
approved these changes
Jun 20, 2023
This file contains hidden or 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
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.
Description
There are CI Errors for the auto-sensing logic for PSP introduced in #4488.
The checks where failing for EKS because they put other characters in their version strings returned by kubectl.
There are additional consideration to why the approach with major/minor version check is brittle in #4813 comments.
This PR changes the check so that it uses
kubectl api-resourcescommand instead. This should be a more reliable solution.Checklist
[ ] Unit test and regression tests added[ ] Evaluated and added CHANGELOG entry if required[ ] Determined and documented upgrade steps[ ] Documented user facing changes (create PR based on openshift/openshift-docs and merge into rhacs-docs)If any of these don't apply, please comment below.
Testing Performed
Running the following once against a cluster with PSPs and once against another cluster without PSPs
In addition to reviewing your code, reviewers must also review your testing
instructions and make sure they are sufficient.