Skip to content

Commit

Permalink
Upgrade controller-gen
Browse files Browse the repository at this point in the history
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
  • Loading branch information
dhaiducek committed Feb 16, 2024
1 parent 4668813 commit 29ff0b2
Show file tree
Hide file tree
Showing 10 changed files with 262 additions and 257 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,14 @@ clean:
############################################################
# Generate manifests
############################################################
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"

.PHONY: manifests
manifests: controller-gen kustomize
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=config-policy-controller paths="./..." output:crd:artifacts:config=deploy/crds output:rbac:artifacts:config=deploy/rbac
$(CONTROLLER_GEN) crd rbac:roleName=config-policy-controller paths="./..." output:crd:artifacts:config=deploy/crds output:rbac:artifacts:config=deploy/rbac
mv deploy/crds/policy.open-cluster-management.io_configurationpolicies.yaml deploy/crds/kustomize_configurationpolicy/policy.open-cluster-management.io_configurationpolicies.yaml
mv deploy/crds/policy.open-cluster-management.io_operatorpolicies.yaml deploy/crds/kustomize_operatorpolicy/policy.open-cluster-management.io_operatorpolicies.yaml
# Add a newline so that the format matches what kubebuilder generates
@printf "\n---\n" > deploy/crds/policy.open-cluster-management.io_configurationpolicies.yaml
@printf "\n---\n" > deploy/crds/policy.open-cluster-management.io_operatorpolicies.yaml
@printf -- "---\n" > deploy/crds/policy.open-cluster-management.io_configurationpolicies.yaml
@printf -- "---\n" > deploy/crds/policy.open-cluster-management.io_operatorpolicies.yaml
$(KUSTOMIZE) build deploy/crds/kustomize_configurationpolicy >> deploy/crds/policy.open-cluster-management.io_configurationpolicies.yaml
$(KUSTOMIZE) build deploy/crds/kustomize_operatorpolicy >> deploy/crds/policy.open-cluster-management.io_operatorpolicies.yaml

