mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-29 02:45:06 +00:00
rename apiversion from policy.kubernetes.io to policy.k8s.io
This commit is contained in:
parent
6952c6cc74
commit
ba4b36153d
25 changed files with 79 additions and 77 deletions
2
Makefile
2
Makefile
|
@ -113,6 +113,8 @@ docker-publish-all: docker-publish-initContainer docker-publish-kyverno docker-p
|
|||
|
||||
docker-build-all: docker-build-initContainer docker-build-kyverno docker-build-cli
|
||||
|
||||
docker-tag-all: docker-tag-repo-initContainer docker-tag-repo-kyverno docker-tag-repo-cli
|
||||
|
||||
##################################
|
||||
# CI Testing
|
||||
##################################
|
||||
|
|
|
@ -26,7 +26,7 @@ const SwaggerDoc = `
|
|||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||
"description": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.k8s.io/v1alpha1, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||
"type": "string"
|
||||
},
|
||||
"namespaceSelector": {
|
||||
|
@ -223,7 +223,7 @@ const SwaggerDoc = `
|
|||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||
"description": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.k8s.io/v1alpha1, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||
"type": "string"
|
||||
},
|
||||
"namespaceSelector": {
|
||||
|
@ -370,7 +370,7 @@ const SwaggerDoc = `
|
|||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||
"description": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.k8s.io/v1alpha1, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||
"type": "string"
|
||||
},
|
||||
"namespaceSelector": {
|
||||
|
@ -565,7 +565,7 @@ const SwaggerDoc = `
|
|||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||
"description": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.k8s.io/v1alpha1, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||
"type": "string"
|
||||
},
|
||||
"namespaceSelector": {
|
||||
|
|
|
@ -277,7 +277,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: clusterpolicyreports.policy.kubernetes.io
|
||||
name: clusterpolicyreports.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -306,7 +306,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ClusterPolicyReport
|
||||
listKind: ClusterPolicyReportList
|
||||
|
@ -684,7 +684,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: clusterreportchangerequests.policy.kubernetes.io
|
||||
name: clusterreportchangerequests.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -713,7 +713,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ClusterReportChangeRequest
|
||||
listKind: ClusterReportChangeRequestList
|
||||
|
@ -1340,7 +1340,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: policyreports.policy.kubernetes.io
|
||||
name: policyreports.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -1369,7 +1369,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: PolicyReport
|
||||
listKind: PolicyReportList
|
||||
|
@ -1746,7 +1746,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: reportchangerequests.policy.kubernetes.io
|
||||
name: reportchangerequests.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -1775,7 +1775,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ReportChangeRequest
|
||||
listKind: ReportChangeRequestList
|
||||
|
|
|
@ -3,7 +3,7 @@ kind: Kustomization
|
|||
|
||||
resources:
|
||||
- ./crds.yaml
|
||||
- ./policy.kubernetes.io_clusterpolicyreports.yaml
|
||||
- ./policy.kubernetes.io_policyreports.yaml
|
||||
- ./policy.kubernetes.io_clusterreportchangerequests.yaml
|
||||
- ./policy.kubernetes.io_reportchangerequests.yaml
|
||||
- ./policy.k8s.io_clusterpolicyreports.yaml
|
||||
- ./policy.k8s.io_policyreports.yaml
|
||||
- ./policy.k8s.io_clusterreportchangerequests.yaml
|
||||
- ./policy.k8s.io_reportchangerequests.yaml
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: clusterpolicyreports.policy.kubernetes.io
|
||||
name: clusterpolicyreports.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -35,7 +35,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ClusterPolicyReport
|
||||
listKind: ClusterPolicyReportList
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: clusterreportchangerequests.policy.kubernetes.io
|
||||
name: clusterreportchangerequests.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -35,7 +35,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ClusterReportChangeRequest
|
||||
listKind: ClusterReportChangeRequestList
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: policyreports.policy.kubernetes.io
|
||||
name: policyreports.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -35,7 +35,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: PolicyReport
|
||||
listKind: PolicyReportList
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: reportchangerequests.policy.kubernetes.io
|
||||
name: reportchangerequests.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -35,7 +35,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ReportChangeRequest
|
||||
listKind: ReportChangeRequestList
|
|
@ -282,7 +282,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: clusterpolicyreports.policy.kubernetes.io
|
||||
name: clusterpolicyreports.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -311,7 +311,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ClusterPolicyReport
|
||||
listKind: ClusterPolicyReportList
|
||||
|
@ -689,7 +689,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: clusterreportchangerequests.policy.kubernetes.io
|
||||
name: clusterreportchangerequests.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -718,7 +718,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ClusterReportChangeRequest
|
||||
listKind: ClusterReportChangeRequestList
|
||||
|
@ -1345,7 +1345,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: policyreports.policy.kubernetes.io
|
||||
name: policyreports.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -1374,7 +1374,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: PolicyReport
|
||||
listKind: PolicyReportList
|
||||
|
@ -1751,7 +1751,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: reportchangerequests.policy.kubernetes.io
|
||||
name: reportchangerequests.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -1780,7 +1780,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ReportChangeRequest
|
||||
listKind: ReportChangeRequestList
|
||||
|
@ -2246,7 +2246,7 @@ metadata:
|
|||
name: kyverno:admin-policyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- policyreport
|
||||
- clusterpolicyreport
|
||||
|
@ -2261,7 +2261,7 @@ metadata:
|
|||
name: kyverno:edit-policies-policyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- policyreport
|
||||
- clusterpolicyreport
|
||||
|
@ -2326,7 +2326,7 @@ metadata:
|
|||
name: kyverno:view-clusterpolicyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- clusterpolicyreport
|
||||
verbs:
|
||||
|
@ -2375,7 +2375,7 @@ metadata:
|
|||
name: kyverno:view-policyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- policyreport
|
||||
verbs:
|
||||
|
|
|
@ -282,7 +282,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: clusterpolicyreports.policy.kubernetes.io
|
||||
name: clusterpolicyreports.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -311,7 +311,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ClusterPolicyReport
|
||||
listKind: ClusterPolicyReportList
|
||||
|
@ -689,7 +689,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: clusterreportchangerequests.policy.kubernetes.io
|
||||
name: clusterreportchangerequests.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -718,7 +718,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ClusterReportChangeRequest
|
||||
listKind: ClusterReportChangeRequestList
|
||||
|
@ -1345,7 +1345,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: policyreports.policy.kubernetes.io
|
||||
name: policyreports.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -1374,7 +1374,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: PolicyReport
|
||||
listKind: PolicyReportList
|
||||
|
@ -1751,7 +1751,7 @@ metadata:
|
|||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.2.5
|
||||
creationTimestamp: null
|
||||
name: reportchangerequests.policy.kubernetes.io
|
||||
name: reportchangerequests.policy.k8s.io
|
||||
spec:
|
||||
additionalPrinterColumns:
|
||||
- JSONPath: .scope.kind
|
||||
|
@ -1780,7 +1780,7 @@ spec:
|
|||
- JSONPath: .metadata.creationTimestamp
|
||||
name: Age
|
||||
type: date
|
||||
group: policy.kubernetes.io
|
||||
group: policy.k8s.io
|
||||
names:
|
||||
kind: ReportChangeRequest
|
||||
listKind: ReportChangeRequestList
|
||||
|
@ -2246,7 +2246,7 @@ metadata:
|
|||
name: kyverno:admin-policyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- policyreport
|
||||
- clusterpolicyreport
|
||||
|
@ -2261,7 +2261,7 @@ metadata:
|
|||
name: kyverno:edit-policies-policyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- policyreport
|
||||
- clusterpolicyreport
|
||||
|
@ -2326,7 +2326,7 @@ metadata:
|
|||
name: kyverno:view-clusterpolicyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- clusterpolicyreport
|
||||
verbs:
|
||||
|
@ -2375,7 +2375,7 @@ metadata:
|
|||
name: kyverno:view-policyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- policyreport
|
||||
verbs:
|
||||
|
|
|
@ -317,7 +317,7 @@ metadata:
|
|||
labels:
|
||||
rbac.authorization.k8s.io/aggregate-to-view: "true"
|
||||
rules:
|
||||
- apiGroups: [ "policy.kubernetes.io" ]
|
||||
- apiGroups: [ "policy.k8s.io/v1alpha1" ]
|
||||
resources:
|
||||
- policyreport
|
||||
verbs: [ "get", "list", "watch" ]
|
||||
|
@ -330,7 +330,7 @@ metadata:
|
|||
labels:
|
||||
rbac.authorization.k8s.io/aggregate-to-admin: "true"
|
||||
rules:
|
||||
- apiGroups: ["policy.kubernetes.io"]
|
||||
- apiGroups: ["policy.k8s.io/v1alpha1"]
|
||||
resources:
|
||||
- clusterpolicyreport
|
||||
verbs: ["get", "list", "watch"]
|
||||
|
@ -343,7 +343,7 @@ metadata:
|
|||
name: kyverno:edit-policies-policyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- policyreport
|
||||
- clusterpolicyreport
|
||||
|
@ -362,7 +362,7 @@ metadata:
|
|||
name: kyverno:admin-policyreport
|
||||
rules:
|
||||
- apiGroups:
|
||||
- policy.kubernetes.io
|
||||
- policy.k8s.io/v1alpha1
|
||||
resources:
|
||||
- policyreport
|
||||
- clusterpolicyreport
|
||||
|
|
|
@ -17,5 +17,5 @@ limitations under the License.
|
|||
// Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=policy.kubernetes.io
|
||||
// +groupName=policy.k8s.io
|
||||
package v1alpha1
|
||||
|
|
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||
|
||||
// Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=policy.kubernetes.io
|
||||
// +groupName=policy.k8s.io
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
|
@ -26,10 +26,10 @@ import (
|
|||
|
||||
// Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=policy.kubernetes.io
|
||||
// +groupName=policy.k8s.io
|
||||
var (
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "policy.kubernetes.io", Version: "v1alpha1"}
|
||||
SchemeGroupVersion = schema.GroupVersion{Group: "policy.k8s.io", Version: "v1alpha1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
|
||||
|
|
|
@ -35,9 +35,9 @@ type FakeClusterPolicyReports struct {
|
|||
Fake *FakePolicyV1alpha1
|
||||
}
|
||||
|
||||
var clusterpolicyreportsResource = schema.GroupVersionResource{Group: "policy.kubernetes.io", Version: "v1alpha1", Resource: "clusterpolicyreports"}
|
||||
var clusterpolicyreportsResource = schema.GroupVersionResource{Group: "policy.k8s.io", Version: "v1alpha1", Resource: "clusterpolicyreports"}
|
||||
|
||||
var clusterpolicyreportsKind = schema.GroupVersionKind{Group: "policy.kubernetes.io", Version: "v1alpha1", Kind: "ClusterPolicyReport"}
|
||||
var clusterpolicyreportsKind = schema.GroupVersionKind{Group: "policy.k8s.io", Version: "v1alpha1", 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) {
|
||||
|
|
|
@ -35,9 +35,9 @@ type FakeClusterReportChangeRequests struct {
|
|||
Fake *FakePolicyV1alpha1
|
||||
}
|
||||
|
||||
var clusterreportchangerequestsResource = schema.GroupVersionResource{Group: "policy.kubernetes.io", Version: "v1alpha1", Resource: "clusterreportchangerequests"}
|
||||
var clusterreportchangerequestsResource = schema.GroupVersionResource{Group: "policy.k8s.io", Version: "v1alpha1", Resource: "clusterreportchangerequests"}
|
||||
|
||||
var clusterreportchangerequestsKind = schema.GroupVersionKind{Group: "policy.kubernetes.io", Version: "v1alpha1", Kind: "ClusterReportChangeRequest"}
|
||||
var clusterreportchangerequestsKind = schema.GroupVersionKind{Group: "policy.k8s.io", Version: "v1alpha1", 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) {
|
||||
|
|
|
@ -36,9 +36,9 @@ type FakePolicyReports struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var policyreportsResource = schema.GroupVersionResource{Group: "policy.kubernetes.io", Version: "v1alpha1", Resource: "policyreports"}
|
||||
var policyreportsResource = schema.GroupVersionResource{Group: "policy.k8s.io", Version: "v1alpha1", Resource: "policyreports"}
|
||||
|
||||
var policyreportsKind = schema.GroupVersionKind{Group: "policy.kubernetes.io", Version: "v1alpha1", Kind: "PolicyReport"}
|
||||
var policyreportsKind = schema.GroupVersionKind{Group: "policy.k8s.io", Version: "v1alpha1", 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) {
|
||||
|
|
|
@ -36,9 +36,9 @@ type FakeReportChangeRequests struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var reportchangerequestsResource = schema.GroupVersionResource{Group: "policy.kubernetes.io", Version: "v1alpha1", Resource: "reportchangerequests"}
|
||||
var reportchangerequestsResource = schema.GroupVersionResource{Group: "policy.k8s.io", Version: "v1alpha1", Resource: "reportchangerequests"}
|
||||
|
||||
var reportchangerequestsKind = schema.GroupVersionKind{Group: "policy.kubernetes.io", Version: "v1alpha1", Kind: "ReportChangeRequest"}
|
||||
var reportchangerequestsKind = schema.GroupVersionKind{Group: "policy.k8s.io", Version: "v1alpha1", 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) {
|
||||
|
|
|
@ -32,7 +32,7 @@ type PolicyV1alpha1Interface interface {
|
|||
ReportChangeRequestsGetter
|
||||
}
|
||||
|
||||
// PolicyV1alpha1Client is used to interact with features provided by the policy.kubernetes.io group.
|
||||
// PolicyV1alpha1Client is used to interact with features provided by the policy.k8s.io group.
|
||||
type PolicyV1alpha1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
|||
case v1.SchemeGroupVersion.WithResource("policyviolations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Kyverno().V1().PolicyViolations().Informer()}, nil
|
||||
|
||||
// Group=policy.kubernetes.io, Version=v1alpha1
|
||||
// Group=policy.k8s.io, Version=v1alpha1
|
||||
case v1alpha1.SchemeGroupVersion.WithResource("clusterpolicyreports"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1alpha1().ClusterPolicyReports().Informer()}, nil
|
||||
case v1alpha1.SchemeGroupVersion.WithResource("clusterreportchangerequests"):
|
||||
|
|
|
@ -84,7 +84,7 @@ func mergeClusterReport(reports []*unstructured.Unstructured) (*unstructured.Uns
|
|||
res := &unstructured.Unstructured{}
|
||||
res.SetName(clusterpolicyreport)
|
||||
res.SetKind("ClusterPolicyReport")
|
||||
res.SetAPIVersion("policy.kubernetes.io/v1alpha1")
|
||||
res.SetAPIVersion("policy.k8s.io/v1alpha1")
|
||||
|
||||
for _, report := range reports {
|
||||
if report.GetNamespace() != "" {
|
||||
|
|
|
@ -12,7 +12,7 @@ func Test_mergeClusterReport(t *testing.T) {
|
|||
reports := []*unstructured.Unstructured{
|
||||
{
|
||||
Object: map[string]interface{}{
|
||||
"apiVersion": "policy.kubernetes.io/v1alpha1",
|
||||
"apiVersion": "policy.k8s.io/v1alpha1",
|
||||
"kind": "PolicyReport",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "ns-polr-1",
|
||||
|
@ -29,7 +29,7 @@ func Test_mergeClusterReport(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Object: map[string]interface{}{
|
||||
"apiVersion": "policy.kubernetes.io/v1alpha1",
|
||||
"apiVersion": "policy.k8s.io/v1alpha1",
|
||||
"kind": "PolicyReport",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "ns-polr-2",
|
||||
|
@ -59,7 +59,7 @@ func Test_mergeClusterReport(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Object: map[string]interface{}{
|
||||
"apiVersion": "policy.kubernetes.io/v1alpha1",
|
||||
"apiVersion": "policy.k8s.io/v1alpha1",
|
||||
"kind": "ClusterPolicyReport",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "cpolr-4",
|
||||
|
@ -74,7 +74,7 @@ func Test_mergeClusterReport(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Object: map[string]interface{}{
|
||||
"apiVersion": "policy.kubernetes.io/v1alpha1",
|
||||
"apiVersion": "policy.k8s.io/v1alpha1",
|
||||
"kind": "ClusterPolicyReport",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "cpolr-5",
|
||||
|
@ -113,7 +113,7 @@ func Test_mergeClusterReport(t *testing.T) {
|
|||
cpolr, err := mergeClusterReport(reports)
|
||||
assert.NilError(t, err)
|
||||
|
||||
assert.Assert(t, cpolr.GetAPIVersion() == "policy.kubernetes.io/v1alpha1", cpolr.GetAPIVersion())
|
||||
assert.Assert(t, cpolr.GetAPIVersion() == "policy.k8s.io/v1alpha1", cpolr.GetAPIVersion())
|
||||
assert.Assert(t, cpolr.GetKind() == "ClusterPolicyReport", cpolr.GetKind())
|
||||
|
||||
entries, _, err := unstructured.NestedSlice(cpolr.UnstructuredContent(), "results")
|
||||
|
|
|
@ -27,7 +27,7 @@ func buildPolicyReports(resps []response.EngineResponse) (res []*unstructured.Un
|
|||
if scope == clusterpolicyreport {
|
||||
report := &report.ClusterPolicyReport{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: "policy.kubernetes.io/v1alpha1",
|
||||
APIVersion: "policy.k8s.io/v1alpha1",
|
||||
Kind: "ClusterPolicyReport",
|
||||
},
|
||||
Results: result,
|
||||
|
@ -41,7 +41,7 @@ func buildPolicyReports(resps []response.EngineResponse) (res []*unstructured.Un
|
|||
} else {
|
||||
report := &report.PolicyReport{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: "policy.kubernetes.io/v1alpha1",
|
||||
APIVersion: "policy.k8s.io/v1alpha1",
|
||||
Kind: "PolicyReport",
|
||||
},
|
||||
Results: result,
|
||||
|
|
|
@ -156,7 +156,7 @@ func set(obj *unstructured.Unstructured, name string, info Info) {
|
|||
resource := info.Resource
|
||||
obj.SetName(name)
|
||||
obj.SetNamespace(config.KubePolicyNamespace)
|
||||
obj.SetAPIVersion("policy.kubernetes.io/v1alpha1")
|
||||
obj.SetAPIVersion("policy.k8s.io/v1alpha1")
|
||||
if resource.GetNamespace() == "" {
|
||||
obj.SetKind("ClusterReportChangeRequest")
|
||||
} else {
|
||||
|
|
|
@ -460,7 +460,7 @@ func mergeRequests(ns *v1.Namespace, requestsGeneral interface{}) (*unstructured
|
|||
}
|
||||
|
||||
func setReport(report *unstructured.Unstructured, ns *v1.Namespace) {
|
||||
report.SetAPIVersion("policy.kubernetes.io/v1alpha1")
|
||||
report.SetAPIVersion("policy.k8s.io/v1alpha1")
|
||||
|
||||
if ns == nil {
|
||||
report.SetName(generatePolicyReportName(""))
|
||||
|
|
|
@ -277,7 +277,7 @@ func (gen *Generator) sync(reportReq *unstructured.Unstructured, info Info) erro
|
|||
if err != nil {
|
||||
if apierrors.IsNotFound(err) {
|
||||
if _, err = gen.dclient.CreateResource(reportReq.GetAPIVersion(), reportReq.GetKind(), config.KubePolicyNamespace, reportReq, false); err != nil {
|
||||
return fmt.Errorf("failed to create %s: %v", reportReq.GetKind(), err)
|
||||
return fmt.Errorf("failed to create ReportChangeRequest: %v", err)
|
||||
}
|
||||
|
||||
logger.V(3).Info("successfully created reportChangeRequest", "name", reportReq.GetName())
|
||||
|
|
Loading…
Add table
Reference in a new issue