Skip to content

Commit

Permalink
Merge pull request #16045 from hakman/fix-kops-deploy
Browse files Browse the repository at this point in the history
Fix tests for multi-arch clusters
  • Loading branch information
k8s-ci-robot authored Oct 23, 2023
2 parents b427cc0 + aecae41 commit 63c69fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/e2e/kubetest2-kops/deployer/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ func (d *deployer) verifyBuildFlags() error {
if d.BuildOptions.TargetBuildArch != "" {
if !strings.HasPrefix(d.BuildOptions.TargetBuildArch, "linux/") {
return errors.New("--target-build-arch supports linux/amd64 and linux/arm64 only")
} else if d.BuildOptions.BuildKubernetes {
d.BuildOptions.TargetBuildArch = "linux/amd64"
}
}

Expand Down
5 changes: 4 additions & 1 deletion tests/e2e/kubetest2-kops/deployer/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,13 @@ func (d *deployer) env() []string {
fmt.Sprintf("HOME=%v", os.Getenv("HOME")),
fmt.Sprintf("KOPS_STATE_STORE=%v", d.stateStore()),
fmt.Sprintf("KOPS_FEATURE_FLAGS=%v", d.featureFlags()),
fmt.Sprintf("KOPS_ARCH=%s", strings.Trim(d.BuildOptions.TargetBuildArch, "linux/")),
"KOPS_RUN_TOO_NEW_VERSION=1",
}...)

if d.BuildOptions.TargetBuildArch != "" {
vars = append(vars, fmt.Sprintf("KOPS_ARCH=%s", strings.Trim(d.BuildOptions.TargetBuildArch, "linux/")))
}

// Pass-through some env vars if set (on all clouds)
for _, k := range []string{"KOPS_ARCH"} {
if v := os.Getenv(k); v != "" {
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/kubetest2-kops/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func New(opts types.Options) (types.Deployer, *pflag.FlagSet) {
d := &deployer{
commonOptions: opts,
BuildOptions: &builder.BuildOptions{
TargetBuildArch: "linux/amd64",
BuildKubernetes: false,
},
boskosHeartbeatClose: make(chan struct{}),
Expand Down

0 comments on commit 63c69fe

Please sign in to comment.