1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-05 07:26:55 +00:00

Update PolicyReport CRDs to wgpolicyk8s.io/v1alpha2 (#1825)

This commit is contained in:
Frank Jogeleit 2021-08-21 19:35:17 +02:00 committed by GitHub
parent 8c7858c4b0
commit c522343c03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 1039 additions and 613 deletions

View file

@ -226,11 +226,11 @@ release-notes:
true
kyverno-crd: controller-gen
$(CONTROLLER_GEN) crd paths=./pkg/api/kyverno/v1alpha1 output:dir=./definitions/crds
$(CONTROLLER_GEN) crd paths=./pkg/api/kyverno/v1alpha2 output:dir=./definitions/crds
$(CONTROLLER_GEN) crd paths=./pkg/api/kyverno/v1 output:dir=./definitions/crds
report-crd: controller-gen
$(CONTROLLER_GEN) crd paths=./pkg/api/policyreport/v1alpha1 output:dir=./definitions/crds
$(CONTROLLER_GEN) crd paths=./pkg/api/policyreport/v1alpha2 output:dir=./definitions/crds
# install the right version of controller-gen
install-controller-gen:

View file

@ -1057,7 +1057,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ClusterPolicyReport is the Schema for the clusterpolicyreports API
@ -1078,10 +1078,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -1089,6 +1089,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -1160,8 +1185,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -1303,7 +1328,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ClusterReportChangeRequest is the Schema for the ClusterReportChangeRequests API
@ -1324,10 +1349,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -1335,6 +1360,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -1406,8 +1456,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -2728,7 +2778,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: PolicyReport is the Schema for the policyreports API
@ -2749,10 +2799,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -2760,6 +2810,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -2831,8 +2906,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -2974,7 +3049,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ReportChangeRequest is the Schema for the ReportChangeRequests API
@ -2995,10 +3070,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -3006,6 +3081,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -3077,8 +3177,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail

View file

@ -205,7 +205,7 @@ metadata:
name: {{ template "kyverno.fullname" . }}:admin-policyreport
rules:
- apiGroups:
- wgpolicyk8s.io/v1alpha1
- wgpolicyk8s.io/v1alpha2
resources:
- policyreport
- clusterpolicyreport

View file

@ -198,8 +198,8 @@ func main() {
// POLICY Report GENERATOR
reportReqGen := policyreport.NewReportChangeRequestGenerator(pclient,
client,
pInformer.Kyverno().V1alpha1().ReportChangeRequests(),
pInformer.Kyverno().V1alpha1().ClusterReportChangeRequests(),
pInformer.Kyverno().V1alpha2().ReportChangeRequests(),
pInformer.Kyverno().V1alpha2().ClusterReportChangeRequests(),
pInformer.Kyverno().V1().ClusterPolicies(),
pInformer.Kyverno().V1().Policies(),
log.Log.WithName("ReportChangeRequestGenerator"),
@ -209,10 +209,10 @@ func main() {
kubeClient,
pclient,
client,
pInformer.Wgpolicyk8s().V1alpha1().ClusterPolicyReports(),
pInformer.Wgpolicyk8s().V1alpha1().PolicyReports(),
pInformer.Kyverno().V1alpha1().ReportChangeRequests(),
pInformer.Kyverno().V1alpha1().ClusterReportChangeRequests(),
pInformer.Wgpolicyk8s().V1alpha2().ClusterPolicyReports(),
pInformer.Wgpolicyk8s().V1alpha2().PolicyReports(),
pInformer.Kyverno().V1alpha2().ReportChangeRequests(),
pInformer.Kyverno().V1alpha2().ClusterReportChangeRequests(),
kubeInformer.Core().V1().Namespaces(),
log.Log.WithName("PolicyReportGenerator"),
)

View file

@ -45,7 +45,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ClusterReportChangeRequest is the Schema for the ClusterReportChangeRequests
@ -72,12 +72,6 @@ spec:
category:
description: Category indicates policy category
type: string
data:
additionalProperties:
type: string
description: Data provides additional information for the policy
rule
type: object
message:
description: Message is a short user friendly description of the
policy rule
@ -85,6 +79,12 @@ spec:
policy:
description: Policy is the name of the policy
type: string
properties:
additionalProperties:
type: string
description: Properties provides additional information for the
policy rule
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy
results that apply to multiple resources. For example, a policy
@ -197,6 +197,15 @@ spec:
type: string
type: object
type: array
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
- warn
- error
- skip
type: string
rule:
description: Rule is the name of the policy rule
type: string
@ -210,15 +219,31 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
enum:
- pass
- fail
- warn
- error
- skip
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
required:
- policy
type: object

View file

@ -45,7 +45,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ReportChangeRequest is the Schema for the ReportChangeRequests
@ -72,12 +72,6 @@ spec:
category:
description: Category indicates policy category
type: string
data:
additionalProperties:
type: string
description: Data provides additional information for the policy
rule
type: object
message:
description: Message is a short user friendly description of the
policy rule
@ -85,6 +79,12 @@ spec:
policy:
description: Policy is the name of the policy
type: string
properties:
additionalProperties:
type: string
description: Properties provides additional information for the
policy rule
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy
results that apply to multiple resources. For example, a policy
@ -197,6 +197,15 @@ spec:
type: string
type: object
type: array
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
- warn
- error
- skip
type: string
rule:
description: Rule is the name of the policy rule
type: string
@ -210,15 +219,31 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
enum:
- pass
- fail
- warn
- error
- skip
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
required:
- policy
type: object

View file

@ -45,7 +45,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ClusterPolicyReport is the Schema for the clusterpolicyreports
@ -72,12 +72,6 @@ spec:
category:
description: Category indicates policy category
type: string
data:
additionalProperties:
type: string
description: Data provides additional information for the policy
rule
type: object
message:
description: Message is a short user friendly description of the
policy rule
@ -85,6 +79,12 @@ spec:
policy:
description: Policy is the name of the policy
type: string
properties:
additionalProperties:
type: string
description: Properties provides additional information for the
policy rule
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy
results that apply to multiple resources. For example, a policy
@ -197,6 +197,15 @@ spec:
type: string
type: object
type: array
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
- warn
- error
- skip
type: string
rule:
description: Rule is the name of the policy rule
type: string
@ -210,15 +219,31 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
enum:
- pass
- fail
- warn
- error
- skip
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
required:
- policy
type: object

View file

@ -45,7 +45,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: PolicyReport is the Schema for the policyreports API
@ -71,12 +71,6 @@ spec:
category:
description: Category indicates policy category
type: string
data:
additionalProperties:
type: string
description: Data provides additional information for the policy
rule
type: object
message:
description: Message is a short user friendly description of the
policy rule
@ -84,6 +78,12 @@ spec:
policy:
description: Policy is the name of the policy
type: string
properties:
additionalProperties:
type: string
description: Properties provides additional information for the
policy rule
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy
results that apply to multiple resources. For example, a policy
@ -196,6 +196,15 @@ spec:
type: string
type: object
type: array
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
- warn
- error
- skip
type: string
rule:
description: Rule is the name of the policy rule
type: string
@ -209,15 +218,31 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
enum:
- pass
- fail
- warn
- error
- skip
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
required:
- policy
type: object

View file

@ -1084,7 +1084,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ClusterPolicyReport is the Schema for the clusterpolicyreports API
@ -1105,10 +1105,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -1116,6 +1116,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -1187,8 +1212,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -1337,7 +1362,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ClusterReportChangeRequest is the Schema for the ClusterReportChangeRequests API
@ -1358,10 +1383,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -1369,6 +1394,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -1440,8 +1490,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -2783,7 +2833,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: PolicyReport is the Schema for the policyreports API
@ -2804,10 +2854,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -2815,6 +2865,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -2886,8 +2961,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -3036,7 +3111,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ReportChangeRequest is the Schema for the ReportChangeRequests API
@ -3057,10 +3132,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -3068,6 +3143,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -3139,8 +3239,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -3288,7 +3388,7 @@ metadata:
name: kyverno:admin-policyreport
rules:
- apiGroups:
- wgpolicyk8s.io/v1alpha1
- wgpolicyk8s.io/v1alpha2
resources:
- policyreports
- clusterpolicyreports

View file

@ -1064,7 +1064,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ClusterPolicyReport is the Schema for the clusterpolicyreports API
@ -1085,10 +1085,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -1096,6 +1096,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -1167,8 +1192,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -1310,7 +1335,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ClusterReportChangeRequest is the Schema for the ClusterReportChangeRequests API
@ -1331,10 +1356,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -1342,6 +1367,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -1413,8 +1463,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -2735,7 +2785,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: PolicyReport is the Schema for the policyreports API
@ -2756,10 +2806,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -2767,6 +2817,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -2838,8 +2913,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -2981,7 +3056,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
name: v1alpha2
schema:
openAPIV3Schema:
description: ReportChangeRequest is the Schema for the ReportChangeRequests API
@ -3002,10 +3077,10 @@ spec:
category:
description: Category indicates policy category
type: string
data:
properties:
additionalProperties:
type: string
description: Data provides additional information for the policy rule
description: Properties provides additional information for the policy rule
type: object
message:
description: Message is a short user friendly description of the policy rule
@ -3013,6 +3088,31 @@ spec:
policy:
description: Policy is the name of the policy
type: string
source:
description: Source is an identifier for the policy engine that
manages this report
type: string
timestamp:
description: Timestamp indicates the time the result was found
properties:
nanos:
description: Non-negative fractions of a second at nanosecond
resolution. Negative second values with fractions must still
have non-negative nanos values that count forward in time.
Must be from 0 to 999,999,999 inclusive. This field may be
limited in precision depending on context.
format: int32
type: integer
seconds:
description: Represents seconds of UTC time since Unix epoch
1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
9999-12-31T23:59:59Z inclusive.
format: int64
type: integer
required:
- nanos
- seconds
type: object
resourceSelector:
description: ResourceSelector is an optional selector for policy results that apply to multiple resources. For example, a policy result may apply to all pods that match a label. Either a Resource or a ResourceSelector can be specified. If neither are provided, the result is assumed to be for the policy report scope.
properties:
@ -3084,8 +3184,8 @@ spec:
- low
- medium
type: string
status:
description: Status indicates the result of the policy rule check
result:
description: Result indicates the outcome of the policy rule execution
enum:
- pass
- fail
@ -3215,7 +3315,7 @@ metadata:
name: kyverno:admin-policyreport
rules:
- apiGroups:
- wgpolicyk8s.io/v1alpha1
- wgpolicyk8s.io/v1alpha2
resources:
- policyreports
- clusterpolicyreports

View file

@ -201,7 +201,7 @@ metadata:
name: kyverno:admin-policyreport
rules:
- apiGroups:
- wgpolicyk8s.io/v1alpha1
- wgpolicyk8s.io/v1alpha2
resources:
- policyreports
- clusterpolicyreports

View file

@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1alpha2
import (
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

View file

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group
// Package v1alpha2 contains API Schema definitions for the policy v1alpha2 API group
// +k8s:deepcopy-gen=package
// +kubebuilder:object:generate=true
// +groupName=kyverno.io
package v1alpha1
package v1alpha2

View file

@ -14,22 +14,22 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group
// Package v1alpha2 contains API Schema definitions for the policy v1alpha2 API group
// +kubebuilder:object:generate=true
// +groupName=kyverno.io
package v1alpha1
package v1alpha2
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
// Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group
// Package v1alpha2 contains API Schema definitions for the policy v1alpha2 API group
// +kubebuilder:object:generate=true
// +groupName=kyverno.io
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "kyverno.io", Version: "v1alpha1"}
SchemeGroupVersion = schema.GroupVersion{Group: "kyverno.io", Version: "v1alpha2"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

View file

@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1alpha2
import (
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

View file

@ -18,10 +18,10 @@ limitations under the License.
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
policyreportv1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
policyreportv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
@ -45,11 +45,11 @@ func (in *ClusterReportChangeRequest) DeepCopyInto(out *ClusterReportChangeReque
out.Summary = in.Summary
if in.Results != nil {
in, out := &in.Results, &out.Results
*out = make([]*policyreportv1alpha1.PolicyReportResult, len(*in))
*out = make([]*policyreportv1alpha2.PolicyReportResult, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(policyreportv1alpha1.PolicyReportResult)
*out = new(policyreportv1alpha2.PolicyReportResult)
(*in).DeepCopyInto(*out)
}
}
@ -126,11 +126,11 @@ func (in *ReportChangeRequest) DeepCopyInto(out *ReportChangeRequest) {
out.Summary = in.Summary
if in.Results != nil {
in, out := &in.Results, &out.Results
*out = make([]*policyreportv1alpha1.PolicyReportResult, len(*in))
*out = make([]*policyreportv1alpha2.PolicyReportResult, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(policyreportv1alpha1.PolicyReportResult)
*out = new(policyreportv1alpha2.PolicyReportResult)
(*in).DeepCopyInto(*out)
}
}

View file

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1alpha2
import (
corev1 "k8s.io/api/core/v1"

View file

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group
// Package v1alpha2 contains API Schema definitions for the policy v1alpha2 API group
// +k8s:deepcopy-gen=package
// +kubebuilder:object:generate=true
// +groupName=wgpolicyk8s.io
package v1alpha1
package v1alpha2

View file

@ -14,22 +14,22 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group
// Package v1alpha2 contains API Schema definitions for the policy v1alpha2 API group
// +kubebuilder:object:generate=true
// +groupName=wgpolicyk8s.io
package v1alpha1
package v1alpha2
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
// Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group
// Package v1alpha2 contains API Schema definitions for the policy v1alpha2 API group
// +kubebuilder:object:generate=true
// +groupName=wgpolicyk8s.io
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "wgpolicyk8s.io", Version: "v1alpha1"}
SchemeGroupVersion = schema.GroupVersion{Group: "wgpolicyk8s.io", Version: "v1alpha2"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

View file

@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1alpha2
import (
corev1 "k8s.io/api/core/v1"
@ -61,7 +61,7 @@ type PolicyReportSummary struct {
Skip int `json:"skip"`
}
// PolicyStatus has one of the following values:
// PolicyResult has one of the following values:
// - pass: indicates that the policy requirements are met
// - fail: indicates that the policy requirements are not met
// - warn: indicates that the policy requirements and not met, and the policy is not scored
@ -69,7 +69,7 @@ type PolicyReportSummary struct {
// - skip: indicates that the policy was not selected based on user inputs or applicability
//
// +kubebuilder:validation:Enum=pass;fail;warn;error;skip
type PolicyStatus string
type PolicyResult string
// PolicySeverity has one of the following values:
// - high
@ -81,6 +81,10 @@ type PolicySeverity string
// PolicyReportResult provides the result for an individual policy
type PolicyReportResult struct {
// Source is an identifier for the policy engine that manages this report
// +optional
Source string `json:"source"`
// Policy is the name of the policy
Policy string `json:"policy"`
@ -102,14 +106,17 @@ type PolicyReportResult struct {
// Message is a short user friendly description of the policy rule
Message string `json:"message,omitempty"`
// Status indicates the result of the policy rule check
Status PolicyStatus `json:"status,omitempty"`
// Result indicates the outcome of the policy rule execution
Result PolicyResult `json:"result,omitempty"`
// Scored indicates if this policy rule is scored
Scored bool `json:"scored,omitempty"`
// Data provides additional information for the policy rule
Data map[string]string `json:"data,omitempty"`
// Properties provides additional information for the policy rule
Properties map[string]string `json:"properties,omitempty"`
// Timestamp indicates the time the result was found
Timestamp metav1.Timestamp `json:"timestamp,omitempty"`
// Category indicates policy category
// +optional

View file

@ -18,7 +18,7 @@ limitations under the License.
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
v1 "k8s.io/api/core/v1"
@ -207,13 +207,14 @@ func (in *PolicyReportResult) DeepCopyInto(out *PolicyReportResult) {
*out = new(metav1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.Data != nil {
in, out := &in.Data, &out.Data
if in.Properties != nil {
in, out := &in.Properties, &out.Properties
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
out.Timestamp = in.Timestamp
return
}

View file

@ -22,8 +22,8 @@ import (
"fmt"
kyvernov1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1"
kyvernov1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha1"
wgpolicyk8sv1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha1"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha2"
wgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha2"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
@ -32,8 +32,8 @@ import (
type Interface interface {
Discovery() discovery.DiscoveryInterface
KyvernoV1() kyvernov1.KyvernoV1Interface
KyvernoV1alpha1() kyvernov1alpha1.KyvernoV1alpha1Interface
Wgpolicyk8sV1alpha1() wgpolicyk8sv1alpha1.Wgpolicyk8sV1alpha1Interface
KyvernoV1alpha2() kyvernov1alpha2.KyvernoV1alpha2Interface
Wgpolicyk8sV1alpha2() wgpolicyk8sv1alpha2.Wgpolicyk8sV1alpha2Interface
}
// Clientset contains the clients for groups. Each group has exactly one
@ -41,8 +41,8 @@ type Interface interface {
type Clientset struct {
*discovery.DiscoveryClient
kyvernoV1 *kyvernov1.KyvernoV1Client
kyvernoV1alpha1 *kyvernov1alpha1.KyvernoV1alpha1Client
wgpolicyk8sV1alpha1 *wgpolicyk8sv1alpha1.Wgpolicyk8sV1alpha1Client
kyvernoV1alpha2 *kyvernov1alpha2.KyvernoV1alpha2Client
wgpolicyk8sV1alpha2 *wgpolicyk8sv1alpha2.Wgpolicyk8sV1alpha2Client
}
// KyvernoV1 retrieves the KyvernoV1Client
@ -50,14 +50,14 @@ func (c *Clientset) KyvernoV1() kyvernov1.KyvernoV1Interface {
return c.kyvernoV1
}
// KyvernoV1alpha1 retrieves the KyvernoV1alpha1Client
func (c *Clientset) KyvernoV1alpha1() kyvernov1alpha1.KyvernoV1alpha1Interface {
return c.kyvernoV1alpha1
// KyvernoV1alpha2 retrieves the KyvernoV1alpha2Client
func (c *Clientset) KyvernoV1alpha2() kyvernov1alpha2.KyvernoV1alpha2Interface {
return c.kyvernoV1alpha2
}
// Wgpolicyk8sV1alpha1 retrieves the Wgpolicyk8sV1alpha1Client
func (c *Clientset) Wgpolicyk8sV1alpha1() wgpolicyk8sv1alpha1.Wgpolicyk8sV1alpha1Interface {
return c.wgpolicyk8sV1alpha1
// Wgpolicyk8sV1alpha2 retrieves the Wgpolicyk8sV1alpha2Client
func (c *Clientset) Wgpolicyk8sV1alpha2() wgpolicyk8sv1alpha2.Wgpolicyk8sV1alpha2Interface {
return c.wgpolicyk8sV1alpha2
}
// Discovery retrieves the DiscoveryClient
@ -85,11 +85,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.kyvernoV1alpha1, err = kyvernov1alpha1.NewForConfig(&configShallowCopy)
cs.kyvernoV1alpha2, err = kyvernov1alpha2.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.wgpolicyk8sV1alpha1, err = wgpolicyk8sv1alpha1.NewForConfig(&configShallowCopy)
cs.wgpolicyk8sV1alpha2, err = wgpolicyk8sv1alpha2.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
@ -106,8 +106,8 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.kyvernoV1 = kyvernov1.NewForConfigOrDie(c)
cs.kyvernoV1alpha1 = kyvernov1alpha1.NewForConfigOrDie(c)
cs.wgpolicyk8sV1alpha1 = wgpolicyk8sv1alpha1.NewForConfigOrDie(c)
cs.kyvernoV1alpha2 = kyvernov1alpha2.NewForConfigOrDie(c)
cs.wgpolicyk8sV1alpha2 = wgpolicyk8sv1alpha2.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
@ -117,8 +117,8 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.kyvernoV1 = kyvernov1.New(c)
cs.kyvernoV1alpha1 = kyvernov1alpha1.New(c)
cs.wgpolicyk8sV1alpha1 = wgpolicyk8sv1alpha1.New(c)
cs.kyvernoV1alpha2 = kyvernov1alpha2.New(c)
cs.wgpolicyk8sV1alpha2 = wgpolicyk8sv1alpha2.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs

View file

@ -22,10 +22,10 @@ import (
clientset "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
kyvernov1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1"
fakekyvernov1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1/fake"
kyvernov1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha1"
fakekyvernov1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha1/fake"
wgpolicyk8sv1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha1"
fakewgpolicyk8sv1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha1/fake"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha2"
fakekyvernov1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha2/fake"
wgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha2"
fakewgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha2/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
@ -85,12 +85,12 @@ func (c *Clientset) KyvernoV1() kyvernov1.KyvernoV1Interface {
return &fakekyvernov1.FakeKyvernoV1{Fake: &c.Fake}
}
// KyvernoV1alpha1 retrieves the KyvernoV1alpha1Client
func (c *Clientset) KyvernoV1alpha1() kyvernov1alpha1.KyvernoV1alpha1Interface {
return &fakekyvernov1alpha1.FakeKyvernoV1alpha1{Fake: &c.Fake}
// KyvernoV1alpha2 retrieves the KyvernoV1alpha2Client
func (c *Clientset) KyvernoV1alpha2() kyvernov1alpha2.KyvernoV1alpha2Interface {
return &fakekyvernov1alpha2.FakeKyvernoV1alpha2{Fake: &c.Fake}
}
// Wgpolicyk8sV1alpha1 retrieves the Wgpolicyk8sV1alpha1Client
func (c *Clientset) Wgpolicyk8sV1alpha1() wgpolicyk8sv1alpha1.Wgpolicyk8sV1alpha1Interface {
return &fakewgpolicyk8sv1alpha1.FakeWgpolicyk8sV1alpha1{Fake: &c.Fake}
// Wgpolicyk8sV1alpha2 retrieves the Wgpolicyk8sV1alpha2Client
func (c *Clientset) Wgpolicyk8sV1alpha2() wgpolicyk8sv1alpha2.Wgpolicyk8sV1alpha2Interface {
return &fakewgpolicyk8sv1alpha2.FakeWgpolicyk8sV1alpha2{Fake: &c.Fake}
}

View file

@ -20,8 +20,8 @@ package fake
import (
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
wgpolicyk8sv1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
wgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -34,8 +34,8 @@ var codecs = serializer.NewCodecFactory(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
kyvernov1.AddToScheme,
kyvernov1alpha1.AddToScheme,
wgpolicyk8sv1alpha1.AddToScheme,
kyvernov1alpha2.AddToScheme,
wgpolicyk8sv1alpha2.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition

View file

@ -20,8 +20,8 @@ package scheme
import (
kyvernov1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
kyvernov1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
wgpolicyk8sv1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
wgpolicyk8sv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -34,8 +34,8 @@ var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
kyvernov1.AddToScheme,
kyvernov1alpha1.AddToScheme,
wgpolicyk8sv1alpha1.AddToScheme,
kyvernov1alpha2.AddToScheme,
wgpolicyk8sv1alpha2.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition

View file

@ -16,13 +16,13 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
"context"
"time"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
@ -38,14 +38,14 @@ type ClusterReportChangeRequestsGetter interface {
// ClusterReportChangeRequestInterface has methods to work with ClusterReportChangeRequest resources.
type ClusterReportChangeRequestInterface interface {
Create(ctx context.Context, clusterReportChangeRequest *v1alpha1.ClusterReportChangeRequest, opts v1.CreateOptions) (*v1alpha1.ClusterReportChangeRequest, error)
Update(ctx context.Context, clusterReportChangeRequest *v1alpha1.ClusterReportChangeRequest, opts v1.UpdateOptions) (*v1alpha1.ClusterReportChangeRequest, error)
Create(ctx context.Context, clusterReportChangeRequest *v1alpha2.ClusterReportChangeRequest, opts v1.CreateOptions) (*v1alpha2.ClusterReportChangeRequest, error)
Update(ctx context.Context, clusterReportChangeRequest *v1alpha2.ClusterReportChangeRequest, opts v1.UpdateOptions) (*v1alpha2.ClusterReportChangeRequest, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterReportChangeRequest, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterReportChangeRequestList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ClusterReportChangeRequest, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ClusterReportChangeRequestList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterReportChangeRequest, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ClusterReportChangeRequest, err error)
ClusterReportChangeRequestExpansion
}
@ -55,15 +55,15 @@ type clusterReportChangeRequests struct {
}
// newClusterReportChangeRequests returns a ClusterReportChangeRequests
func newClusterReportChangeRequests(c *KyvernoV1alpha1Client) *clusterReportChangeRequests {
func newClusterReportChangeRequests(c *KyvernoV1alpha2Client) *clusterReportChangeRequests {
return &clusterReportChangeRequests{
client: c.RESTClient(),
}
}
// Get takes name of the clusterReportChangeRequest, and returns the corresponding clusterReportChangeRequest object, and an error if there is any.
func (c *clusterReportChangeRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterReportChangeRequest, err error) {
result = &v1alpha1.ClusterReportChangeRequest{}
func (c *clusterReportChangeRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ClusterReportChangeRequest, err error) {
result = &v1alpha2.ClusterReportChangeRequest{}
err = c.client.Get().
Resource("clusterreportchangerequests").
Name(name).
@ -74,12 +74,12 @@ func (c *clusterReportChangeRequests) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of ClusterReportChangeRequests that match those selectors.
func (c *clusterReportChangeRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterReportChangeRequestList, err error) {
func (c *clusterReportChangeRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ClusterReportChangeRequestList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterReportChangeRequestList{}
result = &v1alpha2.ClusterReportChangeRequestList{}
err = c.client.Get().
Resource("clusterreportchangerequests").
VersionedParams(&opts, scheme.ParameterCodec).
@ -104,8 +104,8 @@ func (c *clusterReportChangeRequests) Watch(ctx context.Context, opts v1.ListOpt
}
// Create takes the representation of a clusterReportChangeRequest and creates it. Returns the server's representation of the clusterReportChangeRequest, and an error, if there is any.
func (c *clusterReportChangeRequests) Create(ctx context.Context, clusterReportChangeRequest *v1alpha1.ClusterReportChangeRequest, opts v1.CreateOptions) (result *v1alpha1.ClusterReportChangeRequest, err error) {
result = &v1alpha1.ClusterReportChangeRequest{}
func (c *clusterReportChangeRequests) Create(ctx context.Context, clusterReportChangeRequest *v1alpha2.ClusterReportChangeRequest, opts v1.CreateOptions) (result *v1alpha2.ClusterReportChangeRequest, err error) {
result = &v1alpha2.ClusterReportChangeRequest{}
err = c.client.Post().
Resource("clusterreportchangerequests").
VersionedParams(&opts, scheme.ParameterCodec).
@ -116,8 +116,8 @@ func (c *clusterReportChangeRequests) Create(ctx context.Context, clusterReportC
}
// Update takes the representation of a clusterReportChangeRequest and updates it. Returns the server's representation of the clusterReportChangeRequest, and an error, if there is any.
func (c *clusterReportChangeRequests) Update(ctx context.Context, clusterReportChangeRequest *v1alpha1.ClusterReportChangeRequest, opts v1.UpdateOptions) (result *v1alpha1.ClusterReportChangeRequest, err error) {
result = &v1alpha1.ClusterReportChangeRequest{}
func (c *clusterReportChangeRequests) Update(ctx context.Context, clusterReportChangeRequest *v1alpha2.ClusterReportChangeRequest, opts v1.UpdateOptions) (result *v1alpha2.ClusterReportChangeRequest, err error) {
result = &v1alpha2.ClusterReportChangeRequest{}
err = c.client.Put().
Resource("clusterreportchangerequests").
Name(clusterReportChangeRequest.Name).
@ -154,8 +154,8 @@ func (c *clusterReportChangeRequests) DeleteCollection(ctx context.Context, opts
}
// Patch applies the patch and returns the patched clusterReportChangeRequest.
func (c *clusterReportChangeRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterReportChangeRequest, err error) {
result = &v1alpha1.ClusterReportChangeRequest{}
func (c *clusterReportChangeRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ClusterReportChangeRequest, err error) {
result = &v1alpha2.ClusterReportChangeRequest{}
err = c.client.Patch(pt).
Resource("clusterreportchangerequests").
Name(name).

View file

@ -17,4 +17,4 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1
package v1alpha2

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -32,27 +32,27 @@ import (
// FakeClusterReportChangeRequests implements ClusterReportChangeRequestInterface
type FakeClusterReportChangeRequests struct {
Fake *FakeKyvernoV1alpha1
Fake *FakeKyvernoV1alpha2
}
var clusterreportchangerequestsResource = schema.GroupVersionResource{Group: "kyverno.io", Version: "v1alpha1", Resource: "clusterreportchangerequests"}
var clusterreportchangerequestsResource = schema.GroupVersionResource{Group: "kyverno.io", Version: "v1alpha2", Resource: "clusterreportchangerequests"}
var clusterreportchangerequestsKind = schema.GroupVersionKind{Group: "kyverno.io", Version: "v1alpha1", Kind: "ClusterReportChangeRequest"}
var clusterreportchangerequestsKind = schema.GroupVersionKind{Group: "kyverno.io", Version: "v1alpha2", Kind: "ClusterReportChangeRequest"}
// Get takes name of the clusterReportChangeRequest, and returns the corresponding clusterReportChangeRequest object, and an error if there is any.
func (c *FakeClusterReportChangeRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterReportChangeRequest, err error) {
func (c *FakeClusterReportChangeRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ClusterReportChangeRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(clusterreportchangerequestsResource, name), &v1alpha1.ClusterReportChangeRequest{})
Invokes(testing.NewRootGetAction(clusterreportchangerequestsResource, name), &v1alpha2.ClusterReportChangeRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterReportChangeRequest), err
return obj.(*v1alpha2.ClusterReportChangeRequest), err
}
// List takes label and field selectors, and returns the list of ClusterReportChangeRequests that match those selectors.
func (c *FakeClusterReportChangeRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterReportChangeRequestList, err error) {
func (c *FakeClusterReportChangeRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ClusterReportChangeRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(clusterreportchangerequestsResource, clusterreportchangerequestsKind, opts), &v1alpha1.ClusterReportChangeRequestList{})
Invokes(testing.NewRootListAction(clusterreportchangerequestsResource, clusterreportchangerequestsKind, opts), &v1alpha2.ClusterReportChangeRequestList{})
if obj == nil {
return nil, err
}
@ -61,8 +61,8 @@ func (c *FakeClusterReportChangeRequests) List(ctx context.Context, opts v1.List
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterReportChangeRequestList{ListMeta: obj.(*v1alpha1.ClusterReportChangeRequestList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterReportChangeRequestList).Items {
list := &v1alpha2.ClusterReportChangeRequestList{ListMeta: obj.(*v1alpha2.ClusterReportChangeRequestList).ListMeta}
for _, item := range obj.(*v1alpha2.ClusterReportChangeRequestList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -77,29 +77,29 @@ func (c *FakeClusterReportChangeRequests) Watch(ctx context.Context, opts v1.Lis
}
// Create takes the representation of a clusterReportChangeRequest and creates it. Returns the server's representation of the clusterReportChangeRequest, and an error, if there is any.
func (c *FakeClusterReportChangeRequests) Create(ctx context.Context, clusterReportChangeRequest *v1alpha1.ClusterReportChangeRequest, opts v1.CreateOptions) (result *v1alpha1.ClusterReportChangeRequest, err error) {
func (c *FakeClusterReportChangeRequests) Create(ctx context.Context, clusterReportChangeRequest *v1alpha2.ClusterReportChangeRequest, opts v1.CreateOptions) (result *v1alpha2.ClusterReportChangeRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(clusterreportchangerequestsResource, clusterReportChangeRequest), &v1alpha1.ClusterReportChangeRequest{})
Invokes(testing.NewRootCreateAction(clusterreportchangerequestsResource, clusterReportChangeRequest), &v1alpha2.ClusterReportChangeRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterReportChangeRequest), err
return obj.(*v1alpha2.ClusterReportChangeRequest), err
}
// Update takes the representation of a clusterReportChangeRequest and updates it. Returns the server's representation of the clusterReportChangeRequest, and an error, if there is any.
func (c *FakeClusterReportChangeRequests) Update(ctx context.Context, clusterReportChangeRequest *v1alpha1.ClusterReportChangeRequest, opts v1.UpdateOptions) (result *v1alpha1.ClusterReportChangeRequest, err error) {
func (c *FakeClusterReportChangeRequests) Update(ctx context.Context, clusterReportChangeRequest *v1alpha2.ClusterReportChangeRequest, opts v1.UpdateOptions) (result *v1alpha2.ClusterReportChangeRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(clusterreportchangerequestsResource, clusterReportChangeRequest), &v1alpha1.ClusterReportChangeRequest{})
Invokes(testing.NewRootUpdateAction(clusterreportchangerequestsResource, clusterReportChangeRequest), &v1alpha2.ClusterReportChangeRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterReportChangeRequest), err
return obj.(*v1alpha2.ClusterReportChangeRequest), err
}
// Delete takes name of the clusterReportChangeRequest and deletes it. Returns an error if one occurs.
func (c *FakeClusterReportChangeRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(clusterreportchangerequestsResource, name), &v1alpha1.ClusterReportChangeRequest{})
Invokes(testing.NewRootDeleteAction(clusterreportchangerequestsResource, name), &v1alpha2.ClusterReportChangeRequest{})
return err
}
@ -107,16 +107,16 @@ func (c *FakeClusterReportChangeRequests) Delete(ctx context.Context, name strin
func (c *FakeClusterReportChangeRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clusterreportchangerequestsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterReportChangeRequestList{})
_, err := c.Fake.Invokes(action, &v1alpha2.ClusterReportChangeRequestList{})
return err
}
// Patch applies the patch and returns the patched clusterReportChangeRequest.
func (c *FakeClusterReportChangeRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterReportChangeRequest, err error) {
func (c *FakeClusterReportChangeRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ClusterReportChangeRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(clusterreportchangerequestsResource, name, pt, data, subresources...), &v1alpha1.ClusterReportChangeRequest{})
Invokes(testing.NewRootPatchSubresourceAction(clusterreportchangerequestsResource, name, pt, data, subresources...), &v1alpha2.ClusterReportChangeRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterReportChangeRequest), err
return obj.(*v1alpha2.ClusterReportChangeRequest), err
}

View file

@ -19,26 +19,26 @@ limitations under the License.
package fake
import (
v1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/kyverno/v1alpha2"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeKyvernoV1alpha1 struct {
type FakeKyvernoV1alpha2 struct {
*testing.Fake
}
func (c *FakeKyvernoV1alpha1) ClusterReportChangeRequests() v1alpha1.ClusterReportChangeRequestInterface {
func (c *FakeKyvernoV1alpha2) ClusterReportChangeRequests() v1alpha2.ClusterReportChangeRequestInterface {
return &FakeClusterReportChangeRequests{c}
}
func (c *FakeKyvernoV1alpha1) ReportChangeRequests(namespace string) v1alpha1.ReportChangeRequestInterface {
func (c *FakeKyvernoV1alpha2) ReportChangeRequests(namespace string) v1alpha2.ReportChangeRequestInterface {
return &FakeReportChangeRequests{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeKyvernoV1alpha1) RESTClient() rest.Interface {
func (c *FakeKyvernoV1alpha2) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -32,29 +32,29 @@ import (
// FakeReportChangeRequests implements ReportChangeRequestInterface
type FakeReportChangeRequests struct {
Fake *FakeKyvernoV1alpha1
Fake *FakeKyvernoV1alpha2
ns string
}
var reportchangerequestsResource = schema.GroupVersionResource{Group: "kyverno.io", Version: "v1alpha1", Resource: "reportchangerequests"}
var reportchangerequestsResource = schema.GroupVersionResource{Group: "kyverno.io", Version: "v1alpha2", Resource: "reportchangerequests"}
var reportchangerequestsKind = schema.GroupVersionKind{Group: "kyverno.io", Version: "v1alpha1", Kind: "ReportChangeRequest"}
var reportchangerequestsKind = schema.GroupVersionKind{Group: "kyverno.io", Version: "v1alpha2", Kind: "ReportChangeRequest"}
// Get takes name of the reportChangeRequest, and returns the corresponding reportChangeRequest object, and an error if there is any.
func (c *FakeReportChangeRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ReportChangeRequest, err error) {
func (c *FakeReportChangeRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ReportChangeRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(reportchangerequestsResource, c.ns, name), &v1alpha1.ReportChangeRequest{})
Invokes(testing.NewGetAction(reportchangerequestsResource, c.ns, name), &v1alpha2.ReportChangeRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ReportChangeRequest), err
return obj.(*v1alpha2.ReportChangeRequest), err
}
// List takes label and field selectors, and returns the list of ReportChangeRequests that match those selectors.
func (c *FakeReportChangeRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ReportChangeRequestList, err error) {
func (c *FakeReportChangeRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ReportChangeRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(reportchangerequestsResource, reportchangerequestsKind, c.ns, opts), &v1alpha1.ReportChangeRequestList{})
Invokes(testing.NewListAction(reportchangerequestsResource, reportchangerequestsKind, c.ns, opts), &v1alpha2.ReportChangeRequestList{})
if obj == nil {
return nil, err
@ -64,8 +64,8 @@ func (c *FakeReportChangeRequests) List(ctx context.Context, opts v1.ListOptions
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ReportChangeRequestList{ListMeta: obj.(*v1alpha1.ReportChangeRequestList).ListMeta}
for _, item := range obj.(*v1alpha1.ReportChangeRequestList).Items {
list := &v1alpha2.ReportChangeRequestList{ListMeta: obj.(*v1alpha2.ReportChangeRequestList).ListMeta}
for _, item := range obj.(*v1alpha2.ReportChangeRequestList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -81,31 +81,31 @@ func (c *FakeReportChangeRequests) Watch(ctx context.Context, opts v1.ListOption
}
// Create takes the representation of a reportChangeRequest and creates it. Returns the server's representation of the reportChangeRequest, and an error, if there is any.
func (c *FakeReportChangeRequests) Create(ctx context.Context, reportChangeRequest *v1alpha1.ReportChangeRequest, opts v1.CreateOptions) (result *v1alpha1.ReportChangeRequest, err error) {
func (c *FakeReportChangeRequests) Create(ctx context.Context, reportChangeRequest *v1alpha2.ReportChangeRequest, opts v1.CreateOptions) (result *v1alpha2.ReportChangeRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(reportchangerequestsResource, c.ns, reportChangeRequest), &v1alpha1.ReportChangeRequest{})
Invokes(testing.NewCreateAction(reportchangerequestsResource, c.ns, reportChangeRequest), &v1alpha2.ReportChangeRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ReportChangeRequest), err
return obj.(*v1alpha2.ReportChangeRequest), err
}
// Update takes the representation of a reportChangeRequest and updates it. Returns the server's representation of the reportChangeRequest, and an error, if there is any.
func (c *FakeReportChangeRequests) Update(ctx context.Context, reportChangeRequest *v1alpha1.ReportChangeRequest, opts v1.UpdateOptions) (result *v1alpha1.ReportChangeRequest, err error) {
func (c *FakeReportChangeRequests) Update(ctx context.Context, reportChangeRequest *v1alpha2.ReportChangeRequest, opts v1.UpdateOptions) (result *v1alpha2.ReportChangeRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(reportchangerequestsResource, c.ns, reportChangeRequest), &v1alpha1.ReportChangeRequest{})
Invokes(testing.NewUpdateAction(reportchangerequestsResource, c.ns, reportChangeRequest), &v1alpha2.ReportChangeRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ReportChangeRequest), err
return obj.(*v1alpha2.ReportChangeRequest), err
}
// Delete takes name of the reportChangeRequest and deletes it. Returns an error if one occurs.
func (c *FakeReportChangeRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(reportchangerequestsResource, c.ns, name), &v1alpha1.ReportChangeRequest{})
Invokes(testing.NewDeleteAction(reportchangerequestsResource, c.ns, name), &v1alpha2.ReportChangeRequest{})
return err
}
@ -114,17 +114,17 @@ func (c *FakeReportChangeRequests) Delete(ctx context.Context, name string, opts
func (c *FakeReportChangeRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(reportchangerequestsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ReportChangeRequestList{})
_, err := c.Fake.Invokes(action, &v1alpha2.ReportChangeRequestList{})
return err
}
// Patch applies the patch and returns the patched reportChangeRequest.
func (c *FakeReportChangeRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ReportChangeRequest, err error) {
func (c *FakeReportChangeRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ReportChangeRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(reportchangerequestsResource, c.ns, name, pt, data, subresources...), &v1alpha1.ReportChangeRequest{})
Invokes(testing.NewPatchSubresourceAction(reportchangerequestsResource, c.ns, name, pt, data, subresources...), &v1alpha2.ReportChangeRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ReportChangeRequest), err
return obj.(*v1alpha2.ReportChangeRequest), err
}

View file

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
type ClusterReportChangeRequestExpansion interface{}

View file

@ -16,35 +16,35 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
v1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
type KyvernoV1alpha1Interface interface {
type KyvernoV1alpha2Interface interface {
RESTClient() rest.Interface
ClusterReportChangeRequestsGetter
ReportChangeRequestsGetter
}
// KyvernoV1alpha1Client is used to interact with features provided by the kyverno.io group.
type KyvernoV1alpha1Client struct {
// KyvernoV1alpha2Client is used to interact with features provided by the kyverno.io group.
type KyvernoV1alpha2Client struct {
restClient rest.Interface
}
func (c *KyvernoV1alpha1Client) ClusterReportChangeRequests() ClusterReportChangeRequestInterface {
func (c *KyvernoV1alpha2Client) ClusterReportChangeRequests() ClusterReportChangeRequestInterface {
return newClusterReportChangeRequests(c)
}
func (c *KyvernoV1alpha1Client) ReportChangeRequests(namespace string) ReportChangeRequestInterface {
func (c *KyvernoV1alpha2Client) ReportChangeRequests(namespace string) ReportChangeRequestInterface {
return newReportChangeRequests(c, namespace)
}
// NewForConfig creates a new KyvernoV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*KyvernoV1alpha1Client, error) {
// NewForConfig creates a new KyvernoV1alpha2Client for the given config.
func NewForConfig(c *rest.Config) (*KyvernoV1alpha2Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@ -53,12 +53,12 @@ func NewForConfig(c *rest.Config) (*KyvernoV1alpha1Client, error) {
if err != nil {
return nil, err
}
return &KyvernoV1alpha1Client{client}, nil
return &KyvernoV1alpha2Client{client}, nil
}
// NewForConfigOrDie creates a new KyvernoV1alpha1Client for the given config and
// NewForConfigOrDie creates a new KyvernoV1alpha2Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *KyvernoV1alpha1Client {
func NewForConfigOrDie(c *rest.Config) *KyvernoV1alpha2Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@ -66,13 +66,13 @@ func NewForConfigOrDie(c *rest.Config) *KyvernoV1alpha1Client {
return client
}
// New creates a new KyvernoV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *KyvernoV1alpha1Client {
return &KyvernoV1alpha1Client{c}
// New creates a new KyvernoV1alpha2Client for the given RESTClient.
func New(c rest.Interface) *KyvernoV1alpha2Client {
return &KyvernoV1alpha2Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
gv := v1alpha2.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
@ -86,7 +86,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *KyvernoV1alpha1Client) RESTClient() rest.Interface {
func (c *KyvernoV1alpha2Client) RESTClient() rest.Interface {
if c == nil {
return nil
}

View file

@ -16,13 +16,13 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
"context"
"time"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
@ -38,14 +38,14 @@ type ReportChangeRequestsGetter interface {
// ReportChangeRequestInterface has methods to work with ReportChangeRequest resources.
type ReportChangeRequestInterface interface {
Create(ctx context.Context, reportChangeRequest *v1alpha1.ReportChangeRequest, opts v1.CreateOptions) (*v1alpha1.ReportChangeRequest, error)
Update(ctx context.Context, reportChangeRequest *v1alpha1.ReportChangeRequest, opts v1.UpdateOptions) (*v1alpha1.ReportChangeRequest, error)
Create(ctx context.Context, reportChangeRequest *v1alpha2.ReportChangeRequest, opts v1.CreateOptions) (*v1alpha2.ReportChangeRequest, error)
Update(ctx context.Context, reportChangeRequest *v1alpha2.ReportChangeRequest, opts v1.UpdateOptions) (*v1alpha2.ReportChangeRequest, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ReportChangeRequest, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ReportChangeRequestList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ReportChangeRequest, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ReportChangeRequestList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ReportChangeRequest, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ReportChangeRequest, err error)
ReportChangeRequestExpansion
}
@ -56,7 +56,7 @@ type reportChangeRequests struct {
}
// newReportChangeRequests returns a ReportChangeRequests
func newReportChangeRequests(c *KyvernoV1alpha1Client, namespace string) *reportChangeRequests {
func newReportChangeRequests(c *KyvernoV1alpha2Client, namespace string) *reportChangeRequests {
return &reportChangeRequests{
client: c.RESTClient(),
ns: namespace,
@ -64,8 +64,8 @@ func newReportChangeRequests(c *KyvernoV1alpha1Client, namespace string) *report
}
// Get takes name of the reportChangeRequest, and returns the corresponding reportChangeRequest object, and an error if there is any.
func (c *reportChangeRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ReportChangeRequest, err error) {
result = &v1alpha1.ReportChangeRequest{}
func (c *reportChangeRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ReportChangeRequest, err error) {
result = &v1alpha2.ReportChangeRequest{}
err = c.client.Get().
Namespace(c.ns).
Resource("reportchangerequests").
@ -77,12 +77,12 @@ func (c *reportChangeRequests) Get(ctx context.Context, name string, options v1.
}
// List takes label and field selectors, and returns the list of ReportChangeRequests that match those selectors.
func (c *reportChangeRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ReportChangeRequestList, err error) {
func (c *reportChangeRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ReportChangeRequestList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ReportChangeRequestList{}
result = &v1alpha2.ReportChangeRequestList{}
err = c.client.Get().
Namespace(c.ns).
Resource("reportchangerequests").
@ -109,8 +109,8 @@ func (c *reportChangeRequests) Watch(ctx context.Context, opts v1.ListOptions) (
}
// Create takes the representation of a reportChangeRequest and creates it. Returns the server's representation of the reportChangeRequest, and an error, if there is any.
func (c *reportChangeRequests) Create(ctx context.Context, reportChangeRequest *v1alpha1.ReportChangeRequest, opts v1.CreateOptions) (result *v1alpha1.ReportChangeRequest, err error) {
result = &v1alpha1.ReportChangeRequest{}
func (c *reportChangeRequests) Create(ctx context.Context, reportChangeRequest *v1alpha2.ReportChangeRequest, opts v1.CreateOptions) (result *v1alpha2.ReportChangeRequest, err error) {
result = &v1alpha2.ReportChangeRequest{}
err = c.client.Post().
Namespace(c.ns).
Resource("reportchangerequests").
@ -122,8 +122,8 @@ func (c *reportChangeRequests) Create(ctx context.Context, reportChangeRequest *
}
// Update takes the representation of a reportChangeRequest and updates it. Returns the server's representation of the reportChangeRequest, and an error, if there is any.
func (c *reportChangeRequests) Update(ctx context.Context, reportChangeRequest *v1alpha1.ReportChangeRequest, opts v1.UpdateOptions) (result *v1alpha1.ReportChangeRequest, err error) {
result = &v1alpha1.ReportChangeRequest{}
func (c *reportChangeRequests) Update(ctx context.Context, reportChangeRequest *v1alpha2.ReportChangeRequest, opts v1.UpdateOptions) (result *v1alpha2.ReportChangeRequest, err error) {
result = &v1alpha2.ReportChangeRequest{}
err = c.client.Put().
Namespace(c.ns).
Resource("reportchangerequests").
@ -163,8 +163,8 @@ func (c *reportChangeRequests) DeleteCollection(ctx context.Context, opts v1.Del
}
// Patch applies the patch and returns the patched reportChangeRequest.
func (c *reportChangeRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ReportChangeRequest, err error) {
result = &v1alpha1.ReportChangeRequest{}
func (c *reportChangeRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ReportChangeRequest, err error) {
result = &v1alpha2.ReportChangeRequest{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("reportchangerequests").

View file

@ -16,13 +16,13 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
"context"
"time"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
@ -38,14 +38,14 @@ type ClusterPolicyReportsGetter interface {
// ClusterPolicyReportInterface has methods to work with ClusterPolicyReport resources.
type ClusterPolicyReportInterface interface {
Create(ctx context.Context, clusterPolicyReport *v1alpha1.ClusterPolicyReport, opts v1.CreateOptions) (*v1alpha1.ClusterPolicyReport, error)
Update(ctx context.Context, clusterPolicyReport *v1alpha1.ClusterPolicyReport, opts v1.UpdateOptions) (*v1alpha1.ClusterPolicyReport, error)
Create(ctx context.Context, clusterPolicyReport *v1alpha2.ClusterPolicyReport, opts v1.CreateOptions) (*v1alpha2.ClusterPolicyReport, error)
Update(ctx context.Context, clusterPolicyReport *v1alpha2.ClusterPolicyReport, opts v1.UpdateOptions) (*v1alpha2.ClusterPolicyReport, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterPolicyReport, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterPolicyReportList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ClusterPolicyReport, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ClusterPolicyReportList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterPolicyReport, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ClusterPolicyReport, err error)
ClusterPolicyReportExpansion
}
@ -55,15 +55,15 @@ type clusterPolicyReports struct {
}
// newClusterPolicyReports returns a ClusterPolicyReports
func newClusterPolicyReports(c *Wgpolicyk8sV1alpha1Client) *clusterPolicyReports {
func newClusterPolicyReports(c *Wgpolicyk8sV1alpha2Client) *clusterPolicyReports {
return &clusterPolicyReports{
client: c.RESTClient(),
}
}
// Get takes name of the clusterPolicyReport, and returns the corresponding clusterPolicyReport object, and an error if there is any.
func (c *clusterPolicyReports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterPolicyReport, err error) {
result = &v1alpha1.ClusterPolicyReport{}
func (c *clusterPolicyReports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ClusterPolicyReport, err error) {
result = &v1alpha2.ClusterPolicyReport{}
err = c.client.Get().
Resource("clusterpolicyreports").
Name(name).
@ -74,12 +74,12 @@ func (c *clusterPolicyReports) Get(ctx context.Context, name string, options v1.
}
// List takes label and field selectors, and returns the list of ClusterPolicyReports that match those selectors.
func (c *clusterPolicyReports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterPolicyReportList, err error) {
func (c *clusterPolicyReports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ClusterPolicyReportList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterPolicyReportList{}
result = &v1alpha2.ClusterPolicyReportList{}
err = c.client.Get().
Resource("clusterpolicyreports").
VersionedParams(&opts, scheme.ParameterCodec).
@ -104,8 +104,8 @@ func (c *clusterPolicyReports) Watch(ctx context.Context, opts v1.ListOptions) (
}
// Create takes the representation of a clusterPolicyReport and creates it. Returns the server's representation of the clusterPolicyReport, and an error, if there is any.
func (c *clusterPolicyReports) Create(ctx context.Context, clusterPolicyReport *v1alpha1.ClusterPolicyReport, opts v1.CreateOptions) (result *v1alpha1.ClusterPolicyReport, err error) {
result = &v1alpha1.ClusterPolicyReport{}
func (c *clusterPolicyReports) Create(ctx context.Context, clusterPolicyReport *v1alpha2.ClusterPolicyReport, opts v1.CreateOptions) (result *v1alpha2.ClusterPolicyReport, err error) {
result = &v1alpha2.ClusterPolicyReport{}
err = c.client.Post().
Resource("clusterpolicyreports").
VersionedParams(&opts, scheme.ParameterCodec).
@ -116,8 +116,8 @@ func (c *clusterPolicyReports) Create(ctx context.Context, clusterPolicyReport *
}
// Update takes the representation of a clusterPolicyReport and updates it. Returns the server's representation of the clusterPolicyReport, and an error, if there is any.
func (c *clusterPolicyReports) Update(ctx context.Context, clusterPolicyReport *v1alpha1.ClusterPolicyReport, opts v1.UpdateOptions) (result *v1alpha1.ClusterPolicyReport, err error) {
result = &v1alpha1.ClusterPolicyReport{}
func (c *clusterPolicyReports) Update(ctx context.Context, clusterPolicyReport *v1alpha2.ClusterPolicyReport, opts v1.UpdateOptions) (result *v1alpha2.ClusterPolicyReport, err error) {
result = &v1alpha2.ClusterPolicyReport{}
err = c.client.Put().
Resource("clusterpolicyreports").
Name(clusterPolicyReport.Name).
@ -154,8 +154,8 @@ func (c *clusterPolicyReports) DeleteCollection(ctx context.Context, opts v1.Del
}
// Patch applies the patch and returns the patched clusterPolicyReport.
func (c *clusterPolicyReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterPolicyReport, err error) {
result = &v1alpha1.ClusterPolicyReport{}
func (c *clusterPolicyReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ClusterPolicyReport, err error) {
result = &v1alpha2.ClusterPolicyReport{}
err = c.client.Patch(pt).
Resource("clusterpolicyreports").
Name(name).

View file

@ -17,4 +17,4 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1
package v1alpha2

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -32,27 +32,27 @@ import (
// FakeClusterPolicyReports implements ClusterPolicyReportInterface
type FakeClusterPolicyReports struct {
Fake *FakeWgpolicyk8sV1alpha1
Fake *FakeWgpolicyk8sV1alpha2
}
var clusterpolicyreportsResource = schema.GroupVersionResource{Group: "wgpolicyk8s.io", Version: "v1alpha1", Resource: "clusterpolicyreports"}
var clusterpolicyreportsResource = schema.GroupVersionResource{Group: "wgpolicyk8s.io", Version: "v1alpha2", Resource: "clusterpolicyreports"}
var clusterpolicyreportsKind = schema.GroupVersionKind{Group: "wgpolicyk8s.io", Version: "v1alpha1", Kind: "ClusterPolicyReport"}
var clusterpolicyreportsKind = schema.GroupVersionKind{Group: "wgpolicyk8s.io", Version: "v1alpha2", Kind: "ClusterPolicyReport"}
// Get takes name of the clusterPolicyReport, and returns the corresponding clusterPolicyReport object, and an error if there is any.
func (c *FakeClusterPolicyReports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterPolicyReport, err error) {
func (c *FakeClusterPolicyReports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ClusterPolicyReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(clusterpolicyreportsResource, name), &v1alpha1.ClusterPolicyReport{})
Invokes(testing.NewRootGetAction(clusterpolicyreportsResource, name), &v1alpha2.ClusterPolicyReport{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterPolicyReport), err
return obj.(*v1alpha2.ClusterPolicyReport), err
}
// List takes label and field selectors, and returns the list of ClusterPolicyReports that match those selectors.
func (c *FakeClusterPolicyReports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterPolicyReportList, err error) {
func (c *FakeClusterPolicyReports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ClusterPolicyReportList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(clusterpolicyreportsResource, clusterpolicyreportsKind, opts), &v1alpha1.ClusterPolicyReportList{})
Invokes(testing.NewRootListAction(clusterpolicyreportsResource, clusterpolicyreportsKind, opts), &v1alpha2.ClusterPolicyReportList{})
if obj == nil {
return nil, err
}
@ -61,8 +61,8 @@ func (c *FakeClusterPolicyReports) List(ctx context.Context, opts v1.ListOptions
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterPolicyReportList{ListMeta: obj.(*v1alpha1.ClusterPolicyReportList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterPolicyReportList).Items {
list := &v1alpha2.ClusterPolicyReportList{ListMeta: obj.(*v1alpha2.ClusterPolicyReportList).ListMeta}
for _, item := range obj.(*v1alpha2.ClusterPolicyReportList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -77,29 +77,29 @@ func (c *FakeClusterPolicyReports) Watch(ctx context.Context, opts v1.ListOption
}
// Create takes the representation of a clusterPolicyReport and creates it. Returns the server's representation of the clusterPolicyReport, and an error, if there is any.
func (c *FakeClusterPolicyReports) Create(ctx context.Context, clusterPolicyReport *v1alpha1.ClusterPolicyReport, opts v1.CreateOptions) (result *v1alpha1.ClusterPolicyReport, err error) {
func (c *FakeClusterPolicyReports) Create(ctx context.Context, clusterPolicyReport *v1alpha2.ClusterPolicyReport, opts v1.CreateOptions) (result *v1alpha2.ClusterPolicyReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(clusterpolicyreportsResource, clusterPolicyReport), &v1alpha1.ClusterPolicyReport{})
Invokes(testing.NewRootCreateAction(clusterpolicyreportsResource, clusterPolicyReport), &v1alpha2.ClusterPolicyReport{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterPolicyReport), err
return obj.(*v1alpha2.ClusterPolicyReport), err
}
// Update takes the representation of a clusterPolicyReport and updates it. Returns the server's representation of the clusterPolicyReport, and an error, if there is any.
func (c *FakeClusterPolicyReports) Update(ctx context.Context, clusterPolicyReport *v1alpha1.ClusterPolicyReport, opts v1.UpdateOptions) (result *v1alpha1.ClusterPolicyReport, err error) {
func (c *FakeClusterPolicyReports) Update(ctx context.Context, clusterPolicyReport *v1alpha2.ClusterPolicyReport, opts v1.UpdateOptions) (result *v1alpha2.ClusterPolicyReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(clusterpolicyreportsResource, clusterPolicyReport), &v1alpha1.ClusterPolicyReport{})
Invokes(testing.NewRootUpdateAction(clusterpolicyreportsResource, clusterPolicyReport), &v1alpha2.ClusterPolicyReport{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterPolicyReport), err
return obj.(*v1alpha2.ClusterPolicyReport), err
}
// Delete takes name of the clusterPolicyReport and deletes it. Returns an error if one occurs.
func (c *FakeClusterPolicyReports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(clusterpolicyreportsResource, name), &v1alpha1.ClusterPolicyReport{})
Invokes(testing.NewRootDeleteAction(clusterpolicyreportsResource, name), &v1alpha2.ClusterPolicyReport{})
return err
}
@ -107,16 +107,16 @@ func (c *FakeClusterPolicyReports) Delete(ctx context.Context, name string, opts
func (c *FakeClusterPolicyReports) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clusterpolicyreportsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterPolicyReportList{})
_, err := c.Fake.Invokes(action, &v1alpha2.ClusterPolicyReportList{})
return err
}
// Patch applies the patch and returns the patched clusterPolicyReport.
func (c *FakeClusterPolicyReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterPolicyReport, err error) {
func (c *FakeClusterPolicyReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ClusterPolicyReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(clusterpolicyreportsResource, name, pt, data, subresources...), &v1alpha1.ClusterPolicyReport{})
Invokes(testing.NewRootPatchSubresourceAction(clusterpolicyreportsResource, name, pt, data, subresources...), &v1alpha2.ClusterPolicyReport{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterPolicyReport), err
return obj.(*v1alpha2.ClusterPolicyReport), err
}

View file

@ -21,7 +21,7 @@ package fake
import (
"context"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -32,29 +32,29 @@ import (
// FakePolicyReports implements PolicyReportInterface
type FakePolicyReports struct {
Fake *FakeWgpolicyk8sV1alpha1
Fake *FakeWgpolicyk8sV1alpha2
ns string
}
var policyreportsResource = schema.GroupVersionResource{Group: "wgpolicyk8s.io", Version: "v1alpha1", Resource: "policyreports"}
var policyreportsResource = schema.GroupVersionResource{Group: "wgpolicyk8s.io", Version: "v1alpha2", Resource: "policyreports"}
var policyreportsKind = schema.GroupVersionKind{Group: "wgpolicyk8s.io", Version: "v1alpha1", Kind: "PolicyReport"}
var policyreportsKind = schema.GroupVersionKind{Group: "wgpolicyk8s.io", Version: "v1alpha2", Kind: "PolicyReport"}
// Get takes name of the policyReport, and returns the corresponding policyReport object, and an error if there is any.
func (c *FakePolicyReports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PolicyReport, err error) {
func (c *FakePolicyReports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.PolicyReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(policyreportsResource, c.ns, name), &v1alpha1.PolicyReport{})
Invokes(testing.NewGetAction(policyreportsResource, c.ns, name), &v1alpha2.PolicyReport{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PolicyReport), err
return obj.(*v1alpha2.PolicyReport), err
}
// List takes label and field selectors, and returns the list of PolicyReports that match those selectors.
func (c *FakePolicyReports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PolicyReportList, err error) {
func (c *FakePolicyReports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PolicyReportList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(policyreportsResource, policyreportsKind, c.ns, opts), &v1alpha1.PolicyReportList{})
Invokes(testing.NewListAction(policyreportsResource, policyreportsKind, c.ns, opts), &v1alpha2.PolicyReportList{})
if obj == nil {
return nil, err
@ -64,8 +64,8 @@ func (c *FakePolicyReports) List(ctx context.Context, opts v1.ListOptions) (resu
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.PolicyReportList{ListMeta: obj.(*v1alpha1.PolicyReportList).ListMeta}
for _, item := range obj.(*v1alpha1.PolicyReportList).Items {
list := &v1alpha2.PolicyReportList{ListMeta: obj.(*v1alpha2.PolicyReportList).ListMeta}
for _, item := range obj.(*v1alpha2.PolicyReportList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -81,31 +81,31 @@ func (c *FakePolicyReports) Watch(ctx context.Context, opts v1.ListOptions) (wat
}
// Create takes the representation of a policyReport and creates it. Returns the server's representation of the policyReport, and an error, if there is any.
func (c *FakePolicyReports) Create(ctx context.Context, policyReport *v1alpha1.PolicyReport, opts v1.CreateOptions) (result *v1alpha1.PolicyReport, err error) {
func (c *FakePolicyReports) Create(ctx context.Context, policyReport *v1alpha2.PolicyReport, opts v1.CreateOptions) (result *v1alpha2.PolicyReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(policyreportsResource, c.ns, policyReport), &v1alpha1.PolicyReport{})
Invokes(testing.NewCreateAction(policyreportsResource, c.ns, policyReport), &v1alpha2.PolicyReport{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PolicyReport), err
return obj.(*v1alpha2.PolicyReport), err
}
// Update takes the representation of a policyReport and updates it. Returns the server's representation of the policyReport, and an error, if there is any.
func (c *FakePolicyReports) Update(ctx context.Context, policyReport *v1alpha1.PolicyReport, opts v1.UpdateOptions) (result *v1alpha1.PolicyReport, err error) {
func (c *FakePolicyReports) Update(ctx context.Context, policyReport *v1alpha2.PolicyReport, opts v1.UpdateOptions) (result *v1alpha2.PolicyReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(policyreportsResource, c.ns, policyReport), &v1alpha1.PolicyReport{})
Invokes(testing.NewUpdateAction(policyreportsResource, c.ns, policyReport), &v1alpha2.PolicyReport{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PolicyReport), err
return obj.(*v1alpha2.PolicyReport), err
}
// Delete takes name of the policyReport and deletes it. Returns an error if one occurs.
func (c *FakePolicyReports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(policyreportsResource, c.ns, name), &v1alpha1.PolicyReport{})
Invokes(testing.NewDeleteAction(policyreportsResource, c.ns, name), &v1alpha2.PolicyReport{})
return err
}
@ -114,17 +114,17 @@ func (c *FakePolicyReports) Delete(ctx context.Context, name string, opts v1.Del
func (c *FakePolicyReports) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(policyreportsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.PolicyReportList{})
_, err := c.Fake.Invokes(action, &v1alpha2.PolicyReportList{})
return err
}
// Patch applies the patch and returns the patched policyReport.
func (c *FakePolicyReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PolicyReport, err error) {
func (c *FakePolicyReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PolicyReport, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(policyreportsResource, c.ns, name, pt, data, subresources...), &v1alpha1.PolicyReport{})
Invokes(testing.NewPatchSubresourceAction(policyreportsResource, c.ns, name, pt, data, subresources...), &v1alpha2.PolicyReport{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PolicyReport), err
return obj.(*v1alpha2.PolicyReport), err
}

View file

@ -19,26 +19,26 @@ limitations under the License.
package fake
import (
v1alpha1 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/clientset/versioned/typed/policyreport/v1alpha2"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeWgpolicyk8sV1alpha1 struct {
type FakeWgpolicyk8sV1alpha2 struct {
*testing.Fake
}
func (c *FakeWgpolicyk8sV1alpha1) ClusterPolicyReports() v1alpha1.ClusterPolicyReportInterface {
func (c *FakeWgpolicyk8sV1alpha2) ClusterPolicyReports() v1alpha2.ClusterPolicyReportInterface {
return &FakeClusterPolicyReports{c}
}
func (c *FakeWgpolicyk8sV1alpha1) PolicyReports(namespace string) v1alpha1.PolicyReportInterface {
func (c *FakeWgpolicyk8sV1alpha2) PolicyReports(namespace string) v1alpha2.PolicyReportInterface {
return &FakePolicyReports{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeWgpolicyk8sV1alpha1) RESTClient() rest.Interface {
func (c *FakeWgpolicyk8sV1alpha2) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View file

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
type ClusterPolicyReportExpansion interface{}

View file

@ -16,13 +16,13 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
"context"
"time"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
scheme "github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
@ -38,14 +38,14 @@ type PolicyReportsGetter interface {
// PolicyReportInterface has methods to work with PolicyReport resources.
type PolicyReportInterface interface {
Create(ctx context.Context, policyReport *v1alpha1.PolicyReport, opts v1.CreateOptions) (*v1alpha1.PolicyReport, error)
Update(ctx context.Context, policyReport *v1alpha1.PolicyReport, opts v1.UpdateOptions) (*v1alpha1.PolicyReport, error)
Create(ctx context.Context, policyReport *v1alpha2.PolicyReport, opts v1.CreateOptions) (*v1alpha2.PolicyReport, error)
Update(ctx context.Context, policyReport *v1alpha2.PolicyReport, opts v1.UpdateOptions) (*v1alpha2.PolicyReport, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PolicyReport, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PolicyReportList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.PolicyReport, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.PolicyReportList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PolicyReport, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PolicyReport, err error)
PolicyReportExpansion
}
@ -56,7 +56,7 @@ type policyReports struct {
}
// newPolicyReports returns a PolicyReports
func newPolicyReports(c *Wgpolicyk8sV1alpha1Client, namespace string) *policyReports {
func newPolicyReports(c *Wgpolicyk8sV1alpha2Client, namespace string) *policyReports {
return &policyReports{
client: c.RESTClient(),
ns: namespace,
@ -64,8 +64,8 @@ func newPolicyReports(c *Wgpolicyk8sV1alpha1Client, namespace string) *policyRep
}
// Get takes name of the policyReport, and returns the corresponding policyReport object, and an error if there is any.
func (c *policyReports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PolicyReport, err error) {
result = &v1alpha1.PolicyReport{}
func (c *policyReports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.PolicyReport, err error) {
result = &v1alpha2.PolicyReport{}
err = c.client.Get().
Namespace(c.ns).
Resource("policyreports").
@ -77,12 +77,12 @@ func (c *policyReports) Get(ctx context.Context, name string, options v1.GetOpti
}
// List takes label and field selectors, and returns the list of PolicyReports that match those selectors.
func (c *policyReports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PolicyReportList, err error) {
func (c *policyReports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PolicyReportList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.PolicyReportList{}
result = &v1alpha2.PolicyReportList{}
err = c.client.Get().
Namespace(c.ns).
Resource("policyreports").
@ -109,8 +109,8 @@ func (c *policyReports) Watch(ctx context.Context, opts v1.ListOptions) (watch.I
}
// Create takes the representation of a policyReport and creates it. Returns the server's representation of the policyReport, and an error, if there is any.
func (c *policyReports) Create(ctx context.Context, policyReport *v1alpha1.PolicyReport, opts v1.CreateOptions) (result *v1alpha1.PolicyReport, err error) {
result = &v1alpha1.PolicyReport{}
func (c *policyReports) Create(ctx context.Context, policyReport *v1alpha2.PolicyReport, opts v1.CreateOptions) (result *v1alpha2.PolicyReport, err error) {
result = &v1alpha2.PolicyReport{}
err = c.client.Post().
Namespace(c.ns).
Resource("policyreports").
@ -122,8 +122,8 @@ func (c *policyReports) Create(ctx context.Context, policyReport *v1alpha1.Polic
}
// Update takes the representation of a policyReport and updates it. Returns the server's representation of the policyReport, and an error, if there is any.
func (c *policyReports) Update(ctx context.Context, policyReport *v1alpha1.PolicyReport, opts v1.UpdateOptions) (result *v1alpha1.PolicyReport, err error) {
result = &v1alpha1.PolicyReport{}
func (c *policyReports) Update(ctx context.Context, policyReport *v1alpha2.PolicyReport, opts v1.UpdateOptions) (result *v1alpha2.PolicyReport, err error) {
result = &v1alpha2.PolicyReport{}
err = c.client.Put().
Namespace(c.ns).
Resource("policyreports").
@ -163,8 +163,8 @@ func (c *policyReports) DeleteCollection(ctx context.Context, opts v1.DeleteOpti
}
// Patch applies the patch and returns the patched policyReport.
func (c *policyReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PolicyReport, err error) {
result = &v1alpha1.PolicyReport{}
func (c *policyReports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PolicyReport, err error) {
result = &v1alpha2.PolicyReport{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("policyreports").

View file

@ -16,35 +16,35 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
v1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
type Wgpolicyk8sV1alpha1Interface interface {
type Wgpolicyk8sV1alpha2Interface interface {
RESTClient() rest.Interface
ClusterPolicyReportsGetter
PolicyReportsGetter
}
// Wgpolicyk8sV1alpha1Client is used to interact with features provided by the wgpolicyk8s.io group.
type Wgpolicyk8sV1alpha1Client struct {
// Wgpolicyk8sV1alpha2Client is used to interact with features provided by the wgpolicyk8s.io group.
type Wgpolicyk8sV1alpha2Client struct {
restClient rest.Interface
}
func (c *Wgpolicyk8sV1alpha1Client) ClusterPolicyReports() ClusterPolicyReportInterface {
func (c *Wgpolicyk8sV1alpha2Client) ClusterPolicyReports() ClusterPolicyReportInterface {
return newClusterPolicyReports(c)
}
func (c *Wgpolicyk8sV1alpha1Client) PolicyReports(namespace string) PolicyReportInterface {
func (c *Wgpolicyk8sV1alpha2Client) PolicyReports(namespace string) PolicyReportInterface {
return newPolicyReports(c, namespace)
}
// NewForConfig creates a new Wgpolicyk8sV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*Wgpolicyk8sV1alpha1Client, error) {
// NewForConfig creates a new Wgpolicyk8sV1alpha2Client for the given config.
func NewForConfig(c *rest.Config) (*Wgpolicyk8sV1alpha2Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@ -53,12 +53,12 @@ func NewForConfig(c *rest.Config) (*Wgpolicyk8sV1alpha1Client, error) {
if err != nil {
return nil, err
}
return &Wgpolicyk8sV1alpha1Client{client}, nil
return &Wgpolicyk8sV1alpha2Client{client}, nil
}
// NewForConfigOrDie creates a new Wgpolicyk8sV1alpha1Client for the given config and
// NewForConfigOrDie creates a new Wgpolicyk8sV1alpha2Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Wgpolicyk8sV1alpha1Client {
func NewForConfigOrDie(c *rest.Config) *Wgpolicyk8sV1alpha2Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@ -66,13 +66,13 @@ func NewForConfigOrDie(c *rest.Config) *Wgpolicyk8sV1alpha1Client {
return client
}
// New creates a new Wgpolicyk8sV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *Wgpolicyk8sV1alpha1Client {
return &Wgpolicyk8sV1alpha1Client{c}
// New creates a new Wgpolicyk8sV1alpha2Client for the given RESTClient.
func New(c rest.Interface) *Wgpolicyk8sV1alpha2Client {
return &Wgpolicyk8sV1alpha2Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
gv := v1alpha2.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
@ -86,7 +86,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *Wgpolicyk8sV1alpha1Client) RESTClient() rest.Interface {
func (c *Wgpolicyk8sV1alpha2Client) RESTClient() rest.Interface {
if c == nil {
return nil
}

View file

@ -22,8 +22,8 @@ import (
"fmt"
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
policyreportv1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
policyreportv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
@ -62,17 +62,17 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case v1.SchemeGroupVersion.WithResource("policies"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V1().Policies().Informer()}, nil
// Group=kyverno.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("clusterreportchangerequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V1alpha1().ClusterReportChangeRequests().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("reportchangerequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V1alpha1().ReportChangeRequests().Informer()}, nil
// Group=kyverno.io, Version=v1alpha2
case v1alpha2.SchemeGroupVersion.WithResource("clusterreportchangerequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V1alpha2().ClusterReportChangeRequests().Informer()}, nil
case v1alpha2.SchemeGroupVersion.WithResource("reportchangerequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V1alpha2().ReportChangeRequests().Informer()}, nil
// Group=wgpolicyk8s.io, Version=v1alpha1
case policyreportv1alpha1.SchemeGroupVersion.WithResource("clusterpolicyreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Wgpolicyk8s().V1alpha1().ClusterPolicyReports().Informer()}, nil
case policyreportv1alpha1.SchemeGroupVersion.WithResource("policyreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Wgpolicyk8s().V1alpha1().PolicyReports().Informer()}, nil
// Group=wgpolicyk8s.io, Version=v1alpha2
case policyreportv1alpha2.SchemeGroupVersion.WithResource("clusterpolicyreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Wgpolicyk8s().V1alpha2().ClusterPolicyReports().Informer()}, nil
case policyreportv1alpha2.SchemeGroupVersion.WithResource("policyreports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Wgpolicyk8s().V1alpha2().PolicyReports().Informer()}, nil
}

View file

@ -21,15 +21,15 @@ package kyverno
import (
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1 "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1"
v1alpha1 "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1alpha2"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1 provides access to shared informers for resources in V1.
V1() v1.Interface
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
// V1alpha2 provides access to shared informers for resources in V1alpha2.
V1alpha2() v1alpha2.Interface
}
type group struct {
@ -48,7 +48,7 @@ func (g *group) V1() v1.Interface {
return v1.New(g.factory, g.namespace, g.tweakListOptions)
}
// V1alpha1 returns a new v1alpha1.Interface.
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
// V1alpha2 returns a new v1alpha2.Interface.
func (g *group) V1alpha2() v1alpha2.Interface {
return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions)
}

View file

@ -16,16 +16,16 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
"context"
time "time"
kyvernov1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
@ -36,7 +36,7 @@ import (
// ClusterReportChangeRequests.
type ClusterReportChangeRequestInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ClusterReportChangeRequestLister
Lister() v1alpha2.ClusterReportChangeRequestLister
}
type clusterReportChangeRequestInformer struct {
@ -61,16 +61,16 @@ func NewFilteredClusterReportChangeRequestInformer(client versioned.Interface, r
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.KyvernoV1alpha1().ClusterReportChangeRequests().List(context.TODO(), options)
return client.KyvernoV1alpha2().ClusterReportChangeRequests().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.KyvernoV1alpha1().ClusterReportChangeRequests().Watch(context.TODO(), options)
return client.KyvernoV1alpha2().ClusterReportChangeRequests().Watch(context.TODO(), options)
},
},
&kyvernov1alpha1.ClusterReportChangeRequest{},
&kyvernov1alpha2.ClusterReportChangeRequest{},
resyncPeriod,
indexers,
)
@ -81,9 +81,9 @@ func (f *clusterReportChangeRequestInformer) defaultInformer(client versioned.In
}
func (f *clusterReportChangeRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&kyvernov1alpha1.ClusterReportChangeRequest{}, f.defaultInformer)
return f.factory.InformerFor(&kyvernov1alpha2.ClusterReportChangeRequest{}, f.defaultInformer)
}
func (f *clusterReportChangeRequestInformer) Lister() v1alpha1.ClusterReportChangeRequestLister {
return v1alpha1.NewClusterReportChangeRequestLister(f.Informer().GetIndexer())
func (f *clusterReportChangeRequestInformer) Lister() v1alpha2.ClusterReportChangeRequestLister {
return v1alpha2.NewClusterReportChangeRequestLister(f.Informer().GetIndexer())
}

View file

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"

View file

@ -16,16 +16,16 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
"context"
time "time"
kyvernov1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
@ -36,7 +36,7 @@ import (
// ReportChangeRequests.
type ReportChangeRequestInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ReportChangeRequestLister
Lister() v1alpha2.ReportChangeRequestLister
}
type reportChangeRequestInformer struct {
@ -62,16 +62,16 @@ func NewFilteredReportChangeRequestInformer(client versioned.Interface, namespac
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.KyvernoV1alpha1().ReportChangeRequests(namespace).List(context.TODO(), options)
return client.KyvernoV1alpha2().ReportChangeRequests(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.KyvernoV1alpha1().ReportChangeRequests(namespace).Watch(context.TODO(), options)
return client.KyvernoV1alpha2().ReportChangeRequests(namespace).Watch(context.TODO(), options)
},
},
&kyvernov1alpha1.ReportChangeRequest{},
&kyvernov1alpha2.ReportChangeRequest{},
resyncPeriod,
indexers,
)
@ -82,9 +82,9 @@ func (f *reportChangeRequestInformer) defaultInformer(client versioned.Interface
}
func (f *reportChangeRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&kyvernov1alpha1.ReportChangeRequest{}, f.defaultInformer)
return f.factory.InformerFor(&kyvernov1alpha2.ReportChangeRequest{}, f.defaultInformer)
}
func (f *reportChangeRequestInformer) Lister() v1alpha1.ReportChangeRequestLister {
return v1alpha1.NewReportChangeRequestLister(f.Informer().GetIndexer())
func (f *reportChangeRequestInformer) Lister() v1alpha2.ReportChangeRequestLister {
return v1alpha2.NewReportChangeRequestLister(f.Informer().GetIndexer())
}

View file

@ -20,13 +20,13 @@ package policyreport
import (
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/kyverno/kyverno/pkg/client/informers/externalversions/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/informers/externalversions/policyreport/v1alpha2"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
// V1alpha2 provides access to shared informers for resources in V1alpha2.
V1alpha2() v1alpha2.Interface
}
type group struct {
@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// V1alpha1 returns a new v1alpha1.Interface.
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
// V1alpha2 returns a new v1alpha2.Interface.
func (g *group) V1alpha2() v1alpha2.Interface {
return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions)
}

View file

@ -16,16 +16,16 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
"context"
time "time"
policyreportv1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
policyreportv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
@ -36,7 +36,7 @@ import (
// ClusterPolicyReports.
type ClusterPolicyReportInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ClusterPolicyReportLister
Lister() v1alpha2.ClusterPolicyReportLister
}
type clusterPolicyReportInformer struct {
@ -61,16 +61,16 @@ func NewFilteredClusterPolicyReportInformer(client versioned.Interface, resyncPe
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.Wgpolicyk8sV1alpha1().ClusterPolicyReports().List(context.TODO(), options)
return client.Wgpolicyk8sV1alpha2().ClusterPolicyReports().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.Wgpolicyk8sV1alpha1().ClusterPolicyReports().Watch(context.TODO(), options)
return client.Wgpolicyk8sV1alpha2().ClusterPolicyReports().Watch(context.TODO(), options)
},
},
&policyreportv1alpha1.ClusterPolicyReport{},
&policyreportv1alpha2.ClusterPolicyReport{},
resyncPeriod,
indexers,
)
@ -81,9 +81,9 @@ func (f *clusterPolicyReportInformer) defaultInformer(client versioned.Interface
}
func (f *clusterPolicyReportInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&policyreportv1alpha1.ClusterPolicyReport{}, f.defaultInformer)
return f.factory.InformerFor(&policyreportv1alpha2.ClusterPolicyReport{}, f.defaultInformer)
}
func (f *clusterPolicyReportInformer) Lister() v1alpha1.ClusterPolicyReportLister {
return v1alpha1.NewClusterPolicyReportLister(f.Informer().GetIndexer())
func (f *clusterPolicyReportInformer) Lister() v1alpha2.ClusterPolicyReportLister {
return v1alpha2.NewClusterPolicyReportLister(f.Informer().GetIndexer())
}

View file

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"

View file

@ -16,16 +16,16 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
"context"
time "time"
policyreportv1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
policyreportv1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
versioned "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
internalinterfaces "github.com/kyverno/kyverno/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
@ -36,7 +36,7 @@ import (
// PolicyReports.
type PolicyReportInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.PolicyReportLister
Lister() v1alpha2.PolicyReportLister
}
type policyReportInformer struct {
@ -62,16 +62,16 @@ func NewFilteredPolicyReportInformer(client versioned.Interface, namespace strin
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.Wgpolicyk8sV1alpha1().PolicyReports(namespace).List(context.TODO(), options)
return client.Wgpolicyk8sV1alpha2().PolicyReports(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.Wgpolicyk8sV1alpha1().PolicyReports(namespace).Watch(context.TODO(), options)
return client.Wgpolicyk8sV1alpha2().PolicyReports(namespace).Watch(context.TODO(), options)
},
},
&policyreportv1alpha1.PolicyReport{},
&policyreportv1alpha2.PolicyReport{},
resyncPeriod,
indexers,
)
@ -82,9 +82,9 @@ func (f *policyReportInformer) defaultInformer(client versioned.Interface, resyn
}
func (f *policyReportInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&policyreportv1alpha1.PolicyReport{}, f.defaultInformer)
return f.factory.InformerFor(&policyreportv1alpha2.PolicyReport{}, f.defaultInformer)
}
func (f *policyReportInformer) Lister() v1alpha1.PolicyReportLister {
return v1alpha1.NewPolicyReportLister(f.Informer().GetIndexer())
func (f *policyReportInformer) Lister() v1alpha2.PolicyReportLister {
return v1alpha2.NewPolicyReportLister(f.Informer().GetIndexer())
}

View file

@ -16,10 +16,10 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
v1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,10 +30,10 @@ import (
type ClusterReportChangeRequestLister interface {
// List lists all ClusterReportChangeRequests in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ClusterReportChangeRequest, err error)
List(selector labels.Selector) (ret []*v1alpha2.ClusterReportChangeRequest, err error)
// Get retrieves the ClusterReportChangeRequest from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.ClusterReportChangeRequest, error)
Get(name string) (*v1alpha2.ClusterReportChangeRequest, error)
ClusterReportChangeRequestListerExpansion
}
@ -48,21 +48,21 @@ func NewClusterReportChangeRequestLister(indexer cache.Indexer) ClusterReportCha
}
// List lists all ClusterReportChangeRequests in the indexer.
func (s *clusterReportChangeRequestLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterReportChangeRequest, err error) {
func (s *clusterReportChangeRequestLister) List(selector labels.Selector) (ret []*v1alpha2.ClusterReportChangeRequest, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ClusterReportChangeRequest))
ret = append(ret, m.(*v1alpha2.ClusterReportChangeRequest))
})
return ret, err
}
// Get retrieves the ClusterReportChangeRequest from the index for a given name.
func (s *clusterReportChangeRequestLister) Get(name string) (*v1alpha1.ClusterReportChangeRequest, error) {
func (s *clusterReportChangeRequestLister) Get(name string) (*v1alpha2.ClusterReportChangeRequest, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("clusterreportchangerequest"), name)
return nil, errors.NewNotFound(v1alpha2.Resource("clusterreportchangerequest"), name)
}
return obj.(*v1alpha1.ClusterReportChangeRequest), nil
return obj.(*v1alpha2.ClusterReportChangeRequest), nil
}

View file

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
// ClusterReportChangeRequestListerExpansion allows custom methods to be added to
// ClusterReportChangeRequestLister.

View file

@ -16,10 +16,10 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
v1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,7 +30,7 @@ import (
type ReportChangeRequestLister interface {
// List lists all ReportChangeRequests in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ReportChangeRequest, err error)
List(selector labels.Selector) (ret []*v1alpha2.ReportChangeRequest, err error)
// ReportChangeRequests returns an object that can list and get ReportChangeRequests.
ReportChangeRequests(namespace string) ReportChangeRequestNamespaceLister
ReportChangeRequestListerExpansion
@ -47,9 +47,9 @@ func NewReportChangeRequestLister(indexer cache.Indexer) ReportChangeRequestList
}
// List lists all ReportChangeRequests in the indexer.
func (s *reportChangeRequestLister) List(selector labels.Selector) (ret []*v1alpha1.ReportChangeRequest, err error) {
func (s *reportChangeRequestLister) List(selector labels.Selector) (ret []*v1alpha2.ReportChangeRequest, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ReportChangeRequest))
ret = append(ret, m.(*v1alpha2.ReportChangeRequest))
})
return ret, err
}
@ -64,10 +64,10 @@ func (s *reportChangeRequestLister) ReportChangeRequests(namespace string) Repor
type ReportChangeRequestNamespaceLister interface {
// List lists all ReportChangeRequests in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ReportChangeRequest, err error)
List(selector labels.Selector) (ret []*v1alpha2.ReportChangeRequest, err error)
// Get retrieves the ReportChangeRequest from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.ReportChangeRequest, error)
Get(name string) (*v1alpha2.ReportChangeRequest, error)
ReportChangeRequestNamespaceListerExpansion
}
@ -79,21 +79,21 @@ type reportChangeRequestNamespaceLister struct {
}
// List lists all ReportChangeRequests in the indexer for a given namespace.
func (s reportChangeRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ReportChangeRequest, err error) {
func (s reportChangeRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.ReportChangeRequest, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ReportChangeRequest))
ret = append(ret, m.(*v1alpha2.ReportChangeRequest))
})
return ret, err
}
// Get retrieves the ReportChangeRequest from the indexer for a given namespace and name.
func (s reportChangeRequestNamespaceLister) Get(name string) (*v1alpha1.ReportChangeRequest, error) {
func (s reportChangeRequestNamespaceLister) Get(name string) (*v1alpha2.ReportChangeRequest, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("reportchangerequest"), name)
return nil, errors.NewNotFound(v1alpha2.Resource("reportchangerequest"), name)
}
return obj.(*v1alpha1.ReportChangeRequest), nil
return obj.(*v1alpha2.ReportChangeRequest), nil
}

View file

@ -16,10 +16,10 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
v1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,10 +30,10 @@ import (
type ClusterPolicyReportLister interface {
// List lists all ClusterPolicyReports in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ClusterPolicyReport, err error)
List(selector labels.Selector) (ret []*v1alpha2.ClusterPolicyReport, err error)
// Get retrieves the ClusterPolicyReport from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.ClusterPolicyReport, error)
Get(name string) (*v1alpha2.ClusterPolicyReport, error)
ClusterPolicyReportListerExpansion
}
@ -48,21 +48,21 @@ func NewClusterPolicyReportLister(indexer cache.Indexer) ClusterPolicyReportList
}
// List lists all ClusterPolicyReports in the indexer.
func (s *clusterPolicyReportLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterPolicyReport, err error) {
func (s *clusterPolicyReportLister) List(selector labels.Selector) (ret []*v1alpha2.ClusterPolicyReport, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ClusterPolicyReport))
ret = append(ret, m.(*v1alpha2.ClusterPolicyReport))
})
return ret, err
}
// Get retrieves the ClusterPolicyReport from the index for a given name.
func (s *clusterPolicyReportLister) Get(name string) (*v1alpha1.ClusterPolicyReport, error) {
func (s *clusterPolicyReportLister) Get(name string) (*v1alpha2.ClusterPolicyReport, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("clusterpolicyreport"), name)
return nil, errors.NewNotFound(v1alpha2.Resource("clusterpolicyreport"), name)
}
return obj.(*v1alpha1.ClusterPolicyReport), nil
return obj.(*v1alpha2.ClusterPolicyReport), nil
}

View file

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
// ClusterPolicyReportListerExpansion allows custom methods to be added to
// ClusterPolicyReportLister.

View file

@ -16,10 +16,10 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
v1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -30,7 +30,7 @@ import (
type PolicyReportLister interface {
// List lists all PolicyReports in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.PolicyReport, err error)
List(selector labels.Selector) (ret []*v1alpha2.PolicyReport, err error)
// PolicyReports returns an object that can list and get PolicyReports.
PolicyReports(namespace string) PolicyReportNamespaceLister
PolicyReportListerExpansion
@ -47,9 +47,9 @@ func NewPolicyReportLister(indexer cache.Indexer) PolicyReportLister {
}
// List lists all PolicyReports in the indexer.
func (s *policyReportLister) List(selector labels.Selector) (ret []*v1alpha1.PolicyReport, err error) {
func (s *policyReportLister) List(selector labels.Selector) (ret []*v1alpha2.PolicyReport, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.PolicyReport))
ret = append(ret, m.(*v1alpha2.PolicyReport))
})
return ret, err
}
@ -64,10 +64,10 @@ func (s *policyReportLister) PolicyReports(namespace string) PolicyReportNamespa
type PolicyReportNamespaceLister interface {
// List lists all PolicyReports in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.PolicyReport, err error)
List(selector labels.Selector) (ret []*v1alpha2.PolicyReport, err error)
// Get retrieves the PolicyReport from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.PolicyReport, error)
Get(name string) (*v1alpha2.PolicyReport, error)
PolicyReportNamespaceListerExpansion
}
@ -79,21 +79,21 @@ type policyReportNamespaceLister struct {
}
// List lists all PolicyReports in the indexer for a given namespace.
func (s policyReportNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.PolicyReport, err error) {
func (s policyReportNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.PolicyReport, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.PolicyReport))
ret = append(ret, m.(*v1alpha2.PolicyReport))
})
return ret, err
}
// Get retrieves the PolicyReport from the indexer for a given namespace and name.
func (s policyReportNamespaceLister) Get(name string) (*v1alpha1.PolicyReport, error) {
func (s policyReportNamespaceLister) Get(name string) (*v1alpha2.PolicyReport, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("policyreport"), name)
return nil, errors.NewNotFound(v1alpha2.Resource("policyreport"), name)
}
return obj.(*v1alpha1.PolicyReport), nil
return obj.(*v1alpha2.PolicyReport), nil
}

View file

@ -3,7 +3,7 @@ package apply
import (
"testing"
preport "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
preport "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"gotest.tools/assert"
)

View file

@ -3,7 +3,7 @@ package apply
import (
"reflect"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
client "github.com/kyverno/kyverno/pkg/dclient"
sanitizederror "github.com/kyverno/kyverno/pkg/kyverno/sanitizedError"
apierrors "k8s.io/apimachinery/pkg/api/errors"
@ -132,7 +132,7 @@ func updateSummary(results []interface{}) map[string]interface{} {
continue
}
switch typedResult["status"].(string) {
switch typedResult["result"].(string) {
case report.StatusPass:
pass, _ := summary[report.StatusPass].(int64)
pass++

View file

@ -4,7 +4,7 @@ import (
"reflect"
"testing"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"gotest.tools/assert"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
@ -22,7 +22,7 @@ func Test_mergeClusterReport(t *testing.T) {
"results": []interface{}{
map[string]interface{}{
"policy": "ns-polr-1",
"status": report.StatusPass,
"result": report.StatusPass,
"resources": make([]interface{}, 10),
},
},
@ -38,7 +38,7 @@ func Test_mergeClusterReport(t *testing.T) {
"results": []interface{}{
map[string]interface{}{
"policy": "ns-polr-2",
"status": report.StatusPass,
"result": report.StatusPass,
"resources": make([]interface{}, 5),
},
},
@ -52,7 +52,7 @@ func Test_mergeClusterReport(t *testing.T) {
"results": []interface{}{
map[string]interface{}{
"policy": "polr-3",
"status": report.StatusPass,
"result": report.StatusPass,
"resources": make([]interface{}, 1),
},
},
@ -68,7 +68,7 @@ func Test_mergeClusterReport(t *testing.T) {
"results": []interface{}{
map[string]interface{}{
"policy": "cpolr-4",
"status": report.StatusFail,
"result": report.StatusFail,
},
},
},
@ -83,7 +83,7 @@ func Test_mergeClusterReport(t *testing.T) {
"results": []interface{}{
map[string]interface{}{
"policy": "cpolr-5",
"status": report.StatusFail,
"result": report.StatusFail,
},
},
},
@ -93,21 +93,21 @@ func Test_mergeClusterReport(t *testing.T) {
expectedResults := []interface{}{
map[string]interface{}{
"policy": "ns-polr-2",
"status": report.StatusPass,
"result": report.StatusPass,
"resources": make([]interface{}, 5),
},
map[string]interface{}{
"policy": "polr-3",
"status": report.StatusPass,
"result": report.StatusPass,
"resources": make([]interface{}, 1),
},
map[string]interface{}{
"policy": "cpolr-4",
"status": report.StatusFail,
"result": report.StatusFail,
},
map[string]interface{}{
"policy": "cpolr-5",
"status": report.StatusFail,
"result": report.StatusFail,
},
}
@ -131,17 +131,17 @@ func Test_mergeClusterReport(t *testing.T) {
func Test_updateSummary(t *testing.T) {
results := []interface{}{
map[string]interface{}{
"status": report.StatusPass,
"result": report.StatusPass,
"resources": make([]interface{}, 5),
},
map[string]interface{}{
"status": report.StatusFail,
"result": report.StatusFail,
},
map[string]interface{}{
"status": report.StatusFail,
"result": report.StatusFail,
},
map[string]interface{}{
"status": report.StatusFail,
"result": report.StatusFail,
},
}

View file

@ -4,8 +4,9 @@ import (
"encoding/json"
"fmt"
"strings"
"time"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/pkg/engine/response"
"github.com/kyverno/kyverno/pkg/engine/utils"
engineutils "github.com/kyverno/kyverno/pkg/engine/utils"
@ -31,7 +32,7 @@ func buildPolicyReports(resps []*response.EngineResponse, skippedPolicies []Skip
Message: fmt.Sprintln("skipped policy with variables -", sp.Variable),
Policy: sp.Name,
Rule: r.Name,
Status: "skip",
Result: "skip",
},
}
@ -110,6 +111,7 @@ func buildPolicyReports(resps []*response.EngineResponse, skippedPolicies []Skip
func buildPolicyResults(resps []*response.EngineResponse) map[string][]*report.PolicyReportResult {
results := make(map[string][]*report.PolicyReportResult)
infos := policyreport.GeneratePRsFromEngineResponse(resps, log.Log)
now := metav1.Timestamp{Seconds: time.Now().Unix()}
for _, info := range infos {
var appname string
@ -142,7 +144,9 @@ func buildPolicyResults(resps []*response.EngineResponse) map[string][]*report.P
result.Rule = rule.Name
result.Message = rule.Message
result.Status = report.PolicyStatus(rule.Check)
result.Result = report.PolicyResult(rule.Check)
result.Source = policyreport.SourceValue
result.Timestamp = now
results[appname] = append(results[appname], &result)
}
}
@ -158,7 +162,7 @@ func mergeSucceededResults(results map[string][]*report.PolicyReportResult) map[
resourcesMap := make(map[string]*report.PolicyReportResult)
for _, result := range scopedResults {
if result.Status != report.PolicyStatus("pass") {
if result.Result != report.PolicyResult("pass") {
resultsNew[scope] = append(resultsNew[scope], result)
continue
}
@ -183,7 +187,7 @@ func mergeSucceededResults(results map[string][]*report.PolicyReportResult) map[
Policy: names[0],
Rule: names[1],
Resources: v.Resources,
Status: report.PolicyStatus(v.Status),
Result: report.PolicyResult(v.Result),
}
resultsNew[scope] = append(resultsNew[scope], r)
@ -194,7 +198,7 @@ func mergeSucceededResults(results map[string][]*report.PolicyReportResult) map[
func calculateSummary(results []*report.PolicyReportResult) (summary report.PolicyReportSummary) {
for _, res := range results {
switch string(res.Status) {
switch string(res.Result) {
case report.StatusPass:
summary.Pass++
case report.StatusFail:

View file

@ -4,8 +4,8 @@ import (
"os"
"testing"
preport "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
preport "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
"github.com/kyverno/kyverno/pkg/common"
"github.com/kyverno/kyverno/pkg/engine/response"
"github.com/kyverno/kyverno/pkg/engine/utils"
@ -106,9 +106,9 @@ func Test_buildPolicyResults(t *testing.T) {
for _, r := range result {
switch r.Rule {
case "policy1-rule1", "clusterpolicy2-rule1":
assert.Assert(t, r.Status == report.PolicyStatus(preport.StatusPass))
assert.Assert(t, r.Result == report.PolicyResult(preport.StatusPass))
case "policy1-rule2", "clusterpolicy2-rule2":
assert.Assert(t, r.Status == report.PolicyStatus(preport.StatusFail))
assert.Assert(t, r.Result == report.PolicyResult(preport.StatusFail))
}
}
}
@ -118,17 +118,17 @@ func Test_calculateSummary(t *testing.T) {
results := []*report.PolicyReportResult{
{
Resources: make([]*v1.ObjectReference, 5),
Status: report.PolicyStatus(preport.StatusPass),
Result: report.PolicyResult(preport.StatusPass),
},
{Status: report.PolicyStatus(preport.StatusFail)},
{Status: report.PolicyStatus(preport.StatusFail)},
{Status: report.PolicyStatus(preport.StatusFail)},
{Result: report.PolicyResult(preport.StatusFail)},
{Result: report.PolicyResult(preport.StatusFail)},
{Result: report.PolicyResult(preport.StatusFail)},
{
Resources: make([]*v1.ObjectReference, 1),
Status: report.PolicyStatus(preport.StatusPass)},
Result: report.PolicyResult(preport.StatusPass)},
{
Resources: make([]*v1.ObjectReference, 4),
Status: report.PolicyStatus(preport.StatusPass),
Result: report.PolicyResult(preport.StatusPass),
},
}

View file

@ -10,13 +10,14 @@ import (
"reflect"
"sort"
"strings"
"time"
"github.com/fatih/color"
"github.com/go-git/go-billy/v5"
"github.com/go-git/go-billy/v5/memfs"
"github.com/kataras/tablewriter"
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
client "github.com/kyverno/kyverno/pkg/dclient"
"github.com/kyverno/kyverno/pkg/engine/response"
"github.com/kyverno/kyverno/pkg/engine/utils"
@ -30,6 +31,7 @@ import (
"github.com/lensesio/tableprinter"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/yaml"
log "sigs.k8s.io/controller-runtime/pkg/log"
)
@ -79,7 +81,7 @@ type SkippedPolicy struct {
type TestResults struct {
Policy string `json:"policy"`
Rule string `json:"rule"`
Status report.PolicyStatus `json:"status"`
Result report.PolicyResult `json:"result"`
Resource string `json:"resource"`
}
@ -224,6 +226,7 @@ func getLocalDirTestFiles(fs billy.Filesystem, path, fileName, valuesFile string
func buildPolicyResults(resps []*response.EngineResponse, testResults []TestResults) map[string]report.PolicyReportResult {
results := make(map[string]report.PolicyReportResult)
infos := policyreport.GeneratePRsFromEngineResponse(resps, log.Log)
now := metav1.Timestamp{Seconds: time.Now().Unix()}
for _, resp := range resps {
policyName := resp.PolicyResponse.Policy.Name
resourceName := resp.PolicyResponse.Resource.Name
@ -243,7 +246,7 @@ func buildPolicyResults(resps []*response.EngineResponse, testResults []TestResu
for _, test := range testResults {
if test.Policy == policyName && test.Resource == resourceName {
if !util.ContainsString(rules, test.Rule) {
result.Status = report.StatusSkip
result.Result = report.StatusSkip
}
resultsKey := fmt.Sprintf("%s-%s-%s", test.Policy, test.Rule, test.Resource)
if _, ok := results[resultsKey]; !ok {
@ -270,7 +273,9 @@ func buildPolicyResults(resps []*response.EngineResponse, testResults []TestResu
continue
}
result.Rule = ruleName
result.Status = report.PolicyStatus(rule.Check)
result.Result = report.PolicyResult(rule.Check)
result.Source = policyreport.SourceValue
result.Timestamp = now
results[resultsKey] = result
}
}
@ -424,8 +429,8 @@ func printTestResult(resps map[string]report.PolicyReportResult, testResults []T
table = append(table, res)
continue
}
if testRes.Status == v.Status {
if testRes.Status == report.StatusSkip {
if testRes.Result == v.Result {
if testRes.Result == report.StatusSkip {
res.Result = boldGreen.Sprintf("Pass")
rc.skip++
} else {

View file

@ -7,10 +7,10 @@ import (
"time"
"github.com/go-logr/logr"
v1alpha1 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
v1alpha2 "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
kyvernoclient "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
changerequestlister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha1"
policyreportlister "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha1"
changerequestlister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha2"
policyreportlister "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha2"
"github.com/kyverno/kyverno/pkg/config"
"github.com/kyverno/kyverno/pkg/engine/response"
"github.com/kyverno/kyverno/pkg/event"
@ -82,12 +82,12 @@ func cleanupReportChangeRequests(pclient *kyvernoclient.Clientset, rcrLister cha
var gracePeriod int64 = 0
deleteOptions := metav1.DeleteOptions{GracePeriodSeconds: &gracePeriod}
err := pclient.KyvernoV1alpha1().ClusterReportChangeRequests().DeleteCollection(context.TODO(), deleteOptions, metav1.ListOptions{})
err := pclient.KyvernoV1alpha2().ClusterReportChangeRequests().DeleteCollection(context.TODO(), deleteOptions, metav1.ListOptions{})
if err != nil {
errors = append(errors, err.Error())
}
err = pclient.KyvernoV1alpha1().ReportChangeRequests(config.KyvernoNamespace).DeleteCollection(context.TODO(), deleteOptions, metav1.ListOptions{})
err = pclient.KyvernoV1alpha2().ReportChangeRequests(config.KyvernoNamespace).DeleteCollection(context.TODO(), deleteOptions, metav1.ListOptions{})
if err != nil {
errors = append(errors, err.Error())
}
@ -106,9 +106,9 @@ func eraseResultsEntries(pclient *kyvernoclient.Clientset, reportLister policyre
errors = append(errors, err.Error())
} else {
for _, polr := range polrs {
polr.Results = []*v1alpha1.PolicyReportResult{}
polr.Summary = v1alpha1.PolicyReportSummary{}
if _, err = pclient.Wgpolicyk8sV1alpha1().PolicyReports(polr.GetNamespace()).Update(context.TODO(), polr, metav1.UpdateOptions{}); err != nil {
polr.Results = []*v1alpha2.PolicyReportResult{}
polr.Summary = v1alpha2.PolicyReportSummary{}
if _, err = pclient.Wgpolicyk8sV1alpha2().PolicyReports(polr.GetNamespace()).Update(context.TODO(), polr, metav1.UpdateOptions{}); err != nil {
errors = append(errors, fmt.Sprintf("%s/%s/%s: %v", polr.Kind, polr.Namespace, polr.Name, err))
}
}
@ -118,9 +118,9 @@ func eraseResultsEntries(pclient *kyvernoclient.Clientset, reportLister policyre
errors = append(errors, err.Error())
} else {
for _, cpolr := range cpolrs {
cpolr.Results = []*v1alpha1.PolicyReportResult{}
cpolr.Summary = v1alpha1.PolicyReportSummary{}
if _, err = pclient.Wgpolicyk8sV1alpha1().ClusterPolicyReports().Update(context.TODO(), cpolr, metav1.UpdateOptions{}); err != nil {
cpolr.Results = []*v1alpha2.PolicyReportResult{}
cpolr.Summary = v1alpha2.PolicyReportSummary{}
if _, err = pclient.Wgpolicyk8sV1alpha2().ClusterPolicyReports().Update(context.TODO(), cpolr, metav1.UpdateOptions{}); err != nil {
errors = append(errors, fmt.Sprintf("%s/%s: %v", cpolr.Kind, cpolr.Name, err))
}
}

View file

@ -3,11 +3,12 @@ package policyreport
import (
"fmt"
"reflect"
"time"
"github.com/go-logr/logr"
kyverno "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
request "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
request "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
kyvernolister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1"
"github.com/kyverno/kyverno/pkg/config"
"github.com/kyverno/kyverno/pkg/engine/response"
@ -29,6 +30,9 @@ const (
// there would be a problem if use labels as the value could exceed 63 chars
deletedAnnotationResourceName string = "kyverno.io/delete.resource.name"
deletedAnnotationResourceKind string = "kyverno.io/delete.resource.kind"
// static value for PolicyReportResult.Source
SourceValue = "Kyverno"
)
func generatePolicyReportName(ns string) string {
@ -152,9 +156,13 @@ func (builder *requestBuilder) buildRCRResult(policy string, resource response.R
result.Rule = rule.Name
result.Message = rule.Message
result.Status = report.PolicyStatus(rule.Check)
if result.Status == "fail" && !av.scored {
result.Status = "warn"
result.Result = report.PolicyResult(rule.Check)
if result.Result == "fail" && !av.scored {
result.Result = "warn"
}
result.Source = SourceValue
result.Timestamp = metav1.Timestamp{
Seconds: time.Now().Unix(),
}
return result
}
@ -212,7 +220,7 @@ func setRequestLabels(req *unstructured.Unstructured, info Info) bool {
func calculateSummary(results []*report.PolicyReportResult) (summary report.PolicyReportSummary) {
for _, res := range results {
switch string(res.Status) {
switch string(res.Result) {
case report.StatusPass:
summary.Pass++
case report.StatusFail:

View file

@ -6,11 +6,11 @@ import (
"strings"
"github.com/cornelk/hashmap"
changerequest "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
changerequest "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
kyvernoclient "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
changerequestlister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha1"
policyreportlister "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha1"
changerequestlister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha2"
policyreportlister "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha2"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
@ -181,7 +181,7 @@ func updateSummary(results []interface{}) map[string]interface{} {
continue
}
switch typedResult["status"].(string) {
switch typedResult["result"].(string) {
case report.StatusPass:
pass, _ := summary[report.StatusPass].(int64)
summary[report.StatusPass] = pass + 1

View file

@ -22,13 +22,13 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
changerequest "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha1"
changerequest "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
report "github.com/kyverno/kyverno/pkg/api/policyreport/v1alpha2"
kyvernoclient "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
requestinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1alpha1"
policyreportinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions/policyreport/v1alpha1"
requestlister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha1"
policyreport "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha1"
requestinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1alpha2"
policyreportinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions/policyreport/v1alpha2"
requestlister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha2"
policyreport "github.com/kyverno/kyverno/pkg/client/listers/policyreport/v1alpha2"
"github.com/kyverno/kyverno/pkg/config"
dclient "github.com/kyverno/kyverno/pkg/dclient"
)

View file

@ -12,9 +12,9 @@ import (
kyverno "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
policyreportclient "github.com/kyverno/kyverno/pkg/client/clientset/versioned"
kyvernoinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1"
requestinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1alpha1"
requestinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1alpha2"
kyvernolister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1"
requestlister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha1"
requestlister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1alpha2"
dclient "github.com/kyverno/kyverno/pkg/dclient"
"github.com/kyverno/kyverno/pkg/engine/response"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"

View file

@ -1,11 +1,12 @@
package webhooks
import (
"github.com/go-logr/logr"
kyvernov1alpha1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha1"
"github.com/kyverno/kyverno/pkg/engine/response"
"strings"
"github.com/go-logr/logr"
kyvernov1alpha2 "github.com/kyverno/kyverno/pkg/api/kyverno/v1alpha2"
"github.com/kyverno/kyverno/pkg/engine/response"
"github.com/kyverno/kyverno/pkg/event"
)
@ -35,7 +36,7 @@ func generateEvents(engineResponses []*response.EngineResponse, blocked, onUpdat
pe := event.NewEvent(
log,
kind,
kyvernov1alpha1.SchemeGroupVersion.String(),
kyvernov1alpha2.SchemeGroupVersion.String(),
er.PolicyResponse.Policy.Namespace,
er.PolicyResponse.Policy.Name,
event.PolicyViolation.String(),
@ -73,7 +74,7 @@ func generateEvents(engineResponses []*response.EngineResponse, blocked, onUpdat
e := event.NewEvent(
log,
kind,
kyvernov1alpha1.SchemeGroupVersion.String(),
kyvernov1alpha2.SchemeGroupVersion.String(),
er.PolicyResponse.Policy.Namespace,
er.PolicyResponse.Policy.Name,
event.PolicyApplied.String(),

View file

@ -26,4 +26,4 @@ ${CODEGEN_PKG}/generate-groups.sh \
"deepcopy,client,informer,lister" \
${NIRMATA_PKG}/pkg/client \
${NIRMATA_PKG}/pkg/api \
"kyverno:v1 policyreport:v1alpha1 kyverno:v1alpha1"
"kyverno:v1 policyreport:v1alpha2 kyverno:v1alpha2"

View file

@ -7,4 +7,4 @@ results:
- policy: missing
rule: validate-image-tag
resource: test
status: pass
result: pass

View file

@ -7,4 +7,4 @@ results:
- policy: disallow-latest-tag
rule: validate-image-tag
resource: missing
status: pass
result: pass

View file

@ -6,47 +6,47 @@ results:
# TEST: Pod with Labels Should Pass
- policy: require-common-labels
rule: check-for-labels
status: pass
result: pass
resource: pod-with-labels
# TEST: Pod Missing Labels Should Fail
- policy: require-common-labels
rule: check-for-labels
status: fail
result: fail
resource: pod-missing-labels
# TEST: Deployment with Labels Should Pass
- policy: require-common-labels
rule: check-for-labels
status: pass
result: pass
resource: deployment-with-labels
# TEST: Deployment with Labels Should Fail
- policy: require-common-labels
rule: check-for-labels
status: fail
result: fail
resource: deployment-missing-labels
# TEST: StatefulSet with Labels Should Pass
- policy: require-common-labels
rule: check-for-labels
status: pass
result: pass
resource: StatefulSet-with-labels
# TEST: StatefulSet with Labels Should fail
- policy: require-common-labels
rule: check-for-labels
status: fail
result: fail
resource: StatefulSet-without-labels
# TEST: Cronjob with Labels Should pass
- policy: require-common-labels
rule: check-for-labels
status: pass
result: pass
resource: cronjob-with-labels
# TEST: Cronjob without Labels Should fail
- policy: require-common-labels
rule: check-for-labels
status: fail
result: fail
resource: cronjob-without-labels

View file

@ -7,20 +7,20 @@ results:
- policy: disallow-latest-tag
rule: require-image-tag
resource: test-require-image-tag-pass
status: pass
result: pass
- policy: disallow-latest-tag
rule: require-image-tag
resource: test-require-image-tag-fail
status: fail
result: fail
- policy: disallow-latest-tag
rule: validate-image-tag
resource: test-validate-image-tag-ignore
status: skip
result: skip
- policy: disallow-latest-tag
rule: validate-image-tag
resource: test-validate-image-tag-fail
status: fail
result: fail
- policy: disallow-latest-tag
rule: validate-image-tag
resource: test-validate-image-tag-pass
status: pass
result: pass

View file

@ -9,16 +9,16 @@ results:
- policy: cm-variable-example
rule: example-configmap-lookup
resource: test-env-test
status: pass
result: pass
- policy: cm-variable-example
rule: example-configmap-lookup
resource: test-env-dev
status: fail
result: fail
- policy: cm-array-example
rule: validate-role-annotation
resource: test-web
status: fail
result: fail
- policy: cm-array-example
rule: validate-role-annotation
resource: test-app
status: pass
result: pass