Skip to content

Commit

Permalink
remove unnecessary from generated sub-resources introduced by #439
Browse files Browse the repository at this point in the history
Update deepcopy-gen
  • Loading branch information
bakito committed May 21, 2024
1 parent ac79bd1 commit 4c8ed30
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 175 deletions.
1 change: 0 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ linters:
- govet
- importas
- ineffassign
- megacheck
- misspell
- nakedret
- nolintlint
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ manager: generate fmt
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./pkg/..." paths="./api/..." paths="./controllers/..." output:crd:artifacts:config=config/crd/bases
cp config/crd/bases/*.yaml helm/crds/
yq -i '.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.imagePullSecrets.items.properties.name.description="Name of the referent."' helm/crds/eventlogger.bakito.ch_eventloggers.yaml

generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand Down
6 changes: 6 additions & 0 deletions api/v1/zz_generated.deepcopy.go

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

3 changes: 2 additions & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ sources:
- https://github.com/bakito/k8s-event-logger-operator
annotations:
artifacthub.io/changes: |
- Allow additional pid annotations
- add image pull secrets to the EventLogger CRD
- CRD reformatted in post-processing
icon: https://raw.githubusercontent.com/bakito/k8s-event-logger-operator/main/docs/chart-logo.png
330 changes: 157 additions & 173 deletions helm/crds/eventlogger.bakito.ch_eventloggers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,184 +14,168 @@ spec:
singular: eventlogger
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: EventLogger is the Schema for the eventloggers 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
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
type: string
metadata:
type: object
spec:
description: EventLoggerSpec defines the desired state of EventLogger
properties:
annotations:
additionalProperties:
type: string
description: Labels additional annotations for the logger pod
type: object
eventTypes:
description: EventTypes the event types to log. If empty all events
are logged.
items:
type: string
minItems: 0
type: array
imagePullSecrets:
description: |-
ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this EventLoggerSpec.
If specified, these secrets will be passed to individual puller implementations for them to use.
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
- name: v1
schema:
openAPIV3Schema:
description: EventLogger is the Schema for the eventloggers 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
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
type: string
metadata:
type: object
spec:
description: EventLoggerSpec defines the desired state of EventLogger
properties:
annotations:
additionalProperties:
type: string
description: Labels additional annotations for the logger pod
type: object
x-kubernetes-map-type: atomic
type: array
kinds:
description: Kinds the kinds to log the events for
items:
description: Kind defines a kind to log events for
properties:
apiGroup:
nullable: true
type: string
eventTypes:
description: EventTypes the event types to log. If empty events
are logged as defined in spec.
items:
type: string
minItems: 0
type: array
matchingPatterns:
description: MatchingPatterns optional regex pattern that must
be contained in the message to be logged
items:
eventTypes:
description: EventTypes the event types to log. If empty all events are logged.
items:
type: string
minItems: 0
type: array
imagePullSecrets:
description: |-
ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this EventLoggerSpec.
If specified, these secrets will be passed to individual puller implementations for them to use.
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
default: ""
description: |-
Name of the referent.
type: string
minItems: 0
type: array
name:
minLength: 3
type: string
reasons:
description: Reasons the event reasons to log. If empty events
with any reasons are logged.
items:
type: object
x-kubernetes-map-type: atomic
type: array
kinds:
description: Kinds the kinds to log the events for
items:
description: Kind defines a kind to log events for
properties:
apiGroup:
nullable: true
type: string
minItems: 0
type: array
skipOnMatch:
description: SkipOnMatch skip the entry if matched
type: boolean
skipReasons:
description: SkipReasons event reasons to log to skip. If empty
events with any reasons are logged.
items:
eventTypes:
description: EventTypes the event types to log. If empty events are logged as defined in spec.
items:
type: string
minItems: 0
type: array
matchingPatterns:
description: MatchingPatterns optional regex pattern that must be contained in the message to be logged
items:
type: string
minItems: 0
type: array
name:
minLength: 3
type: string
minItems: 0
type: array
required:
- name
reasons:
description: Reasons the event reasons to log. If empty events with any reasons are logged.
items:
type: string
minItems: 0
type: array
skipOnMatch:
description: SkipOnMatch skip the entry if matched
type: boolean
skipReasons:
description: SkipReasons event reasons to log to skip. If empty events with any reasons are logged.
items:
type: string
minItems: 0
type: array
required:
- name
type: object
minItems: 1
type: array
labels:
additionalProperties:
type: string
description: Labels additional labels for the logger pod
type: object
minItems: 1
type: array
labels:
additionalProperties:
type: string
description: Labels additional labels for the logger pod
type: object
logFields:
description: LogFields fields ot the event to be logged.
items:
description: LogField defines a log field
properties:
name:
description: name of the log field
type: string
path:
description: Path within the corev1.Event struct https://github.com/kubernetes/api/blob/master/core/v1/types.go
items:
logFields:
description: LogFields fields ot the event to be logged.
items:
description: LogField defines a log field
properties:
name:
description: name of the log field
type: string
path:
description: Path within the corev1.Event struct https://github.com/kubernetes/api/blob/master/core/v1/types.go
items:
type: string
minItems: 1
type: array
value:
description: Value a static value of the log field. Can be uses to add static log fields
nullable: true
type: string
minItems: 1
type: array
value:
description: Value a static value of the log field. Can be uses
to add static log fields
nullable: true
type: string
required:
- name
required:
- name
type: object
type: array
namespace:
description: namespace the namespace to watch on, may be an empty string
nullable: true
type: string
nodeSelector:
additionalProperties:
type: string
description: |-
NodeSelector is a selector which must be true for the pod to fit on a node.
Selector which must match a node's labels for the pod to be scheduled on that node.
More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
type: object
type: array
namespace:
description: namespace the namespace to watch on, may be an empty
string
nullable: true
type: string
nodeSelector:
additionalProperties:
scrapeMetrics:
description: ScrapeMetrics if true, prometheus scrape annotations are added to the pod
type: boolean
serviceAccount:
description: ServiceAccount the service account to use for the logger pod
type: string
type: object
status:
description: EventLoggerStatus defines the observed state of EventLogger
properties:
error:
description: Error
type: string
hash:
description: Hash
type: string
lastProcessed:
description: LastProcessed the timestamp the cr was last processed
format: date-time
type: string
operatorVersion:
description: OperatorVersion the version of the operator that processed the cr
type: string
description: |-
NodeSelector is a selector which must be true for the pod to fit on a node.
Selector which must match a node's labels for the pod to be scheduled on that node.
More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
type: object
scrapeMetrics:
description: ScrapeMetrics if true, prometheus scrape annotations
are added to the pod
type: boolean
serviceAccount:
description: ServiceAccount the service account to use for the logger
pod
type: string
type: object
status:
description: EventLoggerStatus defines the observed state of EventLogger
properties:
error:
description: Error
type: string
hash:
description: Hash
type: string
lastProcessed:
description: LastProcessed the timestamp the cr was last processed
format: date-time
type: string
operatorVersion:
description: OperatorVersion the version of the operator that processed
the cr
type: string
required:
- lastProcessed
- operatorVersion
type: object
type: object
served: true
storage: true
required:
- lastProcessed
- operatorVersion
type: object
type: object
served: true
storage: true

0 comments on commit 4c8ed30

Please sign in to comment.