Skip to content

Commit

Permalink
arm64 RKE2 CNI download logic (#528)
Browse files Browse the repository at this point in the history
* arm64 rke2 cni download logic
  • Loading branch information
dbw7 authored Aug 14, 2024
1 parent fa484c8 commit 14a9509
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## General

* Allow RKE2 deployments with Calico, Cilium and Multus on aarch64 platforms

## API

### Image Definition Changes
Expand Down
9 changes: 0 additions & 9 deletions pkg/kubernetes/artefact_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,14 @@ func rke2ImageArtefacts(cni string, multusEnabled bool, arch image.Arch) ([]stri
case image.CNITypeCanal:
artefacts = append(artefacts, fmt.Sprintf(rke2CanalImages, artefactArch))
case image.CNITypeCalico:
if arch == image.ArchTypeARM {
return nil, fmt.Errorf("calico is not supported on %s platforms", arch)
}
artefacts = append(artefacts, fmt.Sprintf(rke2CalicoImages, artefactArch))
case image.CNITypeCilium:
if arch == image.ArchTypeARM {
return nil, fmt.Errorf("cilium is not supported on %s platforms", arch)
}
artefacts = append(artefacts, fmt.Sprintf(rke2CiliumImages, artefactArch))
default:
return nil, fmt.Errorf("unsupported CNI: %s", cni)
}

if multusEnabled {
if arch == image.ArchTypeARM {
return nil, fmt.Errorf("multus is not supported on %s platforms", arch)
}
artefacts = append(artefacts, fmt.Sprintf(rke2MultusImages, artefactArch))
}

Expand Down
28 changes: 19 additions & 9 deletions pkg/kubernetes/artefact_downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,33 @@ func TestRKE2ImageArtefacts(t *testing.T) {
},
},
{
name: "aarch64 artefacts with calico CNI",
cni: image.CNITypeCalico,
arch: image.ArchTypeARM,
expectedError: "calico is not supported on aarch64 platforms",
name: "aarch64 artefacts with calico CNI",
cni: image.CNITypeCalico,
arch: image.ArchTypeARM,
expectedArtefacts: []string{
"rke2-images-core.linux-arm64.tar.zst",
"rke2-images-calico.linux-arm64.tar.zst",
},
},
{
name: "aarch64 artefacts with cilium CNI",
cni: image.CNITypeCilium,
arch: image.ArchTypeARM,
expectedError: "cilium is not supported on aarch64 platforms",
name: "aarch64 artefacts with cilium CNI",
cni: image.CNITypeCilium,
arch: image.ArchTypeARM,
expectedArtefacts: []string{
"rke2-images-core.linux-arm64.tar.zst",
"rke2-images-cilium.linux-arm64.tar.zst",
},
},
{
name: "aarch64 artefacts with canal CNI + multus",
cni: image.CNITypeCanal,
multusEnabled: true,
arch: image.ArchTypeARM,
expectedError: "multus is not supported on aarch64 platforms",
expectedArtefacts: []string{
"rke2-images-core.linux-arm64.tar.zst",
"rke2-images-canal.linux-arm64.tar.zst",
"rke2-images-multus.linux-arm64.tar.zst",
},
},
}

Expand Down

0 comments on commit 14a9509

Please sign in to comment.