-
Notifications
You must be signed in to change notification settings - Fork 66
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
adding required annotations check and necessary tests #1086
adding required annotations check and necessary tests #1086
Conversation
Skipping CI for Draft Pull Request. |
Hi @acornett21 the DCI job failed because of a new test you've added
I'll change the expectations for simple-demo-operator tomorrow - for the moment we simply expect all tests to be green. |
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.
A few comments.
@tkrishtop Are you saying the new check showed up as failed? If so that's incorrect. This is still WIP, and I'll be working to update |
TokenAuthAWSAnnotation = "features.operators.openshift.io/token-auth-aws" | ||
TokenAuthAzureAnnotation = "features.operators.openshift.io/token-auth-azure" | ||
TokenAuthGCPAnnotation = "features.operators.openshift.io/token-auth-gcp" |
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.
This is a potentially unrelated question.. but why are these becoming required? Are we installing operators on all providers all at once?
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.
I'm not sure if a given operator would/could support token auth for all cloud providers or not. My guess would be that is unlikely, just based on our dealings with STS in the ACK project. IMO It's more so for the below:
The current format of the infrastructure annotations is unsuited for robust checks and effective enforcement. We need a new format that allows to cleanly differentiate between mere absence of a data or actual lack of support for a certain infrastructure feature.
I adjusted the pinned tests on our side, to ignore the new test failing for simple-demo. For the future, it would be nice to fix the simple-demo as well. |
check workload preflight-green |
Sorry @acornett21 , I just saw your comment. Would you prefer me to fallback the fix on our side and pin all the tests for the simple-demo to be green, as before? With the old setup, the DCI job for your PR will be failing because it automatically auto-discovers all the tests and expects them to be green:
|
@tkrishtop I've updated the the
The idea of introducing a new check at level |
/ok-to-test |
/ok-to-test |
Tested locally as well now that the operators are updated...
|
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.
A few requests.
internal/engine/engine.go
Outdated
@@ -236,6 +236,12 @@ func (c *craneEngine) ExecuteChecks(ctx context.Context) error { | |||
} | |||
|
|||
if !checkPassed { | |||
// if a test doesn't pass but is of level warn include it in warning results, instead of failed results | |||
if check.Metadata().Level == "warn" { |
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.
This is different... You use "warning" on 223, but "warn" here. Perhaps time for a constant for these levels?
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.
I moved this to a constant, though I'm not sure the package is the ideal place. I put it in check.certification
which defines the Check
interface.
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.
Notes about the import name
internal/engine/engine.go
Outdated
@@ -220,7 +220,7 @@ func (c *craneEngine) ExecuteChecks(ctx context.Context) error { | |||
c.results.TestedImage = c.image | |||
|
|||
logger.V(log.DBG).Info("running check", "check", check.Name()) | |||
if check.Metadata().Level == "optional" { | |||
if check.Metadata().Level == "optional" || check.Metadata().Level == certcheck.LevelWarn { |
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.
Why not use the Optional const?
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.
To keep this PR focused on the required annotations, I was planning a follow up PR to switch all other checks to the constants. I assumed that would be preference then introducing here. But maybe it's fine to just introduce for this one line since it is already changing?
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.
I switched this one line, but as mentioned another pr will follow to update all the things.
Signed-off-by: Adam D. Cornett <[email protected]>
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.
Barring E2E, LGTM.
/lgtm
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: acornett21, bcrochet, komish 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 |
Adding a new check that checks for newly required annotations. At first we will only warn partners about this, then after sometime we will move to enforce this check.
Note: There are backend changes being made to support
Warning
being in the results