Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

fix failing scorecard tests #204

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

thomasmckay
Copy link
Collaborator

No description provided.

@thomasmckay thomasmckay changed the title remove failing scorecard tests fix failing scorecard tests Sep 15, 2021
@thomasmckay thomasmckay changed the title fix failing scorecard tests [WIP] fix failing scorecard tests Sep 15, 2021
@thomasmckay thomasmckay force-pushed the fix-scorecard branch 2 times, most recently from 26af505 to 767f86c Compare September 20, 2021 14:33
@thomasmckay thomasmckay changed the title [WIP] fix failing scorecard tests fix failing scorecard tests Sep 20, 2021
Copy link
Collaborator

@JustinKuli JustinKuli left a comment

Choose a reason for hiding this comment

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

Looking good, some questions/comments that we don't need to address, but I wanted to bring up.

Comment on lines 47 to 50
"image": {
"image": "docker.io/openpolicyagent/gatekeeper:v3.5.2",
"imagePullPolicy": "Always"
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm unsure if we want this in the example, since it's a deprecated part of the CR spec. Do the scorecard tests require every possible field in the CR to be in the examples? If not, I think it would be more useful if the example was closer to what we are encouraging users to create.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm happy to remove it from here as well as docs. Perhaps next release we remove it also from the console UI. The release after that we remove completely, including code?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is it in the console UI?

Copy link
Member

Choose a reason for hiding this comment

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

This wasn't released yet, so it shouldn't exist in the console UI yet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Separate PR for removing image #180

Comment on lines 47 to 50
"image": {
"image": "docker.io/openpolicyagent/gatekeeper:v3.5.2",
"imagePullPolicy": "Always"
},
Copy link
Member

Choose a reason for hiding this comment

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

This wasn't released yet, so it shouldn't exist in the console UI yet.

"spec": {
"affinity": {
"podAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": [
Copy link
Member

Choose a reason for hiding this comment

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

Should we curate this a little more closely? I imagine users may consider taking the example exactly as-is. I wonder if it would be best to provide a good default sample config that we feel comfortable with if users use it as-is. WDYT?

disabledBuiltins:
- http.send
nodeSelector:
region: "EMEA"
Copy link
Member

Choose a reason for hiding this comment

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

I like using this default config for something that will be known to work for deploying Gatekeeper. If used as-is, it will prevent Gatekeeper from being deployed until the node is labeled accordingly. For example, we do this during the e2e tests:

func labelNode(node *corev1.Node) error {

Do you think we should maintain a separate, good and sane, default config for use during testing and to document the CR options for operatorhub and the console UI? See comment above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, since this file is used for to populate alm-examples it would be good to have a well-formed and useful set of defaults here. (It is also pasted exactly into the docs.)
You'll note that i did a bit of config/samples shuffling to keep the tests sorted. We could make this yaml have defaults and then re-run the minimal test with it and confirm it passes?

Copy link
Member

Choose a reason for hiding this comment

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

SGTM. I think we probably want up to 3 configs:

  1. A sane default config that is used for testing and for the CR documentation in alm-examples and we can use this file name for it.
  2. Then we may want to have an empty config that allows the operator to set the defaults Gatekeeper ships with as you're providing in this PR.
  3. Then optionally another one that allows us to test all options if not all of the options were added to default config from 1. above.

Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's follow up in new PR #209

nodeSelector:
region: "EMEA"
affinity:
podAffinity:
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above. If used as-is, it will prevent Gatekeeper from being deployed until the podAffinity requirement is met. We do this in e2e tests here:

func createAffinityPod() {

@thomasmckay
Copy link
Collaborator Author

@font @JustinKuli This should be ready to go.

  • I'll do a follow-up to add some more robust alm-examples
  • Let's talk about removing image and moving to v1alpha2 api
  • Separate PR to add scorecard to ci test

Copy link
Member

@font font left a comment

Choose a reason for hiding this comment

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

Awesome @thomasmckay !

@thomasmckay thomasmckay merged commit 3bef731 into gatekeeper:master Sep 23, 2021
@thomasmckay thomasmckay deleted the fix-scorecard branch September 23, 2021 16:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants