Skip to content

Commit

Permalink
Checking if artifact image is nil (#4114)
Browse files Browse the repository at this point in the history
* checking if artifact image is nil

Signed-off-by: jonahjon <jonahjones094@gmail.com>

* golden bundle add

Signed-off-by: jonahjon <jonahjones094@gmail.com>

Signed-off-by: jonahjon <jonahjones094@gmail.com>
  • Loading branch information
jonahjon authored Nov 16, 2022
1 parent e1f11eb commit e550d4b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
6 changes: 4 additions & 2 deletions release/pkg/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,10 @@ func GetPackagesImageTags(eksArtifacts map[string][]releasetypes.Artifact) (map[
m := make(map[string]string)
for _, artifacts := range eksArtifacts {
for _, artifact := range artifacts {
if artifact.Image.AssetName == "eks-anywhere-packages" || artifact.Image.AssetName == "ecr-token-refresher" {
m[artifact.Image.AssetName] = artifact.Image.ReleaseImageURI
if artifact.Image != nil {
if artifact.Image.AssetName == "eks-anywhere-packages" || artifact.Image.AssetName == "ecr-token-refresher" {
m[artifact.Image.AssetName] = artifact.Image.ReleaseImageURI
}
}
}
}
Expand Down
40 changes: 20 additions & 20 deletions release/pkg/test/testdata/main-bundle-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ spec:
description: Helm chart for eks-anywhere-packages
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.20-eks-a-v0.0.0-dev-build.1
packageController:
arch:
- amd64
Expand All @@ -460,7 +460,7 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
os: linux
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.20-eks-a-v0.0.0-dev-build.1
tokenRefresher:
arch:
- amd64
Expand All @@ -469,8 +469,8 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: ecr-token-refresher
os: linux
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.19-eks-a-v0.0.0-dev-build.1
version: v0.2.19+abcdef1
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.20-eks-a-v0.0.0-dev-build.1
version: v0.2.20+abcdef1
snow:
components:
uri: https://release-bucket/artifacts/v0.0.0-dev-build.0/cluster-api-provider-aws-snow/manifests/infrastructure-snow/v0.1.8/infrastructure-components.yaml
Expand Down Expand Up @@ -1210,7 +1210,7 @@ spec:
description: Helm chart for eks-anywhere-packages
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.20-eks-a-v0.0.0-dev-build.1
packageController:
arch:
- amd64
Expand All @@ -1219,7 +1219,7 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
os: linux
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.20-eks-a-v0.0.0-dev-build.1
tokenRefresher:
arch:
- amd64
Expand All @@ -1228,8 +1228,8 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: ecr-token-refresher
os: linux
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.19-eks-a-v0.0.0-dev-build.1
version: v0.2.19+abcdef1
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.20-eks-a-v0.0.0-dev-build.1
version: v0.2.20+abcdef1
snow:
components:
uri: https://release-bucket/artifacts/v0.0.0-dev-build.0/cluster-api-provider-aws-snow/manifests/infrastructure-snow/v0.1.8/infrastructure-components.yaml
Expand Down Expand Up @@ -1969,7 +1969,7 @@ spec:
description: Helm chart for eks-anywhere-packages
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.20-eks-a-v0.0.0-dev-build.1
packageController:
arch:
- amd64
Expand All @@ -1978,7 +1978,7 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
os: linux
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.20-eks-a-v0.0.0-dev-build.1
tokenRefresher:
arch:
- amd64
Expand All @@ -1987,8 +1987,8 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: ecr-token-refresher
os: linux
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.19-eks-a-v0.0.0-dev-build.1
version: v0.2.19+abcdef1
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.20-eks-a-v0.0.0-dev-build.1
version: v0.2.20+abcdef1
snow:
components:
uri: https://release-bucket/artifacts/v0.0.0-dev-build.0/cluster-api-provider-aws-snow/manifests/infrastructure-snow/v0.1.8/infrastructure-components.yaml
Expand Down Expand Up @@ -2728,7 +2728,7 @@ spec:
description: Helm chart for eks-anywhere-packages
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.20-eks-a-v0.0.0-dev-build.1
packageController:
arch:
- amd64
Expand All @@ -2737,7 +2737,7 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
os: linux
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.20-eks-a-v0.0.0-dev-build.1
tokenRefresher:
arch:
- amd64
Expand All @@ -2746,8 +2746,8 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: ecr-token-refresher
os: linux
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.19-eks-a-v0.0.0-dev-build.1
version: v0.2.19+abcdef1
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.20-eks-a-v0.0.0-dev-build.1
version: v0.2.20+abcdef1
snow:
components:
uri: https://release-bucket/artifacts/v0.0.0-dev-build.0/cluster-api-provider-aws-snow/manifests/infrastructure-snow/v0.1.8/infrastructure-components.yaml
Expand Down Expand Up @@ -3469,7 +3469,7 @@ spec:
description: Helm chart for eks-anywhere-packages
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:0.2.20-eks-a-v0.0.0-dev-build.1
packageController:
arch:
- amd64
Expand All @@ -3478,7 +3478,7 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: eks-anywhere-packages
os: linux
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.19-eks-a-v0.0.0-dev-build.1
uri: public.ecr.aws/release-container-registry/eks-anywhere-packages:v0.2.20-eks-a-v0.0.0-dev-build.1
tokenRefresher:
arch:
- amd64
Expand All @@ -3487,8 +3487,8 @@ spec:
imageDigest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
name: ecr-token-refresher
os: linux
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.19-eks-a-v0.0.0-dev-build.1
version: v0.2.19+abcdef1
uri: public.ecr.aws/release-container-registry/ecr-token-refresher:v0.2.20-eks-a-v0.0.0-dev-build.1
version: v0.2.20+abcdef1
snow:
components:
uri: https://release-bucket/artifacts/v0.0.0-dev-build.0/cluster-api-provider-aws-snow/manifests/infrastructure-snow/v0.1.8/infrastructure-components.yaml
Expand Down

0 comments on commit e550d4b

Please sign in to comment.