Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use official controller-gen #4171

Merged
merged 5 commits into from Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions Makefile
Expand Up @@ -10,7 +10,7 @@ GIT_BRANCH := $(shell git branch | grep \* | cut -d ' ' -f2)
GIT_HASH := $(GIT_BRANCH)/$(shell git log -1 --pretty=format:"%H")
TIMESTAMP := $(shell date '+%Y-%m-%d_%I:%M:%S%p')
CONTROLLER_GEN=controller-gen
CONTROLLER_GEN_REQ_VERSION := v0.8.0
CONTROLLER_GEN_REQ_VERSION := v0.9.1-0.20220629131006-1878064c4cdf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like changes has not included/cherry-picked in latest release 0.9.2 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, not yet :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prateekpandey14 I need to cherry pick my changes so that they are included in the next release.
Until then it's still better to use the official repo than my fork IMHO.

VERSION ?= $(shell git describe --match "v[0-9]*")

REGISTRY?=ghcr.io
Expand Down Expand Up @@ -375,9 +375,7 @@ install-controller-gen: ## Install controller-gen
set -e ;\
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go mod edit -replace=sigs.k8s.io/controller-tools@$(CONTROLLER_GEN_REQ_VERSION)=github.com/eddycharly/controller-tools@704af868d45a3a78448b9a6a2279c12ea96a621e ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_REQ_VERSION) ;\
go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_REQ_VERSION) ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOPATH)/bin/controller-gen
Expand Down
68 changes: 60 additions & 8 deletions charts/kyverno/templates/crds.yaml

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion config/crds/kyverno.io_clusterpolicies.yaml
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.1-0.20220629131006-1878064c4cdf
creationTimestamp: null
name: clusterpolicies.kyverno.io
spec:
Expand Down Expand Up @@ -280,6 +280,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces
names. Each name supports wildcard characters
Expand Down Expand Up @@ -345,6 +346,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role
Expand Down Expand Up @@ -388,6 +390,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
type: array
Expand Down Expand Up @@ -495,6 +498,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces
names. Each name supports wildcard characters
Expand Down Expand Up @@ -560,6 +564,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role
Expand Down Expand Up @@ -603,6 +608,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
type: array
Expand Down Expand Up @@ -699,6 +705,7 @@ spec:
requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces names.
Each name supports wildcard characters "*" (matches
Expand Down Expand Up @@ -758,6 +765,7 @@ spec:
requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role names
Expand Down Expand Up @@ -800,6 +808,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
generate:
Expand Down Expand Up @@ -990,6 +999,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces
names. Each name supports wildcard characters
Expand Down Expand Up @@ -1055,6 +1065,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role
Expand Down Expand Up @@ -1098,6 +1109,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
type: array
Expand Down Expand Up @@ -1205,6 +1217,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces
names. Each name supports wildcard characters
Expand Down Expand Up @@ -1270,6 +1283,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role
Expand Down Expand Up @@ -1313,6 +1327,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
type: array
Expand Down Expand Up @@ -1409,6 +1424,7 @@ spec:
requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces names.
Each name supports wildcard characters "*" (matches
Expand Down Expand Up @@ -1468,6 +1484,7 @@ spec:
requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role names
Expand Down Expand Up @@ -1510,6 +1527,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
mutate:
Expand Down
6 changes: 5 additions & 1 deletion config/crds/kyverno.io_clusterreportchangerequests.yaml
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.1-0.20220629131006-1878064c4cdf
creationTimestamp: null
name: clusterreportchangerequests.kyverno.io
spec:
Expand Down Expand Up @@ -132,6 +132,7 @@ spec:
are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
resources:
description: Resources is an optional reference to the resource
checked by the policy and rule
Expand Down Expand Up @@ -195,6 +196,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
type: array
result:
description: Result indicates the outcome of the policy rule execution
Expand Down Expand Up @@ -283,6 +285,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
scopeSelector:
description: ScopeSelector is an optional selector for multiple scopes
(e.g. Pods). Either one of, or none of, but not both of, Scope or ScopeSelector
Expand Down Expand Up @@ -326,6 +329,7 @@ spec:
contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
summary:
description: PolicyReportSummary provides a summary of results
properties:
Expand Down
2 changes: 1 addition & 1 deletion config/crds/kyverno.io_generaterequests.yaml
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.1-0.20220629131006-1878064c4cdf
creationTimestamp: null
name: generaterequests.kyverno.io
spec:
Expand Down
20 changes: 19 additions & 1 deletion config/crds/kyverno.io_policies.yaml
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.1-0.20220629131006-1878064c4cdf
creationTimestamp: null
name: policies.kyverno.io
spec:
Expand Down Expand Up @@ -281,6 +281,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces
names. Each name supports wildcard characters
Expand Down Expand Up @@ -346,6 +347,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role
Expand Down Expand Up @@ -389,6 +391,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
type: array
Expand Down Expand Up @@ -496,6 +499,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces
names. Each name supports wildcard characters
Expand Down Expand Up @@ -561,6 +565,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role
Expand Down Expand Up @@ -604,6 +609,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
type: array
Expand Down Expand Up @@ -700,6 +706,7 @@ spec:
requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces names.
Each name supports wildcard characters "*" (matches
Expand Down Expand Up @@ -759,6 +766,7 @@ spec:
requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role names
Expand Down Expand Up @@ -801,6 +809,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
generate:
Expand Down Expand Up @@ -991,6 +1000,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces
names. Each name supports wildcard characters
Expand Down Expand Up @@ -1056,6 +1066,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role
Expand Down Expand Up @@ -1099,6 +1110,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
type: array
Expand Down Expand Up @@ -1206,6 +1218,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces
names. Each name supports wildcard characters
Expand Down Expand Up @@ -1271,6 +1284,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role
Expand Down Expand Up @@ -1314,6 +1328,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
type: array
Expand Down Expand Up @@ -1410,6 +1425,7 @@ spec:
requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
namespaces:
description: Namespaces is a list of namespaces names.
Each name supports wildcard characters "*" (matches
Expand Down Expand Up @@ -1469,6 +1485,7 @@ spec:
requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
roles:
description: Roles is the list of namespaced role names
Expand Down Expand Up @@ -1511,6 +1528,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
type: object
mutate:
Expand Down