Skip to content

Commit

Permalink
Delete unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenmarten committed Jul 13, 2024
1 parent f72ee0e commit 2e26069
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,19 @@ package utils

import (
"context"
"flag"
"fmt"
"net"
"net/http"
"os"
"os/exec"
"path/filepath"
"strings"

. "github.com/onsi/ginkgo/v2" //nolint:golint,revive
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/portforward"
"k8s.io/client-go/transport/spdy"
"k8s.io/client-go/util/homedir"
)

// Run executes the provided command within this context
Expand Down Expand Up @@ -67,23 +63,6 @@ func GetProjectDir() (string, error) {
return wd, nil
}

// GetConfig retrieves the Kubernetes configuration file.
func GetConfig() (*rest.Config, error) {
var kubeconfig *string
if home := homedir.HomeDir(); home != "" {
kubeconfig = flag.String("kubeconfig", filepath.Join(home, ".kube", "config"), "(optional) absolute path to the kubeconfig file")
} else {
kubeconfig = flag.String("kubeconfig", "", "absolute path to the kubeconfig file")
}
flag.Parse()

config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig)
if err != nil {
panic(err)
}
return config, nil
}

// GetClientset returns a kubernetes Clientset.
func GetClientset(config *rest.Config) (*kubernetes.Clientset, error) {
clientset, err := kubernetes.NewForConfig(config)
Expand Down

0 comments on commit 2e26069

Please sign in to comment.