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

Fix replicalimits ConstraintTemplate to handle scaling to zero properly. Fixes #419 #427

Closed

Conversation

skaven81
Copy link

What this PR does / why we need it: The replicalimits ConstraintTemplate has two bugs that are fixed in this PR. First, the input_replica_limit() function contained a reference to global input.review.object.spec instead of using the local spec argument. Second, when kubectl scale <resource> --replicas=0 is issued, a Scale resource is created with an empty spec: { }, not spec: { replicas: 0 }. Using object.get() with a default value of 0 ensures that the ConstraintTemplate works properly in this condition.,

Which issue(s) does this PR fix:
Fixes #419

…ly. Fixes open-policy-agent#419

Signed-off-by: Paul Krizak <paul.krizak@gmail.com>
@skaven81
Copy link
Author

I'm going to need some help here. I thought that I followed the instructions properly for modifying the source code. But I found that make generate-all doesn't seem to do anything at all with the src_test.rego, so I manually inserted my updated tests into the library tree. I suspect that is what is causing the CI tests to fail. But as I can't seem to get the tests to build at all using make generate-all, how do I properly validate this in my own working copy?

@apeabody
Copy link
Contributor

I'm going to need some help here. I thought that I followed the instructions properly for modifying the source code. But I found that make generate-all doesn't seem to do anything at all with the src_test.rego, so I manually inserted my updated tests into the library tree. I suspect that is what is causing the CI tests to fail. But as I can't seem to get the tests to build at all using make generate-all, how do I properly validate this in my own working copy?

Hi @skaven81 the separate ./test.sh script should run all tests, however from the CI it initially appears the website documentation updates didn't occur for some reason, which should be included in make generate-all.

@apeabody
Copy link
Contributor

I'm going to need some help here. I thought that I followed the instructions properly for modifying the source code. But I found that make generate-all doesn't seem to do anything at all with the src_test.rego, so I manually inserted my updated tests into the library tree. I suspect that is what is causing the CI tests to fail. But as I can't seem to get the tests to build at all using make generate-all, how do I properly validate this in my own working copy?

Hi @skaven81 the separate ./test.sh script should run all tests, however from the CI it initially appears the website documentation updates didn't occur for some reason, which should be included in make generate-all.

diff --git a/website/docs/validation/replicalimits.md b/website/docs/validation/replicalimits.md
index 4f458dd..343e990 100644
--- a/website/docs/validation/replicalimits.md
+++ b/website/docs/validation/replicalimits.md
@@ -92,6 +92,8 @@ spec:
     kinds:
       - apiGroups: ["apps"]
         kinds: ["Deployment"]
+      - apiGroups: ["autoscaling"]
+        kinds: ["Scale"]
   parameters:
     ranges:
     - min_replicas: 3
@@ -139,6 +141,26 @@ Usage
 kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/replicalimits/samples/replicalimits/example_allowed.yaml

+
+


+example-scale-allowed
+
+```yaml
+apiVersion: autoscaling/v1
+kind: Scale
+metadata:

  • name: allowed-deployment
    +spec:
  • replicas: 3

+ + +Usage + +shell
+kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/replicalimits/samples/replicalimits/example_scale_allowed.yaml
+```
+

example-disallowed @@ -172,6 +194,168 @@ Usage kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/replicalimits/samples/replicalimits/example_disallowed.yaml ```

+


+

+example-scale-disallowed
+
+```yaml
+apiVersion: autoscaling/v1
+kind: Scale
+metadata:

  • name: allowed-deployment
    +spec:
  • replicas: 100

+ + +Usage + +shell
+kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/replicalimits/samples/replicalimits/example_scale_disallowed.yaml
+ + +</details> + + +</blockquote></details><details> +<summary>replica-limit-zero</summary><blockquote> + +<details> +<summary>constraint</summary> + +yaml
+apiVersion: constraints.gatekeeper.sh/v1beta1
+kind: K8sReplicaLimits
+metadata:

  • name: replica-limits
    +spec:
  • match:
  • kinds:
  •  - apiGroups: ["apps"]
    
  •    kinds: ["Deployment"]
    
  •  - apiGroups: ["autoscaling"]
    
  •    kinds: ["Scale"]
    
  • parameters:
  • ranges:
    • min_replicas: 0
  •  max_replicas: 50
    

+ + +Usage + +shell
+kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/replicalimits/samples/replicalimits_zero/constraint.yaml
+ + +</details> + +<details> +<summary>example-allowed</summary> + +yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:

  • name: allowed-deployment
    +spec:
  • selector:
  • matchLabels:
  •  app: nginx
    
  • replicas: 0
  • template:
  • metadata:
  •  labels:
    
  •    app: nginx
    
  • spec:
  •  containers:
    
  •  - name: nginx
    
  •    image: nginx:1.14.2
    
  •    ports:
    
  •    - containerPort: 80
    

