From 70c7c19c2b45cbbdf5f1d32b5d28f2d8dd962a24 Mon Sep 17 00:00:00 2001 From: Sam Dowell Date: Thu, 21 Sep 2023 16:17:32 -0700 Subject: [PATCH] fix: add askpass to override container enum (#891) The askpass sidecar is supported by the overrides in code, but is rejected by the RSync API because it is not enumerated in the CRD. This change enables overriding the askpass container via the RSync. --- manifests/reposync-crd.yaml | 8 ++++---- manifests/rootsync-crd.yaml | 8 ++++---- pkg/api/configsync/v1alpha1/resource_override.go | 4 ++-- pkg/api/configsync/v1beta1/resource_override.go | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifests/reposync-crd.yaml b/manifests/reposync-crd.yaml index e70f962abe..1ed175ee8b 100644 --- a/manifests/reposync-crd.yaml +++ b/manifests/reposync-crd.yaml @@ -346,7 +346,7 @@ spec: deployment container for which log level will be overridden. Must be one of the following: "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync".' - pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ type: string logLevel: description: logLevel specifies the log level override value @@ -383,7 +383,7 @@ spec: whose resource requirements will be overridden. Must be "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync". - pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ type: string cpuLimit: anyOf: @@ -1389,7 +1389,7 @@ spec: deployment container for which log level will be overridden. Must be one of the following: "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync".' - pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ type: string logLevel: description: logLevel specifies the log level override value @@ -1426,7 +1426,7 @@ spec: whose resource requirements will be overridden. Must be "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync". - pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ type: string cpuLimit: anyOf: diff --git a/manifests/rootsync-crd.yaml b/manifests/rootsync-crd.yaml index 190404d05b..2d24c74ada 100644 --- a/manifests/rootsync-crd.yaml +++ b/manifests/rootsync-crd.yaml @@ -356,7 +356,7 @@ spec: deployment container for which log level will be overridden. Must be one of the following: "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync".' - pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ type: string logLevel: description: logLevel specifies the log level override value @@ -405,7 +405,7 @@ spec: whose resource requirements will be overridden. Must be "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync". - pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ type: string cpuLimit: anyOf: @@ -1421,7 +1421,7 @@ spec: deployment container for which log level will be overridden. Must be one of the following: "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync".' - pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ type: string logLevel: description: logLevel specifies the log level override value @@ -1470,7 +1470,7 @@ spec: whose resource requirements will be overridden. Must be "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync". - pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + pattern: ^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ type: string cpuLimit: anyOf: diff --git a/pkg/api/configsync/v1alpha1/resource_override.go b/pkg/api/configsync/v1alpha1/resource_override.go index 37a40a04b4..e6e33d0b69 100644 --- a/pkg/api/configsync/v1alpha1/resource_override.go +++ b/pkg/api/configsync/v1alpha1/resource_override.go @@ -103,7 +103,7 @@ type ContainerResourcesSpec struct { // containerName specifies the name of a container whose resource requirements will be overridden. // Must be "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync". // - // +kubebuilder:validation:Pattern=^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + // +kubebuilder:validation:Pattern=^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ // +optional ContainerName string `json:"containerName,omitempty"` // cpuRequest allows one to override the CPU request of a container @@ -126,7 +126,7 @@ type ContainerLogLevelOverride struct { // Must be one of the following: "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync". // // +kubebuilder:validation:Required - // +kubebuilder:validation:Pattern=^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + // +kubebuilder:validation:Pattern=^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ ContainerName string `json:"containerName"` // logLevel specifies the log level override value for the container. diff --git a/pkg/api/configsync/v1beta1/resource_override.go b/pkg/api/configsync/v1beta1/resource_override.go index 2f4a154b98..109a164969 100644 --- a/pkg/api/configsync/v1beta1/resource_override.go +++ b/pkg/api/configsync/v1beta1/resource_override.go @@ -103,7 +103,7 @@ type ContainerResourcesSpec struct { // containerName specifies the name of a container whose resource requirements will be overridden. // Must be "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync". // - // +kubebuilder:validation:Pattern=^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + // +kubebuilder:validation:Pattern=^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ // +optional ContainerName string `json:"containerName,omitempty"` // cpuRequest allows one to override the CPU request of a container @@ -126,7 +126,7 @@ type ContainerLogLevelOverride struct { // Must be one of the following: "reconciler", "git-sync", "hydration-controller", "oci-sync", or "helm-sync". // // +kubebuilder:validation:Required - // +kubebuilder:validation:Pattern=^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync)$ + // +kubebuilder:validation:Pattern=^(reconciler|git-sync|hydration-controller|oci-sync|helm-sync|gcenode-askpass-sidecar)$ ContainerName string `json:"containerName"` // logLevel specifies the log level override value for the container.