Files
k3k/tests/cli/tests_suite_test.go
T
Enrico CandinoandGitHub 3d0438edc9 Update k8s dependencies to v1.36 (main) (#979)
* 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
2026-07-08 15:58:06 +02:00

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
}