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

bump kind #1914

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion kind-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: &kind_node_image kindest/node:v1.23.13
image: &kind_node_image kindest/node:v1.26.0
- role: worker
image: *kind_node_image
- role: worker
Expand Down
61 changes: 3 additions & 58 deletions test/integration/sonobuoy_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import (
"context"
"flag"
"fmt"
"github.com/kylelemons/godebug/pretty"
"github.com/vmware-tanzu/sonobuoy/pkg/client/results"
yaml "gopkg.in/yaml.v2"
"os"
"os/exec"
"path/filepath"
Expand All @@ -16,10 +19,6 @@ import (
"strings"
"testing"
"time"

"github.com/kylelemons/godebug/pretty"
"github.com/vmware-tanzu/sonobuoy/pkg/client/results"
yaml "gopkg.in/yaml.v2"
)

const (
Expand Down Expand Up @@ -375,60 +374,6 @@ func TestQuick(t *testing.T) {
})
}

// TestQuickLegacyFix runs a real "--mode quick" check against the cluster with the yaml from v0.54.0
// which suffered from issues with agreement regarding ResultsDir.
func TestQuickLegacyFix(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
defer cancel()

// Hardcoded namespace due to nature of test being from a file.
ns, cleanup := getNamespace(t)
// Doing a deletion check here rather than as a separate test so-as not to waste the extra compute time.
defer func(t *testing.T, ns string) {
if err := deleteComplete(t, ns); err != nil {
t.Fatalf("Failed to completely delete resources: %v", err)
}
}(t, ns)
defer cleanup(true)

// Get and modify data so it targets the right sonobuoy image and namespace.
runData, err := os.ReadFile("./testdata/issue1688.yaml")
if err != nil {
t.Fatalf("Failed to read run data file: %v", err)
}

tmpfile, err := os.CreateTemp("", "")
if err != nil {
t.Fatalf("Failed to create necessary tmpfile: %v", err)
}

curVersion := mustRunSonobuoyCommandWithContext(context.Background(), t, ns, "version --short")
imgName := strings.TrimSpace(fmt.Sprintf("sonobuoy/sonobuoy:%v", curVersion.String()))
runData = bytes.ReplaceAll(runData, []byte("REPLACE_NS"), []byte(ns))
runData = bytes.ReplaceAll(runData, []byte("REPLACE_IMAGE"), []byte(imgName))

if _, err := tmpfile.Write(runData); err != nil {
t.Fatalf("Failed to rewrite test data as needed for 1688 test: %v", err)
}
if err := tmpfile.Close(); err != nil {
t.Fatalf("Failed to close tmpfile: %v", err)
}

// Use kubectl to apply the run so that we don't have the CLI modifying the data.
args := fmt.Sprintf("apply -f %v", tmpfile.Name())
if out, err := runCommandWithContext(context.TODO(), t, kubectl, args); err != nil {
t.Fatalf("Failed to launch run for 1688: %v %v", err, out.String())
}

// Now we can use sonobuoy to wait for results.
mustRunSonobuoyCommandWithContext(ctx, t, ns, fmt.Sprintf("wait -n %v", ns))

checkStatusForPluginErrors(ctx, t, ns, "e2ecustom", 0)
tb := mustDownloadTarball(ctx, t, ns)
tb = saveToArtifacts(t, tb)
}

// deleteComplete is the logic that checks that we deleted the namespace and our clusterRole[Bindings]
func deleteComplete(t *testing.T, ns string) error {
out, err := runCommandWithContext(context.TODO(), t, kubectl, fmt.Sprintf("get clusterroles sonobuoy-serviceaccount-%v -o yaml", ns))
Expand Down