+ + +Usage + +shell
+kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/replicalimits/samples/replicalimits_zero/example_allowed.yaml
+ + +</details> +<details> +<summary>example-scale-allowed</summary> + +yaml
+apiVersion: autoscaling/v1
+kind: Scale
+metadata:

  • name: allowed-deployment
    +# kubectl scale deploy --replicas=0 creates a Scale
    +# resource with an empty spec, not replicas:0
    +spec: {}

+ + +Usage + +shell
+kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/replicalimits/samples/replicalimits_zero/example_scale_allowed.yaml
+ + +</details> +<details> +<summary>example-disallowed</summary> + +yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:

  • name: disallowed-deployment
    +spec:
  • selector:
  • matchLabels:
  •  app: nginx
    
  • replicas: 100
  • template:
  • metadata:
  •  labels:
    
  •    app: nginx
    
  • spec:
  •  containers:
    
  •  - name: nginx
    
  •    image: nginx:1.14.2
    
  •    ports:
    
  •    - containerPort: 80
    

+ + +Usage + +shell
+kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/replicalimits/samples/replicalimits_zero/example_disallowed.yaml
+ + +</details> +<details> +<summary>example-scale-disallowed</summary> + +yaml
+apiVersion: autoscaling/v1
+kind: Scale
+metadata:

  • name: allowed-deployment
    +spec:
  • replicas: 100

