From ae9ccf6a5db845d28f5fb28b2982ab87d349b0c1 Mon Sep 17 00:00:00 2001 From: Berk Dehrioglu Date: Thu, 7 Mar 2024 11:14:58 +0300 Subject: [PATCH] change image lookup format for os images (#525) --- CHANGELOG.md | 4 ++++ helm/cluster-aws/README.md | 1 + helm/cluster-aws/templates/_helpers.tpl | 10 ++++++++-- helm/cluster-aws/values.schema.json | 5 +++++ helm/cluster-aws/values.yaml | 1 + 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1c8ae11..d6a06341 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Change image lookup format for base OS image. + ## [0.64.2] - 2024-03-06 ### Changed diff --git a/helm/cluster-aws/README.md b/helm/cluster-aws/README.md index 60dcbfbf..6a7b033a 100644 --- a/helm/cluster-aws/README.md +++ b/helm/cluster-aws/README.md @@ -22,6 +22,7 @@ Properties within the `.global.providerSpecific` object | `global.providerSpecific.ami` | **Amazon machine image (AMI)** - If specified, this image will be used to provision EC2 instances.|**Type:** `string`
| | `global.providerSpecific.awsClusterRoleIdentityName` | **Cluster role identity name** - Name of an AWSClusterRoleIdentity object. Learn more at https://docs.giantswarm.io/getting-started/cloud-provider-accounts/cluster-api/aws/#configure-the-awsclusterroleidentity .|**Type:** `string`
**Value pattern:** `^[-a-zA-Z0-9_\.]{1,63}$`
**Default:** `"default"`| | `global.providerSpecific.flatcarAwsAccount` | **AWS account owning Flatcar image** - AWS account ID owning the Flatcar Container Linux AMI.|**Type:** `string`
**Default:** `"706635527432"`| +| `global.providerSpecific.osImageVariant` | **OS image variant**|**Type:** `string`
**Default:** `"2"`| | `global.providerSpecific.region` | **Region**|**Type:** `string`
| ### Apps diff --git a/helm/cluster-aws/templates/_helpers.tpl b/helm/cluster-aws/templates/_helpers.tpl index ecc69de8..3753dcb0 100644 --- a/helm/cluster-aws/templates/_helpers.tpl +++ b/helm/cluster-aws/templates/_helpers.tpl @@ -66,10 +66,16 @@ ami: {{- else -}} ami: {} imageLookupBaseOS: "flatcar-stable" -imageLookupFormat: {{ "capa-ami-{{.BaseOS}}-v{{.K8sVersion}}-gs" }} +{{- $suffix := .Values.global.providerSpecific.osImageVariant }} +{{- if $suffix }} + {{- $suffix = printf "-%s-gs" $suffix }} +{{- else }} + {{- $suffix = "-gs" }} +{{- end }} +imageLookupFormat: {{ "capa-ami-{{.BaseOS}}-v{{.K8sVersion}}" }}{{$suffix}} imageLookupOrg: "706635527432" {{- end }} -{{- end -}} +{{- end }} {{/* Hash function based on data provided diff --git a/helm/cluster-aws/values.schema.json b/helm/cluster-aws/values.schema.json index db9a5783..0da31566 100644 --- a/helm/cluster-aws/values.schema.json +++ b/helm/cluster-aws/values.schema.json @@ -1093,6 +1093,11 @@ "description": "AWS account ID owning the Flatcar Container Linux AMI.", "default": "706635527432" }, + "osImageVariant": { + "type": "string", + "title": "OS image variant", + "default": "2" + }, "region": { "type": "string", "title": "Region" diff --git a/helm/cluster-aws/values.yaml b/helm/cluster-aws/values.yaml index 521a9622..abcd4582 100644 --- a/helm/cluster-aws/values.yaml +++ b/helm/cluster-aws/values.yaml @@ -200,6 +200,7 @@ global: providerSpecific: awsClusterRoleIdentityName: default flatcarAwsAccount: "706635527432" + osImageVariant: "2" internal: migration: {} kubectlImage: