mirror of
https://github.com/rancher/k3k.git
synced 2026-08-19 04:16:16 +00:00
* Update k3s version in test suites to v1.36.2-k3s1 - Updated the k3sVersion and k3sOldVersion constants in both cli and e2e test suites to reflect the new version v1.36.2-k3s1 and the previous version v1.36.0-k3s1. * updated README.md
50 lines
904 B
Go
50 lines
904 B
Go
package cli_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"k8s.io/client-go/kubernetes"
|
|
"k8s.io/client-go/rest"
|
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
|
|
|
fwclient "github.com/rancher/k3k/tests/framework/client"
|
|
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
const (
|
|
k3kNamespace = "k3k-system"
|
|
|
|
k3sVersion = "v1.36.2-k3s1"
|
|
k3sOldVersion = "v1.36.0-k3s1"
|
|
)
|
|
|
|
func TestTests(t *testing.T) {
|
|
RegisterFailHandler(Fail)
|
|
RunSpecs(t, "Tests Suite")
|
|
}
|
|
|
|
var (
|
|
restcfg *rest.Config
|
|
k8s *kubernetes.Clientset
|
|
k8sClient client.Client
|
|
)
|
|
|
|
var _ = BeforeSuite(func() {
|
|
ctx := context.Background()
|
|
|
|
initKubernetesClient(ctx)
|
|
})
|
|
|
|
func initKubernetesClient(ctx context.Context) {
|
|
scheme := fwclient.NewScheme()
|
|
config, err := fwclient.InitFromKubeconfig(ctx, scheme)
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
|
restcfg = config.RestConfig
|
|
k8s = config.Clientset
|
|
k8sClient = config.Client
|
|
}
|