...

Source file src/github.com/redhat-developer/odo/tests/helper/kubernetes_utils.go

Documentation: github.com/redhat-developer/odo/tests/helper

     1  package helper
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  
     7  	. "github.com/onsi/ginkgo/v2"
     8  	. "github.com/onsi/gomega"
     9  
    10  	dfutil "github.com/devfile/library/v2/pkg/util"
    11  )
    12  
    13  // copyKubeConfigFile copies default kubeconfig file into current temporary context config file
    14  func copyKubeConfigFile(kubeConfigFile, tempConfigFile string) {
    15  	info, err := os.Stat(kubeConfigFile)
    16  	Expect(err).NotTo(HaveOccurred())
    17  	err = dfutil.CopyFile(kubeConfigFile, tempConfigFile, info)
    18  	Expect(err).NotTo(HaveOccurred())
    19  	os.Setenv("KUBECONFIG", tempConfigFile)
    20  	fmt.Fprintf(GinkgoWriter, "Setting KUBECONFIG=%s\n", tempConfigFile)
    21  }
    22  

View as plain text