Skip to content

Commit

Permalink
update clusterpolicy description
Browse files Browse the repository at this point in the history
  • Loading branch information
realshuting committed Nov 16, 2020
1 parent 1e00ef2 commit 9d7c304
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 21 deletions.
9 changes: 6 additions & 3 deletions charts/kyverno/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions definitions/crds/kyverno.io_clusterpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions definitions/crds/kyverno.io_policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 6 additions & 3 deletions definitions/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
9 changes: 6 additions & 3 deletions definitions/install_debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
11 changes: 7 additions & 4 deletions pkg/api/kyverno/v1/clusterpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"`
Expand Down
11 changes: 6 additions & 5 deletions pkg/api/kyverno/v1/policy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"`

Expand Down

0 comments on commit 9d7c304

Please sign in to comment.