Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix TestTaskRunStatus e2e test to run on s390x #3061

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion test/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
package test

import (
"runtime"
"strings"
"testing"

Expand Down Expand Up @@ -126,13 +127,17 @@ func TestTaskRunStatus(t *testing.T) {
taskRunName := "status-taskrun"

fqImageName := "busybox@sha256:895ab622e92e18d6b461d671081757af7dbaa3b00e3e28e12505af7817f73649"
if runtime.GOARCH == "s390x" {
fqImageName = "busybox@sha256:4f47c01fa91355af2865ac10fef5bf6ec9c7f42ad2321377c21e844427972977"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have quite a lot of places that uses the busybox image around, maybe we can have a common function which could be extended easily for other architectures if needed ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix is required only for places where busybox sha is specified directly. I identified 1 piece of code for e2e tests(fixed by this PR), and 2 pieces for examples.
Just busybox image is multi-arched, and expectation here, that if you have image: busybox statement it should run on all architectures without modifications.
Anyway, it's a good point for other cases (and can be applied even here), where image name for amd64 will be different to s390x or ppx64le names. Thank you for feedback, I will work on this extension.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome thank you! 🙇

}

t.Logf("Creating Task and TaskRun in namespace %s", namespace)
task := &v1beta1.Task{
ObjectMeta: metav1.ObjectMeta{Name: "status-task", Namespace: namespace},
Spec: v1beta1.TaskSpec{
// This was the digest of the latest tag as of 8/12/2019
Steps: []v1beta1.Step{{Container: corev1.Container{
Image: "busybox@sha256:895ab622e92e18d6b461d671081757af7dbaa3b00e3e28e12505af7817f73649",
Image: fqImageName,
Command: []string{"/bin/sh"},
Args: []string{"-c", "echo hello"},
}}},
Expand Down