Skip to content

Commit

Permalink
Add architecture tolerations to bundleUnpacker job (#2958)
Browse files Browse the repository at this point in the history
Signed-off-by: James Bartlett <[email protected]>
  • Loading branch information
JamesMBartlett authored Jul 14, 2023
1 parent f8b1721 commit 4564b26
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pkg/controller/bundle/bundle_unpacker.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,28 @@ func (c *ConfigMapUnpacker) job(cmRef *corev1.ObjectReference, bundlePath string
NodeSelector: map[string]string{
"kubernetes.io/os": "linux",
},
Tolerations: []corev1.Toleration{
{
Key: "kubernetes.io/arch",
Value: "amd64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "arm64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "ppc64le",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "s390x",
Operator: "Equal",
},
},
},
},
},
Expand Down
132 changes: 132 additions & 0 deletions pkg/controller/bundle/bundle_unpacker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,28 @@ func TestConfigMapUnpacker(t *testing.T) {
NodeSelector: map[string]string{
"kubernetes.io/os": "linux",
},
Tolerations: []corev1.Toleration{
{
Key: "kubernetes.io/arch",
Value: "amd64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "arm64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "ppc64le",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "s390x",
Operator: "Equal",
},
},
},
},
},
Expand Down Expand Up @@ -542,6 +564,28 @@ func TestConfigMapUnpacker(t *testing.T) {
NodeSelector: map[string]string{
"kubernetes.io/os": "linux",
},
Tolerations: []corev1.Toleration{
{
Key: "kubernetes.io/arch",
Value: "amd64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "arm64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "ppc64le",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "s390x",
Operator: "Equal",
},
},
},
},
},
Expand Down Expand Up @@ -788,6 +832,28 @@ func TestConfigMapUnpacker(t *testing.T) {
NodeSelector: map[string]string{
"kubernetes.io/os": "linux",
},
Tolerations: []corev1.Toleration{
{
Key: "kubernetes.io/arch",
Value: "amd64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "arm64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "ppc64le",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "s390x",
Operator: "Equal",
},
},
},
},
},
Expand Down Expand Up @@ -1028,6 +1094,28 @@ func TestConfigMapUnpacker(t *testing.T) {
NodeSelector: map[string]string{
"kubernetes.io/os": "linux",
},
Tolerations: []corev1.Toleration{
{
Key: "kubernetes.io/arch",
Value: "amd64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "arm64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "ppc64le",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "s390x",
Operator: "Equal",
},
},
},
},
},
Expand Down Expand Up @@ -1238,6 +1326,28 @@ func TestConfigMapUnpacker(t *testing.T) {
NodeSelector: map[string]string{
"kubernetes.io/os": "linux",
},
Tolerations: []corev1.Toleration{
{
Key: "kubernetes.io/arch",
Value: "amd64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "arm64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "ppc64le",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "s390x",
Operator: "Equal",
},
},
},
},
},
Expand Down Expand Up @@ -1459,6 +1569,28 @@ func TestConfigMapUnpacker(t *testing.T) {
NodeSelector: map[string]string{
"kubernetes.io/os": "linux",
},
Tolerations: []corev1.Toleration{
{
Key: "kubernetes.io/arch",
Value: "amd64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "arm64",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "ppc64le",
Operator: "Equal",
},
{
Key: "kubernetes.io/arch",
Value: "s390x",
Operator: "Equal",
},
},
},
},
},
Expand Down

0 comments on commit 4564b26

Please sign in to comment.