From 0dbc7a1d33f9d8da011b5f59308398acfec3cfd9 Mon Sep 17 00:00:00 2001 From: peppi-lotta Date: Thu, 13 Jun 2024 09:55:18 +0000 Subject: [PATCH] Rewrite fetch_target_logs.sh in Golang Signed-off-by: peppi-lotta --- scripts/fetch_target_logs.sh | 31 ---- test/e2e/common.go | 77 ---------- test/e2e/logcollector.go | 221 ++++++++++++++++++++++++++++ test/e2e/pivoting.go | 35 ++--- test/e2e/upgrade_clusterctl_test.go | 28 +--- test/go.mod | 9 ++ test/go.sum | 17 +++ 7 files changed, 266 insertions(+), 152 deletions(-) delete mode 100755 scripts/fetch_target_logs.sh create mode 100644 test/e2e/logcollector.go diff --git a/scripts/fetch_target_logs.sh b/scripts/fetch_target_logs.sh deleted file mode 100755 index b43fb54484..0000000000 --- a/scripts/fetch_target_logs.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -set -x - -DIR_NAME="/tmp/target_cluster_logs" -NAMESPACES="$(kubectl --kubeconfig="${KUBECONFIG_WORKLOAD}" get namespace -o jsonpath='{.items[*].metadata.name}')" -mkdir -p "${DIR_NAME}" - -set +x - -for NAMESPACE in ${NAMESPACES} -do - mkdir -p "${DIR_NAME}/${NAMESPACE}" -# Fetch logs from target cluster according to the pods name - PODS="$(kubectl --kubeconfig="${KUBECONFIG_WORKLOAD}" get pods -n "${NAMESPACE}" -o jsonpath='{.items[*].metadata.name}')" - for POD in ${PODS} - do - mkdir -p "${DIR_NAME}/${NAMESPACE}/${POD}" - kubectl --kubeconfig="${KUBECONFIG_WORKLOAD}" describe pods -n "${NAMESPACE}" "${POD}" \ - > "${DIR_NAME}/${NAMESPACE}/${POD}/stdout_describe.log" \ - 2> "${DIR_NAME}/${NAMESPACE}/${POD}/stderr_describe.log" - CONTAINERS="$(kubectl --kubeconfig="${KUBECONFIG_WORKLOAD}" get pods -n "${NAMESPACE}" "${POD}" -o jsonpath='{.spec.containers[*].name}')" - for CONTAINER in ${CONTAINERS} - do - LOG_DIR="${DIR_NAME}/${NAMESPACE}/${POD}/${CONTAINER}" - mkdir -p "${LOG_DIR}" - kubectl --kubeconfig="${KUBECONFIG_WORKLOAD}" logs -n "${NAMESPACE}" "${POD}" "${CONTAINER}" \ - > "${LOG_DIR}/stdout.log" 2> "${LOG_DIR}/stderr.log" - done - done -done \ No newline at end of file diff --git a/test/e2e/common.go b/test/e2e/common.go index a472e68057..7e666b96c2 100644 --- a/test/e2e/common.go +++ b/test/e2e/common.go @@ -38,7 +38,6 @@ import ( "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" testexec "sigs.k8s.io/cluster-api/test/framework/exec" @@ -721,82 +720,6 @@ func runCommand(logFolder, filename, machineIP, user, command string) error { return nil } -type Metal3LogCollector struct{} - -// CollectMachineLog collects specific logs from machines. -func (Metal3LogCollector) CollectMachineLog(ctx context.Context, cli client.Client, m *clusterv1.Machine, outputPath string) error { - VMName, err := MachineToVMName(ctx, cli, m) - if err != nil { - return fmt.Errorf("error while fetching the VM name: %w", err) - } - - qemuFolder := path.Join(outputPath, VMName) - if err := os.MkdirAll(qemuFolder, 0o750); err != nil { - fmt.Fprintf(GinkgoWriter, "couldn't create directory %q : %s\n", qemuFolder, err) - } - - serialLog := fmt.Sprintf("/var/log/libvirt/qemu/%s-serial0.log", VMName) - if _, err := os.Stat(serialLog); os.IsNotExist(err) { - return fmt.Errorf("error finding the serial log: %w", err) - } - - copyCmd := fmt.Sprintf("sudo cp %s %s", serialLog, qemuFolder) - cmd := exec.Command("/bin/sh", "-c", copyCmd) // #nosec G204:gosec - if output, err := cmd.Output(); err != nil { - return fmt.Errorf("something went wrong when executing '%s': %w, output: %s", cmd.String(), err, output) - } - setPermsCmd := fmt.Sprintf("sudo chmod -v 777 %s", path.Join(qemuFolder, filepath.Base(serialLog))) - cmd = exec.Command("/bin/sh", "-c", setPermsCmd) // #nosec G204:gosec - output, err := cmd.Output() - if err != nil { - return fmt.Errorf("error changing file permissions after copying: %w, output: %s", err, output) - } - - kubeadmCP := framework.GetKubeadmControlPlaneByCluster(ctx, framework.GetKubeadmControlPlaneByClusterInput{ - Lister: cli, - ClusterName: m.Spec.ClusterName, - Namespace: m.Namespace, - }) - - if len(kubeadmCP.Spec.KubeadmConfigSpec.Users) < 1 { - return fmt.Errorf("no valid credentials found: KubeadmConfigSpec.Users is empty") - } - creds := kubeadmCP.Spec.KubeadmConfigSpec.Users[0] - - // get baremetal ip pool for retreiving ip addresses of controlpane and worker nodes - baremetalv4Pool, _ := GetIPPools(ctx, cli, m.Spec.ClusterName, m.Namespace) - Expect(baremetalv4Pool).ToNot(BeEmpty()) - - ip, err := MachineToIPAddress(ctx, cli, m, baremetalv4Pool[0]) - if err != nil { - return fmt.Errorf("couldn't get IP address of machine: %w", err) - } - - commands := map[string]string{ - "cloud-final.log": "journalctl --no-pager -u cloud-final", - "kubelet.log": "journalctl --no-pager -u kubelet.service", - "containerd.log": "journalctl --no-pager -u containerd.service", - } - - for title, cmd := range commands { - err = runCommand(outputPath, title, ip, creds.Name, cmd) - if err != nil { - return fmt.Errorf("couldn't gather logs: %w", err) - } - } - - Logf("Successfully collected logs for machine %s", m.Name) - return nil -} - -func (Metal3LogCollector) CollectMachinePoolLog(_ context.Context, _ client.Client, _ *expv1.MachinePool, _ string) error { - return fmt.Errorf("CollectMachinePoolLog not implemented") -} - -func (Metal3LogCollector) CollectInfrastructureLogs(_ context.Context, _ client.Client, _ *clusterv1.Cluster, _ string) error { - return fmt.Errorf("CollectInfrastructureLogs not implemented") -} - // LabelCRD is adding the specified labels to the CRD crdName. Existing labels with matching keys will be overwritten. func LabelCRD(ctx context.Context, c client.Client, crdName string, labels map[string]string) error { crd := &apiextensionsv1.CustomResourceDefinition{} diff --git a/test/e2e/logcollector.go b/test/e2e/logcollector.go new file mode 100644 index 0000000000..d317438d94 --- /dev/null +++ b/test/e2e/logcollector.go @@ -0,0 +1,221 @@ +package e2e + +import ( + "bytes" + "context" + "fmt" + "io" + "os" + "os/exec" + "path" + "path/filepath" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/kubectl/pkg/describe" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" + "sigs.k8s.io/cluster-api/test/framework" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type Metal3LogCollector struct{} + +// CollectMachineLog collects specific logs from machines. +func (Metal3LogCollector) CollectMachineLog(ctx context.Context, cli client.Client, m *clusterv1.Machine, outputPath string) error { + VMName, err := MachineToVMName(ctx, cli, m) + if err != nil { + return fmt.Errorf("error while fetching the VM name: %w", err) + } + + qemuFolder := path.Join(outputPath, VMName) + if err := os.MkdirAll(qemuFolder, 0o750); err != nil { + fmt.Fprintf(GinkgoWriter, "couldn't create directory %q : %s\n", qemuFolder, err) + } + + serialLog := fmt.Sprintf("/var/log/libvirt/qemu/%s-serial0.log", VMName) + if _, err := os.Stat(serialLog); os.IsNotExist(err) { + return fmt.Errorf("error finding the serial log: %w", err) + } + + copyCmd := fmt.Sprintf("sudo cp %s %s", serialLog, qemuFolder) + cmd := exec.Command("/bin/sh", "-c", copyCmd) // #nosec G204:gosec + if output, err := cmd.Output(); err != nil { + return fmt.Errorf("something went wrong when executing '%s': %w, output: %s", cmd.String(), err, output) + } + setPermsCmd := fmt.Sprintf("sudo chmod -v 777 %s", path.Join(qemuFolder, filepath.Base(serialLog))) + cmd = exec.Command("/bin/sh", "-c", setPermsCmd) // #nosec G204:gosec + output, err := cmd.Output() + if err != nil { + return fmt.Errorf("error changing file permissions after copying: %w, output: %s", err, output) + } + + kubeadmCP := framework.GetKubeadmControlPlaneByCluster(ctx, framework.GetKubeadmControlPlaneByClusterInput{ + Lister: cli, + ClusterName: m.Spec.ClusterName, + Namespace: m.Namespace, + }) + + if len(kubeadmCP.Spec.KubeadmConfigSpec.Users) < 1 { + return fmt.Errorf("no valid credentials found: KubeadmConfigSpec.Users is empty") + } + creds := kubeadmCP.Spec.KubeadmConfigSpec.Users[0] + + // get baremetal ip pool for retreiving ip addresses of controlpane and worker nodes + baremetalv4Pool, _ := GetIPPools(ctx, cli, m.Spec.ClusterName, m.Namespace) + Expect(baremetalv4Pool).ToNot(BeEmpty()) + + ip, err := MachineToIPAddress(ctx, cli, m, baremetalv4Pool[0]) + if err != nil { + return fmt.Errorf("couldn't get IP address of machine: %w", err) + } + + commands := map[string]string{ + "cloud-final.log": "journalctl --no-pager -u cloud-final", + "kubelet.log": "journalctl --no-pager -u kubelet.service", + "containerd.log": "journalctl --no-pager -u containerd.service", + } + + for title, cmd := range commands { + err = runCommand(outputPath, title, ip, creds.Name, cmd) + if err != nil { + return fmt.Errorf("couldn't gather logs: %w", err) + } + } + + Logf("Successfully collected logs for machine %s", m.Name) + return nil +} + +func (Metal3LogCollector) CollectInfrastructureLogs(_ context.Context, _ client.Client, _ *clusterv1.Cluster, _ string) error { + return fmt.Errorf("CollectInfrastructureLogs not implemented") +} + +func (Metal3LogCollector) CollectMachinePoolLog(_ context.Context, _ client.Client, _ *expv1.MachinePool, _ string) error { + return fmt.Errorf("CollectMachinePoolLog not implemented") +} + +func FetchManifests(_ framework.ClusterProxy) error { + return fmt.Errorf("FetchManifests not implemented") +} + +func FetchClusterLogs(clusterProxy framework.ClusterProxy, outputPath string) error { + ctx := context.Background() + baseDir := filepath.Join(outputPath, clusterProxy.GetName()) + err := os.MkdirAll(baseDir, 0775) + if err != nil { + return fmt.Errorf("couldn't create directory: %v", err) + } + + // get the clientset + clientset := clusterProxy.GetClientSet() + + // Print the Pods' information to file + // This does the same thing as: + // kubectl --kubeconfig="${KUBECONFIG_WORKLOAD}" get pods -A + out, err := exec.Command("kubectl", "--kubeconfig", clusterProxy.GetKubeconfigPath(), "get", "pods", "-A", "-o", "wide").Output() // #nosec G204:gosec + if err != nil { + return fmt.Errorf("couldn't get pods: %v", err) + } + file := filepath.Join(baseDir, "pods.log") + err = os.WriteFile(file, out, 0600) + if err != nil { + return fmt.Errorf("couldn't write to file: %v", err) + } + + // Get all namespaces + namespaces, err := clientset.CoreV1().Namespaces().List(ctx, metav1.ListOptions{}) + if err != nil { + return fmt.Errorf("couldn't get namespaces: %v", err) + } + for _, namespace := range namespaces.Items { + // Get all pods in the namespace + pods, err := clientset.CoreV1().Pods(namespace.Name).List(ctx, metav1.ListOptions{}) + if err != nil { + return fmt.Errorf("couldn't list pods in namespace %s: %v", namespace.Name, err) + } + for _, pod := range pods.Items { + machineName := pod.Spec.NodeName + // Create a directory for each pod and the path to it if + // it does not exist + podDir := filepath.Join(baseDir, "machines", machineName, namespace.Name, pod.Name) + err = os.MkdirAll(podDir, 0775) + if err != nil { + return fmt.Errorf("couldn't write to file: %v", err) + } + + // Get detailed information about the Pod + // This does the same thing as: + // kubectl --kubeconfig="${KUBECONFIG_WORKLOAD}" describe pods -n "${NAMESPACE}" "${POD}" + describerSettings := describe.DescriberSettings{ + ShowEvents: true, + } + podDescriber := describe.PodDescriber{ + Interface: clientset, + } + podDescription, err := podDescriber.Describe(namespace.Name, pod.Name, describerSettings) + if err != nil { + return fmt.Errorf("couldn't describe pod %s in namespace %s: %v", pod.Name, namespace.Name, err) + } + + // Print the Pod information to file + file := filepath.Join(podDir, "stdout_describe.log") + err = os.WriteFile(file, []byte(podDescription), 0600) + if err != nil { + return fmt.Errorf("couldn't write to file: %v", err) + } + + // Get containers of the Pod + for _, container := range pod.Spec.Containers { + // Create a directory for each container + containerDir := filepath.Join(podDir, container.Name) + + err := CollectContainerLogs(ctx, namespace.Name, pod.Name, container.Name, clientset, containerDir) + if err != nil { + return err + } + } + } + } + fmt.Printf("Successfully collected logs for cluster %s.", clusterProxy.GetName()) + return nil +} + +func CollectContainerLogs(ctx context.Context, namespace string, podName string, containerName string, clientset *kubernetes.Clientset, outputPath string) error { + err := os.MkdirAll(outputPath, 0775) + if err != nil { + return fmt.Errorf("couldn't create directory: %v", err) + } + + // Get logs of a container + // Does the same thing as: + // kubectl --kubeconfig="${KUBECONFIG_WORKLOAD}" logs -n "${NAMESPACE}" "${POD}" "${CONTAINER}" + podLogOptions := corev1.PodLogOptions{ + Container: containerName, + } + podLogs, err := clientset.CoreV1().Pods(namespace).GetLogs(podName, &podLogOptions).Stream(ctx) + if err != nil { + return fmt.Errorf("couldn't get container logs: %v", err) + } + defer podLogs.Close() + + // Read the logs into a string + buf := new(bytes.Buffer) + _, err = io.Copy(buf, podLogs) + if err != nil { + return fmt.Errorf("couldn't buffer container logs: %v", err) + } + podStr := buf.String() + + // Print the Pod information to file + file := filepath.Join(outputPath, "stdout.log") + err = os.WriteFile(file, []byte(podStr), 0600) + if err != nil { + return fmt.Errorf("couldn't write to file: %v", err) + } + + return nil +} diff --git a/test/e2e/pivoting.go b/test/e2e/pivoting.go index 8ed078d4c7..1a13d496ae 100644 --- a/test/e2e/pivoting.go +++ b/test/e2e/pivoting.go @@ -3,7 +3,6 @@ package e2e import ( "context" "fmt" - "io" "log" "os" "os/exec" @@ -26,15 +25,16 @@ import ( ) const ( - bmoPath = "BMOPATH" - ironicTLSSetup = "IRONIC_TLS_SETUP" - ironicBasicAuth = "IRONIC_BASIC_AUTH" - ironicKeepalived = "IRONIC_KEEPALIVED" - ironicMariadb = "IRONIC_USE_MARIADB" - Kind = "kind" - NamePrefix = "NAMEPREFIX" - restartContainerCertUpdate = "RESTART_CONTAINER_CERTIFICATE_UPDATED" - ironicNamespace = "IRONIC_NAMESPACE" + bmoPath = "BMOPATH" + ironicTLSSetup = "IRONIC_TLS_SETUP" + ironicBasicAuth = "IRONIC_BASIC_AUTH" + ironicKeepalived = "IRONIC_KEEPALIVED" + ironicMariadb = "IRONIC_USE_MARIADB" + Kind = "kind" + NamePrefix = "NAMEPREFIX" + restartContainerCertUpdate = "RESTART_CONTAINER_CERTIFICATE_UPDATED" + ironicNamespace = "IRONIC_NAMESPACE" + clusterLogCollectionBasePath = "/tmp/target_cluster_logs" ) type PivotingInput struct { @@ -424,19 +424,14 @@ func rePivoting(ctx context.Context, inputGetter func() RePivotingInput) { numberOfAllBmh := numberOfWorkers + numberOfControlplane By("Fetch logs from target cluster") - path := filepath.Join(os.Getenv("CAPM3PATH"), "scripts") - cmd := exec.Command("./fetch_target_logs.sh") // #nosec G204:gosec - cmd.Dir = path - errorPipe, _ := cmd.StderrPipe() - _ = cmd.Start() - errorData, _ := io.ReadAll(errorPipe) - if len(errorData) > 0 { - Logf("Error of the shell: %v\n", string(errorData)) + err := FetchClusterLogs(input.TargetCluster, clusterLogCollectionBasePath) + if err != nil { + Logf("Error: %v", err) } By("Fetch manifest for workload cluster after pivot") - path = filepath.Join(os.Getenv("CAPM3PATH"), "scripts") - cmd = exec.Command("./fetch_manifests.sh") // #nosec G204:gosec + path := filepath.Join(os.Getenv("CAPM3PATH"), "scripts") + cmd := exec.Command("./fetch_manifests.sh") // #nosec G204:gosec cmd.Dir = path _ = cmd.Run() os.Unsetenv("KUBECONFIG_WORKLOAD") diff --git a/test/e2e/upgrade_clusterctl_test.go b/test/e2e/upgrade_clusterctl_test.go index 00fbe161f1..c4fb66508a 100644 --- a/test/e2e/upgrade_clusterctl_test.go +++ b/test/e2e/upgrade_clusterctl_test.go @@ -2,7 +2,6 @@ package e2e import ( "fmt" - "io" "os" "os/exec" "path/filepath" @@ -357,29 +356,10 @@ func preUpgrade(clusterProxy framework.ClusterProxy, ironicUpgradeToRelease stri // preCleanupManagementCluster hook should be called from ClusterctlUpgradeSpec before cleaning the target management cluster // it moves back Ironic to the bootstrap cluster. func preCleanupManagementCluster(clusterProxy framework.ClusterProxy, ironicRelease string) { - if CurrentSpecReport().Failed() { - // Fetch logs in case of failure in management cluster - By("Fetch logs from management cluster") - path := filepath.Join(os.Getenv("CAPM3PATH"), "scripts") - cmd := exec.Command("./fetch_target_logs.sh") // #nosec G204:gosec - cmd.Dir = path - errorPipe, _ := cmd.StderrPipe() - _ = cmd.Start() - errorData, _ := io.ReadAll(errorPipe) - if len(errorData) > 0 { - Logf("Error of the shell: %v\n", string(errorData)) - } - } - // Fetch logs from management cluster - By("Fetch logs from management cluster") - path := filepath.Join(os.Getenv("CAPM3PATH"), "scripts") - cmd := exec.Command("./fetch_target_logs.sh") //#nosec G204:gosec - cmd.Dir = path - errorPipe, _ := cmd.StderrPipe() - _ = cmd.Start() - errorData, _ := io.ReadAll(errorPipe) - if len(errorData) > 0 { - Logf("Error of the shell: %v\n", string(errorData)) + By("Fetch logs from target cluster") + err := FetchClusterLogs(clusterProxy, clusterLogCollectionBasePath) + if err != nil { + Logf("Error: %v", err) } os.Unsetenv("KUBECONFIG_WORKLOAD") os.Unsetenv("KUBECONFIG_BOOTSTRAP") diff --git a/test/go.mod b/test/go.mod index 86cbec5790..d3c7d199da 100644 --- a/test/go.mod +++ b/test/go.mod @@ -20,6 +20,7 @@ require ( k8s.io/apimachinery v0.30.5 k8s.io/client-go v0.30.5 k8s.io/klog/v2 v2.120.1 + k8s.io/kubectl v0.30.3 k8s.io/utils v0.0.0-20231127182322-b307cd553661 sigs.k8s.io/cluster-api v1.8.3 sigs.k8s.io/cluster-api/test v1.8.3 @@ -31,6 +32,7 @@ require ( replace github.com/metal3-io/cluster-api-provider-metal3/api => ./../api require ( + github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect @@ -55,6 +57,7 @@ require ( github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/fatih/camelcase v1.0.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-errors/errors v1.4.2 // indirect @@ -68,6 +71,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect + github.com/google/btree v1.0.1 // indirect github.com/google/cel-go v0.17.8 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -78,6 +82,7 @@ require ( github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.4.0 // indirect @@ -85,6 +90,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -94,6 +100,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect @@ -102,6 +109,7 @@ require ( github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect github.com/prometheus/common v0.45.0 // indirect @@ -149,6 +157,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gotest.tools/v3 v3.5.0 // indirect k8s.io/apiserver v0.30.5 // indirect + k8s.io/cli-runtime v0.30.3 // indirect k8s.io/cluster-bootstrap v0.30.3 // indirect k8s.io/component-base v0.30.5 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect diff --git a/test/go.sum b/test/go.sum index f25fd848e5..a6daf4afec 100644 --- a/test/go.sum +++ b/test/go.sum @@ -56,6 +56,8 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -78,6 +80,8 @@ github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= +github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -122,6 +126,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cel-go v0.17.8 h1:j9m730pMZt1Fc4oKhCLUHfjj6527LuhYcYw0Rl8gqto= github.com/google/cel-go v0.17.8/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= @@ -152,6 +158,8 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= @@ -181,6 +189,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= @@ -230,6 +240,8 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -379,6 +391,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -472,6 +485,8 @@ k8s.io/apimachinery v0.30.5 h1:CQZO19GFgw4zcOjY2H+mJ3k1u1o7zFACTNCB7nu4O18= k8s.io/apimachinery v0.30.5/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/apiserver v0.30.5 h1:roo3cfvUS7zvI6u+bY35Xv3rSDXbY9dwl1gN+rxx0S4= k8s.io/apiserver v0.30.5/go.mod h1:p5UqIn1WPdOFo7uO/ZUdX464hHZy1DP384znr7FOIXA= +k8s.io/cli-runtime v0.30.3 h1:aG69oRzJuP2Q4o8dm+f5WJIX4ZBEwrvdID0+MXyUY6k= +k8s.io/cli-runtime v0.30.3/go.mod h1:hwrrRdd9P84CXSKzhHxrOivAR9BRnkMt0OeP5mj7X30= k8s.io/client-go v0.30.5 h1:vEDSzfTz0F8TXcWVdXl+aqV7NAV8M3UvC2qnGTTCoKw= k8s.io/client-go v0.30.5/go.mod h1:/q5fHHBmhAUesOOFJACpD7VJ4e57rVtTPDOsvXrPpMk= k8s.io/cluster-bootstrap v0.30.3 h1:MgxyxMkpaC6mu0BKWJ8985XCOnKU+eH3Iy+biwtDXRk= @@ -482,6 +497,8 @@ k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/kubectl v0.30.3 h1:YIBBvMdTW0xcDpmrOBzcpUVsn+zOgjMYIu7kAq+yqiI= +k8s.io/kubectl v0.30.3/go.mod h1:IcR0I9RN2+zzTRUa1BzZCm4oM0NLOawE6RzlDvd1Fpo= k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.0 h1:Tc9rS7JJoZ9sl3OpL4842oIk6lH7gWBb0JOmJ0ute7M=