From 9d7c304ffee09437ee550e76125e416869a0bb85 Mon Sep 17 00:00:00 2001
From: Shuting Zhao <shutting06@gmail.com>
Date: Mon, 16 Nov 2020 11:47:16 -0800
Subject: [PATCH] update clusterpolicy description

---
 charts/kyverno/crds/crds.yaml                    |  9 ++++++---
 definitions/crds/kyverno.io_clusterpolicies.yaml |  8 +++++---
 definitions/crds/kyverno.io_policies.yaml        |  1 +
 definitions/install.yaml                         |  9 ++++++---
 definitions/install_debug.yaml                   |  9 ++++++---
 pkg/api/kyverno/v1/clusterpolicy_types.go        | 11 +++++++----
 pkg/api/kyverno/v1/policy_types.go               | 11 ++++++-----
 7 files changed, 37 insertions(+), 21 deletions(-)

diff --git a/charts/kyverno/crds/crds.yaml b/charts/kyverno/crds/crds.yaml
index d70a62b915..ed002d173f 100644
--- a/charts/kyverno/crds/crds.yaml
+++ b/charts/kyverno/crds/crds.yaml
@@ -26,7 +26,8 @@ spec:
     name: v1
     schema:
       openAPIV3Schema:
-        description: ClusterPolicy ...
+        description: ClusterPolicy declares validation, mutation, and generation behaviors
+          for matching resources.
         properties:
           apiVersion:
             description: 'APIVersion defines the versioned schema of this representation
@@ -41,7 +42,7 @@ spec:
           metadata:
             type: object
           spec:
-            description: Spec is the information to identify the policy
+            description: Spec declares policy behaviors.
             properties:
               background:
                 default: true
@@ -404,6 +405,7 @@ spec:
                                 description: Value specifies the value to be applied.
                                 x-kubernetes-preserve-unknown-fields: true
                             type: object
+                          nullable: true
                           type: array
                           x-kubernetes-preserve-unknown-fields: true
                         patchesJson6902:
@@ -490,7 +492,7 @@ spec:
                 type: string
             type: object
           status:
-            description: Status contains statistics related to policy
+            description: Status contains policy runtime data.
             properties:
               averageExecutionTime:
                 description: AvgExecutionTime is the average time taken to process
@@ -1814,6 +1816,7 @@ spec:
                                 description: Value specifies the value to be applied.
                                 x-kubernetes-preserve-unknown-fields: true
                             type: object
+                          nullable: true
                           type: array
                           x-kubernetes-preserve-unknown-fields: true
                         patchesJson6902:
diff --git a/definitions/crds/kyverno.io_clusterpolicies.yaml b/definitions/crds/kyverno.io_clusterpolicies.yaml
index 848b91db7d..50a9effa2a 100644
--- a/definitions/crds/kyverno.io_clusterpolicies.yaml
+++ b/definitions/crds/kyverno.io_clusterpolicies.yaml
@@ -28,7 +28,8 @@ spec:
     name: v1
     schema:
       openAPIV3Schema:
-        description: ClusterPolicy ...
+        description: ClusterPolicy declares validation, mutation, and generation behaviors
+          for matching resources.
         properties:
           apiVersion:
             description: 'APIVersion defines the versioned schema of this representation
@@ -43,7 +44,7 @@ spec:
           metadata:
             type: object
           spec:
-            description: Spec is the information to identify the policy
+            description: Spec declares policy behaviors.
             properties:
               background:
                 default: true
@@ -406,6 +407,7 @@ spec:
                                 description: Value specifies the value to be applied.
                                 x-kubernetes-preserve-unknown-fields: true
                             type: object
+                          nullable: true
                           type: array
                           x-kubernetes-preserve-unknown-fields: true
                         patchesJson6902:
@@ -492,7 +494,7 @@ spec:
                 type: string
             type: object
           status:
-            description: Status contains statistics related to policy
+            description: Status contains policy runtime data.
             properties:
               averageExecutionTime:
                 description: AvgExecutionTime is the average time taken to process
diff --git a/definitions/crds/kyverno.io_policies.yaml b/definitions/crds/kyverno.io_policies.yaml
index 1386fda75d..3a31544696 100644
--- a/definitions/crds/kyverno.io_policies.yaml
+++ b/definitions/crds/kyverno.io_policies.yaml
@@ -408,6 +408,7 @@ spec:
                                 description: Value specifies the value to be applied.
                                 x-kubernetes-preserve-unknown-fields: true
                             type: object
+                          nullable: true
                           type: array
                           x-kubernetes-preserve-unknown-fields: true
                         patchesJson6902:
diff --git a/definitions/install.yaml b/definitions/install.yaml
index ca070c9622..335867e711 100644
--- a/definitions/install.yaml
+++ b/definitions/install.yaml
@@ -31,7 +31,8 @@ spec:
     name: v1
     schema:
       openAPIV3Schema:
-        description: ClusterPolicy ...
+        description: ClusterPolicy declares validation, mutation, and generation behaviors
+          for matching resources.
         properties:
           apiVersion:
             description: 'APIVersion defines the versioned schema of this representation
@@ -46,7 +47,7 @@ spec:
           metadata:
             type: object
           spec:
-            description: Spec is the information to identify the policy
+            description: Spec declares policy behaviors.
             properties:
               background:
                 default: true
@@ -409,6 +410,7 @@ spec:
                                 description: Value specifies the value to be applied.
                                 x-kubernetes-preserve-unknown-fields: true
                             type: object
