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

Release 1.12 #103

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c559761
fix: remove unnecessary podSecurity chainsaw test (#9791) (#9793)
gcp-cherry-pick-bot[bot] Feb 26, 2024
bc904c0
fix: remove unnecessary validation check for podSecurity rule (#9790)…
gcp-cherry-pick-bot[bot] Feb 26, 2024
7acd22c
changed the log level in match policy context (#9626) (#9779)
gcp-cherry-pick-bot[bot] Feb 26, 2024
658b06e
update versions (#9783) (#9801)
gcp-cherry-pick-bot[bot] Feb 26, 2024
153fd54
chore: add tests for exceptions in the CLI (#9781) (#9802)
gcp-cherry-pick-bot[bot] Feb 26, 2024
e682b1a
Cherry-pick #9709, #9763 (#9803)
realshuting Feb 26, 2024
2b79c66
release v1.12.0-alpha.2 (#9777)
realshuting Feb 26, 2024
4b12124
fix(globalcontext): old WaitGroup not stopping (#9813) (#9818)
gcp-cherry-pick-bot[bot] Feb 28, 2024
85fb15f
fix: add podSecurity validation checks for exceptions (#9817) (#9826)
gcp-cherry-pick-bot[bot] Feb 28, 2024
0e009af
release v1.12.0-alpha.3 (#9827)
realshuting Feb 28, 2024
652f354
release v1.12.0-alpha.4 (#9834)
realshuting Feb 29, 2024
d91c2cf
[Bug] [CLI] Restore warn-exit-code functionality for apply command (#…
realshuting Feb 29, 2024
08a84f7
fix: use gcr crane opts while fetching image descriptors (#9838) (#9844)
gcp-cherry-pick-bot[bot] Mar 4, 2024
aaa1853
release v1.12.0-alpha.5 (#9848)
realshuting Mar 4, 2024
1f0350a
fix: release CRDs manifests (#9849) (#9850)
realshuting Mar 4, 2024
c7a60ca
fix: remove duplicate chainsaw tests for PSA (#9835) (#9837)
gcp-cherry-pick-bot[bot] Mar 5, 2024
c41090a
fix: conflicts (#9847)
realshuting Mar 5, 2024
8c5aabd
release v1.12.0-rc.1 (#9865)
realshuting Mar 8, 2024
f467e32
fix: properly update policy context after preexisting resource in vio…
gcp-cherry-pick-bot[bot] Mar 13, 2024
b7adc9a
fix(globalcontext): panics and validation (#9903) (#9910)
gcp-cherry-pick-bot[bot] Mar 15, 2024
c8e930b
release v1.12.0-rc.2 (#9914)
realshuting Mar 15, 2024
5d00419
Default exclusions in webhooks (#9948) (#9950)
gcp-cherry-pick-bot[bot] Mar 27, 2024
bd4666a
fix: deferred loader panic when mutate and generate policies are appl…
gcp-cherry-pick-bot[bot] Mar 29, 2024
0b832a0
fix: cosign ctlog unit tests (#9970) (#9971)
gcp-cherry-pick-bot[bot] Mar 30, 2024
265d57c
release v1.12.0-rc.3 (#9969)
realshuting Mar 30, 2024
5d236da
Latest api 1.12 (#9989)
anushkamittal2001 Apr 3, 2024
66ca7fb
cherry-pick #9984 (#9997)
realshuting Apr 4, 2024
50f0829
release v1.12.0-rc.4 (#9999)
realshuting Apr 4, 2024
4d20c91
chore: bump chainsaw to 0.1.9 (#10013)
realshuting Apr 8, 2024
1f5245e
fix: add rekor opts to cosign certificate verification and make rekor…
gcp-cherry-pick-bot[bot] Apr 9, 2024
f8c058c
chore: bump cosign to v2.2.4 (#10039)
vishal-chdhry Apr 11, 2024
6c71685
fix: re-use the maxQueuedEvents (#10024) (#10031)
gcp-cherry-pick-bot[bot] Apr 11, 2024
f00dcef
fix: policy status reconciliation (#10032) (#10047)
gcp-cherry-pick-bot[bot] Apr 15, 2024
0c0753b
feat(audit): use a worker pool for Audit policies (#10048) (#10056)
realshuting Apr 17, 2024
5915865
fix(cherry-pick #10057): add mutex to mock policy context builder (#1…
vishal-chdhry Apr 17, 2024
0f1d3c5
release v1.12.0-rc.5 (#10060)
realshuting Apr 17, 2024
111b052
release v1.12.0 (#10082)
realshuting Apr 22, 2024
a24380c
fix: return skip when celPreconditions/matchConditions aren't met (#9…
gcp-cherry-pick-bot[bot] Apr 26, 2024
0c45106
fix: remove unused parameters (#10007) (#10069)
gcp-cherry-pick-bot[bot] Apr 26, 2024
a69f539
fix: evaluate namespaceObject for VAPs in the CLI (#9978) (#10076)
gcp-cherry-pick-bot[bot] Apr 26, 2024
294d333
fix: evaluate namespaceObject for Kyverno policies in the CLI (#9977)…
gcp-cherry-pick-bot[bot] Apr 26, 2024
d7ede3f
chore: update perf docs for 1.12 (#10116) (#10129)
gcp-cherry-pick-bot[bot] Apr 29, 2024
39992b7
chore: remove a package that is imported twice (#10101) (#10130)
gcp-cherry-pick-bot[bot] Apr 29, 2024
3634b38
fix: sort pod controllers for autogen rule (#10140) (#10142)
gcp-cherry-pick-bot[bot] Apr 30, 2024
39cb5bb
fix: fetch only adopted ephemeral report (#10148) (#10150)
gcp-cherry-pick-bot[bot] Apr 30, 2024
4b2b56a
fix: shared policy context needs to be copied (#10139) (#10147)
gcp-cherry-pick-bot[bot] Apr 30, 2024
833a2bd
fix: skip rules without operation in resource webhook creation (#1014…
gcp-cherry-pick-bot[bot] May 1, 2024
0308916
fix: add error check in jmespath type conversion in context variables…
gcp-cherry-pick-bot[bot] May 1, 2024
9ca2e4c
Release v1.12.1-rc.1 (#10154)
realshuting May 1, 2024
a726b2c
Ensure CA certificate ConfigMaps get defined (#10156) (#10161)
gcp-cherry-pick-bot[bot] May 2, 2024
84fba8e
feat: release-1.12.1 (#10166)
realshuting May 3, 2024
64aefbb
fix: add pods/ephemeralcontainers to the generated VAPs (#10162) (#10…
gcp-cherry-pick-bot[bot] May 6, 2024
96e200a
fix: add CONNECT operation in the webhook config for pod/exec subreso…
gcp-cherry-pick-bot[bot] May 6, 2024
331a7fe
fix: skip generating VAPs for policies that match multiple resources …
gcp-cherry-pick-bot[bot] May 6, 2024
33ac44a
fix(polex): multiple polexes with conditions (#9994) (#10183)
gcp-cherry-pick-bot[bot] May 7, 2024
35f9cc3
[kyverno helm chart] make webhook pod annotations configurable (#9875…
realshuting May 7, 2024
1d910c3
feat: release chart 3.2.2 (#10193)
realshuting May 7, 2024
129ef3c
feat: make cli results count public (#10177) (#10194)
gcp-cherry-pick-bot[bot] May 7, 2024
e4633d5
allow kyverno apply command to continue on failure (#10036) (#10178)
gcp-cherry-pick-bot[bot] May 8, 2024
9e12195
kyverno-1.12 CVE fix (#10225)
VedRatan May 14, 2024
db97d41
[Bug] [CLI] Level parameter of the apply and test commands does not w…
gcp-cherry-pick-bot[bot] May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 31 additions & 12 deletions .github/workflows/conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ jobs:
- ^verify-manifests$
- ^verifyImages$
- ^webhooks$
needs: prepare-images
needs:
- prepare-images
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
steps:
- name: Checkout
Expand All @@ -126,7 +127,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
# create cluster
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
Expand Down Expand Up @@ -195,7 +196,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
# create cluster
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
Expand Down Expand Up @@ -267,7 +268,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
# create cluster
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
Expand Down Expand Up @@ -338,7 +339,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
# create cluster
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
Expand Down Expand Up @@ -409,7 +410,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
# create cluster
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
Expand Down Expand Up @@ -485,7 +486,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
# create cluster
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
Expand Down Expand Up @@ -560,7 +561,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
# create cluster
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
Expand Down Expand Up @@ -639,7 +640,7 @@ jobs:
- name: Install Cosign
uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
# create cluster
- name: Create kind cluster and setup Sigstore Scaffolding
uses: sigstore/scaffolding/actions/setup@2d10614e854828e2389881abe6c5cf76240897a7
Expand Down Expand Up @@ -729,7 +730,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
# create cluster
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
Expand Down Expand Up @@ -838,7 +839,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3
uses: kyverno/action-install-chainsaw@995cddaee7702e849270b84fa44cdcebe7462da8 # v0.1.9
- name: Download kyverno CLI archive
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
Expand Down Expand Up @@ -946,20 +947,38 @@ jobs:
runs-on: ubuntu-latest
permissions:
packages: read
needs: prepare-cli
strategy:
fail-fast: false
matrix:
tests:
- ^cli$
needs:
- prepare-cli
name: ${{ matrix.tests }} - chainsaw
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# install tools
- name: Download kyverno CLI archive
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: kubectl-kyverno
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@3bf0752f44d348d859fefa022f113bda6a24a1ae # v0.1.7
- name: Install Kyverno CLI
shell: bash
run: |
set -e
chmod +x kubectl-kyverno && mv kubectl-kyverno ./cmd/cli/kubectl-kyverno/kyverno
echo "$PWD/cmd/cli/kubectl-kyverno" >> $GITHUB_PATH
# run tests
- name: Test with Chainsaw
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
cd ./test/conformance/chainsaw && chainsaw test --include-test-regex '^chainsaw$/${{ matrix.tests }}' --no-cluster
- name: Fix test files
shell: bash
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/load-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ jobs:
- name: default
values:
- default-with-profiling
- name: standard
- name: stress
values:
- standard-with-profiling
- stress-with-profiling
test:
- kyverno-pss
- kyverno-mutate
Expand Down Expand Up @@ -139,3 +139,6 @@ jobs:
with:
name: pprof-heap-profiles
path: heap.pprof
- name: Debug failure
if: failure()
uses: ./.github/actions/kyverno-logs
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ jobs:
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # 2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: config/crds/*.yaml
file: config/crds/**/*.yaml
file_glob: true
tag: ${{ github.ref }}
- name: Login to GHCR
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ TOOLS_DIR ?= $(PWD)/.tools
KIND ?= $(TOOLS_DIR)/kind
KIND_VERSION ?= v0.21.0
CONTROLLER_GEN ?= $(TOOLS_DIR)/controller-gen
CONTROLLER_GEN_VERSION ?= v0.12.0
CONTROLLER_GEN_VERSION ?= v0.15.0
CLIENT_GEN ?= $(TOOLS_DIR)/client-gen
LISTER_GEN ?= $(TOOLS_DIR)/lister-gen
INFORMER_GEN ?= $(TOOLS_DIR)/informer-gen
Expand Down Expand Up @@ -497,25 +497,25 @@ codegen-client-all: codegen-register codegen-defaulters codegen-applyconfigurati
codegen-crds-kyverno: $(CONTROLLER_GEN) ## Generate kyverno CRDs
@echo Generate kyverno crds... >&2
@rm -rf $(CRDS_PATH)/kyverno && mkdir -p $(CRDS_PATH)/kyverno
@$(CONTROLLER_GEN) crd paths=./api/kyverno/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)/kyverno
@$(CONTROLLER_GEN) crd paths=./api/kyverno/... output:dir=$(CRDS_PATH)/kyverno

.PHONY: codegen-crds-policyreport
codegen-crds-policyreport: $(CONTROLLER_GEN) ## Generate policy reports CRDs
@echo Generate policy reports crds... >&2
@rm -rf $(CRDS_PATH)/policyreport && mkdir -p $(CRDS_PATH)/policyreport
@$(CONTROLLER_GEN) crd paths=./api/policyreport/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)/policyreport
@$(CONTROLLER_GEN) crd paths=./api/policyreport/... output:dir=$(CRDS_PATH)/policyreport

.PHONY: codegen-crds-reports
codegen-crds-reports: $(CONTROLLER_GEN) ## Generate reports CRDs
@echo Generate reports crds... >&2
@rm -rf $(CRDS_PATH)/reports && mkdir -p $(CRDS_PATH)/reports
@$(CONTROLLER_GEN) crd paths=./api/reports/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)/reports
@$(CONTROLLER_GEN) crd paths=./api/reports/... output:dir=$(CRDS_PATH)/reports

.PHONY: codegen-crds-cli
codegen-crds-cli: $(CONTROLLER_GEN) ## Generate CLI CRDs
@echo Generate cli crds... >&2
@rm -rf ${PWD}/cmd/cli/kubectl-kyverno/config/crds && mkdir -p ${PWD}/cmd/cli/kubectl-kyverno/config/crds
@$(CONTROLLER_GEN) crd paths=./cmd/cli/kubectl-kyverno/apis/... crd:crdVersions=v1 output:dir=${PWD}/cmd/cli/kubectl-kyverno/config/crds
@$(CONTROLLER_GEN) crd paths=./cmd/cli/kubectl-kyverno/apis/... output:dir=${PWD}/cmd/cli/kubectl-kyverno/config/crds

.PHONY: codegen-crds-all
codegen-crds-all: codegen-crds-kyverno codegen-crds-policyreport codegen-crds-reports codegen-cli-crds ## Generate all CRDs
Expand Down
37 changes: 28 additions & 9 deletions api/kyverno/v1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/kyverno/kyverno/pkg/engine/variables/regex"
"github.com/kyverno/kyverno/pkg/pss/utils"
"github.com/sigstore/k8s-manifest-sigstore/pkg/k8smanifest"
admissionv1 "k8s.io/api/admission/v1"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
Expand Down Expand Up @@ -151,18 +152,22 @@ type APICall struct {
// The format required is the same format used by the `kubectl get --raw` command.
// See https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
// for details.
// It's mutually exclusive with the Service field.
// +kubebuilder:validation:Optional
URLPath string `json:"urlPath" yaml:"urlPath"`

// Method is the HTTP request type (GET or POST).
// +kubebuilder:default=GET
Method Method `json:"method,omitempty" yaml:"method,omitempty"`

// Data specifies the POST data sent to the server.
// The data object specifies the POST data sent to the server.
// Only applicable when the method field is set to POST.
// +kubebuilder:validation:Optional
Data []RequestData `json:"data,omitempty" yaml:"data,omitempty"`

// Service is an API call to a JSON web service
// Service is an API call to a JSON web service.
// This is used for non-Kubernetes API server calls.
// It's mutually exclusive with the URLPath field.
// +kubebuilder:validation:Optional
Service *ServiceCall `json:"service,omitempty" yaml:"service,omitempty"`
}
Expand All @@ -181,6 +186,7 @@ type ContextAPICall struct {

type GlobalContextEntryReference struct {
// Name of the global context entry
// +kubebuilder:validation:Required
Name string `json:"name,omitempty" yaml:"name,omitempty"`

// JMESPath is an optional JSON Match Expression that can be used to
Expand Down Expand Up @@ -436,8 +442,8 @@ type PodSecurity struct {
Level api.Level `json:"level,omitempty" yaml:"level,omitempty"`

// Version defines the Pod Security Standard versions that Kubernetes supports.
// Allowed values are v1.19, v1.20, v1.21, v1.22, v1.23, v1.24, v1.25, v1.26, latest. Defaults to latest.
// +kubebuilder:validation:Enum=v1.19;v1.20;v1.21;v1.22;v1.23;v1.24;v1.25;v1.26;latest
// Allowed values are v1.19, v1.20, v1.21, v1.22, v1.23, v1.24, v1.25, v1.26, v1.27, v1.28, v1.29, latest. Defaults to latest.
// +kubebuilder:validation:Enum=v1.19;v1.20;v1.21;v1.22;v1.23;v1.24;v1.25;v1.26;v1.27;v1.28;v1.29;latest
// +optional
Version string `json:"version,omitempty" yaml:"version,omitempty"`

Expand Down Expand Up @@ -469,13 +475,26 @@ type PodSecurityStandard struct {
Values []string `json:"values,omitempty" yaml:"values,omitempty"`
}

// Validate checks if the values in the PodSecurityStandard struct are valid.
func (pss *PodSecurityStandard) Validate(exclude PodSecurityStandard) error {
if (exclude.RestrictedField != "" && len(exclude.Values) == 0) || (exclude.RestrictedField == "" && len(exclude.Values) != 0) {
return fmt.Errorf("Values[] and RestrictedField must be set together")
func (pss *PodSecurityStandard) Validate(path *field.Path) (errs field.ErrorList) {
// container level control must specify images
if containsString(utils.PSS_container_level_control, pss.ControlName) {
if len(pss.Images) == 0 {
errs = append(errs, field.Invalid(path.Child("controlName"), pss.ControlName, "exclude.images must be specified for the container level control"))
}
} else if containsString(utils.PSS_pod_level_control, pss.ControlName) {
if len(pss.Images) != 0 {
errs = append(errs, field.Invalid(path.Child("controlName"), pss.ControlName, "exclude.images must not be specified for the pod level control"))
}
}

return nil
if pss.RestrictedField != "" && len(pss.Values) == 0 {
errs = append(errs, field.Forbidden(path.Child("values"), "values is required"))
}

if pss.RestrictedField == "" && len(pss.Values) != 0 {
errs = append(errs, field.Forbidden(path.Child("restrictedField"), "restrictedField is required"))
}
return errs
}

// CEL allows validation checks using the Common Expression Language (https://kubernetes.io/docs/reference/using-api/cel/).
Expand Down
2 changes: 1 addition & 1 deletion api/kyverno/v1/image_verification_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ type KeylessAttestor struct {

type Rekor struct {
// URL is the address of the transparency log. Defaults to the public Rekor log instance https://rekor.sigstore.dev.
// +kubebuilder:validation:Required
// +kubebuilder:validation:Optional
// +kubebuilder:Default:=https://rekor.sigstore.dev
URL string `json:"url" yaml:"url"`

Expand Down
11 changes: 1 addition & 10 deletions api/kyverno/v1/rule_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,16 +396,7 @@ func (r *Rule) ValidatePSaControlNames(path *field.Path) (errs field.ErrorList)
}

for idx, exclude := range podSecurity.Exclude {
// container level control must specify images
if containsString(utils.PSS_container_level_control, exclude.ControlName) {
if len(exclude.Images) == 0 {
errs = append(errs, field.Invalid(path.Child("podSecurity").Child("exclude").Index(idx).Child("controlName"), exclude.ControlName, "exclude.images must be specified for the container level control"))
}
} else if containsString(utils.PSS_pod_level_control, exclude.ControlName) {
if len(exclude.Images) != 0 {
errs = append(errs, field.Invalid(path.Child("podSecurity").Child("exclude").Index(idx).Child("controlName"), exclude.ControlName, "exclude.images must not be specified for the pod level control"))
}
}
errs = append(errs, exclude.Validate(path.Child("podSecurity").Child("exclude").Index(idx))...)

if containsString([]string{"Seccomp", "Capabilities"}, exclude.ControlName) {
continue
Expand Down
7 changes: 7 additions & 0 deletions api/kyverno/v2alpha1/global_context_entry_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ type GlobalContextEntryStatus struct {
Ready bool `json:"ready" yaml:"ready"`
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// Indicates the time when the globalcontextentry was last refreshed successfully for the API Call
// +optional
LastRefreshTime metav1.Time `json:"lastRefreshTime,omitempty"`
}

func (status *GlobalContextEntryStatus) SetReady(ready bool, message string) {
Expand All @@ -40,6 +43,10 @@ func (status *GlobalContextEntryStatus) SetReady(ready bool, message string) {
meta.SetStatusCondition(&status.Conditions, condition)
}

func (status *GlobalContextEntryStatus) UpdateRefreshTime() {
status.LastRefreshTime = metav1.Now()
}

// IsReady indicates if the globalcontextentry has loaded
func (status *GlobalContextEntryStatus) IsReady() bool {
condition := meta.FindStatusCondition(status.Conditions, GlobalContextEntryConditionReady)
Expand Down