mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-30 19:35:06 +00:00
feat: add categories support to our CRDs (#5112)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
This commit is contained in:
parent
5279958943
commit
0b8c9334d2
15 changed files with 51 additions and 9 deletions
|
@ -13,7 +13,7 @@ import (
|
|||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:resource:path=clusterpolicies,scope="Cluster",shortName=cpol
|
||||
// +kubebuilder:resource:path=clusterpolicies,scope="Cluster",shortName=cpol,categories=kyverno;all
|
||||
// +kubebuilder:printcolumn:name="Background",type=boolean,JSONPath=".spec.background"
|
||||
// +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction"
|
||||
// +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1
|
||||
|
|
|
@ -16,7 +16,7 @@ import (
|
|||
// +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction"
|
||||
// +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1
|
||||
// +kubebuilder:printcolumn:name="Ready",type=boolean,JSONPath=`.status.ready`
|
||||
// +kubebuilder:resource:shortName=pol
|
||||
// +kubebuilder:resource:shortName=pol,categories=kyverno;all
|
||||
// +kubebuilder:storageversion
|
||||
|
||||
// Policy declares validation, mutation, and generation behaviors for matching resources.
|
||||
|
|
|
@ -38,7 +38,7 @@ type AdmissionReportSpec struct {
|
|||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:resource:shortName=admr
|
||||
// +kubebuilder:resource:shortName=admr,categories=kyverno;all
|
||||
// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".metadata.ownerReferences[0].apiVersion",priority=1
|
||||
// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".metadata.ownerReferences[0].kind",priority=1
|
||||
// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".metadata.ownerReferences[0].name",priority=1
|
||||
|
@ -74,7 +74,7 @@ func (r *AdmissionReport) SetSummary(summary policyreportv1alpha2.PolicyReportSu
|
|||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:resource:scope=Cluster,shortName=cadmr
|
||||
// +kubebuilder:resource:scope=Cluster,shortName=cadmr,categories=kyverno;all
|
||||
// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".metadata.ownerReferences[0].apiVersion",priority=1
|
||||
// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".metadata.ownerReferences[0].kind",priority=1
|
||||
// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".metadata.ownerReferences[0].name",priority=1
|
||||
|
|
|
@ -35,7 +35,7 @@ type BackgroundScanReportSpec struct {
|
|||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:resource:shortName=bgscanr
|
||||
// +kubebuilder:resource:shortName=bgscanr,categories=kyverno;all
|
||||
// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".metadata.ownerReferences[0].apiVersion",priority=1
|
||||
// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".metadata.ownerReferences[0].kind",priority=1
|
||||
// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".metadata.ownerReferences[0].name",priority=1
|
||||
|
@ -71,7 +71,7 @@ func (r *BackgroundScanReport) SetSummary(summary policyreportv1alpha2.PolicyRep
|
|||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:storageversion
|
||||
// +kubebuilder:resource:scope=Cluster,shortName=cbgscanr
|
||||
// +kubebuilder:resource:scope=Cluster,shortName=cbgscanr,categories=kyverno;all
|
||||
// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".metadata.ownerReferences[0].apiVersion",priority=1
|
||||
// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".metadata.ownerReferences[0].kind",priority=1
|
||||
// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".metadata.ownerReferences[0].name",priority=1
|
||||
|
|
|
@ -51,7 +51,7 @@ type UpdateRequestStatus struct {
|
|||
// +kubebuilder:printcolumn:name="ResourceNamespace",type="string",JSONPath=".spec.resource.namespace"
|
||||
// +kubebuilder:printcolumn:name="status",type="string",JSONPath=".status.state"
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
|
||||
// +kubebuilder:resource:shortName=ur
|
||||
// +kubebuilder:resource:shortName=ur,categories=kyverno;all
|
||||
|
||||
// UpdateRequest is a request to process mutate and generate rules in background.
|
||||
type UpdateRequest struct {
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:resource:path=clusterpolicies,scope="Cluster",shortName=cpol
|
||||
// +kubebuilder:resource:path=clusterpolicies,scope="Cluster",shortName=cpol,categories=kyverno;all
|
||||
// +kubebuilder:printcolumn:name="Background",type=boolean,JSONPath=".spec.background"
|
||||
// +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction"
|
||||
// +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
// +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction"
|
||||
// +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1
|
||||
// +kubebuilder:printcolumn:name="Ready",type=boolean,JSONPath=`.status.ready`
|
||||
// +kubebuilder:resource:shortName=pol
|
||||
// +kubebuilder:resource:shortName=pol,categories=kyverno;all
|
||||
|
||||
// Policy declares validation, mutation, and generation behaviors for matching resources.
|
||||
// See: https://kyverno.io/docs/writing-policies/ for more information.
|
||||
|
|
|
@ -17,6 +17,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: AdmissionReport
|
||||
listKind: AdmissionReportList
|
||||
plural: admissionreports
|
||||
|
@ -275,6 +278,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: BackgroundScanReport
|
||||
listKind: BackgroundScanReportList
|
||||
plural: backgroundscanreports
|
||||
|
@ -503,6 +509,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: ClusterAdmissionReport
|
||||
listKind: ClusterAdmissionReportList
|
||||
plural: clusteradmissionreports
|
||||
|
@ -761,6 +770,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: ClusterBackgroundScanReport
|
||||
listKind: ClusterBackgroundScanReportList
|
||||
plural: clusterbackgroundscanreports
|
||||
|
@ -989,6 +1001,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: ClusterPolicy
|
||||
listKind: ClusterPolicyList
|
||||
plural: clusterpolicies
|
||||
|
@ -8570,6 +8585,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: Policy
|
||||
listKind: PolicyList
|
||||
plural: policies
|
||||
|
@ -15976,6 +15994,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: UpdateRequest
|
||||
listKind: UpdateRequestList
|
||||
plural: updaterequests
|
||||
|
|
|
@ -9,6 +9,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: AdmissionReport
|
||||
listKind: AdmissionReportList
|
||||
plural: admissionreports
|
||||
|
|
|
@ -9,6 +9,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: BackgroundScanReport
|
||||
listKind: BackgroundScanReportList
|
||||
plural: backgroundscanreports
|
||||
|
|
|
@ -9,6 +9,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: ClusterAdmissionReport
|
||||
listKind: ClusterAdmissionReportList
|
||||
plural: clusteradmissionreports
|
||||
|
|
|
@ -9,6 +9,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: ClusterBackgroundScanReport
|
||||
listKind: ClusterBackgroundScanReportList
|
||||
plural: clusterbackgroundscanreports
|
||||
|
|
|
@ -9,6 +9,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: ClusterPolicy
|
||||
listKind: ClusterPolicyList
|
||||
plural: clusterpolicies
|
||||
|
|
|
@ -9,6 +9,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: Policy
|
||||
listKind: PolicyList
|
||||
plural: policies
|
||||
|
|
|
@ -9,6 +9,9 @@ metadata:
|
|||
spec:
|
||||
group: kyverno.io
|
||||
names:
|
||||
categories:
|
||||
- kyverno
|
||||
- all
|
||||
kind: UpdateRequest
|
||||
listKind: UpdateRequestList
|
||||
plural: updaterequests
|
||||
|
|
Loading…
Add table
Reference in a new issue