+ + +Usage + +shell
+kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/library/general/replicalimits/samples/replicalimits_zero/example_scale_disallowed.yaml
+```
+

Please run 'make generate generate-website-docs generate-artifacthub-artifacts' to generate the templates and docs

@skaven81
Copy link
Author

When I run make generate-artifacthub-artifacts (which is part of make generate-all) it creates a new directory with hundreds of files in it, that weren't in the original repository. It didn't seem right to add that to the commit (I'm pretty sure that's part of what I did wrong in my prior PR).

The website docs did get regenerated, and they're in my commit: 33b39e1#diff-578c418f3682058d7a372ca0fd2d3dafb3cd57c31df54872bbc81890ad63b261

There's something missing from the contribution process that regular contributors must be doing without thinking about it, but isn't explicit in the documentation.

Here's what I did:

  1. Edit src/general/replicalimits/ files, updating version from 1.0.1 to 1.1.0, applying the constraint template code update, and tweaking the test generation Rego to account for the expected test behavior.
  2. Run make generate-all - this generated updates to library/general/replicalimits/template.yaml and website/docs/validation/replicalimits.md, but did nothing to the tests under library/general/replicalimits/.
  3. Add my own updated tests under library/general/replicalimits/ since the build process didn't update them.
  4. Commit and push, open PR.

Step 3 was almost certainly wrong. But the documentation (https://github.com/open-policy-agent/gatekeeper-library#development) makes no mention of how to build the tests, and the Makefile doesn't seem to have anything in there that touches src_test.rego files. Also the documentation isn't explicitly for "you need to do these things, in this order, to contribute to this project" ... it's just a generalized list of tools available while developing in the repo. The documentation above (https://github.com/open-policy-agent/gatekeeper-library#new-policy) is for adding a new policy ... and that does mention src_test.rego but also makes no mention of what commands need to be run to prepare the repo for a PR.

@apeabody
Copy link
Contributor

When I run make generate-artifacthub-artifacts (which is part of make generate-all) it creates a new directory with hundreds of files in it, that weren't in the original repository. It didn't seem right to add that to the commit (I'm pretty sure that's part of what I did wrong in my prior PR).

The website docs did get regenerated, and they're in my commit: 33b39e1#diff-578c418f3682058d7a372ca0fd2d3dafb3cd57c31df54872bbc81890ad63b261

There's something missing from the contribution process that regular contributors must be doing without thinking about it, but isn't explicit in the documentation.

Here's what I did:

  1. Edit src/general/replicalimits/ files, updating version from 1.0.1 to 1.1.0, applying the constraint template code update, and tweaking the test generation Rego to account for the expected test behavior.
  2. Run make generate-all - this generated updates to library/general/replicalimits/template.yaml and website/docs/validation/replicalimits.md, but did nothing to the tests under library/general/replicalimits/.
  3. Add my own updated tests under library/general/replicalimits/ since the build process didn't update them.
  4. Commit and push, open PR.

Step 3 was almost certainly wrong. But the documentation (https://github.com/open-policy-agent/gatekeeper-library#development) makes no mention of how to build the tests, and the Makefile doesn't seem to have anything in there that touches src_test.rego files. Also the documentation isn't explicitly for "you need to do these things, in this order, to contribute to this project" ... it's just a generalized list of tools available while developing in the repo. The documentation above (https://github.com/open-policy-agent/gatekeeper-library#new-policy) is for adding a new policy ... and that does mention src_test.rego but also makes no mention of what commands need to be run to prepare the repo for a PR.

Hi @skaven81 - Sorry any confusion, the make generate-all step should be run after all changes (swap steps 2 and 3), as the tests are also used to build the template documentation. Unlike the template generation, the Rego tests under src/general/replicalimits/ do not build the KRM tests under library/general/replicalimits/, unfortunatly they need to be added independently.

I did a quick test run of make generate-all on your branch and saw 14 new files added to artifacthub/library/general/replicalimits/1.1.0 and several updates to website/docs/validation/replicalimits.md - both expected. If you are still seeing something different let me know, all the other CI tests (e.g. those which exercise the tests, etc) currently look good.

Signed-off-by: Paul Krizak <paul.krizak@gmail.com>
@skaven81
Copy link
Author

OK I re-ran make generate-all and added the additional changes to the website and artifacthub bits. Let's see if the CI tests pass this time 🤞

apeabody
apeabody previously approved these changes Oct 27, 2023
Copy link
Contributor

@apeabody apeabody left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @skaven81!

@@ -51,23 +51,39 @@ empty = {
}

review(replicas) = output {
replicas > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: It might be nice to support a test where spec.replicas is specifically set to 0?

Copy link
Author

Choose a reason for hiding this comment

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

The rule just below with replicas == 0 is what tests that, by blanking out spec (that's what the whole PR is about). I agree that having an additional test that explicitly checks spec.replicas=0 would be good, but it would require a rather large refactoring of the source-to-tests logic to allow for review(replicas) to return two different objects when replicas=0. In fact, that very idea (a Rego function that returns multiple values for the same input) is strictly forbidden by Rego. So the whole thing would need to be reworked from scratch.

Copy link
Author

Choose a reason for hiding this comment

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

That said, I see no evidence that src_test.rego is even being read by anything -- it certainly doesn't seem to be generating the tests under library/general/replicalimits, so I suppose I could add such a test manually and it would likely still pass all the CI tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @skaven81 - The Rego tests under src/general/replicalimits/ do not build the KRM tests under library/general/replicalimits/, however they are run by theCI / Unit test on {} using the opa test command for each folder under src/ - this is basically the same as running ./test.sh locally.

Signed-off-by: Paul Krizak <paul.krizak@gmail.com>
@apeabody apeabody dismissed their stale review October 30, 2023 22:40

Needs a fresh make generate-all - Thanks!

apeabody and others added 3 commits October 30, 2023 15:40
…N=3.11.5 -f build/gomplate/Dockerfile -t gomplate-container .

Sending build context to Docker daemon  6.362MB
Step 1/6 : FROM golang:1.20@sha256:cfc9d1b07b1ef4f7a4571f0b60a99646a92ef76adb7d9943f4cb7b606c6554e2
 ---> e69c1df674bc
Step 2/6 : ARG GOMPLATE_VERSION
 ---> Using cache
 ---> 751f5c31a643
Step 3/6 : RUN go install github.com/hairyhenderson/gomplate/v3/cmd/gomplate@v${GOMPLATE_VERSION}
 ---> Using cache
 ---> d93d01668b95
Step 4/6 : RUN mkdir /gatekeeper-library
 ---> Using cache
 ---> 7e08e5a42a41
Step 5/6 : WORKDIR /gatekeeper-library
 ---> Using cache
 ---> 2f47b827d027
Step 6/6 : ENTRYPOINT ["/bin/bash"]
 ---> Using cache
 ---> 72ede59d508b
Successfully built 72ede59d508b
Successfully tagged gomplate-container:latest
docker  run \
	-u 1000:1000 \
	-v /tmp/gatekeeper-library:/gatekeeper-library \
	gomplate-container ./scripts/generate.sh
Generating library/pod-security-policy/selinux/template.yaml
Generating library/pod-security-policy/host-filesystem/template.yaml
Generating library/pod-security-policy/forbidden-sysctls/template.yaml
Generating library/pod-security-policy/users/template.yaml
Generating library/pod-security-policy/fsgroup/template.yaml
Generating library/pod-security-policy/host-network-ports/template.yaml
Generating library/pod-security-policy/flexvolume-drivers/template.yaml
Generating library/pod-security-policy/privileged-containers/template.yaml
Generating library/pod-security-policy/allow-privilege-escalation/template.yaml
Generating library/pod-security-policy/apparmor/template.yaml
Generating library/pod-security-policy/capabilities/template.yaml
Generating library/pod-security-policy/host-namespaces/template.yaml
Generating library/pod-security-policy/seccomp/template.yaml
Generating library/pod-security-policy/proc-mount/template.yaml
Generating library/pod-security-policy/volumes/template.yaml
Generating library/pod-security-policy/read-only-root-filesystem/template.yaml
Generating library/general/allowedrepos/template.yaml
Generating library/general/containerlimits/template.yaml
Generating library/general/block-wildcard-ingress/template.yaml
Generating library/general/disallowedrepos/template.yaml
Generating library/general/poddisruptionbudget/template.yaml
Generating library/general/uniqueingresshost/template.yaml
Generating library/general/containerrequests/template.yaml
Generating library/general/block-endpoint-edit-default-role/template.yaml
Generating library/general/uniqueserviceselector/template.yaml
Generating library/general/block-loadbalancer-services/template.yaml
Generating library/general/replicalimits/template.yaml
Generating library/general/horizontalpodautoscaler/template.yaml
Generating library/general/externalip/template.yaml
Generating library/general/imagedigests/template.yaml
Generating library/general/httpsonly/template.yaml
Generating library/general/block-nodeport-services/template.yaml
Generating library/general/storageclass/template.yaml
Generating library/general/automount-serviceaccount-token/template.yaml
Generating library/general/ephemeralstoragelimit/template.yaml
Generating library/general/disallowedtags/template.yaml
Generating library/general/requiredlabels/template.yaml
Generating library/general/noupdateserviceaccount/template.yaml
Generating library/general/verifydeprecatedapi/template.yaml
Generating library/general/requiredannotations/template.yaml
Generating library/general/disallowanonymous/template.yaml
Generating library/general/containerresources/template.yaml
Generating library/general/containerresourceratios/template.yaml
Generating library/general/requiredprobes/template.yaml
cd /tmp/gatekeeper-library/scripts/website; go run generate.go
Generating markdown for  /tmp/gatekeeper-library/library/general/allowedrepos
Generating markdown for  /tmp/gatekeeper-library/library/general/automount-serviceaccount-token
Generating markdown for  /tmp/gatekeeper-library/library/general/block-endpoint-edit-default-role
Generating markdown for  /tmp/gatekeeper-library/library/general/block-loadbalancer-services
Generating markdown for  /tmp/gatekeeper-library/library/general/block-nodeport-services
Generating markdown for  /tmp/gatekeeper-library/library/general/block-wildcard-ingress
Generating markdown for  /tmp/gatekeeper-library/library/general/containerlimits
Generating markdown for  /tmp/gatekeeper-library/library/general/containerrequests
Generating markdown for  /tmp/gatekeeper-library/library/general/containerresourceratios
Generating markdown for  /tmp/gatekeeper-library/library/general/containerresources
Generating markdown for  /tmp/gatekeeper-library/library/general/disallowanonymous
Generating markdown for  /tmp/gatekeeper-library/library/general/disallowedrepos
Generating markdown for  /tmp/gatekeeper-library/library/general/disallowedtags
Generating markdown for  /tmp/gatekeeper-library/library/general/ephemeralstoragelimit
Generating markdown for  /tmp/gatekeeper-library/library/general/externalip
Generating markdown for  /tmp/gatekeeper-library/library/general/horizontalpodautoscaler
Generating markdown for  /tmp/gatekeeper-library/library/general/httpsonly
Generating markdown for  /tmp/gatekeeper-library/library/general/imagedigests
Generating markdown for  /tmp/gatekeeper-library/library/general/noupdateserviceaccount
Generating markdown for  /tmp/gatekeeper-library/library/general/poddisruptionbudget
Generating markdown for  /tmp/gatekeeper-library/library/general/replicalimits
Generating markdown for  /tmp/gatekeeper-library/library/general/requiredannotations
Generating markdown for  /tmp/gatekeeper-library/library/general/requiredlabels
Generating markdown for  /tmp/gatekeeper-library/library/general/requiredprobes
Generating markdown for  /tmp/gatekeeper-library/library/general/storageclass
Generating markdown for  /tmp/gatekeeper-library/library/general/uniqueingresshost
Generating markdown for  /tmp/gatekeeper-library/library/general/uniqueserviceselector
Generating markdown for  /tmp/gatekeeper-library/library/general/verifydeprecatedapi
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/allow-privilege-escalation
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/apparmor
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/capabilities
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/flexvolume-drivers
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/forbidden-sysctls
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/fsgroup
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/host-filesystem
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/host-namespaces
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/host-network-ports
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/privileged-containers
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/proc-mount
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/read-only-root-filesystem
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/seccomp
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/selinux
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/users
Generating markdown for  /tmp/gatekeeper-library/library/pod-security-policy/volumes
Generating markdown for  /tmp/gatekeeper-library/mutation/pod-security-policy/allow-privilege-escalation
Generating markdown for  /tmp/gatekeeper-library/mutation/pod-security-policy/capabilities
Generating markdown for  /tmp/gatekeeper-library/mutation/pod-security-policy/read-only-root-filesystem
Generating markdown for  /tmp/gatekeeper-library/mutation/pod-security-policy/seccomp
Generating markdown for  /tmp/gatekeeper-library/mutation/pod-security-policy/selinux
Generating markdown for  /tmp/gatekeeper-library/mutation/pod-security-policy/users
Updating README.md
Updating PSP README.md
Updating sidebar
cd /tmp/gatekeeper-library/scripts/artifacthub; go run hub.go
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/allowedrepos
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/automount-serviceaccount-token
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/block-endpoint-edit-default-role
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/block-loadbalancer-services
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/block-nodeport-services
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/block-wildcard-ingress
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/containerlimits
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/containerrequests
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/containerresourceratios
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/containerresources
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/disallowanonymous
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/disallowedrepos
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/disallowedtags
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/ephemeralstoragelimit
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/externalip
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/horizontalpodautoscaler
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/httpsonly
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/imagedigests
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/noupdateserviceaccount
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/poddisruptionbudget
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/replicalimits
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/requiredannotations
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/requiredlabels
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/requiredprobes
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/storageclass
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/uniqueingresshost
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/uniqueserviceselector
Generating artifact hub content for  /tmp/gatekeeper-library/library/general/verifydeprecatedapi
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/allow-privilege-escalation
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/apparmor
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/capabilities
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/flexvolume-drivers
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/forbidden-sysctls
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/fsgroup
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/host-filesystem
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/host-namespaces
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/host-network-ports
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/privileged-containers
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/proc-mount
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/read-only-root-filesystem
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/seccomp
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/selinux
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/users
Generating artifact hub content for  /tmp/gatekeeper-library/library/pod-security-policy/volumes

Signed-off-by: Paul Krizak <paul.krizak@gmail.com>
skaven81 and others added 3 commits December 19, 2023 19:37
Co-authored-by: Andrew Peabody <andrewpeabody@google.com>
Signed-off-by: Paul Krizak <paul.krizak@gmail.com>
Signed-off-by: Paul Krizak <paul.krizak@gmail.com>
Signed-off-by: Paul Krizak <paul.krizak@gmail.com>
@skaven81
Copy link
Author

skaven81 commented Jan 3, 2024

I don't know why we keep dancing back and forth on this. Every time I fix my branch so that the tests all complete successfully, somebody comes along and does a merge from master which reverts some of my changes, and the tests start failing again.

Somebody please just spend 10 minutes to manually review the actual PR and merge it in, instead of depending on the automation alone.

@ritazh
Copy link
Member

ritazh commented Jan 3, 2024

@skaven81 Thank you for the PR and apologies for the back and forth. The merge from main didnt show any conflicts. If you see any, can you please help update the conflicts? We will review this today.

Error from CI:

looks like template.yaml is updated but the version is not. Please update the 'metadata.gatekeeper.sh/version' annotation in the template.yaml source

Looks like a previously merged PR updated the template version https://github.com/open-policy-agent/gatekeeper-library/pull/429/files#diff-c3f23f7cfeabf9bf68a4be9f0d84eb695dcaf8b31f3cdcbdaaa6aa269fcbb823L7. Can you please bump it again? Thank you!

@ritazh
Copy link
Member

ritazh commented Jan 3, 2024

@apeabody other than the template version, LGTY?

@apeabody
Copy link
Contributor

apeabody commented Jan 3, 2024

@apeabody other than the template version, LGTY?

Thanks @ritazh, agreed!

Subsequent to bumping the template version will need a make generate-all. I also believe the stale changes under artifacthub/library/general/replicalimits/1.0.2/ will need to be manually reverted.

Copy link

stale bot commented Mar 3, 2024

This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 3, 2024
@stale stale bot closed this Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replicalimits unit tests do not include checks for Scale resources
3 participants