Skip to content

Commit

Permalink
chore: bump to vcluster v0.20.0-beta.15 and remove eks
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesfrey committed Aug 8, 2024
1 parent 473e5cc commit 8402649
Show file tree
Hide file tree
Showing 38 changed files with 464 additions and 338 deletions.
23 changes: 3 additions & 20 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
run: |
export CLUSTER_NAME=vcluster-k3s
export CLUSTER_NAMESPACE=vcluster-k3s
export CHART_VERSION=0.20.0-beta.12
export CHART_VERSION=0.20.0-beta.15
export VCLUSTER_YAML=$(cat ./test/e2e/k3s-values.yaml | sed -z 's/\n/\\n/g')
kubectl create namespace ${CLUSTER_NAMESPACE}
cat templates/cluster-template.yaml | ./bin/envsubst | kubectl apply -n ${CLUSTER_NAMESPACE} -f -
Expand All @@ -129,7 +129,7 @@ jobs:
run: |
export CLUSTER_NAME=vcluster-k0s
export CLUSTER_NAMESPACE=vcluster-k0s
export CHART_VERSION=0.20.0-beta.12
export CHART_VERSION=0.20.0-beta.15
export CHART_NAME=vcluster
export VCLUSTER_YAML=$(cat ./test/e2e/k0s-values.yaml | sed -z 's/\n/\\n/g')
kubectl create namespace ${CLUSTER_NAMESPACE}
Expand All @@ -146,7 +146,7 @@ jobs:
run: |
export CLUSTER_NAME=vcluster-k8s
export CLUSTER_NAMESPACE=vcluster-k8s
export CHART_VERSION=0.20.0-beta.12
export CHART_VERSION=0.20.0-beta.15
export CHART_NAME=vcluster
export VCLUSTER_YAML=$(cat ./test/e2e/k8s-values.yaml | sed -z 's/\n/\\n/g')
kubectl create namespace ${CLUSTER_NAMESPACE}
Expand All @@ -158,20 +158,3 @@ jobs:
- name: Run E2E Tests K8S
run: CLUSTER_NAME=vcluster-k8s NAMESPACE=vcluster-k8s LOCAL_PORT=14552 go test -mod=vendor ./test/e2e -v

- name: Create Vcluster Custom Resource EKS
run: |
export CLUSTER_NAME=vcluster-eks
export CLUSTER_NAMESPACE=vcluster-eks
export CHART_VERSION=0.20.0-beta.12
export CHART_NAME=vcluster
export VCLUSTER_YAML=$(cat ./test/e2e/eks-values.yaml | sed -z 's/\n/\\n/g')
kubectl create namespace ${CLUSTER_NAMESPACE}
cat templates/cluster-template.yaml | ./bin/envsubst | kubectl apply -n ${CLUSTER_NAMESPACE} -f -
- name: Validate Resource Ready EKS
run: |
kubectl wait --for=condition=ready vcluster -n vcluster-eks vcluster-eks --timeout=100s
- name: Run E2E Tests EKS
run: CLUSTER_NAME=vcluster-eks NAMESPACE=vcluster-eks LOCAL_PORT=14553 go test -mod=vendor ./test/e2e -v
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/loft-sh/vcluster v0.20.0-beta.12
github.com/loft-sh/vcluster v0.20.0-beta.15
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/errors v0.9.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ github.com/loft-sh/log v0.0.0-20240219160058-26d83ffb46ac h1:Gz/7Lb7WgdgIv+KJz87
github.com/loft-sh/log v0.0.0-20240219160058-26d83ffb46ac/go.mod h1:YImeRjXH34Yf5E79T7UHBQpDZl9fIaaFRgyZ/bkY+UQ=
github.com/loft-sh/utils v0.0.29 h1:P/MObccXToAZy2QoJSQDJ+OJx1qHitpFHEVj3QBSNJs=
github.com/loft-sh/utils v0.0.29/go.mod h1:9hlX9cGpWHg3mNi/oBlv3X4ePGDMK66k8MbOZGFMDTI=
github.com/loft-sh/vcluster v0.20.0-beta.12 h1:xqHLLYbcWEiKyA998CEKaI0AyQ0rf4isPk7DvUri94k=
github.com/loft-sh/vcluster v0.20.0-beta.12/go.mod h1:Xm+Y8EADJCix31Lvb9kIPO3CIoRRV6RJrL48/skB5qw=
github.com/loft-sh/vcluster v0.20.0-beta.15 h1:/E3CBS0a3sGeakKtYxwJCo9aSsQZ5oFWiGbZESytF/A=
github.com/loft-sh/vcluster v0.20.0-beta.15/go.mod h1:Xm+Y8EADJCix31Lvb9kIPO3CIoRRV6RJrL48/skB5qw=
github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM=
github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM=
github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk=
Expand Down
2 changes: 1 addition & 1 deletion templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
chart:
name: ${CHART_NAME:=vcluster}
repo: ${CHART_REPO:=https://charts.loft.sh}
version: ${CHART_VERSION:=0.20.0-beta.12}
version: ${CHART_VERSION:=0.20.0-beta.15}
controlPlaneEndpoint:
host: ${VCLUSTER_HOST:=""}
port: ${VCLUSTER_PORT:=0}
109 changes: 19 additions & 90 deletions test/controllerstest/controllers_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,7 @@ var _ = ginkgo.Describe("Vcluster Controller test", func() {
}
})