Expand Down
7 changes: 4 additions & 3 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/common/Makefile.common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## CLI versions (with links to the latest releases)
# https://github.com/kubernetes-sigs/controller-tools/releases/latest
CONTROLLER_GEN_VERSION := v0.6.1
CONTROLLER_GEN_VERSION := v0.14.0
# https://github.com/kubernetes-sigs/kustomize/releases/latest
KUSTOMIZE_VERSION := v5.3.0
# https://github.com/golangci/golangci-lint/releases/latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: configurationpolicies.policy.open-cluster-management.io
spec:
group: policy.open-cluster-management.io
Expand All @@ -27,47 +25,51 @@ spec:
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: ConfigurationPolicySpec defines the desired state of ConfigurationPolicy
properties:
evaluationInterval:
description: Configures the minimum elapsed time before a ConfigurationPolicy
is reevaluated. If the policy spec is changed, or if the list of
namespaces selected by the policy changes, the policy may be evaluated
regardless of the settings here.
description: |-
Configures the minimum elapsed time before a ConfigurationPolicy is reevaluated. If the policy
spec is changed, or if the list of namespaces selected by the policy changes, the policy may be
evaluated regardless of the settings here.
properties:
compliant:
description: The minimum elapsed time before a ConfigurationPolicy
is reevaluated when in the compliant state. Set this to "never"
to disable reevaluation when in the compliant state.
description: |-
The minimum elapsed time before a ConfigurationPolicy is reevaluated when in the compliant state. Set this to
"never" to disable reevaluation when in the compliant state.
pattern: ^(?:(?:(?:[0-9]+(?:.[0-9])?)(?:h|m|s|(?:ms)|(?:us)|(?:ns)))|never)+$
type: string
noncompliant:
description: The minimum elapsed time before a ConfigurationPolicy
is reevaluated when in the noncompliant state. Set this to "never"
to disable reevaluation when in the noncompliant state.
description: |-
The minimum elapsed time before a ConfigurationPolicy is reevaluated when in the noncompliant state. Set this to
"never" to disable reevaluation when in the noncompliant state.
pattern: ^(?:(?:(?:[0-9]+(?:.[0-9])?)(?:h|m|s|(?:ms)|(?:us)|(?:ns)))|never)+$
type: string
type: object
namespaceSelector:
description: '''namespaceSelector'' defines the list of namespaces
to include/exclude for objects defined in spec.objectTemplates.
All selector rules are ANDed. If ''include'' is not provided but
''matchLabels'' and/or ''matchExpressions'' are, ''include'' will
behave as if [''*''] were given. If ''matchExpressions'' and ''matchLabels''
are both not provided, ''include'' must be provided to retrieve
namespaces.'
description: |-
'namespaceSelector' defines the list of namespaces to include/exclude for objects defined in
spec.objectTemplates. All selector rules are ANDed. If 'include' is not provided but
'matchLabels' and/or 'matchExpressions' are, 'include' will behave as if ['*'] were given. If
'matchExpressions' and 'matchLabels' are both not provided, 'include' must be provided to
retrieve namespaces.
properties:
exclude:
description: '''exclude'' is an array of filepath expressions
Expand All @@ -87,24 +89,24 @@ spec:
description: '''matchExpressions'' is an array of label selector
requirements matching objects by label.'
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
Expand All @@ -122,12 +124,12 @@ spec:
type: object
type: object
object-templates:
description: '''object-templates'' and ''object-templates-raw'' are
arrays of objects for the configuration policy to check, create,
modify, or delete on the cluster. ''object-templates'' is an array
of objects, while ''object-templates-raw'' is a string containing
an array of objects in YAML format. Only one of the two object-templates
variables can be set in a given configurationPolicy.'
description: |-
'object-templates' and 'object-templates-raw' are arrays of objects for the configuration
policy to check, create, modify, or delete on the cluster. 'object-templates' is an array
of objects, while 'object-templates-raw' is a string containing an array of objects in
YAML format. Only one of the two object-templates variables can be set in a given
configurationPolicy.
items:
description: ObjectTemplate describes how an object should look
properties:
Expand Down Expand Up @@ -162,9 +164,9 @@ spec:
type: object
x-kubernetes-preserve-unknown-fields: true
recordDiff:
description: RecordDiff specifies whether (and where) to log
the diff between the object on the cluster and the objectDefinition
in the policy. Defaults to "None".
description: |-
RecordDiff specifies whether (and where) to log the diff between the object on the
cluster and the objectDefinition in the policy. Defaults to "None".
enum:
- Log
- None
Expand All @@ -175,17 +177,18 @@ spec:
type: object
type: array
object-templates-raw:
description: '''object-templates'' and ''object-templates-raw'' are
arrays of objects for the configuration policy to check, create,
modify, or delete on the cluster. ''object-templates'' is an array
of objects, while ''object-templates-raw'' is a string containing
an array of objects in YAML format. Only one of the two object-templates
variables can be set in a given configurationPolicy.'
description: |-
'object-templates' and 'object-templates-raw' are arrays of objects for the configuration
policy to check, create, modify, or delete on the cluster. 'object-templates' is an array
of objects, while 'object-templates-raw' is a string containing an array of objects in
YAML format. Only one of the two object-templates variables can be set in a given
configurationPolicy.
type: string
pruneObjectBehavior:
default: None
description: PruneObjectBehavior is used to remove objects that are
managed by the policy upon policy deletion.
description: |-
PruneObjectBehavior is used to remove objects that are managed by the
policy upon policy deletion.
enum:
- DeleteAll
- DeleteIfCreated
Expand Down Expand Up @@ -290,17 +293,22 @@ spec:
description: API version of the referent.
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind of the referent. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
description: Metadata values from the referent.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
description: |-
Name of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
namespace:
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
description: |-
Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
type: string
type: object
type: object
Expand All @@ -325,9 +333,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit 29ff0b2

Please sign in to comment.