Skip to content

Commit

Permalink
feature(main): mv testdata to kubeadm dir
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu committed Oct 7, 2023
1 parent 81a1102 commit 0f4714e
Show file tree
Hide file tree
Showing 17 changed files with 432 additions and 381 deletions.
10 changes: 6 additions & 4 deletions test/e2e/apply_docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package e2e
import (
"fmt"

"github.com/labring/sealos/test/e2e/testdata/kubeadm"

"github.com/labring/sealos/test/e2e/testhelper/utils"

"github.com/labring/sealos/test/e2e/suites/operators"
Expand Down Expand Up @@ -46,7 +48,7 @@ var _ = Describe("E2E_sealos_apply_docker_test", func() {

By("generate Clusterfile")
clusterfileConfig := config.Clusterfile{
BinData: "testdata/docker-svc-sans.yaml",
BinData: kubeadm.PackageName + "/docker-svc-sans.yaml",
Replaces: map[string]string{"127.0.0.1": utils.GetLocalIpv4()},
}
applyfile, err := clusterfileConfig.Write()
Expand All @@ -71,15 +73,15 @@ var _ = Describe("E2E_sealos_apply_docker_test", func() {
It("sealos apply single by docker-buildimage", func() {

By("build image from dockerfile")
kubeadm := `
kubeadmVar := `
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
networking:
serviceSubnet: "100.55.0.0/16"
podSubnet: "10.160.0.0/12"
`
dFile := config.RootfsDockerfile{
KubeadmYaml: kubeadm,
KubeadmYaml: kubeadmVar,
BaseImage: "labring/kubernetes-docker:v1.25.0",
}
var tmpdir string
Expand All @@ -92,7 +94,7 @@ networking:
utils.CheckErr(err, fmt.Sprintf("failed to build image: %v", err))
By("generate Clusterfile")
clusterfileConfig := config.Clusterfile{
BinData: "testdata/custome-docker-svc.yaml",
BinData: kubeadm.PackageName + "/custome-docker-svc.yaml",
Replaces: map[string]string{"127.0.0.1": utils.GetLocalIpv4(), "labring/kubernetes-docker:v1.25.0": "apply-hack-docker:kubeadm-network"},
}
applyfile, err := clusterfileConfig.Write()
Expand Down
6 changes: 4 additions & 2 deletions test/e2e/apply_other_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package e2e
import (
"fmt"

"github.com/labring/sealos/test/e2e/testdata/kubeadm"

"github.com/labring/sealos/test/e2e/testhelper/utils"

"github.com/labring/sealos/test/e2e/suites/operators"
Expand Down Expand Up @@ -46,7 +48,7 @@ var _ = Describe("E2E_sealos_apply_other_test", func() {
It("sealos apply single by containerd add Taints ", func() {
By("generate Clusterfile")
clusterfileConfig := config.Clusterfile{
BinData: "testdata/containerd-svc-taints.yaml",
BinData: kubeadm.PackageName + "/containerd-svc-taints.yaml",
Replaces: map[string]string{"127.0.0.1": utils.GetLocalIpv4()},
}
applyfile, err := clusterfileConfig.Write()
Expand Down Expand Up @@ -75,7 +77,7 @@ var _ = Describe("E2E_sealos_apply_other_test", func() {
utils.CheckErr(err, fmt.Sprintf("failed to install etcd: %v", err))
By("generate Clusterfile")
clusterfileConfig := config.Clusterfile{
BinData: "testdata/containerd-svc-etcd.yaml",
BinData: kubeadm.PackageName + "/containerd-svc-etcd.yaml",
Replaces: map[string]string{"127.0.0.1": utils.GetLocalIpv4()},
}
applyfile, err := clusterfileConfig.Write()
Expand Down
10 changes: 6 additions & 4 deletions test/e2e/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package e2e
import (
"fmt"

"github.com/labring/sealos/test/e2e/testdata/kubeadm"

"github.com/labring/sealos/test/e2e/testhelper/utils"

"github.com/labring/sealos/test/e2e/suites/operators"
Expand Down Expand Up @@ -46,7 +48,7 @@ var _ = Describe("E2E_sealos_apply_test", func() {

By("generate Clusterfile")
clusterfileConfig := config.Clusterfile{
BinData: "testdata/containerd-svc-sans.yaml",
BinData: kubeadm.PackageName + "/containerd-svc-sans.yaml",
Replaces: map[string]string{"127.0.0.1": utils.GetLocalIpv4()},
}
applyfile, err := clusterfileConfig.Write()
Expand All @@ -71,15 +73,15 @@ var _ = Describe("E2E_sealos_apply_test", func() {
It("sealos apply single by containerd-buildimage", func() {

By("build image from dockerfile")
kubeadm := `
kubeadmVar := `
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
networking:
serviceSubnet: "100.55.0.0/16"
podSubnet: "10.160.0.0/12"
`
dFile := config.RootfsDockerfile{
KubeadmYaml: kubeadm,
KubeadmYaml: kubeadmVar,
BaseImage: "labring/kubernetes:v1.25.0",
}
var tmpdir string
Expand All @@ -93,7 +95,7 @@ networking:

By("generate Clusterfile")
clusterfileConfig := config.Clusterfile{
BinData: "testdata/custome-containerd-svc.yaml",
BinData: kubeadm.PackageName + "/custome-containerd-svc.yaml",
Replaces: map[string]string{"127.0.0.1": utils.GetLocalIpv4(), "labring/kubernetes:v1.25.0": "apply-hack-containerd:kubeadm-network"},
}
applyfile, err := clusterfileConfig.Write()
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ require (
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/labring/sealos/controllers/cluster v0.0.0-20230417222036-c48922461ea6 // indirect
github.com/labring/sreg v0.1.1 // indirect
github.com/labring/sreg v0.1.4 // indirect
github.com/letsencrypt/boulder v0.0.0-20230213213521-fdfea0d469b6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/labring/sreg v0.1.1 h1:JVI2FwdSQMPgQGRrTdsM6SEfy7eKd0F93VkweoNp3b4=
github.com/labring/sreg v0.1.1/go.mod h1:d519C7n2ekJJX6KxsUV78MeKO5Zon+atP4FkfwB++DM=
github.com/labring/sreg v0.1.4 h1:orSQ4M+Yjr2RkWLT3UMrfVz75Feg4EaResZS/GpyQtw=
github.com/labring/sreg v0.1.4/go.mod h1:d519C7n2ekJJX6KxsUV78MeKO5Zon+atP4FkfwB++DM=
github.com/letsencrypt/boulder v0.0.0-20230213213521-fdfea0d469b6 h1:unJdfS94Y3k85TKy+mvKzjW5R9rIC+Lv4KGbE7uNu0I=
github.com/letsencrypt/boulder v0.0.0-20230213213521-fdfea0d469b6/go.mod h1:PUgW5vI9ANEaV6qv9a6EKu8gAySgwf0xrzG9xIB/CK0=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions test/e2e/testdata/kubeadm/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright 2023 [email protected].
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package kubeadm

const PackageName = "kubeadm"
File renamed without changes.
Loading

0 comments on commit 0f4714e

Please sign in to comment.