ginkgo.It("reconcile successfully on k3s", func() {
values := map[string]any{
"vcluster": map[string]string{
"image": "rancher/k3s:v1.28.2-k3s1",
},
}
yamlBytes, yamlErr := yaml.Marshal(&values)
gomega.Expect(yamlErr).NotTo(gomega.HaveOccurred())
ginkgo.It("reconcile successfully on k8s", func() {
vCluster := &v1alpha1.VCluster{
ObjectMeta: metav1.ObjectMeta{
Name: "test-vcluster",
Expand All @@ -91,9 +84,8 @@ var _ = ginkgo.Describe("Vcluster Controller test", func() {
Spec: v1alpha1.VClusterSpec{
HelmRelease: &v1alpha1.VirtualClusterHelmRelease{
Chart: v1alpha1.VirtualClusterHelmChart{
Version: "0.19",
Version: "0.20.0-beta.15",
},
Values: string(yamlBytes),
},
},
}
Expand Down Expand Up @@ -128,75 +120,16 @@ var _ = ginkgo.Describe("Vcluster Controller test", func() {
gomega.Expect(result.RequeueAfter).Should(gomega.Equal(time.Minute))
})

ginkgo.It("reconcile successfully on k0s", func() {
ginkgo.It("reconcile successfully on k3s", func() {
values := map[string]any{
"vcluster": map[string]string{
"image": "rancher/k3s:v1.28.2-k3s1",
},
}
yamlBytes, yamlErr := yaml.Marshal(&values)
gomega.Expect(yamlErr).NotTo(gomega.HaveOccurred())
vCluster := &v1alpha1.VCluster{
ObjectMeta: metav1.ObjectMeta{
Name: "test-vcluster",
Namespace: "default",
},
Spec: v1alpha1.VClusterSpec{
HelmRelease: &v1alpha1.VirtualClusterHelmRelease{
Chart: v1alpha1.VirtualClusterHelmChart{
Name: "vcluster-k0s",
Version: "0.19",
"controlPlane": map[string]any{
"distro": map[string]any{
"k3s": map[string]bool{
"enabled": true,
},
Values: string(yamlBytes),
},
},
}
hemlClient.On("Upgrade").Return(nil)
f := fakeclientset.NewSimpleClientset()

_, err := f.CoreV1().ServiceAccounts("default").Create(context.Background(), &corev1.ServiceAccount{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
Namespace: "default",
},
}, metav1.CreateOptions{})
gomega.Expect(err).NotTo(gomega.HaveOccurred())

reconciler = &controllers.VClusterReconciler{
Client: fakeclient.NewClientBuilder().WithScheme(scheme).WithObjects(vCluster, secret).WithStatusSubresource(vCluster).Build(),
HelmClient: hemlClient,
Scheme: scheme,
ClientConfigGetter: &fakeConfigGetter{
fake: f,
},
HTTPClientGetter: &fakeHTTPClientGetter{},
}
req := ctrl.Request{
NamespacedName: types.NamespacedName{
Name: vCluster.Name,
Namespace: vCluster.Namespace,
},
}
result, err := reconciler.Reconcile(ctx, req)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(result.RequeueAfter).Should(gomega.Equal(time.Minute))
})

ginkgo.It("reconcile successfully on k8s", func() {
values := map[string]any{
"api": map[string]string{
"image": "registry.k8s.io/kube-apiserver:v1.28.2",
},
"scheduler": map[string]string{
"image": "registry.k8s.io/kube-scheduler:v1.28.2",
},
"controller": map[string]string{
"image": "registry.k8s.io/kube-controller-manager:v1.28.2",
},
"etcd": map[string]string{
"image": "registry.k8s.io/etcd:3.5.9-0",
},
}
yamlBytes, yamlErr := yaml.Marshal(&values)
gomega.Expect(yamlErr).NotTo(gomega.HaveOccurred())
vCluster := &v1alpha1.VCluster{
Expand All @@ -207,8 +140,8 @@ var _ = ginkgo.Describe("Vcluster Controller test", func() {
Spec: v1alpha1.VClusterSpec{
HelmRelease: &v1alpha1.VirtualClusterHelmRelease{
Chart: v1alpha1.VirtualClusterHelmChart{
Name: "vcluster-k8s",
Version: "0.19",
Name: "vcluster",
Version: "0.20.0-beta.15",
},
Values: string(yamlBytes),
},
Expand Down Expand Up @@ -245,19 +178,14 @@ var _ = ginkgo.Describe("Vcluster Controller test", func() {
gomega.Expect(result.RequeueAfter).Should(gomega.Equal(time.Minute))
})

ginkgo.It("reconcile successfully on eks", func() {
ginkgo.It("reconcile successfully on k0s", func() {
values := map[string]any{
"api": map[string]string{
"image": "test",
},
"coredns": map[string]string{
"image": "test",
},
"controller": map[string]string{
"image": "test",
},
"etcd": map[string]string{
"image": "test",
"controlPlane": map[string]any{
"distro": map[string]any{
"k0s": map[string]bool{
"enabled": true,
},
},
},
}
yamlBytes, yamlErr := yaml.Marshal(&values)
Expand All @@ -270,8 +198,8 @@ var _ = ginkgo.Describe("Vcluster Controller test", func() {
Spec: v1alpha1.VClusterSpec{
HelmRelease: &v1alpha1.VirtualClusterHelmRelease{
Chart: v1alpha1.VirtualClusterHelmChart{
Name: "vcluster-eks",
Version: "0.19",
Name: "vcluster",
Version: "0.20.0-beta.15",
},
Values: string(yamlBytes),
},
Expand Down Expand Up @@ -307,6 +235,7 @@ var _ = ginkgo.Describe("Vcluster Controller test", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(result.RequeueAfter).Should(gomega.Equal(time.Minute))
})

})

})
22 changes: 0 additions & 22 deletions test/e2e/eks-values.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions vendor/github.com/loft-sh/vcluster/cmd/vclusterctl/cmd/connect.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8402649

Please sign in to comment.