From 10566519cd2fe6ca233daaa9ce4248218b1ccff3 Mon Sep 17 00:00:00 2001 From: Patrick von Steht Date: Mon, 26 Feb 2024 17:11:17 +0100 Subject: [PATCH] Remove changes from api/v1alpha1 and api/v1alpha2 and add changes to manifest_staging directory Signed-off-by: Patrick von Steht --- api/v1alpha1/config/config.go | 1 - api/v1alpha1/eraserconfig_types.go | 19 +++++++++---------- api/v1alpha1/zz_generated.conversion.go | 3 +-- api/v1alpha1/zz_generated.deepcopy.go | 7 ------- api/v1alpha2/config/config.go | 1 - api/v1alpha2/eraserconfig_types.go | 19 +++++++++---------- api/v1alpha2/zz_generated.conversion.go | 3 +-- api/v1alpha2/zz_generated.deepcopy.go | 7 ------- manifest_staging/charts/eraser/README.md | 2 ++ .../eraser-controller-manager-deployment.yaml | 1 + manifest_staging/charts/eraser/values.yaml | 2 ++ manifest_staging/deploy/eraser.yaml | 1 + 12 files changed, 26 insertions(+), 40 deletions(-) diff --git a/api/v1alpha1/config/config.go b/api/v1alpha1/config/config.go index 0b57512a52..cb64795f0c 100644 --- a/api/v1alpha1/config/config.go +++ b/api/v1alpha1/config/config.go @@ -61,7 +61,6 @@ func Default() *v1alpha1.EraserConfig { "eraser.sh/cleanup.filter", }, }, - AdditionalPodLabels: map[string]string{}, }, Components: v1alpha1.Components{ Collector: v1alpha1.OptionalContainerConfig{ diff --git a/api/v1alpha1/eraserconfig_types.go b/api/v1alpha1/eraserconfig_types.go index a2c8f55778..c27bde1fb0 100644 --- a/api/v1alpha1/eraserconfig_types.go +++ b/api/v1alpha1/eraserconfig_types.go @@ -91,16 +91,15 @@ type ContainerConfig struct { } type ManagerConfig struct { - Runtime Runtime `json:"runtime,omitempty"` - OTLPEndpoint string `json:"otlpEndpoint,omitempty"` - LogLevel string `json:"logLevel,omitempty"` - Scheduling ScheduleConfig `json:"scheduling,omitempty"` - Profile ProfileConfig `json:"profile,omitempty"` - ImageJob ImageJobConfig `json:"imageJob,omitempty"` - PullSecrets []string `json:"pullSecrets,omitempty"` - NodeFilter NodeFilterConfig `json:"nodeFilter,omitempty"` - PriorityClassName string `json:"priorityClassName,omitempty"` - AdditionalPodLabels map[string]string `json:"additionalPodLabels,omitempty"` + Runtime Runtime `json:"runtime,omitempty"` + OTLPEndpoint string `json:"otlpEndpoint,omitempty"` + LogLevel string `json:"logLevel,omitempty"` + Scheduling ScheduleConfig `json:"scheduling,omitempty"` + Profile ProfileConfig `json:"profile,omitempty"` + ImageJob ImageJobConfig `json:"imageJob,omitempty"` + PullSecrets []string `json:"pullSecrets,omitempty"` + NodeFilter NodeFilterConfig `json:"nodeFilter,omitempty"` + PriorityClassName string `json:"priorityClassName,omitempty"` } type ScheduleConfig struct { diff --git a/api/v1alpha1/zz_generated.conversion.go b/api/v1alpha1/zz_generated.conversion.go index f771cd7dfb..98f62f724c 100644 --- a/api/v1alpha1/zz_generated.conversion.go +++ b/api/v1alpha1/zz_generated.conversion.go @@ -609,7 +609,6 @@ func autoConvert_v1alpha1_ManagerConfig_To_unversioned_ManagerConfig(in *Manager return err } out.PriorityClassName = in.PriorityClassName - out.AdditionalPodLabels = *(*map[string]string)(unsafe.Pointer(&in.AdditionalPodLabels)) return nil } @@ -633,7 +632,7 @@ func autoConvert_unversioned_ManagerConfig_To_v1alpha1_ManagerConfig(in *unversi return err } out.PriorityClassName = in.PriorityClassName - out.AdditionalPodLabels = *(*map[string]string)(unsafe.Pointer(&in.AdditionalPodLabels)) + // WARNING: in.AdditionalPodLabels requires manual conversion: does not exist in peer-type return nil } diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index f46a620db2..31a79f5fa1 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -334,13 +334,6 @@ func (in *ManagerConfig) DeepCopyInto(out *ManagerConfig) { copy(*out, *in) } in.NodeFilter.DeepCopyInto(&out.NodeFilter) - if in.AdditionalPodLabels != nil { - in, out := &in.AdditionalPodLabels, &out.AdditionalPodLabels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagerConfig. diff --git a/api/v1alpha2/config/config.go b/api/v1alpha2/config/config.go index 39b6e1ca3e..bdd7bcf675 100644 --- a/api/v1alpha2/config/config.go +++ b/api/v1alpha2/config/config.go @@ -61,7 +61,6 @@ func Default() *v1alpha2.EraserConfig { "eraser.sh/cleanup.filter", }, }, - AdditionalPodLabels: map[string]string{}, }, Components: v1alpha2.Components{ Collector: v1alpha2.OptionalContainerConfig{ diff --git a/api/v1alpha2/eraserconfig_types.go b/api/v1alpha2/eraserconfig_types.go index 8d24e27606..f6f8ee8e39 100644 --- a/api/v1alpha2/eraserconfig_types.go +++ b/api/v1alpha2/eraserconfig_types.go @@ -89,16 +89,15 @@ type ContainerConfig struct { } type ManagerConfig struct { - Runtime Runtime `json:"runtime,omitempty"` - OTLPEndpoint string `json:"otlpEndpoint,omitempty"` - LogLevel string `json:"logLevel,omitempty"` - Scheduling ScheduleConfig `json:"scheduling,omitempty"` - Profile ProfileConfig `json:"profile,omitempty"` - ImageJob ImageJobConfig `json:"imageJob,omitempty"` - PullSecrets []string `json:"pullSecrets,omitempty"` - NodeFilter NodeFilterConfig `json:"nodeFilter,omitempty"` - PriorityClassName string `json:"priorityClassName,omitempty"` - AdditionalPodLabels map[string]string `json:"additionalPodLabels,omitempty"` + Runtime Runtime `json:"runtime,omitempty"` + OTLPEndpoint string `json:"otlpEndpoint,omitempty"` + LogLevel string `json:"logLevel,omitempty"` + Scheduling ScheduleConfig `json:"scheduling,omitempty"` + Profile ProfileConfig `json:"profile,omitempty"` + ImageJob ImageJobConfig `json:"imageJob,omitempty"` + PullSecrets []string `json:"pullSecrets,omitempty"` + NodeFilter NodeFilterConfig `json:"nodeFilter,omitempty"` + PriorityClassName string `json:"priorityClassName,omitempty"` } type ScheduleConfig struct { diff --git a/api/v1alpha2/zz_generated.conversion.go b/api/v1alpha2/zz_generated.conversion.go index adeba64b78..b7e282cf68 100644 --- a/api/v1alpha2/zz_generated.conversion.go +++ b/api/v1alpha2/zz_generated.conversion.go @@ -340,7 +340,6 @@ func autoConvert_v1alpha2_ManagerConfig_To_unversioned_ManagerConfig(in *Manager return err } out.PriorityClassName = in.PriorityClassName - out.AdditionalPodLabels = *(*map[string]string)(unsafe.Pointer(&in.AdditionalPodLabels)) return nil } @@ -364,7 +363,7 @@ func autoConvert_unversioned_ManagerConfig_To_v1alpha2_ManagerConfig(in *unversi return err } out.PriorityClassName = in.PriorityClassName - out.AdditionalPodLabels = *(*map[string]string)(unsafe.Pointer(&in.AdditionalPodLabels)) + // WARNING: in.AdditionalPodLabels requires manual conversion: does not exist in peer-type return nil } diff --git a/api/v1alpha2/zz_generated.deepcopy.go b/api/v1alpha2/zz_generated.deepcopy.go index 1963c1034b..54c04dcef7 100644 --- a/api/v1alpha2/zz_generated.deepcopy.go +++ b/api/v1alpha2/zz_generated.deepcopy.go @@ -134,13 +134,6 @@ func (in *ManagerConfig) DeepCopyInto(out *ManagerConfig) { copy(*out, *in) } in.NodeFilter.DeepCopyInto(&out.NodeFilter) - if in.AdditionalPodLabels != nil { - in, out := &in.AdditionalPodLabels, &out.AdditionalPodLabels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagerConfig. diff --git a/manifest_staging/charts/eraser/README.md b/manifest_staging/charts/eraser/README.md index a2ad3ced96..b64563f1fd 100644 --- a/manifest_staging/charts/eraser/README.md +++ b/manifest_staging/charts/eraser/README.md @@ -45,6 +45,7 @@ _See [helm install](https://helm.sh/docs/helm/helm_install/) for command documen | runtimeConfig.manager.imageJob.cleanup | Settings for image job cleanup. | `{}` | | runtimeConfig.manager.pullSecrets | Image pull secrets for collector/scanner/eraser. | `[]` | | runtimeConfig.manager.priorityClassName | Priority class name for collector/scanner/eraser. | `""` | +| runtimeConfig.manager.additionalPodLabels | Additional labels for all pods that the controller creates at runtime. | `{}` | | runtimeConfig.manager.nodeFilter | Filter for nodes. | `{}` | | runtimeConfig.components.collector | Settings for the collector component. | `{ enabled: false }` | | runtimeConfig.components.scanner | Settings for the scanner component. | `{ enabled: false }` | @@ -54,6 +55,7 @@ _See [helm install](https://helm.sh/docs/helm/helm_install/) for command documen | deploy.image.tag | Overrides the default image tag. | `""` | | deploy.additionalArgs | Additional arguments to pass to the command. | `[]` | | deploy.priorityClassName | Priority class name. | `""` | +| deploy.additionalPodLabels | Additional labels for the controller pod. | `{}` | | deploy.securityContext.allowPrivilegeEscalation | Whether to allow privilege escalation. | `false` | | deploy.resources.limits.memory | Memory limit for the resources. | `30Mi` | | deploy.resources.requests.cpu | CPU request for the resources. | `100m` | diff --git a/manifest_staging/charts/eraser/templates/eraser-controller-manager-deployment.yaml b/manifest_staging/charts/eraser/templates/eraser-controller-manager-deployment.yaml index 05d2ffe028..b132e439c2 100644 --- a/manifest_staging/charts/eraser/templates/eraser-controller-manager-deployment.yaml +++ b/manifest_staging/charts/eraser/templates/eraser-controller-manager-deployment.yaml @@ -21,6 +21,7 @@ spec: template: metadata: labels: + {{- if .Values.deploy.additionalPodLabels }}{{- toYaml .Values.deploy.additionalPodLabels | nindent 8 }}{{end}} app.kubernetes.io/instance: '{{ .Release.Name }}' app.kubernetes.io/managed-by: '{{ .Release.Service }}' app.kubernetes.io/name: '{{ template "eraser.name" . }}' diff --git a/manifest_staging/charts/eraser/values.yaml b/manifest_staging/charts/eraser/values.yaml index 484d3ca3c2..3c09f3da34 100644 --- a/manifest_staging/charts/eraser/values.yaml +++ b/manifest_staging/charts/eraser/values.yaml @@ -29,6 +29,7 @@ runtimeConfig: # delayOnFailure: "" pullSecrets: [] # image pull secrets for collector/scanner/eraser priorityClassName: "" # priority class name for collector/scanner/eraser + additionalPodLabels: {} nodeFilter: type: exclude # must be either exclude|include selectors: @@ -97,6 +98,7 @@ deploy: tag: "v1.4.0-beta.0" additionalArgs: [] priorityClassName: "" + additionalPodLabels: {} securityContext: allowPrivilegeEscalation: false diff --git a/manifest_staging/deploy/eraser.yaml b/manifest_staging/deploy/eraser.yaml index 314d8210d9..1b1cf2ab2b 100644 --- a/manifest_staging/deploy/eraser.yaml +++ b/manifest_staging/deploy/eraser.yaml @@ -432,6 +432,7 @@ data: delayOnFailure: 24h pullSecrets: [] # image pull secrets for collector/scanner/eraser priorityClassName: "" # priority class name for collector/scanner/eraser + additionalPodLabels: {} nodeFilter: type: exclude # must be either exclude|include selectors: