From 1df6f89a8cb157ed8a6449557e581e8b1d56adbc Mon Sep 17 00:00:00 2001 From: Noah Campbell Date: Tue, 11 Nov 2025 12:29:08 -0600 Subject: [PATCH 1/8] add optional architecture field to config --- kinds/apis/v1beta1/config_types.go | 16 ++++++++++++++ .../charts/crds/templates/resources.yaml | 22 +++++++++++++++++++ ...mbeddedcluster.replicated.com_configs.yaml | 11 ++++++++++ .../config-embeddedcluster-v1beta1.json | 14 ++++++++++++ pkg/crds/resources.yaml | 22 +++++++++++++++++++ 5 files changed, 85 insertions(+) diff --git a/kinds/apis/v1beta1/config_types.go b/kinds/apis/v1beta1/config_types.go index 1f75f072b3..096d701f9c 100644 --- a/kinds/apis/v1beta1/config_types.go +++ b/kinds/apis/v1beta1/config_types.go @@ -151,6 +151,15 @@ type Domains struct { ReplicatedRegistryDomain string `json:"replicatedRegistryDomain,omitempty"` } +// +kubebuilder:validation:Enum=aarch64;x86_64 +// Architecture represents a supported CPU architecture identifier. +type Architecture string + +const ( + ArchitectureAarch64 Architecture = "aarch64" + ArchitectureX8664 Architecture = "x86_64" +) + // ConfigSpec defines the desired state of Config type ConfigSpec struct { Version string `json:"version,omitempty"` @@ -160,6 +169,13 @@ type ConfigSpec struct { UnsupportedOverrides UnsupportedOverrides `json:"unsupportedOverrides,omitempty"` Extensions Extensions `json:"extensions,omitempty"` Domains Domains `json:"domains,omitempty"` + // Architecture holds the list of CPU architectures supported by this release. + // If omitted, both architectures are assumed to be supported. + // +kubebuilder:validation:Optional + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=2 + // +kubebuilder:validation:UniqueItems=true + Architecture []Architecture `json:"architecture,omitempty"` } // OverrideForBuiltIn returns the override for the built-in extension with the diff --git a/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml b/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml index edaac28694..21bb021eca 100644 --- a/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml +++ b/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml @@ -41,6 +41,17 @@ spec: spec: description: ConfigSpec defines the desired state of Config properties: + architecture: + description: Architecture holds the list of CPU architectures supported by this release. + items: + enum: + - aarch64 + - x86_64 + type: string + maxItems: 2 + minItems: 1 + type: array + uniqueItems: true binaryOverrideUrl: type: string domains: @@ -362,6 +373,17 @@ spec: config: description: Config holds the configuration used at installation time. properties: + architecture: + description: Architecture holds the list of CPU architectures supported by this release. + items: + enum: + - aarch64 + - x86_64 + type: string + maxItems: 2 + minItems: 1 + type: array + uniqueItems: true binaryOverrideUrl: type: string domains: diff --git a/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml b/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml index 355cc2edee..b113f851b8 100644 --- a/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml +++ b/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml @@ -39,6 +39,17 @@ spec: spec: description: ConfigSpec defines the desired state of Config properties: + architecture: + description: Architecture holds the list of CPU architectures supported by this release. + items: + enum: + - aarch64 + - x86_64 + type: string + maxItems: 2 + minItems: 1 + type: array + uniqueItems: true binaryOverrideUrl: type: string domains: diff --git a/operator/schemas/config-embeddedcluster-v1beta1.json b/operator/schemas/config-embeddedcluster-v1beta1.json index 3999d3577a..127319383b 100644 --- a/operator/schemas/config-embeddedcluster-v1beta1.json +++ b/operator/schemas/config-embeddedcluster-v1beta1.json @@ -17,6 +17,20 @@ "description": "ConfigSpec defines the desired state of Config", "type": "object", "properties": { + "architecture": { + "description": "Architecture holds the list of CPU architectures supported by this release.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "aarch64", + "x86_64" + ] + }, + "minItems": 1, + "maxItems": 2, + "uniqueItems": true + }, "binaryOverrideUrl": { "type": "string" }, diff --git a/pkg/crds/resources.yaml b/pkg/crds/resources.yaml index edaac28694..21bb021eca 100644 --- a/pkg/crds/resources.yaml +++ b/pkg/crds/resources.yaml @@ -41,6 +41,17 @@ spec: spec: description: ConfigSpec defines the desired state of Config properties: + architecture: + description: Architecture holds the list of CPU architectures supported by this release. + items: + enum: + - aarch64 + - x86_64 + type: string + maxItems: 2 + minItems: 1 + type: array + uniqueItems: true binaryOverrideUrl: type: string domains: @@ -362,6 +373,17 @@ spec: config: description: Config holds the configuration used at installation time. properties: + architecture: + description: Architecture holds the list of CPU architectures supported by this release. + items: + enum: + - aarch64 + - x86_64 + type: string + maxItems: 2 + minItems: 1 + type: array + uniqueItems: true binaryOverrideUrl: type: string domains: From 8218de7069a6ee5a52cbdcdac23704333fab30eb Mon Sep 17 00:00:00 2001 From: Noah Campbell Date: Tue, 11 Nov 2025 12:34:51 -0600 Subject: [PATCH 2/8] Update config_types.go --- kinds/apis/v1beta1/config_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kinds/apis/v1beta1/config_types.go b/kinds/apis/v1beta1/config_types.go index 096d701f9c..8896f9fd1d 100644 --- a/kinds/apis/v1beta1/config_types.go +++ b/kinds/apis/v1beta1/config_types.go @@ -170,7 +170,7 @@ type ConfigSpec struct { Extensions Extensions `json:"extensions,omitempty"` Domains Domains `json:"domains,omitempty"` // Architecture holds the list of CPU architectures supported by this release. - // If omitted, both architectures are assumed to be supported. + // If omitted, x86_64 is assumed for backward compatibility. // +kubebuilder:validation:Optional // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=2 From c945fd947e4c9913259919dd1a88a1050de65f5b Mon Sep 17 00:00:00 2001 From: Noah Campbell Date: Tue, 11 Nov 2025 15:37:44 -0600 Subject: [PATCH 3/8] ran schema gen commands for ec config --- kinds/apis/v1beta1/zz_generated.deepcopy.go | 5 +++++ .../charts/crds/templates/resources.yaml | 12 ++++++++++-- .../embeddedcluster.replicated.com_configs.yaml | 6 +++++- ...eddedcluster.replicated.com_installations.yaml | 15 +++++++++++++++ ...er.replicated.com_kubernetesinstallations.yaml | 15 +++++++++++++++ .../schemas/config-embeddedcluster-v1beta1.json | 11 ++++++----- ...netesinstallation-embeddedcluster-v1beta1.json | 15 +++++++++++++++ pkg/crds/resources.yaml | 12 ++++++++++-- 8 files changed, 81 insertions(+), 10 deletions(-) diff --git a/kinds/apis/v1beta1/zz_generated.deepcopy.go b/kinds/apis/v1beta1/zz_generated.deepcopy.go index 881191eefb..72c7e4983e 100644 --- a/kinds/apis/v1beta1/zz_generated.deepcopy.go +++ b/kinds/apis/v1beta1/zz_generated.deepcopy.go @@ -195,6 +195,11 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) { in.UnsupportedOverrides.DeepCopyInto(&out.UnsupportedOverrides) in.Extensions.DeepCopyInto(&out.Extensions) out.Domains = in.Domains + if in.Architecture != nil { + in, out := &in.Architecture, &out.Architecture + *out = make([]Architecture, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSpec. diff --git a/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml b/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml index 21bb021eca..45ebd984bb 100644 --- a/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml +++ b/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml @@ -42,8 +42,12 @@ spec: description: ConfigSpec defines the desired state of Config properties: architecture: - description: Architecture holds the list of CPU architectures supported by this release. + description: |- + Architecture holds the list of CPU architectures supported by this release. + If omitted, x86_64 is assumed for backward compatibility. items: + description: Architecture represents a supported CPU architecture + identifier. enum: - aarch64 - x86_64 @@ -374,8 +378,12 @@ spec: description: Config holds the configuration used at installation time. properties: architecture: - description: Architecture holds the list of CPU architectures supported by this release. + description: |- + Architecture holds the list of CPU architectures supported by this release. + If omitted, x86_64 is assumed for backward compatibility. items: + description: Architecture represents a supported CPU architecture + identifier. enum: - aarch64 - x86_64 diff --git a/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml b/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml index b113f851b8..c125cd5c16 100644 --- a/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml +++ b/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml @@ -40,8 +40,12 @@ spec: description: ConfigSpec defines the desired state of Config properties: architecture: - description: Architecture holds the list of CPU architectures supported by this release. + description: |- + Architecture holds the list of CPU architectures supported by this release. + If omitted, x86_64 is assumed for backward compatibility. items: + description: Architecture represents a supported CPU architecture + identifier. enum: - aarch64 - x86_64 diff --git a/operator/config/crd/bases/embeddedcluster.replicated.com_installations.yaml b/operator/config/crd/bases/embeddedcluster.replicated.com_installations.yaml index feda5409c0..9f7b06d8ae 100644 --- a/operator/config/crd/bases/embeddedcluster.replicated.com_installations.yaml +++ b/operator/config/crd/bases/embeddedcluster.replicated.com_installations.yaml @@ -104,6 +104,21 @@ spec: config: description: Config holds the configuration used at installation time. properties: + architecture: + description: |- + Architecture holds the list of CPU architectures supported by this release. + If omitted, x86_64 is assumed for backward compatibility. + items: + description: Architecture represents a supported CPU architecture + identifier. + enum: + - aarch64 + - x86_64 + type: string + maxItems: 2 + minItems: 1 + type: array + uniqueItems: true binaryOverrideUrl: type: string domains: diff --git a/operator/config/crd/bases/embeddedcluster.replicated.com_kubernetesinstallations.yaml b/operator/config/crd/bases/embeddedcluster.replicated.com_kubernetesinstallations.yaml index e22ee57a85..92f8170736 100644 --- a/operator/config/crd/bases/embeddedcluster.replicated.com_kubernetesinstallations.yaml +++ b/operator/config/crd/bases/embeddedcluster.replicated.com_kubernetesinstallations.yaml @@ -63,6 +63,21 @@ spec: config: description: Config holds the configuration used at installation time. properties: + architecture: + description: |- + Architecture holds the list of CPU architectures supported by this release. + If omitted, x86_64 is assumed for backward compatibility. + items: + description: Architecture represents a supported CPU architecture + identifier. + enum: + - aarch64 + - x86_64 + type: string + maxItems: 2 + minItems: 1 + type: array + uniqueItems: true binaryOverrideUrl: type: string domains: diff --git a/operator/schemas/config-embeddedcluster-v1beta1.json b/operator/schemas/config-embeddedcluster-v1beta1.json index 127319383b..ff7df2d32a 100644 --- a/operator/schemas/config-embeddedcluster-v1beta1.json +++ b/operator/schemas/config-embeddedcluster-v1beta1.json @@ -18,18 +18,19 @@ "type": "object", "properties": { "architecture": { - "description": "Architecture holds the list of CPU architectures supported by this release.", + "description": "Architecture holds the list of CPU architectures supported by this release.\nIf omitted, x86_64 is assumed for backward compatibility.", "type": "array", + "maxItems": 2, + "minItems": 1, + "uniqueItems": true, "items": { + "description": "Architecture represents a supported CPU architecture identifier.", "type": "string", "enum": [ "aarch64", "x86_64" ] - }, - "minItems": 1, - "maxItems": 2, - "uniqueItems": true + } }, "binaryOverrideUrl": { "type": "string" diff --git a/operator/schemas/kubernetesinstallation-embeddedcluster-v1beta1.json b/operator/schemas/kubernetesinstallation-embeddedcluster-v1beta1.json index aa105b43ca..9bdbc48d3a 100644 --- a/operator/schemas/kubernetesinstallation-embeddedcluster-v1beta1.json +++ b/operator/schemas/kubernetesinstallation-embeddedcluster-v1beta1.json @@ -43,6 +43,21 @@ "description": "Config holds the configuration used at installation time.", "type": "object", "properties": { + "architecture": { + "description": "Architecture holds the list of CPU architectures supported by this release.\nIf omitted, x86_64 is assumed for backward compatibility.", + "type": "array", + "maxItems": 2, + "minItems": 1, + "uniqueItems": true, + "items": { + "description": "Architecture represents a supported CPU architecture identifier.", + "type": "string", + "enum": [ + "aarch64", + "x86_64" + ] + } + }, "binaryOverrideUrl": { "type": "string" }, diff --git a/pkg/crds/resources.yaml b/pkg/crds/resources.yaml index 21bb021eca..45ebd984bb 100644 --- a/pkg/crds/resources.yaml +++ b/pkg/crds/resources.yaml @@ -42,8 +42,12 @@ spec: description: ConfigSpec defines the desired state of Config properties: architecture: - description: Architecture holds the list of CPU architectures supported by this release. + description: |- + Architecture holds the list of CPU architectures supported by this release. + If omitted, x86_64 is assumed for backward compatibility. items: + description: Architecture represents a supported CPU architecture + identifier. enum: - aarch64 - x86_64 @@ -374,8 +378,12 @@ spec: description: Config holds the configuration used at installation time. properties: architecture: - description: Architecture holds the list of CPU architectures supported by this release. + description: |- + Architecture holds the list of CPU architectures supported by this release. + If omitted, x86_64 is assumed for backward compatibility. items: + description: Architecture represents a supported CPU architecture + identifier. enum: - aarch64 - x86_64 From 5a6b51eeef9c9b2f536c1c4b74b79f2debd41052 Mon Sep 17 00:00:00 2001 From: Noah Campbell Date: Tue, 11 Nov 2025 16:02:08 -0600 Subject: [PATCH 4/8] removed uniqueitems from schema --- kinds/apis/v1beta1/config_types.go | 2 +- .../charts/crds/templates/resources.yaml | 4 ++-- .../crd/bases/embeddedcluster.replicated.com_configs.yaml | 2 +- pkg/crds/resources.yaml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kinds/apis/v1beta1/config_types.go b/kinds/apis/v1beta1/config_types.go index 8896f9fd1d..a22e7537d2 100644 --- a/kinds/apis/v1beta1/config_types.go +++ b/kinds/apis/v1beta1/config_types.go @@ -174,7 +174,7 @@ type ConfigSpec struct { // +kubebuilder:validation:Optional // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=2 - // +kubebuilder:validation:UniqueItems=true + // +listType=set Architecture []Architecture `json:"architecture,omitempty"` } diff --git a/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml b/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml index 45ebd984bb..c5df7f0656 100644 --- a/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml +++ b/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml @@ -55,7 +55,7 @@ spec: maxItems: 2 minItems: 1 type: array - uniqueItems: true + x-kubernetes-list-type: set binaryOverrideUrl: type: string domains: @@ -391,7 +391,7 @@ spec: maxItems: 2 minItems: 1 type: array - uniqueItems: true + x-kubernetes-list-type: set binaryOverrideUrl: type: string domains: diff --git a/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml b/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml index c125cd5c16..e33389586b 100644 --- a/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml +++ b/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml @@ -53,7 +53,7 @@ spec: maxItems: 2 minItems: 1 type: array - uniqueItems: true + x-kubernetes-list-type: set binaryOverrideUrl: type: string domains: diff --git a/pkg/crds/resources.yaml b/pkg/crds/resources.yaml index 45ebd984bb..c5df7f0656 100644 --- a/pkg/crds/resources.yaml +++ b/pkg/crds/resources.yaml @@ -55,7 +55,7 @@ spec: maxItems: 2 minItems: 1 type: array - uniqueItems: true + x-kubernetes-list-type: set binaryOverrideUrl: type: string domains: @@ -391,7 +391,7 @@ spec: maxItems: 2 minItems: 1 type: array - uniqueItems: true + x-kubernetes-list-type: set binaryOverrideUrl: type: string domains: From b12bc25fb3a20a8843857e68ec11716ff94fa27a Mon Sep 17 00:00:00 2001 From: Noah Campbell Date: Tue, 11 Nov 2025 16:20:09 -0600 Subject: [PATCH 5/8] removed remaining uniqueitems references --- kinds/apis/v1beta1/config_types.go | 2 -- .../charts/crds/templates/resources.yaml | 4 ---- .../crd/bases/embeddedcluster.replicated.com_configs.yaml | 2 -- .../bases/embeddedcluster.replicated.com_installations.yaml | 4 +--- ...eddedcluster.replicated.com_kubernetesinstallations.yaml | 4 +--- operator/schemas/config-embeddedcluster-v1beta1.json | 6 ++---- .../kubernetesinstallation-embeddedcluster-v1beta1.json | 6 ++---- pkg/crds/resources.yaml | 4 ---- 8 files changed, 6 insertions(+), 26 deletions(-) diff --git a/kinds/apis/v1beta1/config_types.go b/kinds/apis/v1beta1/config_types.go index a22e7537d2..d58b9cfdb1 100644 --- a/kinds/apis/v1beta1/config_types.go +++ b/kinds/apis/v1beta1/config_types.go @@ -172,8 +172,6 @@ type ConfigSpec struct { // Architecture holds the list of CPU architectures supported by this release. // If omitted, x86_64 is assumed for backward compatibility. // +kubebuilder:validation:Optional - // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:MaxItems=2 // +listType=set Architecture []Architecture `json:"architecture,omitempty"` } diff --git a/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml b/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml index c5df7f0656..6fd64f99b4 100644 --- a/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml +++ b/operator/charts/embedded-cluster-operator/charts/crds/templates/resources.yaml @@ -52,8 +52,6 @@ spec: - aarch64 - x86_64 type: string - maxItems: 2 - minItems: 1 type: array x-kubernetes-list-type: set binaryOverrideUrl: @@ -388,8 +386,6 @@ spec: - aarch64 - x86_64 type: string - maxItems: 2 - minItems: 1 type: array x-kubernetes-list-type: set binaryOverrideUrl: diff --git a/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml b/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml index e33389586b..fc2e6d4d5a 100644 --- a/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml +++ b/operator/config/crd/bases/embeddedcluster.replicated.com_configs.yaml @@ -50,8 +50,6 @@ spec: - aarch64 - x86_64 type: string - maxItems: 2 - minItems: 1 type: array x-kubernetes-list-type: set binaryOverrideUrl: diff --git a/operator/config/crd/bases/embeddedcluster.replicated.com_installations.yaml b/operator/config/crd/bases/embeddedcluster.replicated.com_installations.yaml index 9f7b06d8ae..509ecbdac0 100644 --- a/operator/config/crd/bases/embeddedcluster.replicated.com_installations.yaml +++ b/operator/config/crd/bases/embeddedcluster.replicated.com_installations.yaml @@ -115,10 +115,8 @@ spec: - aarch64 - x86_64 type: string - maxItems: 2 - minItems: 1 type: array - uniqueItems: true + x-kubernetes-list-type: set binaryOverrideUrl: type: string domains: diff --git a/operator/config/crd/bases/embeddedcluster.replicated.com_kubernetesinstallations.yaml b/operator/config/crd/bases/embeddedcluster.replicated.com_kubernetesinstallations.yaml index 92f8170736..caa0d652e5 100644 --- a/operator/config/crd/bases/embeddedcluster.replicated.com_kubernetesinstallations.yaml +++ b/operator/config/crd/bases/embeddedcluster.replicated.com_kubernetesinstallations.yaml @@ -74,10 +74,8 @@ spec: - aarch64 - x86_64 type: string - maxItems: 2 - minItems: 1 type: array - uniqueItems: true + x-kubernetes-list-type: set binaryOverrideUrl: type: string domains: diff --git a/operator/schemas/config-embeddedcluster-v1beta1.json b/operator/schemas/config-embeddedcluster-v1beta1.json index ff7df2d32a..981e273084 100644 --- a/operator/schemas/config-embeddedcluster-v1beta1.json +++ b/operator/schemas/config-embeddedcluster-v1beta1.json @@ -20,9 +20,6 @@ "architecture": { "description": "Architecture holds the list of CPU architectures supported by this release.\nIf omitted, x86_64 is assumed for backward compatibility.", "type": "array", - "maxItems": 2, - "minItems": 1, - "uniqueItems": true, "items": { "description": "Architecture represents a supported CPU architecture identifier.", "type": "string", @@ -30,7 +27,8 @@ "aarch64", "x86_64" ] - } + }, + "x-kubernetes-list-type": "set" }, "binaryOverrideUrl": { "type": "string" diff --git a/operator/schemas/kubernetesinstallation-embeddedcluster-v1beta1.json b/operator/schemas/kubernetesinstallation-embeddedcluster-v1beta1.json index 9bdbc48d3a..f2bf7bf9f7 100644 --- a/operator/schemas/kubernetesinstallation-embeddedcluster-v1beta1.json +++ b/operator/schemas/kubernetesinstallation-embeddedcluster-v1beta1.json @@ -46,9 +46,6 @@ "architecture": { "description": "Architecture holds the list of CPU architectures supported by this release.\nIf omitted, x86_64 is assumed for backward compatibility.", "type": "array", - "maxItems": 2, - "minItems": 1, - "uniqueItems": true, "items": { "description": "Architecture represents a supported CPU architecture identifier.", "type": "string", @@ -56,7 +53,8 @@ "aarch64", "x86_64" ] - } + }, + "x-kubernetes-list-type": "set" }, "binaryOverrideUrl": { "type": "string" diff --git a/pkg/crds/resources.yaml b/pkg/crds/resources.yaml index c5df7f0656..6fd64f99b4 100644 --- a/pkg/crds/resources.yaml +++ b/pkg/crds/resources.yaml @@ -52,8 +52,6 @@ spec: - aarch64 - x86_64 type: string - maxItems: 2 - minItems: 1 type: array x-kubernetes-list-type: set binaryOverrideUrl: @@ -388,8 +386,6 @@ spec: - aarch64 - x86_64 type: string - maxItems: 2 - minItems: 1 type: array x-kubernetes-list-type: set binaryOverrideUrl: From eda1af8f650a0b6419e33fbdfb48e72dc4c1b799 Mon Sep 17 00:00:00 2001 From: Noah Campbell Date: Tue, 11 Nov 2025 17:32:38 -0600 Subject: [PATCH 6/8] add arch validation to linter --- pkg/lint/validator.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/lint/validator.go b/pkg/lint/validator.go index a7c8a03b77..6402cf84cd 100644 --- a/pkg/lint/validator.go +++ b/pkg/lint/validator.go @@ -169,6 +169,20 @@ func (v *Validator) ValidateFile(path string) (*ValidationResult, error) { } } + // Validate architecture values if provided + for i, arch := range config.Spec.Architecture { + val := strings.ToLower(string(arch)) + switch val { + case "aarch64", "x86_64": + // ok + default: + result.Errors = append(result.Errors, ValidationError{ + Field: fmt.Sprintf("architecture[%d]", i), + Message: fmt.Sprintf("invalid value %q; allowed values are aarch64 and x86_64", string(arch)), + }) + } + } + return result, nil } From b7b7c434e94dcda1f4958301121085db2a826364 Mon Sep 17 00:00:00 2001 From: Noah Campbell Date: Tue, 11 Nov 2025 17:40:04 -0600 Subject: [PATCH 7/8] remove lowercase wrap --- pkg/lint/validator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/lint/validator.go b/pkg/lint/validator.go index 6402cf84cd..68f4d4b9c0 100644 --- a/pkg/lint/validator.go +++ b/pkg/lint/validator.go @@ -171,7 +171,7 @@ func (v *Validator) ValidateFile(path string) (*ValidationResult, error) { // Validate architecture values if provided for i, arch := range config.Spec.Architecture { - val := strings.ToLower(string(arch)) + val := string(arch) switch val { case "aarch64", "x86_64": // ok From 887d2d8f4d737dbbba67a041f46d2a2c5af1a56e Mon Sep 17 00:00:00 2001 From: Noah Campbell Date: Wed, 12 Nov 2025 09:18:15 -0600 Subject: [PATCH 8/8] Update validator.go --- pkg/lint/validator.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/lint/validator.go b/pkg/lint/validator.go index 68f4d4b9c0..e2eb167d3e 100644 --- a/pkg/lint/validator.go +++ b/pkg/lint/validator.go @@ -176,9 +176,21 @@ func (v *Validator) ValidateFile(path string) (*ValidationResult, error) { case "aarch64", "x86_64": // ok default: + lower := strings.ToLower(val) + var suggestion string + switch lower { + case "arm64": + suggestion = "did you mean aarch64?" + case "amd64": + suggestion = "did you mean x86_64?" + } + msg := fmt.Sprintf("invalid value %q; allowed values are aarch64 and x86_64", string(arch)) + if suggestion != "" { + msg = fmt.Sprintf("%s (%s)", msg, suggestion) + } result.Errors = append(result.Errors, ValidationError{ Field: fmt.Sprintf("architecture[%d]", i), - Message: fmt.Sprintf("invalid value %q; allowed values are aarch64 and x86_64", string(arch)), + Message: msg, }) } }