Skip to content

Commit

Permalink
change image lookup format for os images (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
Berk Dehrioglu authored Mar 7, 2024
1 parent 0bd9a54 commit ae9ccf6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions helm/cluster-aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`<br/>|
| `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`<br/>**Value pattern:** `^[-a-zA-Z0-9_\.]{1,63}$`<br/>**Default:** `"default"`|
| `global.providerSpecific.flatcarAwsAccount` | **AWS account owning Flatcar image** - AWS account ID owning the Flatcar Container Linux AMI.|**Type:** `string`<br/>**Default:** `"706635527432"`|
| `global.providerSpecific.osImageVariant` | **OS image variant**|**Type:** `string`<br/>**Default:** `"2"`|
| `global.providerSpecific.region` | **Region**|**Type:** `string`<br/>|

### Apps
Expand Down
10 changes: 8 additions & 2 deletions helm/cluster-aws/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions helm/cluster-aws/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions helm/cluster-aws/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ global:
providerSpecific:
awsClusterRoleIdentityName: default
flatcarAwsAccount: "706635527432"
osImageVariant: "2"
internal:
migration: {}
kubectlImage:
Expand Down

0 comments on commit ae9ccf6

Please sign in to comment.