Skip to content

Commit

Permalink
debug: attempting to fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-prindle committed Oct 17, 2023
1 parent b6f14ae commit 3076bf1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ ENV SSL_CERT_DIR=/kaniko/ssl/certs
FROM kaniko-base-slim AS kaniko-base

COPY --from=builder --chown=0:0 /usr/local/bin/docker-credential-gcr /kaniko/docker-credential-gcr
COPY --from=builder --chown=0:0 /usr/local/bin/docker-credential-gcr /kaniko/docker-credential-gcloud
COPY --from=builder --chown=0:0 /usr/local/bin/docker-credential-ecr-login /kaniko/docker-credential-ecr-login
COPY --from=builder --chown=0:0 /usr/local/bin/docker-credential-acr-env /kaniko/docker-credential-acr-env

Expand Down
20 changes: 19 additions & 1 deletion integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package integration

import (
"archive/tar"
"bytes"
"context"
"encoding/json"
"flag"
Expand Down Expand Up @@ -601,6 +602,23 @@ func buildImage(t *testing.T, dockerfile string, imageBuilder *DockerFileBuilder
t.Logf("Building image '%v'...", dockerfile)

if err := imageBuilder.BuildImage(t, config, dockerfilesPath, dockerfile); err != nil {
// Define the command and arguments
cmd := exec.Command("kubectl", "--kubeconfig=/etc/rancher/k3s/k3s.yaml", "get", "po", "-n", "kube-system")

// Create a buffer to capture the output
var out bytes.Buffer
cmd.Stdout = &out

// Run the command
err := cmd.Run()
if err != nil {
log.Fatal(err)
}

// Store the output in a string
cmdOutput := out.String()

t.Errorf("cmdOutput: %s\n", cmdOutput)
t.Errorf("Error building image: %s", err)
t.FailNow()
}
Expand Down Expand Up @@ -1003,7 +1021,7 @@ func initIntegrationTestConfig() *integrationTestConfig {
}

if c.isGcrRepository() && c.gcsBucket == "" {
log.Fatalf("You must provide a gcs bucket when using a Google Container Registry (\"%s\" was provided)", c.imageRepo)
log.Fatalf("You must provide a gcs bucket when using a Google Container Registry (\"%s\" was provided)", c.gcsBucket)
}
if !strings.HasSuffix(c.imageRepo, "/") {
c.imageRepo = c.imageRepo + "/"
Expand Down

0 comments on commit 3076bf1

Please sign in to comment.