2020-06-05 13:42:53 -07:00
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
name: clusterpolicies.kyverno.io
|
|
|
|
spec:
|
|
|
|
group: kyverno.io
|
|
|
|
versions:
|
|
|
|
- name: v1
|
|
|
|
served: true
|
|
|
|
storage: true
|
|
|
|
scope: Cluster
|
|
|
|
names:
|
|
|
|
kind: ClusterPolicy
|
|
|
|
plural: clusterpolicies
|
|
|
|
singular: clusterpolicy
|
|
|
|
shortNames:
|
|
|
|
- cpol
|
|
|
|
subresources:
|
|
|
|
status: {}
|
|
|
|
validation:
|
|
|
|
openAPIV3Schema:
|
|
|
|
properties:
|
|
|
|
status: {}
|
|
|
|
spec:
|
|
|
|
required:
|
|
|
|
- rules
|
|
|
|
properties:
|
|
|
|
# default values to be handled by user
|
|
|
|
validationFailureAction:
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- enforce # blocks the resorce api-reques if a rule fails.
|
|
|
|
- audit # allows resource creation and reports the failed validation rules as violations. Default
|
|
|
|
background:
|
|
|
|
type: boolean
|
|
|
|
rules:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- match
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
match:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- resources
|
|
|
|
properties:
|
|
|
|
roles:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
clusterRoles:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
subjects:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
apiGroup:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
namespace:
|
|
|
|
type: string
|
|
|
|
resources:
|
|
|
|
type: object
|
|
|
|
minProperties: 1
|
|
|
|
properties:
|
|
|
|
kinds:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
namespaces:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
2020-08-18 05:42:27 +05:30
|
|
|
annotations:
|
|
|
|
type: object
|
|
|
|
additionalProperties:
|
|
|
|
type: string
|
2020-06-05 13:42:53 -07:00
|
|
|
selector:
|
|
|
|
properties:
|
|
|
|
matchLabels:
|
|
|
|
type: object
|
|
|
|
additionalProperties:
|
|
|
|
type: string
|
|
|
|
matchExpressions:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- key
|
|
|
|
- operator
|
|
|
|
properties:
|
|
|
|
key:
|
|
|
|
type: string
|
|
|
|
operator:
|
|
|
|
type: string
|
|
|
|
values:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
exclude:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
roles:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
clusterRoles:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
subjects:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
apiGroup:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
namespace:
|
|
|
|
type: string
|
|
|
|
resources:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
kinds:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
namespaces:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
2020-08-18 05:42:27 +05:30
|
|
|
annotations:
|
|
|
|
type: object
|
|
|
|
additionalProperties:
|
|
|
|
type: string
|
2020-06-05 13:42:53 -07:00
|
|
|
selector:
|
|
|
|
properties:
|
|
|
|
matchLabels:
|
|
|
|
type: object
|
|
|
|
additionalProperties:
|
|
|
|
type: string
|
|
|
|
matchExpressions:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- key
|
|
|
|
- operator
|
|
|
|
properties:
|
|
|
|
key:
|
|
|
|
type: string
|
|
|
|
operator:
|
|
|
|
type: string
|
|
|
|
values:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
preconditions:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- key # can be of any type
|
|
|
|
- operator # typed
|
|
|
|
- value # can be of any type
|
|
|
|
mutate:
|
|
|
|
type: object
|
|
|
|
properties:
|
2020-08-13 11:57:35 -07:00
|
|
|
overlay: {}
|
|
|
|
patchStrategicMerge: {}
|
2020-08-05 09:11:23 -07:00
|
|
|
patchesJson6902:
|
|
|
|
type: string
|
2020-06-05 13:42:53 -07:00
|
|
|
patches:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- path
|
|
|
|
- op
|
|
|
|
properties:
|
|
|
|
path:
|
|
|
|
type: string
|
|
|
|
op:
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- add
|
|
|
|
- replace
|
|
|
|
- remove
|
2020-08-13 11:57:35 -07:00
|
|
|
value: {}
|
2020-06-05 13:42:53 -07:00
|
|
|
validate:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
message:
|
|
|
|
type: string
|
2020-08-13 11:57:35 -07:00
|
|
|
pattern: {}
|
|
|
|
anyPattern: {}
|
2020-06-05 13:42:53 -07:00
|
|
|
deny:
|
|
|
|
properties:
|
|
|
|
conditions:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- key # can be of any type
|
|
|
|
- operator # typed
|
|
|
|
- value # can be of any type
|
|
|
|
properties:
|
|
|
|
operator:
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- Equal
|
|
|
|
- Equals
|
|
|
|
- NotEqual
|
|
|
|
- NotEquals
|
2020-06-12 15:48:19 +05:30
|
|
|
- In
|
|
|
|
- NotIn
|
2020-06-05 13:42:53 -07:00
|
|
|
key:
|
|
|
|
type: string
|
|
|
|
value:
|
2020-06-24 12:27:08 +05:30
|
|
|
anyOf:
|
|
|
|
- type: string
|
|
|
|
- type: array
|
|
|
|
items: {}
|
2020-06-05 13:42:53 -07:00
|
|
|
generate:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
2020-08-07 09:47:33 +05:30
|
|
|
apiVersion:
|
|
|
|
type: string
|
2020-06-05 13:42:53 -07:00
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
namespace:
|
|
|
|
type: string
|
2020-06-22 18:49:43 -07:00
|
|
|
synchronize:
|
|
|
|
type: boolean
|
2020-06-05 13:42:53 -07:00
|
|
|
clone:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- namespace
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
namespace:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
2020-08-13 11:57:35 -07:00
|
|
|
data: {}
|
2020-06-05 13:42:53 -07:00
|
|
|
---
|
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
2020-08-19 21:37:23 +05:30
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
name: policies.kyverno.io
|
|
|
|
spec:
|
|
|
|
group: kyverno.io
|
|
|
|
versions:
|
|
|
|
- name: v1
|
|
|
|
served: true
|
|
|
|
storage: true
|
|
|
|
scope: Namespaced
|
|
|
|
names:
|
|
|
|
kind: Policy
|
|
|
|
plural: policies
|
|
|
|
singular: policy
|
|
|
|
shortNames:
|
|
|
|
- pol
|
|
|
|
subresources:
|
|
|
|
status: {}
|
|
|
|
validation:
|
|
|
|
openAPIV3Schema:
|
|
|
|
properties:
|
|
|
|
status: {}
|
|
|
|
spec:
|
|
|
|
required:
|
|
|
|
- rules
|
|
|
|
properties:
|
|
|
|
# default values to be handled by user
|
|
|
|
validationFailureAction:
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- enforce # blocks the resorce api-reques if a rule fails.
|
|
|
|
- audit # allows resource creation and reports the failed validation rules as violations. Default
|
|
|
|
background:
|
|
|
|
type: boolean
|
|
|
|
rules:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- match
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
match:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- resources
|
|
|
|
properties:
|
|
|
|
roles:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
clusterRoles:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
subjects:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
apiGroup:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
namespace:
|
|
|
|
type: string
|
|
|
|
resources:
|
|
|
|
type: object
|
|
|
|
minProperties: 1
|
|
|
|
properties:
|
|
|
|
kinds:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
selector:
|
|
|
|
properties:
|
|
|
|
matchLabels:
|
|
|
|
type: object
|
|
|
|
additionalProperties:
|
|
|
|
type: string
|
|
|
|
matchExpressions:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- key
|
|
|
|
- operator
|
|
|
|
properties:
|
|
|
|
key:
|
|
|
|
type: string
|
|
|
|
operator:
|
|
|
|
type: string
|
|
|
|
values:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
exclude:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
roles:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
clusterRoles:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
subjects:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
apiGroup:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
namespace:
|
|
|
|
type: string
|
|
|
|
resources:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
kinds:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
selector:
|
|
|
|
properties:
|
|
|
|
matchLabels:
|
|
|
|
type: object
|
|
|
|
additionalProperties:
|
|
|
|
type: string
|
|
|
|
matchExpressions:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- key
|
|
|
|
- operator
|
|
|
|
properties:
|
|
|
|
key:
|
|
|
|
type: string
|
|
|
|
operator:
|
|
|
|
type: string
|
|
|
|
values:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
preconditions:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- key # can be of any type
|
|
|
|
- operator # typed
|
|
|
|
- value # can be of any type
|
|
|
|
mutate:
|
|
|
|
type: object
|
|
|
|
properties:
|
Replace Policy CRD AnyValue fields with empty dict (#1086)
/kind cleanup
\## Proposed change
This implements the same change as #1047, except for the new Policy CRD instead of the ClusterPolicy CRD, which apparently did not get those updates before merging.
When deploying Kyverno using Argo CD, we get a persistent false diff for the Policy custom resource definition (the definition itself, not instances of Policy), because Kubernetes converts the invalid AnyValue: {} property types to just an empty dict {}. Since the Kubernetes server makes this change to {} unilaterally after applying, when a diffing tool like Argo CD compares it against the YAML manifest, each such instance of AnyValue appears as a diff.
I know that since AnyValue is not part of the official OpenAPI V3 schema, and that when you run kubectl get crd policies.kyverno.io -o yaml the status message shows Kubernetes complaining about "Required value: must not be empty for specified object fields" for all of these fields. In theory the correct solution would be to somehow provide a full schema, but I know this can be tricky for these data/anyPattern/patches types, but at the minimum, I would like to get Argo CD to believe that there are no changes that need to be applied.
Since these fields are already silently turned into {} by Kubernetes, this should have no functionality change on existing code/deployments.
2020-08-26 11:11:36 -07:00
|
|
|
overlay: {}
|
|
|
|
patchStrategicMerge: {}
|
2020-08-19 21:37:23 +05:30
|
|
|
patchesJson6902:
|
|
|
|
type: string
|
|
|
|
patches:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- path
|
|
|
|
- op
|
|
|
|
properties:
|
|
|
|
path:
|
|
|
|
type: string
|
|
|
|
op:
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- add
|
|
|
|
- replace
|
|
|
|
- remove
|
Replace Policy CRD AnyValue fields with empty dict (#1086)
/kind cleanup
\## Proposed change
This implements the same change as #1047, except for the new Policy CRD instead of the ClusterPolicy CRD, which apparently did not get those updates before merging.
When deploying Kyverno using Argo CD, we get a persistent false diff for the Policy custom resource definition (the definition itself, not instances of Policy), because Kubernetes converts the invalid AnyValue: {} property types to just an empty dict {}. Since the Kubernetes server makes this change to {} unilaterally after applying, when a diffing tool like Argo CD compares it against the YAML manifest, each such instance of AnyValue appears as a diff.
I know that since AnyValue is not part of the official OpenAPI V3 schema, and that when you run kubectl get crd policies.kyverno.io -o yaml the status message shows Kubernetes complaining about "Required value: must not be empty for specified object fields" for all of these fields. In theory the correct solution would be to somehow provide a full schema, but I know this can be tricky for these data/anyPattern/patches types, but at the minimum, I would like to get Argo CD to believe that there are no changes that need to be applied.
Since these fields are already silently turned into {} by Kubernetes, this should have no functionality change on existing code/deployments.
2020-08-26 11:11:36 -07:00
|
|
|
value: {}
|
2020-08-19 21:37:23 +05:30
|
|
|
validate:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
message:
|
|
|
|
type: string
|
Replace Policy CRD AnyValue fields with empty dict (#1086)
/kind cleanup
\## Proposed change
This implements the same change as #1047, except for the new Policy CRD instead of the ClusterPolicy CRD, which apparently did not get those updates before merging.
When deploying Kyverno using Argo CD, we get a persistent false diff for the Policy custom resource definition (the definition itself, not instances of Policy), because Kubernetes converts the invalid AnyValue: {} property types to just an empty dict {}. Since the Kubernetes server makes this change to {} unilaterally after applying, when a diffing tool like Argo CD compares it against the YAML manifest, each such instance of AnyValue appears as a diff.
I know that since AnyValue is not part of the official OpenAPI V3 schema, and that when you run kubectl get crd policies.kyverno.io -o yaml the status message shows Kubernetes complaining about "Required value: must not be empty for specified object fields" for all of these fields. In theory the correct solution would be to somehow provide a full schema, but I know this can be tricky for these data/anyPattern/patches types, but at the minimum, I would like to get Argo CD to believe that there are no changes that need to be applied.
Since these fields are already silently turned into {} by Kubernetes, this should have no functionality change on existing code/deployments.
2020-08-26 11:11:36 -07:00
|
|
|
pattern: {}
|
|
|
|
anyPattern: {}
|
2020-08-19 21:37:23 +05:30
|
|
|
deny:
|
|
|
|
properties:
|
|
|
|
conditions:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- key # can be of any type
|
|
|
|
- operator # typed
|
|
|
|
- value # can be of any type
|
|
|
|
properties:
|
|
|
|
operator:
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- Equal
|
|
|
|
- Equals
|
|
|
|
- NotEqual
|
|
|
|
- NotEquals
|
|
|
|
- In
|
|
|
|
- NotIn
|
|
|
|
key:
|
|
|
|
type: string
|
|
|
|
value:
|
|
|
|
anyOf:
|
|
|
|
- type: string
|
|
|
|
- type: array
|
|
|
|
items: {}
|
|
|
|
generate:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
apiVersion:
|
|
|
|
type: string
|
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
namespace:
|
|
|
|
type: string
|
|
|
|
synchronize:
|
|
|
|
type: boolean
|
|
|
|
clone:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- namespace
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
namespace:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
Replace Policy CRD AnyValue fields with empty dict (#1086)
/kind cleanup
\## Proposed change
This implements the same change as #1047, except for the new Policy CRD instead of the ClusterPolicy CRD, which apparently did not get those updates before merging.
When deploying Kyverno using Argo CD, we get a persistent false diff for the Policy custom resource definition (the definition itself, not instances of Policy), because Kubernetes converts the invalid AnyValue: {} property types to just an empty dict {}. Since the Kubernetes server makes this change to {} unilaterally after applying, when a diffing tool like Argo CD compares it against the YAML manifest, each such instance of AnyValue appears as a diff.
I know that since AnyValue is not part of the official OpenAPI V3 schema, and that when you run kubectl get crd policies.kyverno.io -o yaml the status message shows Kubernetes complaining about "Required value: must not be empty for specified object fields" for all of these fields. In theory the correct solution would be to somehow provide a full schema, but I know this can be tricky for these data/anyPattern/patches types, but at the minimum, I would like to get Argo CD to believe that there are no changes that need to be applied.
Since these fields are already silently turned into {} by Kubernetes, this should have no functionality change on existing code/deployments.
2020-08-26 11:11:36 -07:00
|
|
|
data: {}
|
2020-08-19 21:37:23 +05:30
|
|
|
---
|
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
2020-06-05 13:42:53 -07:00
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
name: clusterpolicyviolations.kyverno.io
|
|
|
|
spec:
|
|
|
|
group: kyverno.io
|
|
|
|
versions:
|
|
|
|
- name: v1
|
|
|
|
served: true
|
|
|
|
storage: true
|
|
|
|
scope: Cluster
|
|
|
|
names:
|
|
|
|
kind: ClusterPolicyViolation
|
|
|
|
plural: clusterpolicyviolations
|
|
|
|
singular: clusterpolicyviolation
|
|
|
|
shortNames:
|
|
|
|
- cpolv
|
|
|
|
subresources:
|
|
|
|
status: {}
|
|
|
|
additionalPrinterColumns:
|
|
|
|
- name: Policy
|
|
|
|
type: string
|
|
|
|
description: The policy that resulted in the violation
|
|
|
|
JSONPath: .spec.policy
|
|
|
|
- name: ResourceKind
|
|
|
|
type: string
|
|
|
|
description: The resource kind that cause the violation
|
|
|
|
JSONPath: .spec.resource.kind
|
|
|
|
- name: ResourceName
|
|
|
|
type: string
|
|
|
|
description: The resource name that caused the violation
|
|
|
|
JSONPath: .spec.resource.name
|
|
|
|
- name: Age
|
|
|
|
type: date
|
|
|
|
JSONPath: .metadata.creationTimestamp
|
|
|
|
validation:
|
|
|
|
openAPIV3Schema:
|
|
|
|
properties:
|
|
|
|
spec:
|
|
|
|
required:
|
|
|
|
- policy
|
|
|
|
- resource
|
|
|
|
- rules
|
|
|
|
properties:
|
|
|
|
policy:
|
|
|
|
type: string
|
|
|
|
resource:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
rules:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- type
|
|
|
|
- message
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
type:
|
|
|
|
type: string
|
|
|
|
message:
|
|
|
|
type: string
|
|
|
|
---
|
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
name: policyviolations.kyverno.io
|
|
|
|
spec:
|
|
|
|
group: kyverno.io
|
|
|
|
versions:
|
|
|
|
- name: v1
|
|
|
|
served: true
|
|
|
|
storage: true
|
|
|
|
scope: Namespaced
|
|
|
|
names:
|
|
|
|
kind: PolicyViolation
|
|
|
|
plural: policyviolations
|
|
|
|
singular: policyviolation
|
|
|
|
shortNames:
|
|
|
|
- polv
|
|
|
|
subresources:
|
|
|
|
status: {}
|
|
|
|
additionalPrinterColumns:
|
|
|
|
- name: Policy
|
|
|
|
type: string
|
|
|
|
description: The policy that resulted in the violation
|
|
|
|
JSONPath: .spec.policy
|
|
|
|
- name: ResourceKind
|
|
|
|
type: string
|
|
|
|
description: The resource kind that cause the violation
|
|
|
|
JSONPath: .spec.resource.kind
|
|
|
|
- name: ResourceName
|
|
|
|
type: string
|
|
|
|
description: The resource name that caused the violation
|
|
|
|
JSONPath: .spec.resource.name
|
|
|
|
- name: Age
|
|
|
|
type: date
|
|
|
|
JSONPath: .metadata.creationTimestamp
|
|
|
|
validation:
|
|
|
|
openAPIV3Schema:
|
|
|
|
properties:
|
|
|
|
spec:
|
|
|
|
required:
|
|
|
|
- policy
|
|
|
|
- resource
|
|
|
|
- rules
|
|
|
|
properties:
|
|
|
|
policy:
|
|
|
|
type: string
|
|
|
|
resource:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
rules:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- name
|
|
|
|
- type
|
|
|
|
- message
|
|
|
|
properties:
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
type:
|
|
|
|
type: string
|
|
|
|
message:
|
|
|
|
type: string
|
|
|
|
---
|
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
|
|
|
name: generaterequests.kyverno.io
|
|
|
|
spec:
|
|
|
|
group: kyverno.io
|
|
|
|
versions:
|
|
|
|
- name: v1
|
|
|
|
served: true
|
|
|
|
storage: true
|
|
|
|
scope: Namespaced
|
|
|
|
names:
|
|
|
|
kind: GenerateRequest
|
|
|
|
plural: generaterequests
|
|
|
|
singular: generaterequest
|
|
|
|
shortNames:
|
|
|
|
- gr
|
|
|
|
subresources:
|
|
|
|
status: {}
|
|
|
|
additionalPrinterColumns:
|
|
|
|
- name: Policy
|
|
|
|
type: string
|
|
|
|
description: The policy that resulted in the violation
|
|
|
|
JSONPath: .spec.policy
|
|
|
|
- name: ResourceKind
|
|
|
|
type: string
|
|
|
|
description: The resource kind that cause the violation
|
|
|
|
JSONPath: .spec.resource.kind
|
|
|
|
- name: ResourceName
|
|
|
|
type: string
|
|
|
|
description: The resource name that caused the violation
|
|
|
|
JSONPath: .spec.resource.name
|
|
|
|
- name: ResourceNamespace
|
|
|
|
type: string
|
|
|
|
description: The resource namespace that caused the violation
|
|
|
|
JSONPath: .spec.resource.namespace
|
|
|
|
- name: status
|
|
|
|
type : string
|
|
|
|
description: Current state of generate request
|
|
|
|
JSONPath: .status.state
|
|
|
|
- name: Age
|
|
|
|
type: date
|
|
|
|
JSONPath: .metadata.creationTimestamp
|
|
|
|
validation:
|
|
|
|
openAPIV3Schema:
|
|
|
|
properties:
|
|
|
|
spec:
|
|
|
|
required:
|
|
|
|
- policy
|
|
|
|
- resource
|
|
|
|
properties:
|
|
|
|
policy:
|
|
|
|
type: string
|
|
|
|
resource:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
namespace:
|
Replace Policy CRD AnyValue fields with empty dict (#1086)
/kind cleanup
\## Proposed change
This implements the same change as #1047, except for the new Policy CRD instead of the ClusterPolicy CRD, which apparently did not get those updates before merging.
When deploying Kyverno using Argo CD, we get a persistent false diff for the Policy custom resource definition (the definition itself, not instances of Policy), because Kubernetes converts the invalid AnyValue: {} property types to just an empty dict {}. Since the Kubernetes server makes this change to {} unilaterally after applying, when a diffing tool like Argo CD compares it against the YAML manifest, each such instance of AnyValue appears as a diff.
I know that since AnyValue is not part of the official OpenAPI V3 schema, and that when you run kubectl get crd policies.kyverno.io -o yaml the status message shows Kubernetes complaining about "Required value: must not be empty for specified object fields" for all of these fields. In theory the correct solution would be to somehow provide a full schema, but I know this can be tricky for these data/anyPattern/patches types, but at the minimum, I would like to get Argo CD to believe that there are no changes that need to be applied.
Since these fields are already silently turned into {} by Kubernetes, this should have no functionality change on existing code/deployments.
2020-08-26 11:11:36 -07:00
|
|
|
type: string
|