+                          nullable: true
                           type: array
                           x-kubernetes-preserve-unknown-fields: true
                         patchesJson6902:
@@ -495,7 +497,7 @@ spec:
                 type: string
             type: object
           status:
-            description: Status contains statistics related to policy
+            description: Status contains policy runtime data.
             properties:
               averageExecutionTime:
                 description: AvgExecutionTime is the average time taken to process
@@ -1819,6 +1821,7 @@ spec:
                                 description: Value specifies the value to be applied.
                                 x-kubernetes-preserve-unknown-fields: true
                             type: object
+                          nullable: true
                           type: array
                           x-kubernetes-preserve-unknown-fields: true
                         patchesJson6902:
diff --git a/definitions/install_debug.yaml b/definitions/install_debug.yaml
index ce0da9c7f2..90cf7f91bc 100755
--- a/definitions/install_debug.yaml
+++ b/definitions/install_debug.yaml
@@ -31,7 +31,8 @@ spec:
     name: v1
     schema:
       openAPIV3Schema:
-        description: ClusterPolicy ...
+        description: ClusterPolicy declares validation, mutation, and generation behaviors
+          for matching resources.
         properties:
           apiVersion:
             description: 'APIVersion defines the versioned schema of this representation
@@ -46,7 +47,7 @@ spec:
           metadata:
             type: object
           spec:
-            description: Spec is the information to identify the policy
+            description: Spec declares policy behaviors.
             properties:
               background:
                 default: true
@@ -409,6 +410,7 @@ spec:
                                 description: Value specifies the value to be applied.
                                 x-kubernetes-preserve-unknown-fields: true
                             type: object
+                          nullable: true
                           type: array
                           x-kubernetes-preserve-unknown-fields: true
                         patchesJson6902:
@@ -495,7 +497,7 @@ spec:
                 type: string
             type: object
           status:
-            description: Status contains statistics related to policy
+            description: Status contains policy runtime data.
             properties:
               averageExecutionTime:
                 description: AvgExecutionTime is the average time taken to process
@@ -1819,6 +1821,7 @@ spec:
                                 description: Value specifies the value to be applied.
                                 x-kubernetes-preserve-unknown-fields: true
                             type: object
+                          nullable: true
                           type: array
                           x-kubernetes-preserve-unknown-fields: true
                         patchesJson6902:
diff --git a/pkg/api/kyverno/v1/clusterpolicy_types.go b/pkg/api/kyverno/v1/clusterpolicy_types.go
index 403df00ae5..c3bdf698b9 100644
--- a/pkg/api/kyverno/v1/clusterpolicy_types.go
+++ b/pkg/api/kyverno/v1/clusterpolicy_types.go
@@ -4,7 +4,7 @@ import (
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
-// ClusterPolicy ...
+// ClusterPolicy declares validation, mutation, and generation behaviors for matching resources.
 // +genclient
 // +genclient:nonNamespaced
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -16,13 +16,16 @@ import (
 type ClusterPolicy struct {
 	metav1.TypeMeta   `json:",inline,omitempty" yaml:",inline,omitempty"`
 	metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
-	// Spec is the information to identify the policy
+
+	// Spec declares policy behaviors.
 	Spec Spec `json:"spec" yaml:"spec"`
-	// Status contains statistics related to policy
+
+	// Status contains policy runtime data.
+	// +optional
 	Status PolicyStatus `json:"status,omitempty" yaml:"status,omitempty"`
 }
 
-// ClusterPolicyList ...
+// ClusterPolicyList is a list of ClusterPolicy instances.
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
 type ClusterPolicyList struct {
 	metav1.TypeMeta `json:",inline" yaml:",inline"`
diff --git a/pkg/api/kyverno/v1/policy_types.go b/pkg/api/kyverno/v1/policy_types.go
index 51acef412f..0ab95e81d0 100755
--- a/pkg/api/kyverno/v1/policy_types.go
+++ b/pkg/api/kyverno/v1/policy_types.go
@@ -121,17 +121,17 @@ type ConditionOperator string
 
 const (
 	// Equal evaluates if the key is equal to the value.
-	Equal     ConditionOperator = "Equal"
+	Equal ConditionOperator = "Equal"
 	// Equals evaluates if the key is equal to the value.
-	Equals    ConditionOperator = "Equals"
+	Equals ConditionOperator = "Equals"
 	// Equals evaluates if the key is not equal to the value.
-	NotEqual  ConditionOperator = "NotEqual"
+	NotEqual ConditionOperator = "NotEqual"
 	// NotEquals evaluates if the key is not equal to the value.
 	NotEquals ConditionOperator = "NotEquals"
 	// In evaluates if the key is contained in the set of values.
-	In        ConditionOperator = "In"
+	In ConditionOperator = "In"
 	// NotIn evaluates if the key is not contained in the set of values.
-	NotIn     ConditionOperator = "NotIn"
+	NotIn ConditionOperator = "NotIn"
 )
 
 // MatchResources is used to specify resource and admission review request data for
@@ -212,6 +212,7 @@ type Mutation struct {
 	// DEPRECATED. Use PatchesJSON6902 instead. Scheduled for
 	// removal in release 1.5+.
 	// +kubebuilder:validation:XPreserveUnknownFields
+	// +nullable
 	// +optional
 	Patches []Patch `json:"patches,omitempty" yaml:"patches,omitempty"`