-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add package to detect platform properties #413
Conversation
/hold |
037d9d8
to
cdb0172
Compare
Signed-off-by: John Strunk <[email protected]>
cdb0172
to
c6fe7c2
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/retest |
1 similar comment
/retest |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #413 +/- ##
=====================================
Coverage 64.1% 64.1%
=====================================
Files 44 45 +1
Lines 5171 5214 +43
=====================================
+ Hits 3317 3346 +29
- Misses 1657 1668 +11
- Partials 197 200 +3
|
/unhold |
// Properties contains properties about the environment in which we are running | ||
type Properties struct { | ||
IsOpenShift bool // True if we are running on OpenShift | ||
HasSCCRestrictedV2 bool // True if the StorageContextConstraints "restricted-v2" exists |
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.
typo in comment - StorageContextConstraints should be SecurityContextConstraints?
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnStrunk, tesshuflower 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 |
Describe what this PR does
Adds the "platform" package that probes the cluster to determine properties of the cluster. This is necessary for #363 so that the movers can adjust their Pod manifests properly.
Right now, all it does is detect whether it's OpenShift and whether the "restricted-v2" SCC is available on the cluster. These checks parallel what we had to do w/ the e2e test manifests to support both kube and OCP.
Detection of OpenShift is done by the presence of any SCC objects, and restricted-v2 is by checking for it specifically.
Is there anything that requires special attention?
Related issues: