Skip to content

Commit

Permalink
Merge pull request #4 from bxy4543/fix/e2e_apply_multi_infra
Browse files Browse the repository at this point in the history
fix multi e2e apply test with infra
  • Loading branch information
bxy4543 authored Jul 20, 2023
2 parents ed40683 + a22f5f0 commit 02ba476
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e_test_apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
permissions:
issues: write
strategy:
fail-fast: false
matrix:
arch: [ arm64, amd64 ]
outputs:
Expand Down
12 changes: 12 additions & 0 deletions test/e2e/suites/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"strings"
"time"

"github.com/labring/sealos/test/e2e/suites/operators"

"github.com/labring/sealos/test/e2e/testhelper/utils"

"github.com/labring/sealos/pkg/types/v1beta1"
Expand Down Expand Up @@ -107,6 +109,16 @@ func (a *Applier) initImage() {
}
err = a.RemoteSealosCmd.ImageLoad(a.Infra.PatchImageTar)
utils.CheckErr(err)
images, err := operators.NewFakeImage(a.RemoteSealosCmd).ListImages(true)
utils.CheckErr(err)
for _, image := range images {
for i := range image.Names {
if strings.Contains(image.Names[i], "sealos-patch") {
a.Infra.PatchImageName = image.Names[i]
break
}
}
}
} else {
err = a.RemoteSealosCmd.ImagePull(&cmd2.PullOptions{
ImageRefs: []string{a.Infra.PatchImageName},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/suites/operators/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type fakeImageClient struct {
*cmd.SealosCmd
}

func newFakeImage(sealosCmd *cmd.SealosCmd) FakeImageInterface {
func NewFakeImage(sealosCmd *cmd.SealosCmd) FakeImageInterface {
return &fakeImageClient{
SealosCmd: sealosCmd,
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/suites/operators/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewFakeClient(clusterName string) *FakeClient {
}
localCmd := cmd.NewSealosCmd(settings.E2EConfig.SealosBinPath, &cmd.LocalCmd{})
return &FakeClient{
Image: newFakeImage(localCmd),
Image: NewFakeImage(localCmd),
CRI: newCRIClient(localCmd),
Cluster: newClusterClient(localCmd, clusterName),
Cert: newCertClient(localCmd, clusterName),
Expand Down

0 comments on commit 02ba476

Please sign in to comment.