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

Add package to detect platform properties #413

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

JohnStrunk
Copy link
Member

@JohnStrunk JohnStrunk commented Sep 6, 2022

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?

  • Adds RBAC to the operator so that it can read SCCs

Related issues:

@project-bot project-bot bot added this to In-progress PRs in VolSync work items Sep 6, 2022
@JohnStrunk
Copy link
Member Author

/hold

Signed-off-by: John Strunk <jstrunk@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Sep 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.2% 2.2% Duplication

@JohnStrunk
Copy link
Member Author

/retest

1 similar comment
@JohnStrunk
Copy link
Member Author

/retest

@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #413 (c6fe7c2) into main (066f018) will increase coverage by 0.0%.
The diff coverage is 67.4%.

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     
Impacted Files Coverage Δ
controllers/platform/properties.go 67.4% <67.4%> (ø)

@JohnStrunk
Copy link
Member Author

/unhold
/cc @tesshuflower

// 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
Copy link
Contributor

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?

Copy link
Contributor

@tesshuflower tesshuflower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 7, 2022

[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:
  • OWNERS [JohnStrunk,tesshuflower]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 15a2fcb into backube:main Sep 7, 2022
@project-bot project-bot bot moved this from In-progress PRs to Done in VolSync work items Sep 7, 2022
@JohnStrunk JohnStrunk mentioned this pull request Sep 7, 2022
@JohnStrunk JohnStrunk deleted the properties branch September 7, 2022 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants