Skip to content

Commit

Permalink
test: helm index fix
Browse files Browse the repository at this point in the history
Signed-off-by: Blake Pettersson <[email protected]>
  • Loading branch information
blakepettersson committed Sep 24, 2024
1 parent 5b11c0d commit 9cd89f9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/e2e/fixture/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
goerrors "errors"
"fmt"
"io"
"net"
"os"
"os/user"
Expand Down Expand Up @@ -686,7 +687,6 @@ func initTestContainers(ctx context.Context) {
port, _ := e2eServer.MappedPort(ctx, "2222")
mappedSSHPort = port.Port()

// TODO: Figure out Helm error
port, _ = e2eServer.MappedPort(ctx, "9080")
mappedHelmHttpPort = port.Port()

Expand All @@ -702,6 +702,22 @@ func initTestContainers(ctx context.Context) {
port, _ = ociRegistry.MappedPort(ctx, "5000")
MappedOCIRegistryPort = port.Port()

// TODO: Figure nicer way to template helm index files with the forwarded port
c, reader, err := e2eServer.Exec(ctx, []string{"sudo", "sed", "-i", fmt.Sprintf("s/9080/%s/g", mappedHelmHttpPort), "/tmp/argo-e2e/testdata.git/helm-repo/local/index.yaml"})
CheckError(err)

c, reader, err = e2eServer.Exec(ctx, []string{"sudo", "sed", "-i", fmt.Sprintf("s/9080/%s/g", mappedHelmHttpPort), "/tmp/argo-e2e/testdata.git/helm-repo/local2/index.yaml"})
CheckError(err)

c, reader, err = e2eServer.Exec(ctx, []string{"sudo", "sed", "-i", fmt.Sprintf("s/9080/%s/g", mappedHelmHttpPort), "/tmp/argo-e2e/testdata.git/helm-repo/remote/index.yaml"})
CheckError(err)

if c != 0 {
buf := new(strings.Builder)
_, err = io.Copy(buf, reader)
panic(buf.String())
}

k3sContainer, err := k3s.RunContainer(ctx,
testcontainers.WithImage(fmt.Sprintf("rancher/k3s:%s-k3s1", k3sVersion)),
testcontainers.WithWaitStrategy(wait.ForExec([]string{"kubectl", "wait", "--timeout=60s", "apiservice", "v1beta1.metrics.k8s.io", "--for", "condition=Available=True"})),
Expand Down

0 comments on commit 9cd89f9

Please sign in to comment.