Skip to content

Commit

Permalink
Support upstream Cluster API images
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Demicev <[email protected]>
  • Loading branch information
alexander-demicev committed Dec 9, 2024
1 parent 6c0550e commit 9fd239b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 10 additions & 0 deletions pkg/verify/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ var imageRepo = map[string]string{
"rancher/nginx-ingress-controller": "rancher/ingress-nginx",
"rancher/rancher": "rancher/rancher-prime",
}

var upstreamImageRepo = map[string]string{
"rancher/cluster-api-controller": "https://github.com/rancher/clusterapi-forks/.github/workflows/core.yaml@refs/heads/main",
"rancher/cluster-api-aws-controller": "https://github.com/rancher/clusterapi-forks/.github/workflows/aws.yaml@refs/heads/main",
"rancher/cluster-api-azure-controller": "https://github.com/rancher/clusterapi-forks/.github/workflows/azure.yaml@refs/heads/main",
"rancher/cluster-api-gcp-controller": "https://github.com/rancher/clusterapi-forks/.github/workflows/gcp.yaml@refs/heads/main",
"rancher/cluster-api-vsphere-controller": "https://github.com/rancher/clusterapi-forks/.github/workflows/vsphere.yaml@refs/heads/main",
"rancher/cluster-api-metal3-controller": "https://github.com/rancher/clusterapi-forks/.github/workflows/metal3.yaml@refs/heads/main",
"rancher/cluster-api-metal3-ipam-controller": "https://github.com/rancher/clusterapi-forks/.github/workflows/metal3-ipam.yaml@refs/heads/main",
}
8 changes: 5 additions & 3 deletions pkg/verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ func certIdentity(imageName string) (string, error) {

repo = overrideRepo(repo)

indentity := fmt.Sprintf(
"https://github.com/%s/.github/workflows/release.yml@refs/tags/%s", repo, ref)
// Check if the image is an upstream image and has a different cert identity.
if identity, isUpstreamRepo := upstreamImageRepo[repo]; isUpstreamRepo {
return identity, nil
}

return indentity, nil
return fmt.Sprintf("https://github.com/%s/.github/workflows/release.yml@refs/tags/%s", repo, ref), nil
}

func overrideRepo(repo string) string {
Expand Down

0 comments on commit 9fd239b

Please sign in to comment.