From 6b5875687f7b57874ebf778c9cb67f2a7c99dcd6 Mon Sep 17 00:00:00 2001 From: yy <56745951+lingdie@users.noreply.github.com> Date: Sat, 7 Oct 2023 14:49:52 +0800 Subject: [PATCH 01/14] feat: add sealos cloud install script and docs. (#4035) * sealos cloud install script. * add todo * fix ingress config. * fix check mongo secret logic. * add docs. * fix script link * fix curl and bash * add sidebar.json * mv install.sh to tmp dir. * mv install.sh to tmp dir. --- .../quick-start/installation/online-installation.md | 2 +- .../quick-start/installation/online-installation.md | 2 +- docs/4.0/sidebar.json | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/4.0/docs/quick-start/installation/online-installation.md b/docs/4.0/docs/quick-start/installation/online-installation.md index 113cc857218..1e3cffee47c 100644 --- a/docs/4.0/docs/quick-start/installation/online-installation.md +++ b/docs/4.0/docs/quick-start/installation/online-installation.md @@ -34,5 +34,5 @@ If you can provide a certificate, it needs to resolve the following domains (ass Execute the command and enter the parameters as prompted: ```bash -curl -sfL https://raw.githubusercontent.com/labring/sealos/main/scripts/cloud/install.sh | sudo bash -s +curl -sfL https://raw.githubusercontent.com/labring/sealos/main/scripts/cloud/install.sh -o /tmp/install.sh && bash /tmp/install.sh ``` \ No newline at end of file diff --git a/docs/4.0/i18n/zh-Hans/quick-start/installation/online-installation.md b/docs/4.0/i18n/zh-Hans/quick-start/installation/online-installation.md index d417f73fdc0..f83017acd38 100644 --- a/docs/4.0/i18n/zh-Hans/quick-start/installation/online-installation.md +++ b/docs/4.0/i18n/zh-Hans/quick-start/installation/online-installation.md @@ -34,5 +34,5 @@ Sealos 需要使用证书来保证通信安全,默认在您不提供证书的 执行命令,并根据提示输入参数: ```bash -curl -sfL https://raw.githubusercontent.com/labring/sealos/main/scripts/cloud/install.sh | sudo bash -s +curl -sfL https://raw.githubusercontent.com/labring/sealos/main/scripts/cloud/install.sh -o /tmp/install.sh && bash /tmp/install.sh ``` \ No newline at end of file diff --git a/docs/4.0/sidebar.json b/docs/4.0/sidebar.json index 34df62f6468..bdfac96c702 100644 --- a/docs/4.0/sidebar.json +++ b/docs/4.0/sidebar.json @@ -19,6 +19,19 @@ "dirName": "quick-start/app-deployments" } ] + }, + { + "type": "category", + "label": "Installation", + "link": { + "type": "generated-index" + }, + "items": [ + { + "type": "autogenerated", + "dirName": "quick-start/installation" + } + ] } ] }, From d5c2a6ebb600901ff96194425d027d05590eb1ea Mon Sep 17 00:00:00 2001 From: yy <56745951+lingdie@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:07:26 +0800 Subject: [PATCH 02/14] change name to admin (#4039) --- controllers/licenseissuer/preset/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/licenseissuer/preset/main.go b/controllers/licenseissuer/preset/main.go index 55fe6fa70b0..4e7ad5f7e92 100644 --- a/controllers/licenseissuer/preset/main.go +++ b/controllers/licenseissuer/preset/main.go @@ -48,7 +48,7 @@ func main() { const ( // pre-defined user name and password - defaultUser = "root" + defaultUser = "admin" defaultPassword = "sealos2023" // kubernetes default user cr is admin From cbf61f800b61d4edc075d2e4213a380e426b4813 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Sat, 7 Oct 2023 19:04:13 +0800 Subject: [PATCH 03/14] feature(main): add tf as infra (#4024) * feature(main): add tf as infra Signed-off-by: cuisongliu * feature(main): add tf as infra Signed-off-by: cuisongliu * feature(main): mv testdata to kubeadm dir Signed-off-by: cuisongliu --------- Signed-off-by: cuisongliu --- test/e2e/apply_docker_test.go | 10 +- test/e2e/apply_other_test.go | 6 +- test/e2e/apply_test.go | 10 +- test/e2e/go.mod | 21 +- test/e2e/go.sum | 29 +- test/e2e/terraform/infra/providers.tf | 3 + test/e2e/terraform/infra/terraform.tf | 61 ++ test/e2e/terraform/infra/vars.tf | 27 + test/e2e/terraform/infra/vars.tf.amd64 | 27 + test/e2e/terraform/infra/vars.tf.arm64 | 27 + test/e2e/terraform/main.go | 44 + test/e2e/terraform/terraform.go | 196 +++++ test/e2e/terraform/terraform.json | 806 ++++++++++++++++++ test/e2e/terraform/terraform_test.go | 60 ++ test/e2e/terraform/zz_generated_terraform.go | 342 ++++++++ .../{ => kubeadm}/containerd-svc-etcd.yaml | 0 .../{ => kubeadm}/containerd-svc-sans.yaml | 0 .../{ => kubeadm}/containerd-svc-taints.yaml | 0 .../{ => kubeadm}/custome-containerd-svc.yaml | 0 .../{ => kubeadm}/custome-docker-svc.yaml | 0 test/e2e/testdata/kubeadm/doc.go | 19 + .../{ => kubeadm}/docker-svc-sans.yaml | 0 .../testdata/kubeadm/zz_generated_kubeadm.go | 342 ++++++++ test/e2e/testdata/main.go | 46 + test/e2e/testdata/testdata.go | 365 -------- test/e2e/testhelper/config/clusterfile.go | 5 +- .../e2e/testhelper/config/clusterfile_test.go | 4 +- 27 files changed, 2049 insertions(+), 401 deletions(-) create mode 100644 test/e2e/terraform/infra/providers.tf create mode 100644 test/e2e/terraform/infra/terraform.tf create mode 100644 test/e2e/terraform/infra/vars.tf create mode 100644 test/e2e/terraform/infra/vars.tf.amd64 create mode 100644 test/e2e/terraform/infra/vars.tf.arm64 create mode 100644 test/e2e/terraform/main.go create mode 100644 test/e2e/terraform/terraform.go create mode 100644 test/e2e/terraform/terraform.json create mode 100644 test/e2e/terraform/terraform_test.go create mode 100644 test/e2e/terraform/zz_generated_terraform.go rename test/e2e/testdata/{ => kubeadm}/containerd-svc-etcd.yaml (100%) rename test/e2e/testdata/{ => kubeadm}/containerd-svc-sans.yaml (100%) rename test/e2e/testdata/{ => kubeadm}/containerd-svc-taints.yaml (100%) rename test/e2e/testdata/{ => kubeadm}/custome-containerd-svc.yaml (100%) rename test/e2e/testdata/{ => kubeadm}/custome-docker-svc.yaml (100%) create mode 100644 test/e2e/testdata/kubeadm/doc.go rename test/e2e/testdata/{ => kubeadm}/docker-svc-sans.yaml (100%) create mode 100644 test/e2e/testdata/kubeadm/zz_generated_kubeadm.go create mode 100644 test/e2e/testdata/main.go delete mode 100644 test/e2e/testdata/testdata.go diff --git a/test/e2e/apply_docker_test.go b/test/e2e/apply_docker_test.go index 29c4c9422b2..79545526b37 100644 --- a/test/e2e/apply_docker_test.go +++ b/test/e2e/apply_docker_test.go @@ -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" @@ -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() @@ -71,7 +73,7 @@ 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: @@ -79,7 +81,7 @@ networking: podSubnet: "10.160.0.0/12" ` dFile := config.RootfsDockerfile{ - KubeadmYaml: kubeadm, + KubeadmYaml: kubeadmVar, BaseImage: "labring/kubernetes-docker:v1.25.0", } var tmpdir string @@ -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() diff --git a/test/e2e/apply_other_test.go b/test/e2e/apply_other_test.go index 2a82eb41be5..ba66c635a1f 100644 --- a/test/e2e/apply_other_test.go +++ b/test/e2e/apply_other_test.go @@ -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" @@ -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() @@ -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() diff --git a/test/e2e/apply_test.go b/test/e2e/apply_test.go index b0dda1cc380..f472d6e8f0e 100644 --- a/test/e2e/apply_test.go +++ b/test/e2e/apply_test.go @@ -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" @@ -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() @@ -71,7 +73,7 @@ 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: @@ -79,7 +81,7 @@ networking: podSubnet: "10.160.0.0/12" ` dFile := config.RootfsDockerfile{ - KubeadmYaml: kubeadm, + KubeadmYaml: kubeadmVar, BaseImage: "labring/kubernetes:v1.25.0", } var tmpdir string @@ -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() diff --git a/test/e2e/go.mod b/test/e2e/go.mod index d9213df3426..3d003d4677a 100644 --- a/test/e2e/go.mod +++ b/test/e2e/go.mod @@ -4,10 +4,8 @@ go 1.20 replace ( github.com/labring/image-cri-shim => ../../staging/src/github.com/labring/image-cri-shim - github.com/labring/lvscare => ../../staging/src/github.com/labring/lvscare github.com/labring/sealos => ../../ github.com/labring/sealos/controllers/cluster => ./../../staging/src/github.com/labring/controllers/cluster - github.com/labring/sealos/controllers/imagehub => ./../../staging/src/github.com/labring/controllers/imagehub github.com/labring/sealos/controllers/infra => ./../../staging/src/github.com/labring/controllers/infra ) @@ -19,6 +17,8 @@ replace ( require ( github.com/BurntSushi/toml v1.3.2 github.com/Masterminds/sprig/v3 v3.2.3 + github.com/go-bindata/go-bindata v1.0.0 + github.com/google/go-containerregistry v0.15.2 github.com/google/uuid v1.3.0 github.com/labring/image-cri-shim v0.0.0 github.com/labring/sealos v0.0.0 @@ -28,8 +28,9 @@ require ( github.com/onsi/gomega v1.27.8 github.com/pkg/errors v0.9.1 golang.org/x/sync v0.2.0 - k8s.io/api v0.27.1 - k8s.io/apimachinery v0.27.1 + k8s.io/api v0.27.4 + k8s.io/apimachinery v0.27.4 + k8s.io/client-go v0.27.4 k8s.io/cri-api v0.27.1 k8s.io/kube-proxy v0.25.6 k8s.io/kubelet v0.25.6 @@ -40,7 +41,7 @@ require ( require ( github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Microsoft/hcsshim v0.10.0-rc.8 // indirect github.com/VividCortex/ewma v1.2.0 // indirect @@ -107,7 +108,6 @@ require ( github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/google/go-containerregistry v0.15.2 // indirect github.com/google/go-intervals v0.0.2 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20230323073829-e72429f035bd // indirect @@ -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/sealos/controllers/common v0.0.0-20230528031239-655196af17c7 // 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 @@ -187,7 +187,7 @@ require ( github.com/vishvananda/netlink v1.2.1-beta.2 // indirect github.com/vishvananda/netns v0.0.4 // indirect go.etcd.io/bbolt v1.3.7 // indirect - go.mongodb.org/mongo-driver v1.11.3 // indirect + go.mongodb.org/mongo-driver v1.11.4 // indirect go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.10.0 // indirect @@ -214,11 +214,10 @@ require ( gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/client-go v0.26.2 // indirect k8s.io/cluster-bootstrap v0.25.6 // indirect - k8s.io/component-base v0.26.2 // indirect + k8s.io/component-base v0.27.2 // indirect k8s.io/klog/v2 v2.100.1 // indirect - k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect sigs.k8s.io/controller-runtime v0.13.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/test/e2e/go.sum b/test/e2e/go.sum index bd09fee9cf5..954606e1e6e 100644 --- a/test/e2e/go.sum +++ b/test/e2e/go.sum @@ -10,8 +10,9 @@ github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8 github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -155,6 +156,8 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/fsouza/go-dockerclient v1.9.7 h1:FlIrT71E62zwKgRvCvWGdxRD+a/pIy+miY/n3MXgfuw= github.com/fsouza/go-dockerclient v1.9.7/go.mod h1:vx9C32kE2D15yDSOMCDaAEIARZpDQDFBHeqL3MgQy/U= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-bindata/go-bindata v1.0.0 h1:DZ34txDXWn1DyWa+vQf7V9ANc2ILTtrEjtlsdJRF26M= +github.com/go-bindata/go-bindata v1.0.0/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -336,6 +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.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= @@ -459,7 +464,7 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/schollz/progressbar/v3 v3.8.6 h1:QruMUdzZ1TbEP++S1m73OqRJk20ON11m6Wqv4EoGg8c= github.com/schollz/progressbar/v3 v3.8.6/go.mod h1:W5IEwbJecncFGBvuEh4A7HT1nZZ6WNIL2i3qbnI0WKY= @@ -559,8 +564,8 @@ go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= -go.mongodb.org/mongo-driver v1.11.3 h1:Ql6K6qYHEzB6xvu4+AU0BoRoqf9vFPcc4o7MUIdPW8Y= -go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= +go.mongodb.org/mongo-driver v1.11.4 h1:4ayjakA013OdpGyL2K3ZqylTac/rMjrJOMZ1EHizXas= +go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 h1:CCriYyAfq1Br1aIYettdHZTy8mBTIPo7We18TuO/bak= go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= @@ -792,22 +797,22 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.27.1 h1:Z6zUGQ1Vd10tJ+gHcNNNgkV5emCyW+v2XTmn+CLjSd0= -k8s.io/api v0.27.1/go.mod h1:z5g/BpAiD+f6AArpqNjkY+cji8ueZDU/WV1jcj5Jk4E= -k8s.io/apimachinery v0.27.1 h1:EGuZiLI95UQQcClhanryclaQE6xjg1Bts6/L3cD7zyc= -k8s.io/apimachinery v0.27.1/go.mod h1:5ikh59fK3AJ287GUvpUsryoMFtH9zj/ARfWCo3AyXTM= +k8s.io/api v0.27.4 h1:0pCo/AN9hONazBKlNUdhQymmnfLRbSZjd5H5H3f0bSs= +k8s.io/api v0.27.4/go.mod h1:O3smaaX15NfxjzILfiln1D8Z3+gEYpjEpiNA/1EVK1Y= +k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs= +k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= k8s.io/client-go v0.25.6 h1:CHxACHi0DijmlYyUR7ooZoXnD5P8jYLgBHcxp775x/U= k8s.io/client-go v0.25.6/go.mod h1:s9mMAGFYiH3Z66j7BESzu0GEradT9GQ2LjFf/YRrnyc= k8s.io/cluster-bootstrap v0.25.6 h1:OuRfdWUxuf/ZzzAAHDfOR+Eb6ipp6ioxbDhmMilKSpg= k8s.io/cluster-bootstrap v0.25.6/go.mod h1:oykEiqdSNCkiZsiyl8z1wnFbqVvSWbI6fYUPKoXjv7U= -k8s.io/component-base v0.26.2 h1:IfWgCGUDzrD6wLLgXEstJKYZKAFS2kO+rBRi0p3LqcI= -k8s.io/component-base v0.26.2/go.mod h1:DxbuIe9M3IZPRxPIzhch2m1eT7uFrSBJUBuVCQEBivs= +k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo= +k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo= k8s.io/cri-api v0.25.6 h1:ueaPYiflK9pvSP+GXgCmklG8Xp63foNYnZpnuiJghtA= k8s.io/cri-api v0.25.6/go.mod h1:fg+6ctfBFAUYnKfjmYqUVXwq6A788L0ZvNooI405Nek= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a h1:gmovKNur38vgoWfGtP5QOGNOA7ki4n6qNYoFAgMlNvg= -k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/kube-proxy v0.25.6 h1:vG8Zg8xMFOGg2gnEkmYuSU/RJ4waIOW6Ti6/Y8at26M= k8s.io/kube-proxy v0.25.6/go.mod h1:uMzY4OdkcMQ+sNAnze9iyKdff035UfCDc1k6dLOjj8Q= k8s.io/kubelet v0.25.6 h1:rZntZUVRlZ1nys1C9QBPJ2drzy6Mq67yfgmDlFzrQHw= diff --git a/test/e2e/terraform/infra/providers.tf b/test/e2e/terraform/infra/providers.tf new file mode 100644 index 00000000000..42fbd017456 --- /dev/null +++ b/test/e2e/terraform/infra/providers.tf @@ -0,0 +1,3 @@ +provider "alicloud" { + region = var.region +} diff --git a/test/e2e/terraform/infra/terraform.tf b/test/e2e/terraform/infra/terraform.tf new file mode 100644 index 00000000000..518979897ce --- /dev/null +++ b/test/e2e/terraform/infra/terraform.tf @@ -0,0 +1,61 @@ +resource "alicloud_vpc" "vpc" { + vpc_name = "${var.name}-vpc" + cidr_block = "172.16.0.0/12" +} + +resource "alicloud_vswitch" "vsw" { + vswitch_name = "${var.name}-vsw" + vpc_id = alicloud_vpc.vpc.id + cidr_block = "172.16.0.0/21" + zone_id = var.zone +} + +resource "alicloud_security_group" "default" { + name = var.name + vpc_id = alicloud_vpc.vpc.id +} + +resource "alicloud_security_group_rule" "allow_all_tcp" { + type = "ingress" + ip_protocol = "tcp" + nic_type = "intranet" + policy = "accept" + port_range = "1/65535" + priority = 1 + security_group_id = alicloud_security_group.default.id + cidr_ip = "0.0.0.0/0" +} + + +resource "alicloud_instance" "sealos" { + instance_name = "${var.name}-sealos" + count = 1 + availability_zone = var.zone + security_groups = [alicloud_security_group.default.id] + instance_type = var.ecs_type + system_disk_category = var.disk_category + system_disk_size = 50 + password = var.ecs_password + image_id = var.image_id + vswitch_id = alicloud_vswitch.vsw.id + internet_max_bandwidth_out = 100 + instance_charge_type = "PostPaid" + spot_strategy = "SpotAsPriceGo" +} + +resource "alicloud_instance" "kube" { + instance_name = "${var.name}-kube-${count.index}" + count = 6 + availability_zone = var.zone + security_groups = [alicloud_security_group.default.id] + instance_type = var.ecs_type + system_disk_category = var.disk_category + system_disk_size = 50 + password = var.ecs_password + image_id = var.image_id + vswitch_id = alicloud_vswitch.vsw.id + internet_max_bandwidth_out = 0 + instance_charge_type = "PostPaid" + spot_strategy = "SpotAsPriceGo" +} + diff --git a/test/e2e/terraform/infra/vars.tf b/test/e2e/terraform/infra/vars.tf new file mode 100644 index 00000000000..be8655c7da5 --- /dev/null +++ b/test/e2e/terraform/infra/vars.tf @@ -0,0 +1,27 @@ +variable "name" { + default = "kubernetes-tf" +} + +variable "zone" { + default = "cn-hongkong-b" +} + +variable "region" { + default = "cn-hongkong" +} + +variable "image_id" { + default = "ubuntu_22_04_x64_20G_alibase_20230613.vhd" +} + +variable "ecs_type" { + default = "ecs.g7.xlarge" +} + +variable "ecs_password" { + default = "Fanux#123" +} + +variable "disk_category" { + default = "cloud_essd" +} diff --git a/test/e2e/terraform/infra/vars.tf.amd64 b/test/e2e/terraform/infra/vars.tf.amd64 new file mode 100644 index 00000000000..be8655c7da5 --- /dev/null +++ b/test/e2e/terraform/infra/vars.tf.amd64 @@ -0,0 +1,27 @@ +variable "name" { + default = "kubernetes-tf" +} + +variable "zone" { + default = "cn-hongkong-b" +} + +variable "region" { + default = "cn-hongkong" +} + +variable "image_id" { + default = "ubuntu_22_04_x64_20G_alibase_20230613.vhd" +} + +variable "ecs_type" { + default = "ecs.g7.xlarge" +} + +variable "ecs_password" { + default = "Fanux#123" +} + +variable "disk_category" { + default = "cloud_essd" +} diff --git a/test/e2e/terraform/infra/vars.tf.arm64 b/test/e2e/terraform/infra/vars.tf.arm64 new file mode 100644 index 00000000000..2fa33474975 --- /dev/null +++ b/test/e2e/terraform/infra/vars.tf.arm64 @@ -0,0 +1,27 @@ +variable "name" { + default = "kubernetes-tf" +} + +variable "zone" { + default = "ap-southeast-1a" +} + +variable "region" { + default = "ap-southeast-1" +} + +variable "image_id" { + default = "ubuntu_22_04_arm64_20G_alibase_20230712.vhd" +} + +variable "ecs_type" { + default = "ecs.g6r.xlarge" +} + +variable "ecs_password" { + default = "Fanux#123" +} + +variable "disk_category" { + default = "cloud_essd" +} diff --git a/test/e2e/terraform/main.go b/test/e2e/terraform/main.go new file mode 100644 index 00000000000..0179da1848c --- /dev/null +++ b/test/e2e/terraform/main.go @@ -0,0 +1,44 @@ +/* +Copyright 2023 cuisongliu@qq.com. + +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 main + +import ( + bindata "github.com/go-bindata/go-bindata" + + "github.com/labring/sealos/pkg/utils/logger" +) + +func main() { + logger.Info("generator bindata start") + bc := &bindata.Config{ + Input: []bindata.InputConfig{ + { + Path: "infra", + Recursive: false, + }, + }, + Package: "main", + NoCompress: true, + NoMemCopy: true, + NoMetadata: true, + Output: "zz_generated_terraform.go", + } + if err := bindata.Translate(bc); err != nil { + logger.Fatal(err) + } + logger.Info("generator bindata success") +} diff --git a/test/e2e/terraform/terraform.go b/test/e2e/terraform/terraform.go new file mode 100644 index 00000000000..acbb3abcf47 --- /dev/null +++ b/test/e2e/terraform/terraform.go @@ -0,0 +1,196 @@ +/* +Copyright 2023 cuisongliu@qq.com. + +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 main + +import ( + "context" + "fmt" + "os" + "path" + "strings" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/util/json" + + "k8s.io/client-go/util/homedir" + + executils "github.com/labring/sealos/pkg/utils/exec" + "github.com/labring/sealos/pkg/utils/file" + "github.com/labring/sealos/pkg/utils/logger" +) + +//go:generate go run main.go + +var HomeDir string + +type Terraform struct { + accessKey string + secretKey string +} + +func (tf *Terraform) Apply(architecture string) error { + _, ok := executils.CheckCmdIsExist("terraform") + if !ok { + return fmt.Errorf("not install terraform, please install terraform. vist: https://developer.hashicorp.com/terraform/downloads ") + } + tf.setEnv() + defer func() { + tf.unsetEnv() + }() + file.CleanDir(HomeDir) + _ = file.MkDirs(HomeDir) + files := AssetNames() + for _, f := range files { + if f == "infra/vars.tf" { + logger.Warn("temp var tf file, skip generator") + continue + } + data, err := Asset(f) + if err != nil { + return err + } + if f == fmt.Sprintf("infra/vars.tf.%s", architecture) { + if err = file.WriteFile(path.Join(HomeDir, "vars.tf"), data); err != nil { + return err + } + } + parts := strings.SplitN(f, "/", 2) + if len(parts) == 2 { + if err = file.WriteFile(path.Join(HomeDir, parts[1]), data); err != nil { + return err + } + } + } + _ = file.CleanFiles(path.Join(HomeDir, "vars.tf.amd64"), path.Join(HomeDir, "vars.tf.arm64")) + err := executils.CmdWithContext(context.Background(), "bash", "-c", fmt.Sprintf("cd %s && terraform init", HomeDir)) + if err != nil { + return err + } + err = executils.CmdWithContext(context.Background(), "bash", "-c", fmt.Sprintf("cd %s && terraform apply -auto-approve", HomeDir)) + if err != nil { + return err + } + return err +} + +func (tf *Terraform) Destroy() error { + _, ok := executils.CheckCmdIsExist("terraform") + if !ok { + return fmt.Errorf("not install terraform, please install terraform. vist: https://developer.hashicorp.com/terraform/downloads ") + } + var err error + tf.setEnv() + defer func() { + tf.unsetEnv() + }() + if !file.IsExist(HomeDir) { + err = fmt.Errorf("infra terraform home dir is not exist") + return err + } + defer func() { + if err == nil { + logger.Warn("destroy error,skip clean files") + file.CleanDir(HomeDir) + } + }() + err = executils.CmdWithContext(context.Background(), "bash", "-c", fmt.Sprintf("cd %s && terraform destroy -auto-approve", HomeDir)) + if err != nil { + return err + } + return nil +} + +type Host struct { + Name string + Password string + PublicIP string + PrivateIP string +} + +type InfraDetail struct { + Public *Host + Nodes []Host +} + +func (tf *Terraform) Detail() (*InfraDetail, error) { + _, ok := executils.CheckCmdIsExist("terraform") + if !ok { + return nil, fmt.Errorf("not install terraform, please install terraform. vist: https://developer.hashicorp.com/terraform/downloads ") + } + var err error + tf.setEnv() + defer func() { + tf.unsetEnv() + }() + if !file.IsExist(path.Join(HomeDir, "terraform.tfstate")) { + err = fmt.Errorf("infra terraform status file is not exist") + return nil, err + } + data, err := file.ReadAll(path.Join(HomeDir, "terraform.tfstate")) + if err != nil { + return nil, err + } + var stateMap map[string]interface{} + if err = json.Unmarshal(data, &stateMap); err != nil { + return nil, err + } + d := &InfraDetail{} + resources, _, _ := unstructured.NestedSlice(stateMap, "resources") + for _, res := range resources { + if obj, ok := res.(map[string]interface{}); ok { + resourceType, _, _ := unstructured.NestedString(obj, "type") + resourceName, _, _ := unstructured.NestedString(obj, "name") + if resourceType == "alicloud_instance" { + instances, _, _ := unstructured.NestedSlice(obj, "instances") + for i, instance := range instances { + if instanceObj, ok := instance.(map[string]interface{}); ok { + h := &Host{} + h.Name, _, _ = unstructured.NestedString(instanceObj, "attributes", "instance_name") + h.Password, _, _ = unstructured.NestedString(instanceObj, "attributes", "password") + h.PublicIP, _, _ = unstructured.NestedString(instanceObj, "attributes", "public_ip") + h.PrivateIP, _, _ = unstructured.NestedString(instanceObj, "attributes", "private_ip") + if resourceName == "sealos" { + d.Public = h + break + } + if d.Nodes == nil { + d.Nodes = make([]Host, len(instances)) + } + d.Nodes[i] = *h + } + } + } + } + } + return d, nil +} + +func (tf *Terraform) setEnv() { + _ = os.Setenv("ALICLOUD_ACCESS_KEY", tf.accessKey) + _ = os.Setenv("ALICLOUD_SECRET_KEY", tf.secretKey) +} + +func (tf *Terraform) unsetEnv() { + _ = os.Unsetenv("ALICLOUD_ACCESS_KEY") + _ = os.Unsetenv("ALICLOUD_SECRET_KEY") +} + +func init() { + if HomeDir == "" { + HomeDir = path.Join(homedir.HomeDir(), ".infra", "terraform") + } +} diff --git a/test/e2e/terraform/terraform.json b/test/e2e/terraform/terraform.json new file mode 100644 index 00000000000..3323bfabcfd --- /dev/null +++ b/test/e2e/terraform/terraform.json @@ -0,0 +1,806 @@ +{ + "version": 4, + "terraform_version": "1.5.7", + "serial": 12, + "lineage": "fab771e4-a0c4-df08-a279-381af4e6271a", + "outputs": {}, + "resources": [ + { + "mode": "managed", + "type": "alicloud_instance", + "name": "kube", + "provider": "provider[\"registry.terraform.io/hashicorp/alicloud\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "allocate_public_ip": null, + "auto_release_time": "", + "auto_renew_period": null, + "availability_zone": "cn-hongkong-b", + "cpu": 4, + "credit_specification": "", + "data_disks": [], + "dedicated_host_id": "", + "deletion_protection": false, + "deployment_set_group_no": null, + "deployment_set_id": "", + "description": "", + "dry_run": false, + "force_delete": null, + "host_name": "iZj6c650miurqg9rfjulu5Z", + "hpc_cluster_id": "", + "http_endpoint": "", + "http_put_response_hop_limit": 0, + "http_tokens": "", + "id": "i-j6c650miurqg9rfjulu5", + "image_id": "ubuntu_22_04_x64_20G_alibase_20230613.vhd", + "include_data_disks": null, + "instance_charge_type": "PostPaid", + "instance_name": "kubernetes-tf-kube-0", + "instance_type": "ecs.g7.xlarge", + "internet_charge_type": "PayByTraffic", + "internet_max_bandwidth_in": -1, + "internet_max_bandwidth_out": 0, + "io_optimized": null, + "ipv6_address_count": 0, + "ipv6_addresses": [], + "is_outdated": null, + "key_name": "", + "kms_encrypted_password": null, + "kms_encryption_context": null, + "maintenance_action": "AutoRecover", + "maintenance_notify": false, + "maintenance_time": [], + "memory": 16384, + "network_interface_id": "eni-j6c5qqcjut1jdqck4blg", + "operator_type": null, + "os_name": "Ubuntu 22.04 64位", + "os_type": "linux", + "password": "Fanux#123", + "period": null, + "period_unit": null, + "primary_ip_address": "172.16.7.16", + "private_ip": "172.16.7.16", + "public_ip": "", + "renewal_status": null, + "resource_group_id": "", + "role_name": null, + "secondary_private_ip_address_count": 0, + "secondary_private_ips": [], + "security_enhancement_strategy": null, + "security_groups": [ + "sg-j6c92di1f36o41wegamo" + ], + "spot_duration": 1, + "spot_price_limit": 0, + "spot_strategy": "SpotAsPriceGo", + "status": "Running", + "stopped_mode": "Not-applicable", + "subnet_id": "vsw-j6ci73yrqv4w1qtu539df", + "system_disk_auto_snapshot_policy_id": "", + "system_disk_category": "cloud_essd", + "system_disk_description": "", + "system_disk_encrypt_algorithm": null, + "system_disk_encrypted": false, + "system_disk_id": "d-j6c6x5krjhlz9z6ir13i", + "system_disk_kms_key_id": "", + "system_disk_name": "", + "system_disk_performance_level": "PL1", + "system_disk_size": 50, + "system_disk_storage_cluster_id": "", + "tags": null, + "timeouts": null, + "user_data": null, + "volume_tags": {}, + "vswitch_id": "vsw-j6ci73yrqv4w1qtu539df" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "alicloud_security_group.default", + "alicloud_vpc.vpc", + "alicloud_vswitch.vsw" + ] + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "allocate_public_ip": null, + "auto_release_time": "", + "auto_renew_period": null, + "availability_zone": "cn-hongkong-b", + "cpu": 4, + "credit_specification": "", + "data_disks": [], + "dedicated_host_id": "", + "deletion_protection": false, + "deployment_set_group_no": null, + "deployment_set_id": "", + "description": "", + "dry_run": false, + "force_delete": null, + "host_name": "iZj6c8f1r86lgu3w2cl5ncZ", + "hpc_cluster_id": "", + "http_endpoint": "", + "http_put_response_hop_limit": 0, + "http_tokens": "", + "id": "i-j6c8f1r86lgu3w2cl5nc", + "image_id": "ubuntu_22_04_x64_20G_alibase_20230613.vhd", + "include_data_disks": null, + "instance_charge_type": "PostPaid", + "instance_name": "kubernetes-tf-kube-1", + "instance_type": "ecs.g7.xlarge", + "internet_charge_type": "PayByTraffic", + "internet_max_bandwidth_in": -1, + "internet_max_bandwidth_out": 0, + "io_optimized": null, + "ipv6_address_count": 0, + "ipv6_addresses": [], + "is_outdated": null, + "key_name": "", + "kms_encrypted_password": null, + "kms_encryption_context": null, + "maintenance_action": "AutoRecover", + "maintenance_notify": false, + "maintenance_time": [], + "memory": 16384, + "network_interface_id": "eni-j6cf04332m123qqk3e25", + "operator_type": null, + "os_name": "Ubuntu 22.04 64位", + "os_type": "linux", + "password": "Fanux#123", + "period": null, + "period_unit": null, + "primary_ip_address": "172.16.7.11", + "private_ip": "172.16.7.11", + "public_ip": "", + "renewal_status": null, + "resource_group_id": "", + "role_name": null, + "secondary_private_ip_address_count": 0, + "secondary_private_ips": [], + "security_enhancement_strategy": null, + "security_groups": [ + "sg-j6c92di1f36o41wegamo" + ], + "spot_duration": 1, + "spot_price_limit": 0, + "spot_strategy": "SpotAsPriceGo", + "status": "Running", + "stopped_mode": "Not-applicable", + "subnet_id": "vsw-j6ci73yrqv4w1qtu539df", + "system_disk_auto_snapshot_policy_id": "", + "system_disk_category": "cloud_essd", + "system_disk_description": "", + "system_disk_encrypt_algorithm": null, + "system_disk_encrypted": false, + "system_disk_id": "d-j6cikf9lqxgheu6oo53l", + "system_disk_kms_key_id": "", + "system_disk_name": "", + "system_disk_performance_level": "PL1", + "system_disk_size": 50, + "system_disk_storage_cluster_id": "", + "tags": null, + "timeouts": null, + "user_data": null, + "volume_tags": {}, + "vswitch_id": "vsw-j6ci73yrqv4w1qtu539df" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "alicloud_security_group.default", + "alicloud_vpc.vpc", + "alicloud_vswitch.vsw" + ] + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "allocate_public_ip": null, + "auto_release_time": "", + "auto_renew_period": null, + "availability_zone": "cn-hongkong-b", + "cpu": 4, + "credit_specification": "", + "data_disks": [], + "dedicated_host_id": "", + "deletion_protection": false, + "deployment_set_group_no": null, + "deployment_set_id": "", + "description": "", + "dry_run": false, + "force_delete": null, + "host_name": "iZj6c8w9kg16teg59oymv1Z", + "hpc_cluster_id": "", + "http_endpoint": "", + "http_put_response_hop_limit": 0, + "http_tokens": "", + "id": "i-j6c8w9kg16teg59oymv1", + "image_id": "ubuntu_22_04_x64_20G_alibase_20230613.vhd", + "include_data_disks": null, + "instance_charge_type": "PostPaid", + "instance_name": "kubernetes-tf-kube-2", + "instance_type": "ecs.g7.xlarge", + "internet_charge_type": "PayByTraffic", + "internet_max_bandwidth_in": -1, + "internet_max_bandwidth_out": 0, + "io_optimized": null, + "ipv6_address_count": 0, + "ipv6_addresses": [], + "is_outdated": null, + "key_name": "", + "kms_encrypted_password": null, + "kms_encryption_context": null, + "maintenance_action": "AutoRecover", + "maintenance_notify": false, + "maintenance_time": [], + "memory": 16384, + "network_interface_id": "eni-j6c4fzs6w4hegxbphypt", + "operator_type": null, + "os_name": "Ubuntu 22.04 64位", + "os_type": "linux", + "password": "Fanux#123", + "period": null, + "period_unit": null, + "primary_ip_address": "172.16.7.13", + "private_ip": "172.16.7.13", + "public_ip": "", + "renewal_status": null, + "resource_group_id": "", + "role_name": null, + "secondary_private_ip_address_count": 0, + "secondary_private_ips": [], + "security_enhancement_strategy": null, + "security_groups": [ + "sg-j6c92di1f36o41wegamo" + ], + "spot_duration": 1, + "spot_price_limit": 0, + "spot_strategy": "SpotAsPriceGo", + "status": "Running", + "stopped_mode": "Not-applicable", + "subnet_id": "vsw-j6ci73yrqv4w1qtu539df", + "system_disk_auto_snapshot_policy_id": "", + "system_disk_category": "cloud_essd", + "system_disk_description": "", + "system_disk_encrypt_algorithm": null, + "system_disk_encrypted": false, + "system_disk_id": "d-j6c8w9kg16teg59q9c1q", + "system_disk_kms_key_id": "", + "system_disk_name": "", + "system_disk_performance_level": "PL1", + "system_disk_size": 50, + "system_disk_storage_cluster_id": "", + "tags": null, + "timeouts": null, + "user_data": null, + "volume_tags": {}, + "vswitch_id": "vsw-j6ci73yrqv4w1qtu539df" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "alicloud_security_group.default", + "alicloud_vpc.vpc", + "alicloud_vswitch.vsw" + ] + }, + { + "index_key": 3, + "schema_version": 0, + "attributes": { + "allocate_public_ip": null, + "auto_release_time": "", + "auto_renew_period": null, + "availability_zone": "cn-hongkong-b", + "cpu": 4, + "credit_specification": "", + "data_disks": [], + "dedicated_host_id": "", + "deletion_protection": false, + "deployment_set_group_no": null, + "deployment_set_id": "", + "description": "", + "dry_run": false, + "force_delete": null, + "host_name": "iZj6chixuzzs8pvwovwqz5Z", + "hpc_cluster_id": "", + "http_endpoint": "", + "http_put_response_hop_limit": 0, + "http_tokens": "", + "id": "i-j6chixuzzs8pvwovwqz5", + "image_id": "ubuntu_22_04_x64_20G_alibase_20230613.vhd", + "include_data_disks": null, + "instance_charge_type": "PostPaid", + "instance_name": "kubernetes-tf-kube-3", + "instance_type": "ecs.g7.xlarge", + "internet_charge_type": "PayByTraffic", + "internet_max_bandwidth_in": -1, + "internet_max_bandwidth_out": 0, + "io_optimized": null, + "ipv6_address_count": 0, + "ipv6_addresses": [], + "is_outdated": null, + "key_name": "", + "kms_encrypted_password": null, + "kms_encryption_context": null, + "maintenance_action": "AutoRecover", + "maintenance_notify": false, + "maintenance_time": [], + "memory": 16384, + "network_interface_id": "eni-j6c97y7jaif1yyf5x2et", + "operator_type": null, + "os_name": "Ubuntu 22.04 64位", + "os_type": "linux", + "password": "Fanux#123", + "period": null, + "period_unit": null, + "primary_ip_address": "172.16.7.12", + "private_ip": "172.16.7.12", + "public_ip": "", + "renewal_status": null, + "resource_group_id": "", + "role_name": null, + "secondary_private_ip_address_count": 0, + "secondary_private_ips": [], + "security_enhancement_strategy": null, + "security_groups": [ + "sg-j6c92di1f36o41wegamo" + ], + "spot_duration": 1, + "spot_price_limit": 0, + "spot_strategy": "SpotAsPriceGo", + "status": "Running", + "stopped_mode": "Not-applicable", + "subnet_id": "vsw-j6ci73yrqv4w1qtu539df", + "system_disk_auto_snapshot_policy_id": "", + "system_disk_category": "cloud_essd", + "system_disk_description": "", + "system_disk_encrypt_algorithm": null, + "system_disk_encrypted": false, + "system_disk_id": "d-j6chemiutlo6g1qq08vk", + "system_disk_kms_key_id": "", + "system_disk_name": "", + "system_disk_performance_level": "PL1", + "system_disk_size": 50, + "system_disk_storage_cluster_id": "", + "tags": null, + "timeouts": null, + "user_data": null, + "volume_tags": {}, + "vswitch_id": "vsw-j6ci73yrqv4w1qtu539df" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "alicloud_security_group.default", + "alicloud_vpc.vpc", + "alicloud_vswitch.vsw" + ] + }, + { + "index_key": 4, + "schema_version": 0, + "attributes": { + "allocate_public_ip": null, + "auto_release_time": "", + "auto_renew_period": null, + "availability_zone": "cn-hongkong-b", + "cpu": 4, + "credit_specification": "", + "data_disks": [], + "dedicated_host_id": "", + "deletion_protection": false, + "deployment_set_group_no": null, + "deployment_set_id": "", + "description": "", + "dry_run": false, + "force_delete": null, + "host_name": "iZj6ccqn4plsv3jm4nfs7zZ", + "hpc_cluster_id": "", + "http_endpoint": "", + "http_put_response_hop_limit": 0, + "http_tokens": "", + "id": "i-j6ccqn4plsv3jm4nfs7z", + "image_id": "ubuntu_22_04_x64_20G_alibase_20230613.vhd", + "include_data_disks": null, + "instance_charge_type": "PostPaid", + "instance_name": "kubernetes-tf-kube-4", + "instance_type": "ecs.g7.xlarge", + "internet_charge_type": "PayByTraffic", + "internet_max_bandwidth_in": -1, + "internet_max_bandwidth_out": 0, + "io_optimized": null, + "ipv6_address_count": 0, + "ipv6_addresses": [], + "is_outdated": null, + "key_name": "", + "kms_encrypted_password": null, + "kms_encryption_context": null, + "maintenance_action": "AutoRecover", + "maintenance_notify": false, + "maintenance_time": [], + "memory": 16384, + "network_interface_id": "eni-j6c1jwgknf6dnpantiil", + "operator_type": null, + "os_name": "Ubuntu 22.04 64位", + "os_type": "linux", + "password": "Fanux#123", + "period": null, + "period_unit": null, + "primary_ip_address": "172.16.7.14", + "private_ip": "172.16.7.14", + "public_ip": "", + "renewal_status": null, + "resource_group_id": "", + "role_name": null, + "secondary_private_ip_address_count": 0, + "secondary_private_ips": [], + "security_enhancement_strategy": null, + "security_groups": [ + "sg-j6c92di1f36o41wegamo" + ], + "spot_duration": 1, + "spot_price_limit": 0, + "spot_strategy": "SpotAsPriceGo", + "status": "Running", + "stopped_mode": "Not-applicable", + "subnet_id": "vsw-j6ci73yrqv4w1qtu539df", + "system_disk_auto_snapshot_policy_id": "", + "system_disk_category": "cloud_essd", + "system_disk_description": "", + "system_disk_encrypt_algorithm": null, + "system_disk_encrypted": false, + "system_disk_id": "d-j6c6x5krjhlz9z6ir13h", + "system_disk_kms_key_id": "", + "system_disk_name": "", + "system_disk_performance_level": "PL1", + "system_disk_size": 50, + "system_disk_storage_cluster_id": "", + "tags": null, + "timeouts": null, + "user_data": null, + "volume_tags": {}, + "vswitch_id": "vsw-j6ci73yrqv4w1qtu539df" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "alicloud_security_group.default", + "alicloud_vpc.vpc", + "alicloud_vswitch.vsw" + ] + }, + { + "index_key": 5, + "schema_version": 0, + "attributes": { + "allocate_public_ip": null, + "auto_release_time": "", + "auto_renew_period": null, + "availability_zone": "cn-hongkong-b", + "cpu": 4, + "credit_specification": "", + "data_disks": [], + "dedicated_host_id": "", + "deletion_protection": false, + "deployment_set_group_no": null, + "deployment_set_id": "", + "description": "", + "dry_run": false, + "force_delete": null, + "host_name": "iZj6cgtbngl9eriifqpcwtZ", + "hpc_cluster_id": "", + "http_endpoint": "", + "http_put_response_hop_limit": 0, + "http_tokens": "", + "id": "i-j6cgtbngl9eriifqpcwt", + "image_id": "ubuntu_22_04_x64_20G_alibase_20230613.vhd", + "include_data_disks": null, + "instance_charge_type": "PostPaid", + "instance_name": "kubernetes-tf-kube-5", + "instance_type": "ecs.g7.xlarge", + "internet_charge_type": "PayByTraffic", + "internet_max_bandwidth_in": -1, + "internet_max_bandwidth_out": 0, + "io_optimized": null, + "ipv6_address_count": 0, + "ipv6_addresses": [], + "is_outdated": null, + "key_name": "", + "kms_encrypted_password": null, + "kms_encryption_context": null, + "maintenance_action": "AutoRecover", + "maintenance_notify": false, + "maintenance_time": [], + "memory": 16384, + "network_interface_id": "eni-j6cicmrm2hwpncijun24", + "operator_type": null, + "os_name": "Ubuntu 22.04 64位", + "os_type": "linux", + "password": "Fanux#123", + "period": null, + "period_unit": null, + "primary_ip_address": "172.16.7.15", + "private_ip": "172.16.7.15", + "public_ip": "", + "renewal_status": null, + "resource_group_id": "", + "role_name": null, + "secondary_private_ip_address_count": 0, + "secondary_private_ips": [], + "security_enhancement_strategy": null, + "security_groups": [ + "sg-j6c92di1f36o41wegamo" + ], + "spot_duration": 1, + "spot_price_limit": 0, + "spot_strategy": "SpotAsPriceGo", + "status": "Running", + "stopped_mode": "Not-applicable", + "subnet_id": "vsw-j6ci73yrqv4w1qtu539df", + "system_disk_auto_snapshot_policy_id": "", + "system_disk_category": "cloud_essd", + "system_disk_description": "", + "system_disk_encrypt_algorithm": null, + "system_disk_encrypted": false, + "system_disk_id": "d-j6c92di1f36o41we4q1i", + "system_disk_kms_key_id": "", + "system_disk_name": "", + "system_disk_performance_level": "PL1", + "system_disk_size": 50, + "system_disk_storage_cluster_id": "", + "tags": null, + "timeouts": null, + "user_data": null, + "volume_tags": {}, + "vswitch_id": "vsw-j6ci73yrqv4w1qtu539df" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "alicloud_security_group.default", + "alicloud_vpc.vpc", + "alicloud_vswitch.vsw" + ] + } + ] + }, + { + "mode": "managed", + "type": "alicloud_instance", + "name": "sealos", + "provider": "provider[\"registry.terraform.io/hashicorp/alicloud\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "allocate_public_ip": null, + "auto_release_time": "", + "auto_renew_period": null, + "availability_zone": "cn-hongkong-b", + "cpu": 4, + "credit_specification": "", + "data_disks": [], + "dedicated_host_id": "", + "deletion_protection": false, + "deployment_set_group_no": null, + "deployment_set_id": "", + "description": "", + "dry_run": false, + "force_delete": null, + "host_name": "iZj6cikf9lqxgheu6n9knnZ", + "hpc_cluster_id": "", + "http_endpoint": "", + "http_put_response_hop_limit": 0, + "http_tokens": "", + "id": "i-j6cikf9lqxgheu6n9knn", + "image_id": "ubuntu_22_04_x64_20G_alibase_20230613.vhd", + "include_data_disks": null, + "instance_charge_type": "PostPaid", + "instance_name": "kubernetes-tf-sealos", + "instance_type": "ecs.g7.xlarge", + "internet_charge_type": "PayByTraffic", + "internet_max_bandwidth_in": 3000, + "internet_max_bandwidth_out": 100, + "io_optimized": null, + "ipv6_address_count": 0, + "ipv6_addresses": [], + "is_outdated": null, + "key_name": "", + "kms_encrypted_password": null, + "kms_encryption_context": null, + "maintenance_action": "AutoRecover", + "maintenance_notify": false, + "maintenance_time": [], + "memory": 16384, + "network_interface_id": "eni-j6chemiutlo6g1qmjhng", + "operator_type": null, + "os_name": "Ubuntu 22.04 64位", + "os_type": "linux", + "password": "Fanux#123", + "period": null, + "period_unit": null, + "primary_ip_address": "172.16.7.10", + "private_ip": "172.16.7.10", + "public_ip": "8.217.238.147", + "renewal_status": null, + "resource_group_id": "", + "role_name": null, + "secondary_private_ip_address_count": 0, + "secondary_private_ips": [], + "security_enhancement_strategy": null, + "security_groups": [ + "sg-j6c92di1f36o41wegamo" + ], + "spot_duration": 1, + "spot_price_limit": 0, + "spot_strategy": "SpotAsPriceGo", + "status": "Running", + "stopped_mode": "Not-applicable", + "subnet_id": "vsw-j6ci73yrqv4w1qtu539df", + "system_disk_auto_snapshot_policy_id": "", + "system_disk_category": "cloud_essd", + "system_disk_description": "", + "system_disk_encrypt_algorithm": null, + "system_disk_encrypted": false, + "system_disk_id": "d-j6cepuytattj2e0d1k1m", + "system_disk_kms_key_id": "", + "system_disk_name": "", + "system_disk_performance_level": "PL1", + "system_disk_size": 50, + "system_disk_storage_cluster_id": "", + "tags": null, + "timeouts": null, + "user_data": null, + "volume_tags": {}, + "vswitch_id": "vsw-j6ci73yrqv4w1qtu539df" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "alicloud_security_group.default", + "alicloud_vpc.vpc", + "alicloud_vswitch.vsw" + ] + } + ] + }, + { + "mode": "managed", + "type": "alicloud_security_group", + "name": "default", + "provider": "provider[\"registry.terraform.io/hashicorp/alicloud\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "description": "", + "id": "sg-j6c92di1f36o41wegamo", + "inner_access": true, + "inner_access_policy": "Accept", + "name": "kubernetes-tf", + "resource_group_id": "", + "security_group_type": "normal", + "tags": null, + "vpc_id": "vpc-j6csefx9ecqu81urz8d8u" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "alicloud_vpc.vpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "alicloud_security_group_rule", + "name": "allow_all_tcp", + "provider": "provider[\"registry.terraform.io/hashicorp/alicloud\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "cidr_ip": "0.0.0.0/0", + "description": "", + "id": "sg-j6c92di1f36o41wegamo:ingress:tcp:1/65535:intranet:0.0.0.0/0:accept:1", + "ip_protocol": "tcp", + "ipv6_cidr_ip": "", + "nic_type": "intranet", + "policy": "accept", + "port_range": "1/65535", + "prefix_list_id": "", + "priority": 1, + "security_group_id": "sg-j6c92di1f36o41wegamo", + "source_group_owner_account": "", + "source_security_group_id": "", + "type": "ingress" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "alicloud_security_group.default", + "alicloud_vpc.vpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "alicloud_vpc", + "name": "vpc", + "provider": "provider[\"registry.terraform.io/hashicorp/alicloud\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "cidr_block": "172.16.0.0/12", + "classic_link_enabled": false, + "create_time": "2023-10-04T13:41:56Z", + "description": "", + "dry_run": null, + "enable_ipv6": null, + "id": "vpc-j6csefx9ecqu81urz8d8u", + "ipv6_cidr_block": "", + "ipv6_cidr_blocks": [], + "ipv6_isp": null, + "name": "kubernetes-tf-vpc", + "resource_group_id": "rg-acfmwwqiglzlgga", + "route_table_id": "vtb-j6cwwo77hppbch9le0g7k", + "router_id": "vrt-j6ci1zckx79kpix5w6bkf", + "router_table_id": "vtb-j6cwwo77hppbch9le0g7k", + "secondary_cidr_blocks": [], + "status": "Available", + "tags": null, + "timeouts": null, + "user_cidrs": [], + "vpc_name": "kubernetes-tf-vpc" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjMwMDAwMDAwMDAwMH19" + } + ] + }, + { + "mode": "managed", + "type": "alicloud_vswitch", + "name": "vsw", + "provider": "provider[\"registry.terraform.io/hashicorp/alicloud\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "availability_zone": "cn-hongkong-b", + "cidr_block": "172.16.0.0/21", + "create_time": "2023-10-04T13:42:01Z", + "description": "", + "enable_ipv6": null, + "id": "vsw-j6ci73yrqv4w1qtu539df", + "ipv6_cidr_block": "", + "ipv6_cidr_block_mask": null, + "name": "kubernetes-tf-vsw", + "status": "Available", + "tags": null, + "timeouts": null, + "vpc_id": "vpc-j6csefx9ecqu81urz8d8u", + "vswitch_name": "kubernetes-tf-vsw", + "zone_id": "cn-hongkong-b" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjMwMDAwMDAwMDAwMH19", + "dependencies": [ + "alicloud_vpc.vpc" + ] + } + ] + } + ], + "check_results": null +} diff --git a/test/e2e/terraform/terraform_test.go b/test/e2e/terraform/terraform_test.go new file mode 100644 index 00000000000..50d0900f7d9 --- /dev/null +++ b/test/e2e/terraform/terraform_test.go @@ -0,0 +1,60 @@ +/* +Copyright 2023 cuisongliu@qq.com. + +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 main + +import ( + "os" + "testing" +) + +func TestTerraform_Apply(t *testing.T) { + tf := &Terraform{ + accessKey: os.Getenv("ALIYUN_AKID"), + secretKey: os.Getenv("ALIYUN_AKSK"), + } + if err := tf.Apply("amd64"); err != nil { + t.Errorf("%+v", err) + return + } + t.Logf("SUCCESS") +} + +func TestTerraform_Destroy(t *testing.T) { + tf := &Terraform{ + accessKey: os.Getenv("ALIYUN_AKID"), + secretKey: os.Getenv("ALIYUN_AKSK"), + } + if err := tf.Destroy(); err != nil { + t.Errorf("%+v", err) + return + } + t.Logf("SUCCESS") +} + +func TestTerraform_Detail(t *testing.T) { + tf := &Terraform{ + accessKey: os.Getenv("ALIYUN_AKID"), + secretKey: os.Getenv("ALIYUN_AKSK"), + } + var err error + var d *InfraDetail + if d, err = tf.Detail(); err != nil { + t.Errorf("%+v", err) + return + } + t.Logf("SUCCESS: %+v", d) +} diff --git a/test/e2e/terraform/zz_generated_terraform.go b/test/e2e/terraform/zz_generated_terraform.go new file mode 100644 index 00000000000..d31f21009f7 --- /dev/null +++ b/test/e2e/terraform/zz_generated_terraform.go @@ -0,0 +1,342 @@ +// Code generated by go-bindata. DO NOT EDIT. +// sources: +// infra/.gitignore +// infra/providers.tf +// infra/terraform.tf +// infra/vars.tf +// infra/vars.tf.amd64 +// infra/vars.tf.arm64 +package main + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "reflect" + "strings" + "time" + "unsafe" +) + +func bindataRead(data, name string) ([]byte, error) { + var empty [0]byte + sx := (*reflect.StringHeader)(unsafe.Pointer(&data)) + b := empty[:] + bx := (*reflect.SliceHeader)(unsafe.Pointer(&b)) + bx.Data = sx.Data + bx.Len = len(data) + bx.Cap = bx.Len + return b, nil +} + +type asset struct { + bytes []byte + info os.FileInfo +} + +type bindataFileInfo struct { + name string + size int64 + mode os.FileMode + modTime time.Time +} + +func (fi bindataFileInfo) Name() string { + return fi.name +} +func (fi bindataFileInfo) Size() int64 { + return fi.size +} +func (fi bindataFileInfo) Mode() os.FileMode { + return fi.mode +} +func (fi bindataFileInfo) ModTime() time.Time { + return fi.modTime +} +func (fi bindataFileInfo) IsDir() bool { + return false +} +func (fi bindataFileInfo) Sys() interface{} { + return nil +} + +var _infraGitignore = "\x2a\x2e\x74\x66\x73\x74\x61\x74\x65\x2a\x0a\x2e\x2e\x2f\x2e\x74\x65\x72\x72\x61\x66\x6f\x72\x6d\x2e\x6c\x6f\x63\x6b\x2e\x68\x63\x6c\x0a\x2e\x74\x65\x72\x72\x61\x66\x6f\x72\x6d\x0a" + +func infraGitignoreBytes() ([]byte, error) { + return bindataRead( + _infraGitignore, + "infra/.gitignore", + ) +} + +func infraGitignore() (*asset, error) { + bytes, err := infraGitignoreBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "infra/.gitignore", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _infraProvidersTf = "\x70\x72\x6f\x76\x69\x64\x65\x72\x20\x22\x61\x6c\x69\x63\x6c\x6f\x75\x64\x22\x20\x7b\x0a\x20\x20\x72\x65\x67\x69\x6f\x6e\x20\x3d\x20\x76\x61\x72\x2e\x72\x65\x67\x69\x6f\x6e\x0a\x7d\x0a" + +func infraProvidersTfBytes() ([]byte, error) { + return bindataRead( + _infraProvidersTf, + "infra/providers.tf", + ) +} + +func infraProvidersTf() (*asset, error) { + bytes, err := infraProvidersTfBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "infra/providers.tf", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _infraTerraformTf = "\x72\x65\x73\x6f\x75\x72\x63\x65\x20\x22\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x76\x70\x63\x22\x20\x22\x76\x70\x63\x22\x20\x7b\x0a\x20\x20\x76\x70\x63\x5f\x6e\x61\x6d\x65\x20\x20\x20\x3d\x20\x22\x24\x7b\x76\x61\x72\x2e\x6e\x61\x6d\x65\x7d\x2d\x76\x70\x63\x22\x0a\x20\x20\x63\x69\x64\x72\x5f\x62\x6c\x6f\x63\x6b\x20\x3d\x20\x22\x31\x37\x32\x2e\x31\x36\x2e\x30\x2e\x30\x2f\x31\x32\x22\x0a\x7d\x0a\x0a\x72\x65\x73\x6f\x75\x72\x63\x65\x20\x22\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x76\x73\x77\x69\x74\x63\x68\x22\x20\x22\x76\x73\x77\x22\x20\x7b\x0a\x20\x20\x76\x73\x77\x69\x74\x63\x68\x5f\x6e\x61\x6d\x65\x20\x3d\x20\x22\x24\x7b\x76\x61\x72\x2e\x6e\x61\x6d\x65\x7d\x2d\x76\x73\x77\x22\x0a\x20\x20\x76\x70\x63\x5f\x69\x64\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x76\x70\x63\x2e\x76\x70\x63\x2e\x69\x64\x0a\x20\x20\x63\x69\x64\x72\x5f\x62\x6c\x6f\x63\x6b\x20\x20\x20\x3d\x20\x22\x31\x37\x32\x2e\x31\x36\x2e\x30\x2e\x30\x2f\x32\x31\x22\x0a\x20\x20\x7a\x6f\x6e\x65\x5f\x69\x64\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x7a\x6f\x6e\x65\x0a\x7d\x0a\x0a\x72\x65\x73\x6f\x75\x72\x63\x65\x20\x22\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x73\x65\x63\x75\x72\x69\x74\x79\x5f\x67\x72\x6f\x75\x70\x22\x20\x22\x64\x65\x66\x61\x75\x6c\x74\x22\x20\x7b\x0a\x20\x20\x6e\x61\x6d\x65\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x6e\x61\x6d\x65\x0a\x20\x20\x76\x70\x63\x5f\x69\x64\x20\x3d\x20\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x76\x70\x63\x2e\x76\x70\x63\x2e\x69\x64\x0a\x7d\x0a\x0a\x72\x65\x73\x6f\x75\x72\x63\x65\x20\x22\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x73\x65\x63\x75\x72\x69\x74\x79\x5f\x67\x72\x6f\x75\x70\x5f\x72\x75\x6c\x65\x22\x20\x22\x61\x6c\x6c\x6f\x77\x5f\x61\x6c\x6c\x5f\x74\x63\x70\x22\x20\x7b\x0a\x20\x20\x74\x79\x70\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x69\x6e\x67\x72\x65\x73\x73\x22\x0a\x20\x20\x69\x70\x5f\x70\x72\x6f\x74\x6f\x63\x6f\x6c\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x74\x63\x70\x22\x0a\x20\x20\x6e\x69\x63\x5f\x74\x79\x70\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x69\x6e\x74\x72\x61\x6e\x65\x74\x22\x0a\x20\x20\x70\x6f\x6c\x69\x63\x79\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x61\x63\x63\x65\x70\x74\x22\x0a\x20\x20\x70\x6f\x72\x74\x5f\x72\x61\x6e\x67\x65\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x31\x2f\x36\x35\x35\x33\x35\x22\x0a\x20\x20\x70\x72\x69\x6f\x72\x69\x74\x79\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x31\x0a\x20\x20\x73\x65\x63\x75\x72\x69\x74\x79\x5f\x67\x72\x6f\x75\x70\x5f\x69\x64\x20\x3d\x20\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x73\x65\x63\x75\x72\x69\x74\x79\x5f\x67\x72\x6f\x75\x70\x2e\x64\x65\x66\x61\x75\x6c\x74\x2e\x69\x64\x0a\x20\x20\x63\x69\x64\x72\x5f\x69\x70\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x30\x2e\x30\x2e\x30\x2e\x30\x2f\x30\x22\x0a\x7d\x0a\x0a\x0a\x72\x65\x73\x6f\x75\x72\x63\x65\x20\x22\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x69\x6e\x73\x74\x61\x6e\x63\x65\x22\x20\x22\x73\x65\x61\x6c\x6f\x73\x22\x20\x7b\x0a\x20\x20\x69\x6e\x73\x74\x61\x6e\x63\x65\x5f\x6e\x61\x6d\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x24\x7b\x76\x61\x72\x2e\x6e\x61\x6d\x65\x7d\x2d\x73\x65\x61\x6c\x6f\x73\x22\x0a\x20\x20\x63\x6f\x75\x6e\x74\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x31\x0a\x20\x20\x61\x76\x61\x69\x6c\x61\x62\x69\x6c\x69\x74\x79\x5f\x7a\x6f\x6e\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x7a\x6f\x6e\x65\x0a\x20\x20\x73\x65\x63\x75\x72\x69\x74\x79\x5f\x67\x72\x6f\x75\x70\x73\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x5b\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x73\x65\x63\x75\x72\x69\x74\x79\x5f\x67\x72\x6f\x75\x70\x2e\x64\x65\x66\x61\x75\x6c\x74\x2e\x69\x64\x5d\x0a\x20\x20\x69\x6e\x73\x74\x61\x6e\x63\x65\x5f\x74\x79\x70\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x65\x63\x73\x5f\x74\x79\x70\x65\x0a\x20\x20\x73\x79\x73\x74\x65\x6d\x5f\x64\x69\x73\x6b\x5f\x63\x61\x74\x65\x67\x6f\x72\x79\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x64\x69\x73\x6b\x5f\x63\x61\x74\x65\x67\x6f\x72\x79\x0a\x20\x20\x73\x79\x73\x74\x65\x6d\x5f\x64\x69\x73\x6b\x5f\x73\x69\x7a\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x35\x30\x0a\x20\x20\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x65\x63\x73\x5f\x70\x61\x73\x73\x77\x6f\x72\x64\x0a\x20\x20\x69\x6d\x61\x67\x65\x5f\x69\x64\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x69\x6d\x61\x67\x65\x5f\x69\x64\x0a\x20\x20\x76\x73\x77\x69\x74\x63\x68\x5f\x69\x64\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x76\x73\x77\x69\x74\x63\x68\x2e\x76\x73\x77\x2e\x69\x64\x0a\x20\x20\x69\x6e\x74\x65\x72\x6e\x65\x74\x5f\x6d\x61\x78\x5f\x62\x61\x6e\x64\x77\x69\x64\x74\x68\x5f\x6f\x75\x74\x20\x3d\x20\x31\x30\x30\x0a\x20\x20\x69\x6e\x73\x74\x61\x6e\x63\x65\x5f\x63\x68\x61\x72\x67\x65\x5f\x74\x79\x70\x65\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x50\x6f\x73\x74\x50\x61\x69\x64\x22\x0a\x20\x20\x73\x70\x6f\x74\x5f\x73\x74\x72\x61\x74\x65\x67\x79\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x53\x70\x6f\x74\x41\x73\x50\x72\x69\x63\x65\x47\x6f\x22\x0a\x7d\x0a\x0a\x72\x65\x73\x6f\x75\x72\x63\x65\x20\x22\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x69\x6e\x73\x74\x61\x6e\x63\x65\x22\x20\x22\x6b\x75\x62\x65\x22\x20\x7b\x0a\x20\x20\x69\x6e\x73\x74\x61\x6e\x63\x65\x5f\x6e\x61\x6d\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x24\x7b\x76\x61\x72\x2e\x6e\x61\x6d\x65\x7d\x2d\x6b\x75\x62\x65\x2d\x24\x7b\x63\x6f\x75\x6e\x74\x2e\x69\x6e\x64\x65\x78\x7d\x22\x0a\x20\x20\x63\x6f\x75\x6e\x74\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x36\x0a\x20\x20\x61\x76\x61\x69\x6c\x61\x62\x69\x6c\x69\x74\x79\x5f\x7a\x6f\x6e\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x7a\x6f\x6e\x65\x0a\x20\x20\x73\x65\x63\x75\x72\x69\x74\x79\x5f\x67\x72\x6f\x75\x70\x73\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x5b\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x73\x65\x63\x75\x72\x69\x74\x79\x5f\x67\x72\x6f\x75\x70\x2e\x64\x65\x66\x61\x75\x6c\x74\x2e\x69\x64\x5d\x0a\x20\x20\x69\x6e\x73\x74\x61\x6e\x63\x65\x5f\x74\x79\x70\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x65\x63\x73\x5f\x74\x79\x70\x65\x0a\x20\x20\x73\x79\x73\x74\x65\x6d\x5f\x64\x69\x73\x6b\x5f\x63\x61\x74\x65\x67\x6f\x72\x79\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x64\x69\x73\x6b\x5f\x63\x61\x74\x65\x67\x6f\x72\x79\x0a\x20\x20\x73\x79\x73\x74\x65\x6d\x5f\x64\x69\x73\x6b\x5f\x73\x69\x7a\x65\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x35\x30\x0a\x20\x20\x70\x61\x73\x73\x77\x6f\x72\x64\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x65\x63\x73\x5f\x70\x61\x73\x73\x77\x6f\x72\x64\x0a\x20\x20\x69\x6d\x61\x67\x65\x5f\x69\x64\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x76\x61\x72\x2e\x69\x6d\x61\x67\x65\x5f\x69\x64\x0a\x20\x20\x76\x73\x77\x69\x74\x63\x68\x5f\x69\x64\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x61\x6c\x69\x63\x6c\x6f\x75\x64\x5f\x76\x73\x77\x69\x74\x63\x68\x2e\x76\x73\x77\x2e\x69\x64\x0a\x20\x20\x69\x6e\x74\x65\x72\x6e\x65\x74\x5f\x6d\x61\x78\x5f\x62\x61\x6e\x64\x77\x69\x64\x74\x68\x5f\x6f\x75\x74\x20\x3d\x20\x30\x0a\x20\x20\x69\x6e\x73\x74\x61\x6e\x63\x65\x5f\x63\x68\x61\x72\x67\x65\x5f\x74\x79\x70\x65\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x50\x6f\x73\x74\x50\x61\x69\x64\x22\x0a\x20\x20\x73\x70\x6f\x74\x5f\x73\x74\x72\x61\x74\x65\x67\x79\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3d\x20\x22\x53\x70\x6f\x74\x41\x73\x50\x72\x69\x63\x65\x47\x6f\x22\x0a\x7d\x0a\x0a" + +func infraTerraformTfBytes() ([]byte, error) { + return bindataRead( + _infraTerraformTf, + "infra/terraform.tf", + ) +} + +func infraTerraformTf() (*asset, error) { + bytes, err := infraTerraformTfBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "infra/terraform.tf", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _infraVarsTf = "\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x6e\x61\x6d\x65\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x6b\x75\x62\x65\x72\x6e\x65\x74\x65\x73\x2d\x74\x66\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x7a\x6f\x6e\x65\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x63\x6e\x2d\x68\x6f\x6e\x67\x6b\x6f\x6e\x67\x2d\x62\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x72\x65\x67\x69\x6f\x6e\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x63\x6e\x2d\x68\x6f\x6e\x67\x6b\x6f\x6e\x67\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x69\x6d\x61\x67\x65\x5f\x69\x64\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x75\x62\x75\x6e\x74\x75\x5f\x32\x32\x5f\x30\x34\x5f\x78\x36\x34\x5f\x32\x30\x47\x5f\x61\x6c\x69\x62\x61\x73\x65\x5f\x32\x30\x32\x33\x30\x36\x31\x33\x2e\x76\x68\x64\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x65\x63\x73\x5f\x74\x79\x70\x65\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x65\x63\x73\x2e\x67\x37\x2e\x78\x6c\x61\x72\x67\x65\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x65\x63\x73\x5f\x70\x61\x73\x73\x77\x6f\x72\x64\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x46\x61\x6e\x75\x78\x23\x31\x32\x33\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x64\x69\x73\x6b\x5f\x63\x61\x74\x65\x67\x6f\x72\x79\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x63\x6c\x6f\x75\x64\x5f\x65\x73\x73\x64\x22\x0a\x7d\x0a" + +func infraVarsTfBytes() ([]byte, error) { + return bindataRead( + _infraVarsTf, + "infra/vars.tf", + ) +} + +func infraVarsTf() (*asset, error) { + bytes, err := infraVarsTfBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "infra/vars.tf", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _infraVarsTfAmd64 = "\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x6e\x61\x6d\x65\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x6b\x75\x62\x65\x72\x6e\x65\x74\x65\x73\x2d\x74\x66\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x7a\x6f\x6e\x65\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x63\x6e\x2d\x68\x6f\x6e\x67\x6b\x6f\x6e\x67\x2d\x62\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x72\x65\x67\x69\x6f\x6e\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x63\x6e\x2d\x68\x6f\x6e\x67\x6b\x6f\x6e\x67\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x69\x6d\x61\x67\x65\x5f\x69\x64\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x75\x62\x75\x6e\x74\x75\x5f\x32\x32\x5f\x30\x34\x5f\x78\x36\x34\x5f\x32\x30\x47\x5f\x61\x6c\x69\x62\x61\x73\x65\x5f\x32\x30\x32\x33\x30\x36\x31\x33\x2e\x76\x68\x64\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x65\x63\x73\x5f\x74\x79\x70\x65\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x65\x63\x73\x2e\x67\x37\x2e\x78\x6c\x61\x72\x67\x65\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x65\x63\x73\x5f\x70\x61\x73\x73\x77\x6f\x72\x64\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x46\x61\x6e\x75\x78\x23\x31\x32\x33\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x64\x69\x73\x6b\x5f\x63\x61\x74\x65\x67\x6f\x72\x79\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x63\x6c\x6f\x75\x64\x5f\x65\x73\x73\x64\x22\x0a\x7d\x0a" + +func infraVarsTfAmd64Bytes() ([]byte, error) { + return bindataRead( + _infraVarsTfAmd64, + "infra/vars.tf.amd64", + ) +} + +func infraVarsTfAmd64() (*asset, error) { + bytes, err := infraVarsTfAmd64Bytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "infra/vars.tf.amd64", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _infraVarsTfArm64 = "\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x6e\x61\x6d\x65\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x6b\x75\x62\x65\x72\x6e\x65\x74\x65\x73\x2d\x74\x66\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x7a\x6f\x6e\x65\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x61\x70\x2d\x73\x6f\x75\x74\x68\x65\x61\x73\x74\x2d\x31\x61\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x72\x65\x67\x69\x6f\x6e\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x61\x70\x2d\x73\x6f\x75\x74\x68\x65\x61\x73\x74\x2d\x31\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x69\x6d\x61\x67\x65\x5f\x69\x64\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x75\x62\x75\x6e\x74\x75\x5f\x32\x32\x5f\x30\x34\x5f\x61\x72\x6d\x36\x34\x5f\x32\x30\x47\x5f\x61\x6c\x69\x62\x61\x73\x65\x5f\x32\x30\x32\x33\x30\x37\x31\x32\x2e\x76\x68\x64\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x65\x63\x73\x5f\x74\x79\x70\x65\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x65\x63\x73\x2e\x67\x36\x72\x2e\x78\x6c\x61\x72\x67\x65\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x65\x63\x73\x5f\x70\x61\x73\x73\x77\x6f\x72\x64\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x46\x61\x6e\x75\x78\x23\x31\x32\x33\x22\x0a\x7d\x0a\x0a\x76\x61\x72\x69\x61\x62\x6c\x65\x20\x22\x64\x69\x73\x6b\x5f\x63\x61\x74\x65\x67\x6f\x72\x79\x22\x20\x7b\x0a\x20\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x22\x63\x6c\x6f\x75\x64\x5f\x65\x73\x73\x64\x22\x0a\x7d\x0a" + +func infraVarsTfArm64Bytes() ([]byte, error) { + return bindataRead( + _infraVarsTfArm64, + "infra/vars.tf.arm64", + ) +} + +func infraVarsTfArm64() (*asset, error) { + bytes, err := infraVarsTfArm64Bytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "infra/vars.tf.arm64", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +// Asset loads and returns the asset for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func Asset(name string) ([]byte, error) { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) + } + return a.bytes, nil + } + return nil, fmt.Errorf("Asset %s not found", name) +} + +// MustAsset is like Asset but panics when Asset would return an error. +// It simplifies safe initialization of global variables. +func MustAsset(name string) []byte { + a, err := Asset(name) + if err != nil { + panic("asset: Asset(" + name + "): " + err.Error()) + } + + return a +} + +// AssetInfo loads and returns the asset info for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func AssetInfo(name string) (os.FileInfo, error) { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) + } + return a.info, nil + } + return nil, fmt.Errorf("AssetInfo %s not found", name) +} + +// AssetNames returns the names of the assets. +func AssetNames() []string { + names := make([]string, 0, len(_bindata)) + for name := range _bindata { + names = append(names, name) + } + return names +} + +// _bindata is a table, holding each asset generator, mapped to its name. +var _bindata = map[string]func() (*asset, error){ + "infra/.gitignore": infraGitignore, + "infra/providers.tf": infraProvidersTf, + "infra/terraform.tf": infraTerraformTf, + "infra/vars.tf": infraVarsTf, + "infra/vars.tf.amd64": infraVarsTfAmd64, + "infra/vars.tf.arm64": infraVarsTfArm64, +} + +// AssetDir returns the file names below a certain +// directory embedded in the file by go-bindata. +// For example if you run go-bindata on data/... and data contains the +// following hierarchy: +// +// data/ +// foo.txt +// img/ +// a.png +// b.png +// +// then AssetDir("data") would return []string{"foo.txt", "img"} +// AssetDir("data/img") would return []string{"a.png", "b.png"} +// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// AssetDir("") will return []string{"data"}. +func AssetDir(name string) ([]string, error) { + node := _bintree + if len(name) != 0 { + cannonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(cannonicalName, "/") + for _, p := range pathList { + node = node.Children[p] + if node == nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + } + } + if node.Func != nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + rv := make([]string, 0, len(node.Children)) + for childName := range node.Children { + rv = append(rv, childName) + } + return rv, nil +} + +type bintree struct { + Func func() (*asset, error) + Children map[string]*bintree +} + +var _bintree = &bintree{nil, map[string]*bintree{ + "infra": {nil, map[string]*bintree{ + ".gitignore": {infraGitignore, map[string]*bintree{}}, + "providers.tf": {infraProvidersTf, map[string]*bintree{}}, + "terraform.tf": {infraTerraformTf, map[string]*bintree{}}, + "vars.tf": {infraVarsTf, map[string]*bintree{}}, + "vars.tf.amd64": {infraVarsTfAmd64, map[string]*bintree{}}, + "vars.tf.arm64": {infraVarsTfArm64, map[string]*bintree{}}, + }}, +}} + +// RestoreAsset restores an asset under the given directory +func RestoreAsset(dir, name string) error { + data, err := Asset(name) + if err != nil { + return err + } + info, err := AssetInfo(name) + if err != nil { + return err + } + err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) + if err != nil { + return err + } + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + if err != nil { + return err + } + err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) + if err != nil { + return err + } + return nil +} + +// RestoreAssets restores an asset under the given directory recursively +func RestoreAssets(dir, name string) error { + children, err := AssetDir(name) + // File + if err != nil { + return RestoreAsset(dir, name) + } + // Dir + for _, child := range children { + err = RestoreAssets(dir, filepath.Join(name, child)) + if err != nil { + return err + } + } + return nil +} + +func _filePath(dir, name string) string { + cannonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) +} diff --git a/test/e2e/testdata/containerd-svc-etcd.yaml b/test/e2e/testdata/kubeadm/containerd-svc-etcd.yaml similarity index 100% rename from test/e2e/testdata/containerd-svc-etcd.yaml rename to test/e2e/testdata/kubeadm/containerd-svc-etcd.yaml diff --git a/test/e2e/testdata/containerd-svc-sans.yaml b/test/e2e/testdata/kubeadm/containerd-svc-sans.yaml similarity index 100% rename from test/e2e/testdata/containerd-svc-sans.yaml rename to test/e2e/testdata/kubeadm/containerd-svc-sans.yaml diff --git a/test/e2e/testdata/containerd-svc-taints.yaml b/test/e2e/testdata/kubeadm/containerd-svc-taints.yaml similarity index 100% rename from test/e2e/testdata/containerd-svc-taints.yaml rename to test/e2e/testdata/kubeadm/containerd-svc-taints.yaml diff --git a/test/e2e/testdata/custome-containerd-svc.yaml b/test/e2e/testdata/kubeadm/custome-containerd-svc.yaml similarity index 100% rename from test/e2e/testdata/custome-containerd-svc.yaml rename to test/e2e/testdata/kubeadm/custome-containerd-svc.yaml diff --git a/test/e2e/testdata/custome-docker-svc.yaml b/test/e2e/testdata/kubeadm/custome-docker-svc.yaml similarity index 100% rename from test/e2e/testdata/custome-docker-svc.yaml rename to test/e2e/testdata/kubeadm/custome-docker-svc.yaml diff --git a/test/e2e/testdata/kubeadm/doc.go b/test/e2e/testdata/kubeadm/doc.go new file mode 100644 index 00000000000..d5f3312d775 --- /dev/null +++ b/test/e2e/testdata/kubeadm/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2023 cuisongliu@qq.com. + +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" diff --git a/test/e2e/testdata/docker-svc-sans.yaml b/test/e2e/testdata/kubeadm/docker-svc-sans.yaml similarity index 100% rename from test/e2e/testdata/docker-svc-sans.yaml rename to test/e2e/testdata/kubeadm/docker-svc-sans.yaml diff --git a/test/e2e/testdata/kubeadm/zz_generated_kubeadm.go b/test/e2e/testdata/kubeadm/zz_generated_kubeadm.go new file mode 100644 index 00000000000..83fb1e3ef81 --- /dev/null +++ b/test/e2e/testdata/kubeadm/zz_generated_kubeadm.go @@ -0,0 +1,342 @@ +// Code generated by go-bindata. DO NOT EDIT. +// sources: +// kubeadm/containerd-svc-etcd.yaml +// kubeadm/containerd-svc-sans.yaml +// kubeadm/containerd-svc-taints.yaml +// kubeadm/custome-containerd-svc.yaml +// kubeadm/custome-docker-svc.yaml +// kubeadm/docker-svc-sans.yaml +package kubeadm + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "reflect" + "strings" + "time" + "unsafe" +) + +func bindataRead(data, name string) ([]byte, error) { + var empty [0]byte + sx := (*reflect.StringHeader)(unsafe.Pointer(&data)) + b := empty[:] + bx := (*reflect.SliceHeader)(unsafe.Pointer(&b)) + bx.Data = sx.Data + bx.Len = len(data) + bx.Cap = bx.Len + return b, nil +} + +type asset struct { + bytes []byte + info os.FileInfo +} + +type bindataFileInfo struct { + name string + size int64 + mode os.FileMode + modTime time.Time +} + +func (fi bindataFileInfo) Name() string { + return fi.name +} +func (fi bindataFileInfo) Size() int64 { + return fi.size +} +func (fi bindataFileInfo) Mode() os.FileMode { + return fi.mode +} +func (fi bindataFileInfo) ModTime() time.Time { + return fi.modTime +} +func (fi bindataFileInfo) IsDir() bool { + return false +} +func (fi bindataFileInfo) Sys() interface{} { + return nil +} + +var _kubeadmContainerdSvcEtcdYaml = "\x23\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\xc2\xa9\x20\x32\x30\x32\x33\x20\x73\x65\x61\x6c\x6f\x73\x2e\x0a\x23\x0a\x23\x20\x4c\x69\x63\x65\x6e\x73\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x41\x70\x61\x63\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2c\x20\x56\x65\x72\x73\x69\x6f\x6e\x20\x32\x2e\x30\x20\x28\x74\x68\x65\x20\x22\x4c\x69\x63\x65\x6e\x73\x65\x22\x29\x3b\x0a\x23\x20\x79\x6f\x75\x20\x6d\x61\x79\x20\x6e\x6f\x74\x20\x75\x73\x65\x20\x74\x68\x69\x73\x20\x66\x69\x6c\x65\x20\x65\x78\x63\x65\x70\x74\x20\x69\x6e\x20\x63\x6f\x6d\x70\x6c\x69\x61\x6e\x63\x65\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x23\x20\x59\x6f\x75\x20\x6d\x61\x79\x20\x6f\x62\x74\x61\x69\x6e\x20\x61\x20\x63\x6f\x70\x79\x20\x6f\x66\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x61\x74\x0a\x23\x0a\x23\x20\x20\x20\x20\x20\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x61\x70\x61\x63\x68\x65\x2e\x6f\x72\x67\x2f\x6c\x69\x63\x65\x6e\x73\x65\x73\x2f\x4c\x49\x43\x45\x4e\x53\x45\x2d\x32\x2e\x30\x0a\x23\x0a\x23\x20\x55\x6e\x6c\x65\x73\x73\x20\x72\x65\x71\x75\x69\x72\x65\x64\x20\x62\x79\x20\x61\x70\x70\x6c\x69\x63\x61\x62\x6c\x65\x20\x6c\x61\x77\x20\x6f\x72\x20\x61\x67\x72\x65\x65\x64\x20\x74\x6f\x20\x69\x6e\x20\x77\x72\x69\x74\x69\x6e\x67\x2c\x20\x73\x6f\x66\x74\x77\x61\x72\x65\x0a\x23\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x69\x73\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x6f\x6e\x20\x61\x6e\x20\x22\x41\x53\x20\x49\x53\x22\x20\x42\x41\x53\x49\x53\x2c\x0a\x23\x20\x57\x49\x54\x48\x4f\x55\x54\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x20\x4f\x52\x20\x43\x4f\x4e\x44\x49\x54\x49\x4f\x4e\x53\x20\x4f\x46\x20\x41\x4e\x59\x20\x4b\x49\x4e\x44\x2c\x20\x65\x69\x74\x68\x65\x72\x20\x65\x78\x70\x72\x65\x73\x73\x20\x6f\x72\x20\x69\x6d\x70\x6c\x69\x65\x64\x2e\x0a\x23\x20\x53\x65\x65\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20\x67\x6f\x76\x65\x72\x6e\x69\x6e\x67\x20\x70\x65\x72\x6d\x69\x73\x73\x69\x6f\x6e\x73\x20\x61\x6e\x64\x0a\x23\x20\x6c\x69\x6d\x69\x74\x61\x74\x69\x6f\x6e\x73\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x61\x70\x70\x73\x2e\x73\x65\x61\x6c\x6f\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x31\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x0a\x6d\x65\x74\x61\x64\x61\x74\x61\x3a\x0a\x20\x20\x6e\x61\x6d\x65\x3a\x20\x64\x65\x66\x61\x75\x6c\x74\x0a\x73\x70\x65\x63\x3a\x0a\x20\x20\x68\x6f\x73\x74\x73\x3a\x0a\x20\x20\x2d\x20\x69\x70\x73\x3a\x0a\x20\x20\x20\x20\x2d\x20\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x3a\x32\x32\x0a\x20\x20\x20\x20\x72\x6f\x6c\x65\x73\x3a\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x6d\x61\x73\x74\x65\x72\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x61\x6d\x64\x36\x34\x0a\x20\x20\x69\x6d\x61\x67\x65\x3a\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x6b\x75\x62\x65\x72\x6e\x65\x74\x65\x73\x3a\x76\x31\x2e\x32\x35\x2e\x30\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x68\x65\x6c\x6d\x3a\x76\x33\x2e\x38\x2e\x32\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x63\x61\x6c\x69\x63\x6f\x3a\x76\x33\x2e\x32\x34\x2e\x31\x0a\x20\x20\x73\x73\x68\x3a\x0a\x20\x20\x20\x20\x70\x6b\x3a\x20\x2f\x72\x6f\x6f\x74\x2f\x2e\x73\x73\x68\x2f\x69\x64\x5f\x72\x73\x61\x0a\x20\x20\x20\x20\x70\x6f\x72\x74\x3a\x20\x32\x32\x0a\x20\x20\x20\x20\x75\x73\x65\x72\x3a\x20\x72\x6f\x6f\x74\x0a\x2d\x2d\x2d\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x6b\x75\x62\x65\x61\x64\x6d\x2e\x6b\x38\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x32\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x43\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\x6e\x0a\x6e\x65\x74\x77\x6f\x72\x6b\x69\x6e\x67\x3a\x0a\x20\x20\x73\x65\x72\x76\x69\x63\x65\x53\x75\x62\x6e\x65\x74\x3a\x20\x22\x31\x30\x30\x2e\x35\x36\x2e\x30\x2e\x30\x2f\x31\x36\x22\x0a\x65\x74\x63\x64\x3a\x0a\x20\x20\x65\x78\x74\x65\x72\x6e\x61\x6c\x3a\x0a\x20\x20\x20\x20\x65\x6e\x64\x70\x6f\x69\x6e\x74\x73\x3a\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x68\x74\x74\x70\x3a\x2f\x2f\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x3a\x32\x33\x37\x39\x0a" + +func kubeadmContainerdSvcEtcdYamlBytes() ([]byte, error) { + return bindataRead( + _kubeadmContainerdSvcEtcdYaml, + "kubeadm/containerd-svc-etcd.yaml", + ) +} + +func kubeadmContainerdSvcEtcdYaml() (*asset, error) { + bytes, err := kubeadmContainerdSvcEtcdYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "kubeadm/containerd-svc-etcd.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _kubeadmContainerdSvcSansYaml = "\x23\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\xc2\xa9\x20\x32\x30\x32\x33\x20\x73\x65\x61\x6c\x6f\x73\x2e\x0a\x23\x0a\x23\x20\x4c\x69\x63\x65\x6e\x73\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x41\x70\x61\x63\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2c\x20\x56\x65\x72\x73\x69\x6f\x6e\x20\x32\x2e\x30\x20\x28\x74\x68\x65\x20\x22\x4c\x69\x63\x65\x6e\x73\x65\x22\x29\x3b\x0a\x23\x20\x79\x6f\x75\x20\x6d\x61\x79\x20\x6e\x6f\x74\x20\x75\x73\x65\x20\x74\x68\x69\x73\x20\x66\x69\x6c\x65\x20\x65\x78\x63\x65\x70\x74\x20\x69\x6e\x20\x63\x6f\x6d\x70\x6c\x69\x61\x6e\x63\x65\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x23\x20\x59\x6f\x75\x20\x6d\x61\x79\x20\x6f\x62\x74\x61\x69\x6e\x20\x61\x20\x63\x6f\x70\x79\x20\x6f\x66\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x61\x74\x0a\x23\x0a\x23\x20\x20\x20\x20\x20\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x61\x70\x61\x63\x68\x65\x2e\x6f\x72\x67\x2f\x6c\x69\x63\x65\x6e\x73\x65\x73\x2f\x4c\x49\x43\x45\x4e\x53\x45\x2d\x32\x2e\x30\x0a\x23\x0a\x23\x20\x55\x6e\x6c\x65\x73\x73\x20\x72\x65\x71\x75\x69\x72\x65\x64\x20\x62\x79\x20\x61\x70\x70\x6c\x69\x63\x61\x62\x6c\x65\x20\x6c\x61\x77\x20\x6f\x72\x20\x61\x67\x72\x65\x65\x64\x20\x74\x6f\x20\x69\x6e\x20\x77\x72\x69\x74\x69\x6e\x67\x2c\x20\x73\x6f\x66\x74\x77\x61\x72\x65\x0a\x23\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x69\x73\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x6f\x6e\x20\x61\x6e\x20\x22\x41\x53\x20\x49\x53\x22\x20\x42\x41\x53\x49\x53\x2c\x0a\x23\x20\x57\x49\x54\x48\x4f\x55\x54\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x20\x4f\x52\x20\x43\x4f\x4e\x44\x49\x54\x49\x4f\x4e\x53\x20\x4f\x46\x20\x41\x4e\x59\x20\x4b\x49\x4e\x44\x2c\x20\x65\x69\x74\x68\x65\x72\x20\x65\x78\x70\x72\x65\x73\x73\x20\x6f\x72\x20\x69\x6d\x70\x6c\x69\x65\x64\x2e\x0a\x23\x20\x53\x65\x65\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20\x67\x6f\x76\x65\x72\x6e\x69\x6e\x67\x20\x70\x65\x72\x6d\x69\x73\x73\x69\x6f\x6e\x73\x20\x61\x6e\x64\x0a\x23\x20\x6c\x69\x6d\x69\x74\x61\x74\x69\x6f\x6e\x73\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x61\x70\x70\x73\x2e\x73\x65\x61\x6c\x6f\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x31\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x0a\x6d\x65\x74\x61\x64\x61\x74\x61\x3a\x0a\x20\x20\x6e\x61\x6d\x65\x3a\x20\x64\x65\x66\x61\x75\x6c\x74\x0a\x73\x70\x65\x63\x3a\x0a\x20\x20\x68\x6f\x73\x74\x73\x3a\x0a\x20\x20\x2d\x20\x69\x70\x73\x3a\x0a\x20\x20\x20\x20\x2d\x20\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x3a\x32\x32\x0a\x20\x20\x20\x20\x72\x6f\x6c\x65\x73\x3a\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x6d\x61\x73\x74\x65\x72\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x61\x6d\x64\x36\x34\x0a\x20\x20\x69\x6d\x61\x67\x65\x3a\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x6b\x75\x62\x65\x72\x6e\x65\x74\x65\x73\x3a\x76\x31\x2e\x32\x35\x2e\x30\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x68\x65\x6c\x6d\x3a\x76\x33\x2e\x38\x2e\x32\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x63\x61\x6c\x69\x63\x6f\x3a\x76\x33\x2e\x32\x34\x2e\x31\x0a\x20\x20\x73\x73\x68\x3a\x0a\x20\x20\x20\x20\x70\x6b\x3a\x20\x2f\x72\x6f\x6f\x74\x2f\x2e\x73\x73\x68\x2f\x69\x64\x5f\x72\x73\x61\x0a\x20\x20\x20\x20\x70\x6f\x72\x74\x3a\x20\x32\x32\x0a\x20\x20\x20\x20\x75\x73\x65\x72\x3a\x20\x72\x6f\x6f\x74\x0a\x2d\x2d\x2d\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x6b\x75\x62\x65\x61\x64\x6d\x2e\x6b\x38\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x32\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x43\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\x6e\x0a\x6e\x65\x74\x77\x6f\x72\x6b\x69\x6e\x67\x3a\x0a\x20\x20\x73\x65\x72\x76\x69\x63\x65\x53\x75\x62\x6e\x65\x74\x3a\x20\x22\x31\x30\x30\x2e\x35\x35\x2e\x30\x2e\x30\x2f\x31\x36\x22\x0a\x61\x70\x69\x53\x65\x72\x76\x65\x72\x3a\x0a\x20\x20\x63\x65\x72\x74\x53\x41\x4e\x73\x3a\x0a\x20\x20\x2d\x20\x31\x39\x32\x2e\x31\x36\x38\x2e\x37\x32\x2e\x31\x30\x30\x0a" + +func kubeadmContainerdSvcSansYamlBytes() ([]byte, error) { + return bindataRead( + _kubeadmContainerdSvcSansYaml, + "kubeadm/containerd-svc-sans.yaml", + ) +} + +func kubeadmContainerdSvcSansYaml() (*asset, error) { + bytes, err := kubeadmContainerdSvcSansYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "kubeadm/containerd-svc-sans.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _kubeadmContainerdSvcTaintsYaml = "\x23\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\xc2\xa9\x20\x32\x30\x32\x33\x20\x73\x65\x61\x6c\x6f\x73\x2e\x0a\x23\x0a\x23\x20\x4c\x69\x63\x65\x6e\x73\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x41\x70\x61\x63\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2c\x20\x56\x65\x72\x73\x69\x6f\x6e\x20\x32\x2e\x30\x20\x28\x74\x68\x65\x20\x22\x4c\x69\x63\x65\x6e\x73\x65\x22\x29\x3b\x0a\x23\x20\x79\x6f\x75\x20\x6d\x61\x79\x20\x6e\x6f\x74\x20\x75\x73\x65\x20\x74\x68\x69\x73\x20\x66\x69\x6c\x65\x20\x65\x78\x63\x65\x70\x74\x20\x69\x6e\x20\x63\x6f\x6d\x70\x6c\x69\x61\x6e\x63\x65\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x23\x20\x59\x6f\x75\x20\x6d\x61\x79\x20\x6f\x62\x74\x61\x69\x6e\x20\x61\x20\x63\x6f\x70\x79\x20\x6f\x66\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x61\x74\x0a\x23\x0a\x23\x20\x20\x20\x20\x20\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x61\x70\x61\x63\x68\x65\x2e\x6f\x72\x67\x2f\x6c\x69\x63\x65\x6e\x73\x65\x73\x2f\x4c\x49\x43\x45\x4e\x53\x45\x2d\x32\x2e\x30\x0a\x23\x0a\x23\x20\x55\x6e\x6c\x65\x73\x73\x20\x72\x65\x71\x75\x69\x72\x65\x64\x20\x62\x79\x20\x61\x70\x70\x6c\x69\x63\x61\x62\x6c\x65\x20\x6c\x61\x77\x20\x6f\x72\x20\x61\x67\x72\x65\x65\x64\x20\x74\x6f\x20\x69\x6e\x20\x77\x72\x69\x74\x69\x6e\x67\x2c\x20\x73\x6f\x66\x74\x77\x61\x72\x65\x0a\x23\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x69\x73\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x6f\x6e\x20\x61\x6e\x20\x22\x41\x53\x20\x49\x53\x22\x20\x42\x41\x53\x49\x53\x2c\x0a\x23\x20\x57\x49\x54\x48\x4f\x55\x54\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x20\x4f\x52\x20\x43\x4f\x4e\x44\x49\x54\x49\x4f\x4e\x53\x20\x4f\x46\x20\x41\x4e\x59\x20\x4b\x49\x4e\x44\x2c\x20\x65\x69\x74\x68\x65\x72\x20\x65\x78\x70\x72\x65\x73\x73\x20\x6f\x72\x20\x69\x6d\x70\x6c\x69\x65\x64\x2e\x0a\x23\x20\x53\x65\x65\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20\x67\x6f\x76\x65\x72\x6e\x69\x6e\x67\x20\x70\x65\x72\x6d\x69\x73\x73\x69\x6f\x6e\x73\x20\x61\x6e\x64\x0a\x23\x20\x6c\x69\x6d\x69\x74\x61\x74\x69\x6f\x6e\x73\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x61\x70\x70\x73\x2e\x73\x65\x61\x6c\x6f\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x31\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x0a\x6d\x65\x74\x61\x64\x61\x74\x61\x3a\x0a\x20\x20\x6e\x61\x6d\x65\x3a\x20\x64\x65\x66\x61\x75\x6c\x74\x0a\x73\x70\x65\x63\x3a\x0a\x20\x20\x68\x6f\x73\x74\x73\x3a\x0a\x20\x20\x2d\x20\x69\x70\x73\x3a\x0a\x20\x20\x20\x20\x2d\x20\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x3a\x32\x32\x0a\x20\x20\x20\x20\x72\x6f\x6c\x65\x73\x3a\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x6d\x61\x73\x74\x65\x72\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x61\x6d\x64\x36\x34\x0a\x20\x20\x69\x6d\x61\x67\x65\x3a\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x6b\x75\x62\x65\x72\x6e\x65\x74\x65\x73\x3a\x76\x31\x2e\x32\x35\x2e\x30\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x68\x65\x6c\x6d\x3a\x76\x33\x2e\x38\x2e\x32\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x63\x61\x6c\x69\x63\x6f\x3a\x76\x33\x2e\x32\x34\x2e\x31\x0a\x20\x20\x73\x73\x68\x3a\x0a\x20\x20\x20\x20\x70\x6b\x3a\x20\x2f\x72\x6f\x6f\x74\x2f\x2e\x73\x73\x68\x2f\x69\x64\x5f\x72\x73\x61\x0a\x20\x20\x20\x20\x70\x6f\x72\x74\x3a\x20\x32\x32\x0a\x20\x20\x20\x20\x75\x73\x65\x72\x3a\x20\x72\x6f\x6f\x74\x0a\x2d\x2d\x2d\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x6b\x75\x62\x65\x61\x64\x6d\x2e\x6b\x38\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x32\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x43\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\x6e\x0a\x6e\x65\x74\x77\x6f\x72\x6b\x69\x6e\x67\x3a\x0a\x20\x20\x73\x65\x72\x76\x69\x63\x65\x53\x75\x62\x6e\x65\x74\x3a\x20\x22\x31\x30\x30\x2e\x35\x36\x2e\x30\x2e\x30\x2f\x31\x36\x22\x0a\x2d\x2d\x2d\x0a\x6e\x6f\x64\x65\x52\x65\x67\x69\x73\x74\x72\x61\x74\x69\x6f\x6e\x3a\x0a\x20\x20\x74\x61\x69\x6e\x74\x73\x3a\x0a\x20\x20\x2d\x20\x65\x66\x66\x65\x63\x74\x3a\x20\x4e\x6f\x53\x63\x68\x65\x64\x75\x6c\x65\x0a\x20\x20\x20\x20\x6b\x65\x79\x3a\x20\x6b\x75\x62\x65\x61\x64\x6d\x4e\x6f\x64\x65\x0a\x20\x20\x20\x20\x76\x61\x6c\x75\x65\x3a\x20\x74\x68\x65\x56\x61\x6c\x75\x65\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x6b\x75\x62\x65\x61\x64\x6d\x2e\x6b\x38\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x33\x0a\x6b\x69\x6e\x64\x3a\x20\x49\x6e\x69\x74\x43\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\x6e\x0a" + +func kubeadmContainerdSvcTaintsYamlBytes() ([]byte, error) { + return bindataRead( + _kubeadmContainerdSvcTaintsYaml, + "kubeadm/containerd-svc-taints.yaml", + ) +} + +func kubeadmContainerdSvcTaintsYaml() (*asset, error) { + bytes, err := kubeadmContainerdSvcTaintsYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "kubeadm/containerd-svc-taints.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _kubeadmCustomeContainerdSvcYaml = "\x23\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\xc2\xa9\x20\x32\x30\x32\x33\x20\x73\x65\x61\x6c\x6f\x73\x2e\x0a\x23\x0a\x23\x20\x4c\x69\x63\x65\x6e\x73\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x41\x70\x61\x63\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2c\x20\x56\x65\x72\x73\x69\x6f\x6e\x20\x32\x2e\x30\x20\x28\x74\x68\x65\x20\x22\x4c\x69\x63\x65\x6e\x73\x65\x22\x29\x3b\x0a\x23\x20\x79\x6f\x75\x20\x6d\x61\x79\x20\x6e\x6f\x74\x20\x75\x73\x65\x20\x74\x68\x69\x73\x20\x66\x69\x6c\x65\x20\x65\x78\x63\x65\x70\x74\x20\x69\x6e\x20\x63\x6f\x6d\x70\x6c\x69\x61\x6e\x63\x65\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x23\x20\x59\x6f\x75\x20\x6d\x61\x79\x20\x6f\x62\x74\x61\x69\x6e\x20\x61\x20\x63\x6f\x70\x79\x20\x6f\x66\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x61\x74\x0a\x23\x0a\x23\x20\x20\x20\x20\x20\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x61\x70\x61\x63\x68\x65\x2e\x6f\x72\x67\x2f\x6c\x69\x63\x65\x6e\x73\x65\x73\x2f\x4c\x49\x43\x45\x4e\x53\x45\x2d\x32\x2e\x30\x0a\x23\x0a\x23\x20\x55\x6e\x6c\x65\x73\x73\x20\x72\x65\x71\x75\x69\x72\x65\x64\x20\x62\x79\x20\x61\x70\x70\x6c\x69\x63\x61\x62\x6c\x65\x20\x6c\x61\x77\x20\x6f\x72\x20\x61\x67\x72\x65\x65\x64\x20\x74\x6f\x20\x69\x6e\x20\x77\x72\x69\x74\x69\x6e\x67\x2c\x20\x73\x6f\x66\x74\x77\x61\x72\x65\x0a\x23\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x69\x73\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x6f\x6e\x20\x61\x6e\x20\x22\x41\x53\x20\x49\x53\x22\x20\x42\x41\x53\x49\x53\x2c\x0a\x23\x20\x57\x49\x54\x48\x4f\x55\x54\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x20\x4f\x52\x20\x43\x4f\x4e\x44\x49\x54\x49\x4f\x4e\x53\x20\x4f\x46\x20\x41\x4e\x59\x20\x4b\x49\x4e\x44\x2c\x20\x65\x69\x74\x68\x65\x72\x20\x65\x78\x70\x72\x65\x73\x73\x20\x6f\x72\x20\x69\x6d\x70\x6c\x69\x65\x64\x2e\x0a\x23\x20\x53\x65\x65\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20\x67\x6f\x76\x65\x72\x6e\x69\x6e\x67\x20\x70\x65\x72\x6d\x69\x73\x73\x69\x6f\x6e\x73\x20\x61\x6e\x64\x0a\x23\x20\x6c\x69\x6d\x69\x74\x61\x74\x69\x6f\x6e\x73\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x61\x70\x70\x73\x2e\x73\x65\x61\x6c\x6f\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x31\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x0a\x6d\x65\x74\x61\x64\x61\x74\x61\x3a\x0a\x20\x20\x6e\x61\x6d\x65\x3a\x20\x64\x65\x66\x61\x75\x6c\x74\x0a\x73\x70\x65\x63\x3a\x0a\x20\x20\x68\x6f\x73\x74\x73\x3a\x0a\x20\x20\x2d\x20\x69\x70\x73\x3a\x0a\x20\x20\x20\x20\x2d\x20\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x3a\x32\x32\x0a\x20\x20\x20\x20\x72\x6f\x6c\x65\x73\x3a\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x6d\x61\x73\x74\x65\x72\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x61\x6d\x64\x36\x34\x0a\x20\x20\x69\x6d\x61\x67\x65\x3a\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x6b\x75\x62\x65\x72\x6e\x65\x74\x65\x73\x3a\x76\x31\x2e\x32\x35\x2e\x30\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x68\x65\x6c\x6d\x3a\x76\x33\x2e\x38\x2e\x32\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x63\x61\x6c\x69\x63\x6f\x3a\x76\x33\x2e\x32\x34\x2e\x31\x0a\x20\x20\x73\x73\x68\x3a\x0a\x20\x20\x20\x20\x70\x6b\x3a\x20\x2f\x72\x6f\x6f\x74\x2f\x2e\x73\x73\x68\x2f\x69\x64\x5f\x72\x73\x61\x0a\x20\x20\x20\x20\x70\x6f\x72\x74\x3a\x20\x32\x32\x0a\x20\x20\x20\x20\x75\x73\x65\x72\x3a\x20\x72\x6f\x6f\x74\x0a\x2d\x2d\x2d\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x6b\x75\x62\x65\x61\x64\x6d\x2e\x6b\x38\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x32\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x43\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\x6e\x0a\x6e\x65\x74\x77\x6f\x72\x6b\x69\x6e\x67\x3a\x0a\x20\x20\x73\x65\x72\x76\x69\x63\x65\x53\x75\x62\x6e\x65\x74\x3a\x20\x22\x31\x30\x30\x2e\x35\x36\x2e\x30\x2e\x30\x2f\x31\x36\x22\x0a" + +func kubeadmCustomeContainerdSvcYamlBytes() ([]byte, error) { + return bindataRead( + _kubeadmCustomeContainerdSvcYaml, + "kubeadm/custome-containerd-svc.yaml", + ) +} + +func kubeadmCustomeContainerdSvcYaml() (*asset, error) { + bytes, err := kubeadmCustomeContainerdSvcYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "kubeadm/custome-containerd-svc.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _kubeadmCustomeDockerSvcYaml = "\x23\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\xc2\xa9\x20\x32\x30\x32\x33\x20\x73\x65\x61\x6c\x6f\x73\x2e\x0a\x23\x0a\x23\x20\x4c\x69\x63\x65\x6e\x73\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x41\x70\x61\x63\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2c\x20\x56\x65\x72\x73\x69\x6f\x6e\x20\x32\x2e\x30\x20\x28\x74\x68\x65\x20\x22\x4c\x69\x63\x65\x6e\x73\x65\x22\x29\x3b\x0a\x23\x20\x79\x6f\x75\x20\x6d\x61\x79\x20\x6e\x6f\x74\x20\x75\x73\x65\x20\x74\x68\x69\x73\x20\x66\x69\x6c\x65\x20\x65\x78\x63\x65\x70\x74\x20\x69\x6e\x20\x63\x6f\x6d\x70\x6c\x69\x61\x6e\x63\x65\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x23\x20\x59\x6f\x75\x20\x6d\x61\x79\x20\x6f\x62\x74\x61\x69\x6e\x20\x61\x20\x63\x6f\x70\x79\x20\x6f\x66\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x61\x74\x0a\x23\x0a\x23\x20\x20\x20\x20\x20\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x61\x70\x61\x63\x68\x65\x2e\x6f\x72\x67\x2f\x6c\x69\x63\x65\x6e\x73\x65\x73\x2f\x4c\x49\x43\x45\x4e\x53\x45\x2d\x32\x2e\x30\x0a\x23\x0a\x23\x20\x55\x6e\x6c\x65\x73\x73\x20\x72\x65\x71\x75\x69\x72\x65\x64\x20\x62\x79\x20\x61\x70\x70\x6c\x69\x63\x61\x62\x6c\x65\x20\x6c\x61\x77\x20\x6f\x72\x20\x61\x67\x72\x65\x65\x64\x20\x74\x6f\x20\x69\x6e\x20\x77\x72\x69\x74\x69\x6e\x67\x2c\x20\x73\x6f\x66\x74\x77\x61\x72\x65\x0a\x23\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x69\x73\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x6f\x6e\x20\x61\x6e\x20\x22\x41\x53\x20\x49\x53\x22\x20\x42\x41\x53\x49\x53\x2c\x0a\x23\x20\x57\x49\x54\x48\x4f\x55\x54\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x20\x4f\x52\x20\x43\x4f\x4e\x44\x49\x54\x49\x4f\x4e\x53\x20\x4f\x46\x20\x41\x4e\x59\x20\x4b\x49\x4e\x44\x2c\x20\x65\x69\x74\x68\x65\x72\x20\x65\x78\x70\x72\x65\x73\x73\x20\x6f\x72\x20\x69\x6d\x70\x6c\x69\x65\x64\x2e\x0a\x23\x20\x53\x65\x65\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20\x67\x6f\x76\x65\x72\x6e\x69\x6e\x67\x20\x70\x65\x72\x6d\x69\x73\x73\x69\x6f\x6e\x73\x20\x61\x6e\x64\x0a\x23\x20\x6c\x69\x6d\x69\x74\x61\x74\x69\x6f\x6e\x73\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x61\x70\x70\x73\x2e\x73\x65\x61\x6c\x6f\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x31\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x0a\x6d\x65\x74\x61\x64\x61\x74\x61\x3a\x0a\x20\x20\x6e\x61\x6d\x65\x3a\x20\x64\x65\x66\x61\x75\x6c\x74\x0a\x73\x70\x65\x63\x3a\x0a\x20\x20\x68\x6f\x73\x74\x73\x3a\x0a\x20\x20\x2d\x20\x69\x70\x73\x3a\x0a\x20\x20\x20\x20\x2d\x20\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x3a\x32\x32\x0a\x20\x20\x20\x20\x72\x6f\x6c\x65\x73\x3a\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x6d\x61\x73\x74\x65\x72\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x61\x6d\x64\x36\x34\x0a\x20\x20\x69\x6d\x61\x67\x65\x3a\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x6b\x75\x62\x65\x72\x6e\x65\x74\x65\x73\x2d\x64\x6f\x63\x6b\x65\x72\x3a\x76\x31\x2e\x32\x35\x2e\x30\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x68\x65\x6c\x6d\x3a\x76\x33\x2e\x38\x2e\x32\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x63\x61\x6c\x69\x63\x6f\x3a\x76\x33\x2e\x32\x34\x2e\x31\x0a\x20\x20\x73\x73\x68\x3a\x0a\x20\x20\x20\x20\x70\x6b\x3a\x20\x2f\x72\x6f\x6f\x74\x2f\x2e\x73\x73\x68\x2f\x69\x64\x5f\x72\x73\x61\x0a\x20\x20\x20\x20\x70\x6f\x72\x74\x3a\x20\x32\x32\x0a\x20\x20\x20\x20\x75\x73\x65\x72\x3a\x20\x72\x6f\x6f\x74\x0a\x2d\x2d\x2d\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x6b\x75\x62\x65\x61\x64\x6d\x2e\x6b\x38\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x32\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x43\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\x6e\x0a\x6e\x65\x74\x77\x6f\x72\x6b\x69\x6e\x67\x3a\x0a\x20\x20\x73\x65\x72\x76\x69\x63\x65\x53\x75\x62\x6e\x65\x74\x3a\x20\x22\x31\x30\x30\x2e\x35\x36\x2e\x30\x2e\x30\x2f\x31\x36\x22\x0a" + +func kubeadmCustomeDockerSvcYamlBytes() ([]byte, error) { + return bindataRead( + _kubeadmCustomeDockerSvcYaml, + "kubeadm/custome-docker-svc.yaml", + ) +} + +func kubeadmCustomeDockerSvcYaml() (*asset, error) { + bytes, err := kubeadmCustomeDockerSvcYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "kubeadm/custome-docker-svc.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _kubeadmDockerSvcSansYaml = "\x23\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\xc2\xa9\x20\x32\x30\x32\x33\x20\x73\x65\x61\x6c\x6f\x73\x2e\x0a\x23\x0a\x23\x20\x4c\x69\x63\x65\x6e\x73\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x41\x70\x61\x63\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2c\x20\x56\x65\x72\x73\x69\x6f\x6e\x20\x32\x2e\x30\x20\x28\x74\x68\x65\x20\x22\x4c\x69\x63\x65\x6e\x73\x65\x22\x29\x3b\x0a\x23\x20\x79\x6f\x75\x20\x6d\x61\x79\x20\x6e\x6f\x74\x20\x75\x73\x65\x20\x74\x68\x69\x73\x20\x66\x69\x6c\x65\x20\x65\x78\x63\x65\x70\x74\x20\x69\x6e\x20\x63\x6f\x6d\x70\x6c\x69\x61\x6e\x63\x65\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x23\x20\x59\x6f\x75\x20\x6d\x61\x79\x20\x6f\x62\x74\x61\x69\x6e\x20\x61\x20\x63\x6f\x70\x79\x20\x6f\x66\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x61\x74\x0a\x23\x0a\x23\x20\x20\x20\x20\x20\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x61\x70\x61\x63\x68\x65\x2e\x6f\x72\x67\x2f\x6c\x69\x63\x65\x6e\x73\x65\x73\x2f\x4c\x49\x43\x45\x4e\x53\x45\x2d\x32\x2e\x30\x0a\x23\x0a\x23\x20\x55\x6e\x6c\x65\x73\x73\x20\x72\x65\x71\x75\x69\x72\x65\x64\x20\x62\x79\x20\x61\x70\x70\x6c\x69\x63\x61\x62\x6c\x65\x20\x6c\x61\x77\x20\x6f\x72\x20\x61\x67\x72\x65\x65\x64\x20\x74\x6f\x20\x69\x6e\x20\x77\x72\x69\x74\x69\x6e\x67\x2c\x20\x73\x6f\x66\x74\x77\x61\x72\x65\x0a\x23\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x69\x73\x20\x64\x69\x73\x74\x72\x69\x62\x75\x74\x65\x64\x20\x6f\x6e\x20\x61\x6e\x20\x22\x41\x53\x20\x49\x53\x22\x20\x42\x41\x53\x49\x53\x2c\x0a\x23\x20\x57\x49\x54\x48\x4f\x55\x54\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x20\x4f\x52\x20\x43\x4f\x4e\x44\x49\x54\x49\x4f\x4e\x53\x20\x4f\x46\x20\x41\x4e\x59\x20\x4b\x49\x4e\x44\x2c\x20\x65\x69\x74\x68\x65\x72\x20\x65\x78\x70\x72\x65\x73\x73\x20\x6f\x72\x20\x69\x6d\x70\x6c\x69\x65\x64\x2e\x0a\x23\x20\x53\x65\x65\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x20\x66\x6f\x72\x20\x74\x68\x65\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20\x67\x6f\x76\x65\x72\x6e\x69\x6e\x67\x20\x70\x65\x72\x6d\x69\x73\x73\x69\x6f\x6e\x73\x20\x61\x6e\x64\x0a\x23\x20\x6c\x69\x6d\x69\x74\x61\x74\x69\x6f\x6e\x73\x20\x75\x6e\x64\x65\x72\x20\x74\x68\x65\x20\x4c\x69\x63\x65\x6e\x73\x65\x2e\x0a\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x61\x70\x70\x73\x2e\x73\x65\x61\x6c\x6f\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x31\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x0a\x6d\x65\x74\x61\x64\x61\x74\x61\x3a\x0a\x20\x20\x6e\x61\x6d\x65\x3a\x20\x64\x65\x66\x61\x75\x6c\x74\x0a\x73\x70\x65\x63\x3a\x0a\x20\x20\x68\x6f\x73\x74\x73\x3a\x0a\x20\x20\x2d\x20\x69\x70\x73\x3a\x0a\x20\x20\x20\x20\x2d\x20\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x3a\x32\x32\x0a\x20\x20\x20\x20\x72\x6f\x6c\x65\x73\x3a\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x6d\x61\x73\x74\x65\x72\x0a\x20\x20\x20\x20\x20\x20\x2d\x20\x61\x6d\x64\x36\x34\x0a\x20\x20\x69\x6d\x61\x67\x65\x3a\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x6b\x75\x62\x65\x72\x6e\x65\x74\x65\x73\x2d\x64\x6f\x63\x6b\x65\x72\x3a\x76\x31\x2e\x32\x35\x2e\x30\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x68\x65\x6c\x6d\x3a\x76\x33\x2e\x38\x2e\x32\x0a\x20\x20\x2d\x20\x6c\x61\x62\x72\x69\x6e\x67\x2f\x63\x61\x6c\x69\x63\x6f\x3a\x76\x33\x2e\x32\x34\x2e\x31\x0a\x20\x20\x73\x73\x68\x3a\x0a\x20\x20\x20\x20\x70\x6b\x3a\x20\x2f\x72\x6f\x6f\x74\x2f\x2e\x73\x73\x68\x2f\x69\x64\x5f\x72\x73\x61\x0a\x20\x20\x20\x20\x70\x6f\x72\x74\x3a\x20\x32\x32\x0a\x20\x20\x20\x20\x75\x73\x65\x72\x3a\x20\x72\x6f\x6f\x74\x0a\x2d\x2d\x2d\x0a\x61\x70\x69\x56\x65\x72\x73\x69\x6f\x6e\x3a\x20\x6b\x75\x62\x65\x61\x64\x6d\x2e\x6b\x38\x73\x2e\x69\x6f\x2f\x76\x31\x62\x65\x74\x61\x32\x0a\x6b\x69\x6e\x64\x3a\x20\x43\x6c\x75\x73\x74\x65\x72\x43\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\x6e\x0a\x6e\x65\x74\x77\x6f\x72\x6b\x69\x6e\x67\x3a\x0a\x20\x20\x73\x65\x72\x76\x69\x63\x65\x53\x75\x62\x6e\x65\x74\x3a\x20\x22\x31\x30\x30\x2e\x35\x35\x2e\x30\x2e\x30\x2f\x31\x36\x22\x0a\x61\x70\x69\x53\x65\x72\x76\x65\x72\x3a\x0a\x20\x20\x63\x65\x72\x74\x53\x41\x4e\x73\x3a\x0a\x20\x20\x2d\x20\x31\x39\x32\x2e\x31\x36\x38\x2e\x37\x32\x2e\x31\x30\x30\x0a" + +func kubeadmDockerSvcSansYamlBytes() ([]byte, error) { + return bindataRead( + _kubeadmDockerSvcSansYaml, + "kubeadm/docker-svc-sans.yaml", + ) +} + +func kubeadmDockerSvcSansYaml() (*asset, error) { + bytes, err := kubeadmDockerSvcSansYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "kubeadm/docker-svc-sans.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +// Asset loads and returns the asset for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func Asset(name string) ([]byte, error) { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) + } + return a.bytes, nil + } + return nil, fmt.Errorf("Asset %s not found", name) +} + +// MustAsset is like Asset but panics when Asset would return an error. +// It simplifies safe initialization of global variables. +func MustAsset(name string) []byte { + a, err := Asset(name) + if err != nil { + panic("asset: Asset(" + name + "): " + err.Error()) + } + + return a +} + +// AssetInfo loads and returns the asset info for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func AssetInfo(name string) (os.FileInfo, error) { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) + } + return a.info, nil + } + return nil, fmt.Errorf("AssetInfo %s not found", name) +} + +// AssetNames returns the names of the assets. +func AssetNames() []string { + names := make([]string, 0, len(_bindata)) + for name := range _bindata { + names = append(names, name) + } + return names +} + +// _bindata is a table, holding each asset generator, mapped to its name. +var _bindata = map[string]func() (*asset, error){ + "kubeadm/containerd-svc-etcd.yaml": kubeadmContainerdSvcEtcdYaml, + "kubeadm/containerd-svc-sans.yaml": kubeadmContainerdSvcSansYaml, + "kubeadm/containerd-svc-taints.yaml": kubeadmContainerdSvcTaintsYaml, + "kubeadm/custome-containerd-svc.yaml": kubeadmCustomeContainerdSvcYaml, + "kubeadm/custome-docker-svc.yaml": kubeadmCustomeDockerSvcYaml, + "kubeadm/docker-svc-sans.yaml": kubeadmDockerSvcSansYaml, +} + +// AssetDir returns the file names below a certain +// directory embedded in the file by go-bindata. +// For example if you run go-bindata on data/... and data contains the +// following hierarchy: +// +// data/ +// foo.txt +// img/ +// a.png +// b.png +// +// then AssetDir("data") would return []string{"foo.txt", "img"} +// AssetDir("data/img") would return []string{"a.png", "b.png"} +// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// AssetDir("") will return []string{"data"}. +func AssetDir(name string) ([]string, error) { + node := _bintree + if len(name) != 0 { + cannonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(cannonicalName, "/") + for _, p := range pathList { + node = node.Children[p] + if node == nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + } + } + if node.Func != nil { + return nil, fmt.Errorf("Asset %s not found", name) + } + rv := make([]string, 0, len(node.Children)) + for childName := range node.Children { + rv = append(rv, childName) + } + return rv, nil +} + +type bintree struct { + Func func() (*asset, error) + Children map[string]*bintree +} + +var _bintree = &bintree{nil, map[string]*bintree{ + "kubeadm": {nil, map[string]*bintree{ + "containerd-svc-etcd.yaml": {kubeadmContainerdSvcEtcdYaml, map[string]*bintree{}}, + "containerd-svc-sans.yaml": {kubeadmContainerdSvcSansYaml, map[string]*bintree{}}, + "containerd-svc-taints.yaml": {kubeadmContainerdSvcTaintsYaml, map[string]*bintree{}}, + "custome-containerd-svc.yaml": {kubeadmCustomeContainerdSvcYaml, map[string]*bintree{}}, + "custome-docker-svc.yaml": {kubeadmCustomeDockerSvcYaml, map[string]*bintree{}}, + "docker-svc-sans.yaml": {kubeadmDockerSvcSansYaml, map[string]*bintree{}}, + }}, +}} + +// RestoreAsset restores an asset under the given directory +func RestoreAsset(dir, name string) error { + data, err := Asset(name) + if err != nil { + return err + } + info, err := AssetInfo(name) + if err != nil { + return err + } + err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) + if err != nil { + return err + } + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + if err != nil { + return err + } + err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) + if err != nil { + return err + } + return nil +} + +// RestoreAssets restores an asset under the given directory recursively +func RestoreAssets(dir, name string) error { + children, err := AssetDir(name) + // File + if err != nil { + return RestoreAsset(dir, name) + } + // Dir + for _, child := range children { + err = RestoreAssets(dir, filepath.Join(name, child)) + if err != nil { + return err + } + } + return nil +} + +func _filePath(dir, name string) string { + cannonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) +} diff --git a/test/e2e/testdata/main.go b/test/e2e/testdata/main.go new file mode 100644 index 00000000000..267074e5902 --- /dev/null +++ b/test/e2e/testdata/main.go @@ -0,0 +1,46 @@ +/* +Copyright 2023 cuisongliu@qq.com. + +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 main + +import ( + "github.com/go-bindata/go-bindata" + + "github.com/labring/sealos/pkg/utils/logger" +) + +//go:generate go run main.go + +func main() { + logger.Info("generator bindata start") + bc := &bindata.Config{ + Input: []bindata.InputConfig{ + { + Path: "kubeadm", + Recursive: false, + }, + }, + Package: "kubeadm", + NoCompress: true, + NoMemCopy: true, + NoMetadata: true, + Output: "kubeadm/zz_generated_kubeadm.go", + } + if err := bindata.Translate(bc); err != nil { + logger.Fatal(err) + } + logger.Info("generator bindata success") +} diff --git a/test/e2e/testdata/testdata.go b/test/e2e/testdata/testdata.go deleted file mode 100644 index 4e3402c4f5a..00000000000 --- a/test/e2e/testdata/testdata.go +++ /dev/null @@ -1,365 +0,0 @@ -// Code generated by go-bindata. (@generated) DO NOT EDIT. - -// Package testdata generated by go-bindata. -// sources: -// testdata/containerd-svc-etcd.yaml -// testdata/containerd-svc-sans.yaml -// testdata/containerd-svc-taints.yaml -// testdata/custome-containerd-svc.yaml -// testdata/custome-docker-svc.yaml -// testdata/docker-svc-sans.yaml -package testdata - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -// Name return file name -func (fi bindataFileInfo) Name() string { - return fi.name -} - -// Size return file size -func (fi bindataFileInfo) Size() int64 { - return fi.size -} - -// Mode return file mode -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} - -// ModTime return file modify time -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} - -// IsDir return file whether a directory -func (fi bindataFileInfo) IsDir() bool { - return fi.mode&os.ModeDir != 0 -} - -// Sys return file is sys mode -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _testdataContainerdSvcEtcdYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x90\x4d\x0e\xdb\x20\x10\x85\xf7\x9c\x02\x65\x6f\x30\xce\x6f\xd9\xe6\x08\x95\xba\xad\xc6\x66\x62\x23\x63\x40\xcc\xd8\xed\xf1\x2b\xe2\x54\x72\x76\xc3\xfb\x46\xc3\xd3\x07\xd9\xff\xc2\x42\x3e\x45\x2b\x21\x67\x52\x84\x10\x12\x29\x9f\xf4\x66\x7a\x64\x30\x62\xf6\xd1\x59\xf9\x0c\x2b\x31\x16\xb1\x20\x83\x03\x06\x2b\xa4\x8c\xb0\xa0\x95\x0e\x5f\xb0\x06\x16\x94\x71\xa8\xe9\x94\x88\xa9\x0e\x8d\xf4\xf9\x3d\xd4\xd1\x74\x77\xd5\xaa\x56\x19\xdb\x75\xef\xa8\xa4\x80\x1f\x5a\xf9\x02\xef\xf3\xff\x9f\xb0\xb8\xdb\x45\x48\xe9\x17\x18\x71\x3f\x16\xa0\x2f\x3e\x8e\x7a\x5e\x7b\x2c\x11\x19\xc9\x6e\x46\x75\x57\xd5\x7e\xe1\x09\xc3\x62\xb7\xb3\x7a\xa8\xee\x2b\x1f\x20\xf8\x21\x55\xd2\x5d\x94\x11\x52\x12\x4d\xfb\xf7\x79\xb6\x52\x97\x94\x58\x2b\xa2\x49\x7b\xf7\xbb\x10\xec\x24\x15\xb6\xf2\x53\x78\x25\x2c\x56\xd6\x3d\xd1\x34\x8d\x38\x9a\xab\x95\xc0\x2d\x6a\x7e\x1c\xcc\x75\xdf\xe6\x9e\x29\xbe\xfc\xb8\x16\x60\x9f\xa2\x88\xc8\x7f\x52\x99\x7d\x1c\x6b\x07\xc2\xb2\xf9\x01\x7f\xae\x7d\x44\xb6\xf2\x64\xda\x56\x5d\x6f\xd5\x97\x36\xb7\x93\x40\x1e\x5c\x5d\xc3\xbf\x8c\x25\x42\xd8\x6b\x63\x74\x39\xf9\xc8\x07\x89\x13\x73\xb6\x5a\x1f\x5c\x9f\xef\x3f\xc4\xbf\x00\x00\x00\xff\xff\x26\x32\x9c\xf1\xe4\x01\x00\x00") - -func testdataContainerdSvcEtcdYamlBytes() ([]byte, error) { - return bindataRead( - _testdataContainerdSvcEtcdYaml, - "testdata/containerd-svc-etcd.yaml", - ) -} - -func testdataContainerdSvcEtcdYaml() (*asset, error) { - bytes, err := testdataContainerdSvcEtcdYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "testdata/containerd-svc-etcd.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _testdataContainerdSvcSansYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x90\xbf\x6e\xf3\x30\x0c\xc4\x77\x3d\x85\x90\xdd\xb4\xa5\x2f\xff\x3e\x6d\x45\xf6\x2e\x01\xba\x16\xb4\xcd\xd8\x82\x2d\xc9\x20\x65\xf7\xf5\x0b\x25\x29\x90\x6c\xc7\x3b\x82\x3c\xfc\x70\xf1\x5f\xc4\xe2\x53\x74\x1a\x97\x45\x40\x08\xe7\x24\xe0\x53\xbd\x99\x96\x32\x1a\x35\xf9\xd8\x3b\x7d\x99\x57\xc9\xc4\x2a\x50\xc6\x1e\x33\x3a\xa5\x75\xc4\x40\x4e\xf7\x74\xc3\x75\xce\x4a\x16\xea\x8a\x3b\x26\xc9\x52\x44\xa5\xfd\x72\x17\x45\x1a\x7b\x82\x06\x1a\x30\xce\xda\xbb\xc5\x69\xa6\x67\x5a\xf2\x80\xf7\xf3\x7f\x23\x86\xfe\xb8\x57\x5a\xfb\x80\x03\x3d\x8e\xcd\xd8\xb2\x8f\x43\x3d\xad\x2d\x71\xa4\x4c\xe2\x36\x03\xf6\x00\xcd\x5b\x3c\xd2\x1c\xdc\xf6\x0f\xce\x60\xdf\xfc\x0e\x67\xdf\xa5\x92\xd8\x3d\x18\xa5\xb5\xc8\xf8\x78\xbf\x4c\x4e\xd7\x9c\x52\xae\x41\x64\xac\x7d\xff\xcd\x82\x8f\x24\x71\x76\xfa\x59\x78\x15\x62\xa7\xcb\x9e\xaa\xaa\x4a\xbd\x92\x2b\x95\xb0\x0f\x30\x9d\x5f\xc8\xd9\x77\x72\x97\x14\x6f\x7e\x58\x19\xb3\x4f\x51\x45\xca\x3f\x89\x27\x1f\x87\xd2\x41\x88\x37\xdf\xd1\x75\x6d\x23\x65\xa7\x77\xa6\x69\xe0\x70\x28\xbc\x6a\x73\xdc\x95\x57\x57\xe2\x8d\xb8\xec\x76\xc4\xf9\xfa\xf1\xf9\x24\x6c\xfe\x5b\x30\xc7\x33\x9c\x2c\x98\xa6\x51\xbf\x01\x00\x00\xff\xff\xdd\xd2\xcc\x7d\xcf\x01\x00\x00") - -func testdataContainerdSvcSansYamlBytes() ([]byte, error) { - return bindataRead( - _testdataContainerdSvcSansYaml, - "testdata/containerd-svc-sans.yaml", - ) -} - -func testdataContainerdSvcSansYaml() (*asset, error) { - bytes, err := testdataContainerdSvcSansYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "testdata/containerd-svc-sans.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _testdataContainerdSvcTaintsYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x50\xbb\x6e\xdc\x30\x10\xec\xf9\x15\x0b\xf7\x47\x3d\x6c\x5f\x0c\xb6\xae\xd2\xb8\x88\x01\xb7\xc1\x9e\xb8\x27\x2d\x44\x91\x02\x77\xa9\x20\x7f\x1f\x50\x3a\x07\xbe\xca\xdd\x68\x46\x9c\x9d\x19\x5c\xf9\x83\xb2\x70\x8a\x0e\x70\x5d\xc5\x0a\x61\x48\x62\x39\x35\x5b\x77\x21\xc5\xce\xcc\x1c\xbd\x83\xd7\x50\x44\x29\x9b\x85\x14\x3d\x2a\x3a\x03\x10\x71\x21\x07\x9e\xae\x58\x82\x1a\x59\x69\xa8\xec\x94\x44\xa5\x82\x13\xf0\xba\x83\x0a\xbb\xfe\x87\x6d\x6d\x6b\x3b\xd7\xf7\x3b\x95\x53\xa0\x9b\x5a\xf5\x05\x77\xfb\xcf\x4f\x5c\xfc\xf9\xc9\x00\xf0\x82\x23\x1d\x66\x01\x2f\x99\xe3\xd8\xcc\xe5\x42\x39\x92\x92\xb8\xad\xb3\xfd\xb3\x6d\xef\xe4\x89\xc2\xe2\xb6\x47\xfb\x62\xfb\x3b\x7e\xc0\xc0\x43\xaa\x4a\xff\x64\x3b\x03\x20\x32\x1d\xe7\xd7\xd9\x41\x93\x53\xd2\xc6\x8a\x4c\x0d\xfb\xdf\x59\xf0\x50\x52\x56\x07\xb7\xc0\x45\x28\x3b\xa8\xff\x99\xd3\xe9\x64\xbe\x2e\x57\x23\xa1\x5f\xec\xfc\xf2\x65\xb9\xfe\x7e\xb9\xd7\x14\xaf\x3c\x96\x8c\xca\x29\x9a\x48\xfa\x27\xe5\x99\xe3\x58\x33\x08\xe5\x8d\x07\x7a\x2f\x97\x48\xea\xe0\xa1\x6b\x5b\xfb\x7c\xae\x7b\x35\xdd\xf9\x61\x3f\x17\x93\xa7\x5f\x34\xb2\xe8\xe1\x50\x9f\x29\x72\xfc\x9c\x9a\xae\x57\x1a\xd4\xc1\x5b\x7a\x1f\x26\xf2\x25\xd0\x1e\x7a\xa6\xbf\xff\xe3\xbd\x25\x7f\x90\x1b\x86\x42\x0e\x74\xa2\x8f\x8a\xbe\xaf\xf2\x78\xab\xf2\x33\xb2\xde\xf7\xf8\x17\x00\x00\xff\xff\x4b\x83\x07\x28\x40\x02\x00\x00") - -func testdataContainerdSvcTaintsYamlBytes() ([]byte, error) { - return bindataRead( - _testdataContainerdSvcTaintsYaml, - "testdata/containerd-svc-taints.yaml", - ) -} - -func testdataContainerdSvcTaintsYaml() (*asset, error) { - bytes, err := testdataContainerdSvcTaintsYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "testdata/containerd-svc-taints.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _testdataCustomeContainerdSvcYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x90\xcd\x6e\xc2\x30\x10\x84\xef\x7e\x8a\x15\xf7\x38\xb1\x0b\x14\xf9\xca\x23\x54\xea\xb5\xda\x24\x4b\xb2\x8a\x7f\x22\xaf\x93\xbe\x7e\x65\xa0\x12\xdc\xc6\xf3\x59\xb3\xa3\xc1\x95\xbf\x29\x0b\xa7\xe8\x00\xd7\x55\xb4\x10\xfa\x24\x9a\x53\xbb\x9b\x9e\x0a\x1a\xb5\x70\x1c\x1d\x5c\xfd\x26\x85\xb2\x0a\x54\x70\xc4\x82\x4e\x01\x44\x0c\xe4\x60\xa4\x1b\x6e\xbe\x28\x59\x69\xa8\xee\x9c\xa4\x48\x15\x0d\xf0\x7a\x17\x55\x1a\xfb\xa9\x3b\xdd\x69\xe3\xac\xbd\x5b\x39\x79\x7a\xd2\xca\x03\xde\xe3\xff\x9f\x18\xc6\xf3\x51\x01\x70\xc0\x89\x1e\x61\x1e\xfb\xcc\x71\x6a\x97\xad\xa7\x1c\xa9\x90\xb8\xdd\x68\x7b\xd2\xdd\x1b\x9e\xc9\x07\xb7\x7f\xe8\x8b\xb6\x6f\xfe\x80\x9e\x87\x54\x89\x3d\x6a\xa3\x00\x44\xe6\xc7\xf9\x75\x71\xd0\xe6\x94\x4a\xab\x45\xe6\x96\xc7\x9f\x2c\xf8\x20\x29\x17\x07\xcf\xc2\x9b\x50\x76\x50\xff\xa9\xa6\x69\xd4\xeb\x72\xb5\x12\x8e\x41\x2f\x97\x97\xe5\xec\xfb\x72\xd7\x14\x6f\x3c\x6d\x19\x0b\xa7\xa8\x22\x95\xdf\x94\x17\x8e\x53\xed\x20\x94\x77\x1e\xe8\x6b\xeb\x23\x15\x07\x07\xd3\x75\xfa\x74\xae\x7b\xb5\xe6\x7c\x50\x7f\x01\x00\x00\xff\xff\x36\x22\xce\x71\xa5\x01\x00\x00") - -func testdataCustomeContainerdSvcYamlBytes() ([]byte, error) { - return bindataRead( - _testdataCustomeContainerdSvcYaml, - "testdata/custome-containerd-svc.yaml", - ) -} - -func testdataCustomeContainerdSvcYaml() (*asset, error) { - bytes, err := testdataCustomeContainerdSvcYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "testdata/custome-containerd-svc.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _testdataCustomeDockerSvcYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x90\xcd\x6a\xc3\x30\x10\x84\xef\x7a\x8a\x25\x77\xcb\x96\x9b\xa4\x41\xd7\x3c\x42\xa1\xd7\xb2\xb6\x36\xb6\xb0\x7e\xcc\xae\xec\xbe\x7e\x51\x92\x42\x72\x9b\x9d\x59\x86\xe1\xc3\xd5\x7f\x13\x8b\xcf\xc9\x02\xae\xab\x68\x21\x0c\x59\xb4\xcf\xed\x6e\x06\x2a\x68\xd4\xe2\x93\xb3\x70\x0d\x9b\x14\x62\x15\xa9\xa0\xc3\x82\x56\x01\x24\x8c\x64\xc1\xd1\x0d\xb7\x50\x94\xac\x34\x56\x77\xce\x52\xa4\x8a\x06\xfc\x7a\x17\x55\x9a\xfe\x53\x77\xba\xd3\xc6\xf6\xfd\xdd\xe2\x1c\xe8\x99\xd6\x3c\xe2\xbd\xfe\xff\xc4\xe8\xce\x47\x05\xe0\x23\x4e\xf4\x28\x0b\x38\xb0\x4f\x53\xbb\x6c\x03\x71\xa2\x42\xd2\xb8\x3c\x2e\xc4\x76\x37\xba\x3f\xe9\xee\xed\x6b\xa6\x10\xed\xfe\xa1\x2f\xba\x7f\xf3\x47\x0c\x7e\xcc\x35\xe9\x8f\xda\x28\x00\x91\xf9\xb1\x62\x5d\x2c\xb4\x9c\x73\x69\xb5\xc8\xdc\x7a\xf7\xc3\x82\x8f\x24\x73\xb1\xf0\xdc\xbd\x09\xb1\x85\xfa\xa7\x9a\xa6\x51\xaf\x00\xeb\x32\x74\x51\x2f\x97\x17\x80\xfd\x3b\xc0\x6b\x4e\x37\x3f\x6d\x8c\xc5\xe7\xa4\x12\x95\xdf\xcc\x8b\x4f\x53\xdd\x20\xc4\xbb\x1f\xe9\x6b\x1b\x12\x15\x0b\x07\xd3\x75\xfa\x74\xae\xd8\x5a\x73\x3e\xa8\xbf\x00\x00\x00\xff\xff\x2d\x56\x4d\x45\xac\x01\x00\x00") - -func testdataCustomeDockerSvcYamlBytes() ([]byte, error) { - return bindataRead( - _testdataCustomeDockerSvcYaml, - "testdata/custome-docker-svc.yaml", - ) -} - -func testdataCustomeDockerSvcYaml() (*asset, error) { - bytes, err := testdataCustomeDockerSvcYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "testdata/custome-docker-svc.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _testdataDockerSvcSansYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x90\xbf\x8e\xb3\x30\x10\xc4\x7b\x3f\x85\x95\x9e\x05\xfb\xcb\xbf\xcf\xdd\x29\xfd\x35\x91\xae\x3d\x2d\xb0\x01\x0b\x6c\xa3\x5d\xc3\xbd\xfe\xc9\x49\x4e\x4a\xba\xf1\xcc\x68\x3d\xfa\xe1\xe2\xbf\x88\xc5\xa7\xe8\x34\x2e\x8b\x80\x10\xce\x49\xc0\xa7\x7a\x33\x2d\x65\x34\x6a\xf2\xb1\x77\xfa\x32\xaf\x92\x89\x55\xa0\x8c\x3d\x66\x74\x4a\xeb\x88\x81\x9c\xee\xe9\x86\xeb\x9c\x95\x2c\xd4\x15\x77\x4c\x92\xa5\x88\x4a\xfb\xe5\x2e\x8a\x34\xf6\x04\x0d\x34\x60\x9c\xb5\x77\x8b\xd3\x4c\xcf\xb4\xe4\x01\xef\xe7\xff\x9e\x18\xfa\xe3\x5e\x69\xed\x03\x0e\xf4\x38\x36\x63\xcb\x3e\x0e\xf5\xb4\xb6\xc4\x91\x32\x49\xd5\xa7\x6e\x22\x76\x9b\x01\x7b\x80\xe6\xad\x35\xd2\x1c\xdc\xf6\x0f\xce\x60\xdf\xfc\x0e\x67\xdf\xa5\x92\xd8\x3d\x18\xa5\xb5\xc8\xf8\x58\xb1\x4c\x4e\xd7\x9c\x52\xae\x41\x64\xac\x7d\xff\xcd\x82\x8f\x24\x71\x76\xfa\xb9\x7b\x15\x62\xa7\x4b\x4f\x55\x55\xa5\x5e\x01\x96\x65\xd8\x07\x98\xce\x2f\x00\xed\x3b\xc0\x4b\x8a\x37\x3f\xac\x8c\xd9\xa7\xa8\x22\xe5\x9f\xc4\x93\x8f\x43\xd9\x20\xc4\x9b\xef\xe8\xba\xb6\x91\xb2\xd3\x3b\xd3\x34\x70\x38\x14\x6c\xb5\x39\xee\xca\x57\x57\xe2\x8d\xb8\x74\x3b\xe2\x7c\xfd\xf8\x7c\x82\x36\xff\x2d\x98\xe3\x19\x4e\x16\x4c\xd3\xa8\xdf\x00\x00\x00\xff\xff\xdb\x8b\x8e\x43\xd6\x01\x00\x00") - -func testdataDockerSvcSansYamlBytes() ([]byte, error) { - return bindataRead( - _testdataDockerSvcSansYaml, - "testdata/docker-svc-sans.yaml", - ) -} - -func testdataDockerSvcSansYaml() (*asset, error) { - bytes, err := testdataDockerSvcSansYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "testdata/docker-svc-sans.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "testdata/containerd-svc-etcd.yaml": testdataContainerdSvcEtcdYaml, - "testdata/containerd-svc-sans.yaml": testdataContainerdSvcSansYaml, - "testdata/containerd-svc-taints.yaml": testdataContainerdSvcTaintsYaml, - "testdata/custome-containerd-svc.yaml": testdataCustomeContainerdSvcYaml, - "testdata/custome-docker-svc.yaml": testdataCustomeDockerSvcYaml, - "testdata/docker-svc-sans.yaml": testdataDockerSvcSansYaml, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// -// data/ -// foo.txt -// img/ -// a.png -// b.png -// -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("nonexistent") would return an error -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - canonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(canonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "testdata": {nil, map[string]*bintree{ - "containerd-svc-etcd.yaml": {testdataContainerdSvcEtcdYaml, map[string]*bintree{}}, - "containerd-svc-sans.yaml": {testdataContainerdSvcSansYaml, map[string]*bintree{}}, - "containerd-svc-taints.yaml": {testdataContainerdSvcTaintsYaml, map[string]*bintree{}}, - "custome-containerd-svc.yaml": {testdataCustomeContainerdSvcYaml, map[string]*bintree{}}, - "custome-docker-svc.yaml": {testdataCustomeDockerSvcYaml, map[string]*bintree{}}, - "docker-svc-sans.yaml": {testdataDockerSvcSansYaml, map[string]*bintree{}}, - }}, -}} - -// RestoreAsset restores an asset under the given directory -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil -} - -// RestoreAssets restores an asset under the given directory recursively -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - canonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) -} diff --git a/test/e2e/testhelper/config/clusterfile.go b/test/e2e/testhelper/config/clusterfile.go index 6f6e7dca216..eb022a5ca88 100644 --- a/test/e2e/testhelper/config/clusterfile.go +++ b/test/e2e/testhelper/config/clusterfile.go @@ -20,6 +20,8 @@ import ( "os" "strings" + "github.com/labring/sealos/test/e2e/testdata/kubeadm" + "github.com/labring/sealos/test/e2e/testhelper/utils" "github.com/pkg/errors" @@ -27,7 +29,6 @@ import ( "k8s.io/apimachinery/pkg/util/yaml" "github.com/labring/sealos/pkg/types/v1beta1" - "github.com/labring/sealos/test/e2e/testdata" ) type Clusterfile struct { @@ -41,7 +42,7 @@ func (c *Clusterfile) Write() (string, error) { if err != nil { return "", errors.WithMessage(err, "create tmpdir failed") } - clusterfile, err := testdata.Asset(c.BinData) + clusterfile, err := kubeadm.Asset(c.BinData) if err != nil { return "", errors.WithMessage(err, "read clusterfile failed") } diff --git a/test/e2e/testhelper/config/clusterfile_test.go b/test/e2e/testhelper/config/clusterfile_test.go index 4f722854e4a..76864ed934c 100644 --- a/test/e2e/testhelper/config/clusterfile_test.go +++ b/test/e2e/testhelper/config/clusterfile_test.go @@ -20,6 +20,8 @@ import ( "os" "testing" + "github.com/labring/sealos/test/e2e/testdata/kubeadm" + "github.com/labring/sealos/test/e2e/testhelper/utils" ) @@ -36,7 +38,7 @@ func TestClusterfile_Write(t *testing.T) { { name: "default", fields: fields{ - BinData: "testdata/containerd-svc-etcd.yaml", + BinData: kubeadm.PackageName + "/containerd-svc-etcd.yaml", Replaces: map[string]string{"127.0.0.1": utils.GetLocalIpv4()}, }, wantErr: false, From 4cbb449522b1ca1d0dbcbad82fd1b5d08d7327b7 Mon Sep 17 00:00:00 2001 From: zhujingyang <72259332+zjy365@users.noreply.github.com> Date: Sat, 7 Oct 2023 19:12:40 +0800 Subject: [PATCH 04/14] feat:modify the format of the exported file (#4040) Signed-off-by: jingyang <3161362058@qq.com> --- .../src/pages/app/edit/components/Header.tsx | 13 +++----- frontend/providers/cronjob/src/utils/user.ts | 2 +- .../src/pages/deploy/components/Header.tsx | 25 ++++++--------- .../template/src/pages/deploy/index.tsx | 21 +++++-------- .../template/src/pages/develop/index.tsx | 31 +++++++++---------- frontend/providers/template/src/types/app.ts | 1 + .../providers/template/src/utils/json-yaml.ts | 4 +-- 7 files changed, 39 insertions(+), 58 deletions(-) diff --git a/frontend/providers/applaunchpad/src/pages/app/edit/components/Header.tsx b/frontend/providers/applaunchpad/src/pages/app/edit/components/Header.tsx index a0261f9af3f..53ddc565060 100644 --- a/frontend/providers/applaunchpad/src/pages/app/edit/components/Header.tsx +++ b/frontend/providers/applaunchpad/src/pages/app/edit/components/Header.tsx @@ -27,15 +27,12 @@ const Header = ({ const { lastRoute } = useGlobalStore(); const handleExportYaml = useCallback(async () => { - const zip = new JSZip(); - yamlList.forEach((item) => { - zip.file(item.filename, item.value); - }); - const res = await zip.generateAsync({ type: 'blob' }); + const exportYamlString = yamlList.map((i) => i.value).join('---\n'); + if (!exportYamlString) return; downLoadBold( - res, - 'application/zip', - appName ? `${appName}.zip` : `yaml${dayjs().format('YYYYMMDDHHmmss')}.zip` + exportYamlString, + 'application/yaml', + appName ? `${appName}.yaml` : `yaml${dayjs().format('YYYYMMDDHHmmss')}.yaml` ); }, [appName, yamlList]); diff --git a/frontend/providers/cronjob/src/utils/user.ts b/frontend/providers/cronjob/src/utils/user.ts index aafeb7c048c..9a1a74aae12 100644 --- a/frontend/providers/cronjob/src/utils/user.ts +++ b/frontend/providers/cronjob/src/utils/user.ts @@ -41,5 +41,5 @@ export const getUserNamespace = () => { export const getUserServiceAccount = () => { const kubeConfig = getUserKubeConfig(); const json = yaml.load(kubeConfig) as KC; - return json?.contexts[0]?.context?.namespace?.replace('ns-', '') || `${json?.users[0]?.name}`; + return json?.contexts[0]?.context?.user || json?.users[0]?.name; }; diff --git a/frontend/providers/template/src/pages/deploy/components/Header.tsx b/frontend/providers/template/src/pages/deploy/components/Header.tsx index ca939b42fbf..07d875dbd5f 100644 --- a/frontend/providers/template/src/pages/deploy/components/Header.tsx +++ b/frontend/providers/template/src/pages/deploy/components/Header.tsx @@ -26,15 +26,12 @@ const Header = ({ const { t } = useTranslation(); const handleExportYaml = useCallback(async () => { - const zip = new JSZip(); - yamlList.forEach((item) => { - zip.file(item.filename, item.value); - }); - const res = await zip.generateAsync({ type: 'blob' }); + const exportYamlString = yamlList.map((i) => i.value).join('---\n'); + if (!exportYamlString) return; downLoadBold( - res, - 'application/zip', - appName ? `${appName}.zip` : `yaml${dayjs().format('YYYYMMDDHHmmss')}.zip` + exportYamlString, + 'application/yaml', + appName ? `${appName}.yaml` : `yaml${dayjs().format('YYYYMMDDHHmmss')}.yaml` ); }, [appName, yamlList]); @@ -49,8 +46,7 @@ const Header = ({ w={'100%'} h={'80px'} alignItems={'center'} - backgroundColor={'rgba(255, 255, 255, 0.90)'} - > + backgroundColor={'rgba(255, 255, 255, 0.90)'}> + border={' 1px solid rgba(255, 255, 255, 0.50)'}> @@ -83,8 +78,7 @@ const Header = ({ mt={'8px'} fontSize={'12px'} color={'5A646E'} - fontWeight={400} - > + fontWeight={400}> {templateDetail?.spec?.description} @@ -98,8 +92,7 @@ const Header = ({ bg={'myWhite.600'} borderColor={'myGray.200'} variant={'base'} - onClick={handleExportYaml} - > + onClick={handleExportYaml}> {t('Export')} Yaml diff --git a/frontend/providers/template/src/types/app.ts b/frontend/providers/template/src/types/app.ts index b2ee5d8e7cc..d601482f8a8 100644 --- a/frontend/providers/template/src/types/app.ts +++ b/frontend/providers/template/src/types/app.ts @@ -7,6 +7,7 @@ export type TemplateType = { spec: { gitRepo: string; // new templateType: 'inline'; // new + template_type?: string; author: string; title: string; url: string; diff --git a/frontend/providers/template/src/utils/json-yaml.ts b/frontend/providers/template/src/utils/json-yaml.ts index df13a643d53..8cc98c9b84a 100644 --- a/frontend/providers/template/src/utils/json-yaml.ts +++ b/frontend/providers/template/src/utils/json-yaml.ts @@ -150,7 +150,7 @@ export const handleTemplateToInstanceYaml = ( instanceName: string ): TemplateInstanceType => { const { - spec: { gitRepo, templateType, ...resetSpec } + spec: { gitRepo, templateType, template_type, ...resetSpec } } = template; return { @@ -161,7 +161,7 @@ export const handleTemplateToInstanceYaml = ( }, spec: { gitRepo: gitRepo, - templateType: templateType, + templateType: templateType || template_type, ...resetSpec } }; From 541bf7c70a73e2f928c9acac2daf8efefbb905aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A6=B4=E8=8E=B2=E6=A6=B4=E8=8E=B2?= <78798447@qq.com> Date: Sun, 8 Oct 2023 14:31:30 +0800 Subject: [PATCH 05/14] fix: scp files (#4041) * fix: scp files * fix: scp files * fix: scp files * fix: scp files --- pkg/ssh/scp.go | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/pkg/ssh/scp.go b/pkg/ssh/scp.go index a20f36588f4..bbbf90e5ea2 100644 --- a/pkg/ssh/scp.go +++ b/pkg/ssh/scp.go @@ -218,16 +218,27 @@ func (c *Client) doCopy(client *sftp.Client, host, src, dest string, epu *progre } defer lf.Close() - dstfp, err := client.Create(dest) - if err != nil { - return fmt.Errorf("failed to create: %v", err) - } - if err = dstfp.Chmod(lfp.Mode()); err != nil { - return fmt.Errorf("failed to Chmod dst: %v", err) + destTmp := dest + ".tmp" + if err = func(tmpName string) error { + dstfp, err := client.Create(tmpName) + if err != nil { + return fmt.Errorf("failed to create: %v", err) + } + defer dstfp.Close() + + if err = dstfp.Chmod(lfp.Mode()); err != nil { + return fmt.Errorf("failed to Chmod dst: %v", err) + } + if _, err = io.Copy(dstfp, lf); err != nil { + return fmt.Errorf("failed to Copy: %v", err) + } + return nil + }(destTmp); err != nil { + return err } - defer dstfp.Close() - if _, err = io.Copy(dstfp, lf); err != nil { - return fmt.Errorf("failed to Copy: %v", err) + + if err = client.PosixRename(destTmp, dest); err != nil { + return fmt.Errorf("failed to rename %s to %s: %v", destTmp, dest, err) } if isCheckFileMD5() { dh := c.RemoteSha256Sum(host, dest) From de953956b189fac341e6f1fa3722441115a4e92f Mon Sep 17 00:00:00 2001 From: zzjin Date: Sun, 8 Oct 2023 16:11:07 +0800 Subject: [PATCH 06/14] Add app template draft spec. (#4044) Signed-off-by: zzjin --- controllers/app/api/v1/template_types.go | 1 + controllers/app/config/crd/bases/app.sealos.io_instances.yaml | 2 ++ controllers/app/config/crd/bases/app.sealos.io_templates.yaml | 2 ++ controllers/app/deploy/manifests/deploy.yaml | 4 ++++ 4 files changed, 9 insertions(+) diff --git a/controllers/app/api/v1/template_types.go b/controllers/app/api/v1/template_types.go index c3f4a6feab0..6394f417a5a 100644 --- a/controllers/app/api/v1/template_types.go +++ b/controllers/app/api/v1/template_types.go @@ -65,6 +65,7 @@ type TemplateData struct { Readme string `json:"readme,omitempty"` Icon string `json:"icon,omitempty"` TemplateType TemplateType `json:"templateType"` + Draft bool `json:"draft,omitempty"` Defaults Defaults `json:"defaults,omitempty"` Inputs Inputs `json:"inputs,omitempty"` } diff --git a/controllers/app/config/crd/bases/app.sealos.io_instances.yaml b/controllers/app/config/crd/bases/app.sealos.io_instances.yaml index c21cb543f0a..c9a709f9052 100644 --- a/controllers/app/config/crd/bases/app.sealos.io_instances.yaml +++ b/controllers/app/config/crd/bases/app.sealos.io_instances.yaml @@ -50,6 +50,8 @@ spec: type: object description: type: string + draft: + type: boolean gitRepo: type: string icon: diff --git a/controllers/app/config/crd/bases/app.sealos.io_templates.yaml b/controllers/app/config/crd/bases/app.sealos.io_templates.yaml index 5cf36ebb39c..3e85a52271a 100644 --- a/controllers/app/config/crd/bases/app.sealos.io_templates.yaml +++ b/controllers/app/config/crd/bases/app.sealos.io_templates.yaml @@ -50,6 +50,8 @@ spec: type: object description: type: string + draft: + type: boolean gitRepo: type: string icon: diff --git a/controllers/app/deploy/manifests/deploy.yaml b/controllers/app/deploy/manifests/deploy.yaml index e5c87c60aa1..e79ef410e4e 100644 --- a/controllers/app/deploy/manifests/deploy.yaml +++ b/controllers/app/deploy/manifests/deploy.yaml @@ -169,6 +169,8 @@ spec: type: object description: type: string + draft: + type: boolean gitRepo: type: string icon: @@ -263,6 +265,8 @@ spec: type: object description: type: string + draft: + type: boolean gitRepo: type: string icon: From 25e08fd3dc56669586cb7a95a3c5483e8782e0ad Mon Sep 17 00:00:00 2001 From: fengxsong Date: Mon, 9 Oct 2023 10:35:26 +0800 Subject: [PATCH 07/14] fix: if string addr has not colon (#4045) Signed-off-by: fengxsong --- pkg/exec/exec.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/exec/exec.go b/pkg/exec/exec.go index cc8a8287e61..66ec4c7b1ad 100644 --- a/pkg/exec/exec.go +++ b/pkg/exec/exec.go @@ -28,6 +28,7 @@ import ( "github.com/labring/sealos/pkg/ssh" "github.com/labring/sealos/pkg/unshare" fileutil "github.com/labring/sealos/pkg/utils/file" + "github.com/labring/sealos/pkg/utils/iputils" "github.com/labring/sealos/pkg/utils/logger" netutil "github.com/labring/sealos/pkg/utils/net" ) @@ -138,10 +139,7 @@ func (w *wrap) isLocal(addr string) bool { if unshare.IsRootless() { return false } - host, _, err := net.SplitHostPort(addr) - if err != nil { - return false - } + host := iputils.GetHostIP(addr) if host == "localhost" || host == "127.0.0.1" || w.localAddresses.Has(host) { return true } From 3686c3dd915b5a1504e991d1884753e35e516079 Mon Sep 17 00:00:00 2001 From: zhujingyang <72259332+zjy365@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:06:38 +0800 Subject: [PATCH 08/14] fix:template multiple names (#4047) Signed-off-by: jingyang <3161362058@qq.com> --- frontend/providers/template/src/api/delete.ts | 5 +++ .../providers/template/src/api/platform.ts | 3 ++ .../template/src/pages/api/platform/getEnv.ts | 9 +++- .../template/src/pages/api/resource/delJob.ts | 28 ++++++++++++ .../src/pages/deploy/components/Header.tsx | 1 - .../template/src/pages/deploy/index.tsx | 44 ++++++++++--------- .../template/src/pages/develop/index.tsx | 16 ++++--- .../providers/template/src/pages/index.tsx | 23 +++------- .../src/pages/instance/components/appList.tsx | 19 +++----- .../pages/instance/components/cronjobList.tsx | 15 +++---- .../src/pages/instance/components/dbList.tsx | 27 +++++------- .../pages/instance/components/delDodal.tsx | 5 +-- .../pages/instance/components/otherList.tsx | 8 ++-- .../template/src/pages/instance/index.tsx | 14 +++--- .../template/src/services/backend/response.ts | 4 +- 15 files changed, 120 insertions(+), 101 deletions(-) create mode 100644 frontend/providers/template/src/pages/api/resource/delJob.ts diff --git a/frontend/providers/template/src/api/delete.ts b/frontend/providers/template/src/api/delete.ts index 81668d1b7cb..b4418ef0533 100644 --- a/frontend/providers/template/src/api/delete.ts +++ b/frontend/providers/template/src/api/delete.ts @@ -19,6 +19,9 @@ export const delDBByName = (instanceName: string) => export const delInstanceByName = (instanceName: string) => DELETE('/api/instance/deleteByName', { instanceName }); +export const delJobByName = (instanceName: string) => + DELETE('/api/resource/delJob', { instanceName }); + export const deleteResourceByKind = (instanceName: string, kind: ResourceKindType) => { switch (kind) { case 'CronJob': @@ -33,6 +36,8 @@ export const deleteResourceByKind = (instanceName: string, kind: ResourceKindTyp return delDBByName(instanceName); case 'Instance': return delInstanceByName(instanceName); + case 'Job': + return delJobByName(instanceName); default: throw new Error(`Unsupported kind: ${kind}`); } diff --git a/frontend/providers/template/src/api/platform.ts b/frontend/providers/template/src/api/platform.ts index c892adf7d4e..111298c5358 100644 --- a/frontend/providers/template/src/api/platform.ts +++ b/frontend/providers/template/src/api/platform.ts @@ -1,3 +1,6 @@ +import { EnvResponse } from '@/pages/api/platform/getEnv'; import { GET } from '@/services/request'; export const updateRepo = () => GET('/api/updateRepo'); + +export const getPlatformEnv = () => GET('/api/platform/getEnv'); diff --git a/frontend/providers/template/src/pages/api/platform/getEnv.ts b/frontend/providers/template/src/pages/api/platform/getEnv.ts index da61ab6ab63..7f3fa5b3008 100644 --- a/frontend/providers/template/src/pages/api/platform/getEnv.ts +++ b/frontend/providers/template/src/pages/api/platform/getEnv.ts @@ -4,6 +4,13 @@ import { jsonRes } from '@/services/backend/response'; import { ApiResp } from '@/services/kubernet'; import type { NextApiRequest, NextApiResponse } from 'next'; +export type EnvResponse = { + SEALOS_CLOUD_DOMAIN: string; + SEALOS_CERT_SECRET_NAME: string; + TEMPLATE_REPO_URL: string; + SEALOS_NAMESPACE: string; +}; + export default async function handler(req: NextApiRequest, res: NextApiResponse) { let user_namespace = ''; @@ -16,7 +23,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse< console.log(error, 'errpr-'); } - jsonRes(res, { + jsonRes(res, { data: { SEALOS_CLOUD_DOMAIN: process.env.SEALOS_CLOUD_DOMAIN || 'cloud.sealos.io', SEALOS_CERT_SECRET_NAME: process.env.SEALOS_CERT_SECRET_NAME || 'wildcard-cert', diff --git a/frontend/providers/template/src/pages/api/resource/delJob.ts b/frontend/providers/template/src/pages/api/resource/delJob.ts new file mode 100644 index 00000000000..8429d117824 --- /dev/null +++ b/frontend/providers/template/src/pages/api/resource/delJob.ts @@ -0,0 +1,28 @@ +import type { NextApiRequest, NextApiResponse } from 'next'; +import { ApiResp } from '@/services/kubernet'; +import { authSession } from '@/services/backend/auth'; +import { getK8s } from '@/services/backend/kubernetes'; +import { jsonRes } from '@/services/backend/response'; + +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + try { + const { instanceName } = req.query as { instanceName: string }; + if (!instanceName) { + throw new Error('Job name is empty'); + } + + const { namespace, k8sBatch } = await getK8s({ + kubeconfig: await authSession(req.headers) + }); + + // 删除 Job + const result = await k8sBatch.deleteNamespacedJob(instanceName, namespace); + + jsonRes(res, { data: result }); + } catch (err: any) { + jsonRes(res, { + code: 500, + error: err + }); + } +} diff --git a/frontend/providers/template/src/pages/deploy/components/Header.tsx b/frontend/providers/template/src/pages/deploy/components/Header.tsx index 07d875dbd5f..639c371d7fc 100644 --- a/frontend/providers/template/src/pages/deploy/components/Header.tsx +++ b/frontend/providers/template/src/pages/deploy/components/Header.tsx @@ -4,7 +4,6 @@ import type { YamlItemType } from '@/types/index'; import { downLoadBold } from '@/utils/tools'; import { Box, Button, Flex, Image, Text } from '@chakra-ui/react'; import dayjs from 'dayjs'; -import JSZip from 'jszip'; import { useTranslation } from 'next-i18next'; import { MouseEvent, useCallback } from 'react'; diff --git a/frontend/providers/template/src/pages/deploy/index.tsx b/frontend/providers/template/src/pages/deploy/index.tsx index 395a5113e68..5f5c4f30d38 100644 --- a/frontend/providers/template/src/pages/deploy/index.tsx +++ b/frontend/providers/template/src/pages/deploy/index.tsx @@ -1,20 +1,20 @@ import { getTemplateSource, postDeployApp } from '@/api/app'; +import { getPlatformEnv } from '@/api/platform'; import { editModeMap } from '@/constants/editApp'; import { useConfirm } from '@/hooks/useConfirm'; import { useLoading } from '@/hooks/useLoading'; import { useToast } from '@/hooks/useToast'; -import { GET } from '@/services/request'; import { useCachedStore } from '@/store/cached'; import { useGlobalStore } from '@/store/global'; import type { QueryType, YamlItemType } from '@/types'; -import { TemplateInstanceType, TemplateSourceType } from '@/types/app'; +import { TemplateSourceType } from '@/types/app'; import { serviceSideProps } from '@/utils/i18n'; import { generateYamlList, parseTemplateString } from '@/utils/json-yaml'; -import { deepSearch } from '@/utils/tools'; +import { deepSearch, useCopyData } from '@/utils/tools'; import { Box, Flex, Icon, Text } from '@chakra-ui/react'; import { useQuery } from '@tanstack/react-query'; import JSYAML from 'js-yaml'; -import { cloneDeep, isEmpty, mapValues, reduce } from 'lodash'; +import { mapValues, reduce } from 'lodash'; import debounce from 'lodash/debounce'; import { useTranslation } from 'next-i18next'; import dynamic from 'next/dynamic'; @@ -22,20 +22,20 @@ import { useRouter } from 'next/router'; import { useEffect, useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; import Form from './components/Form'; -import Yaml from './components/Yaml'; import ReadMe from './components/ReadMe'; const ErrorModal = dynamic(() => import('./components/ErrorModal')); const Header = dynamic(() => import('./components/Header'), { ssr: false }); -export default function EditApp({ appName, tabType }: { appName?: string; tabType: string }) { +export default function EditApp({ appName }: { appName?: string }) { const { t, i18n } = useTranslation(); const { toast } = useToast(); const router = useRouter(); + const { copyData } = useCopyData(); const { templateName } = router.query as QueryType; const { Loading, setIsLoading } = useLoading(); const [forceUpdate, setForceUpdate] = useState(false); - const { title, applyBtnText, applyMessage, applySuccess, applyError } = editModeMap(!!appName); + const { title, applyBtnText, applyMessage, applySuccess, applyError } = editModeMap(false); const [templateSource, setTemplateSource] = useState(); const [yamlList, setYamlList] = useState([]); const [errorMessage, setErrorMessage] = useState(''); @@ -47,7 +47,7 @@ export default function EditApp({ appName, tabType }: { appName?: string; tabTyp [templateSource] ); - const { data: platformEnvs } = useQuery(['getPlatformEnvs'], () => GET('/api/platform/getEnv'), { + const { data: platformEnvs } = useQuery(['getPlatformEnvs'], getPlatformEnv, { staleTime: 5 * 60 * 1000 }); @@ -134,7 +134,7 @@ export default function EditApp({ appName, tabType }: { appName?: string; tabTyp setIsLoading(false); setCached(JSON.stringify({ ...formHook.getValues(), cachedKey: templateName })); const _name = encodeURIComponent(`?templateName=${templateName}&sealos_inside=true`); - const _domain = platformEnvs.SEALOS_CLOUD_DOMAIN; + const _domain = platformEnvs?.SEALOS_CLOUD_DOMAIN; const href = `https://${_domain}/?openapp=system-fastdeploy${_name}`; return window.open(href, '_self'); } @@ -149,14 +149,12 @@ export default function EditApp({ appName, tabType }: { appName?: string; tabTyp deleteCached(); - openConfirm2(() => { - router.push({ - pathname: '/instance', - query: { - instanceName: detailName - } - }); - })(); + router.push({ + pathname: '/instance', + query: { + instanceName: detailName + } + }); } catch (error) { setErrorMessage(JSON.stringify(error)); } @@ -231,6 +229,11 @@ export default function EditApp({ appName, tabType }: { appName?: string; tabTyp } ); + const copyTemplateLink = () => { + const str = `https://${platformEnvs?.SEALOS_CLOUD_DOMAIN}/?openapp=system-fastdeploy%3FtemplateName%3D${appName}`; + copyData(str); + }; + useEffect(() => { setInsideCloud(!(window.top === window)); @@ -297,6 +300,7 @@ export default function EditApp({ appName, tabType }: { appName?: string; tabTyp / {data?.templateYaml?.metadata?.name} @@ -312,7 +316,7 @@ export default function EditApp({ appName, tabType }: { appName?: string; tabTyp backgroundColor={'rgba(255, 255, 255, 0.90)'}>
GET('/api/platform/getEnv')); + const { data: platformEnvs } = useQuery(['getPlatformEnvs'], getPlatformEnv) as { + data: EnvResponse; + }; const onYamlChange = (value: string) => { setYamlValue(value); diff --git a/frontend/providers/template/src/pages/index.tsx b/frontend/providers/template/src/pages/index.tsx index 2e214e5f98e..ab826c6ff42 100644 --- a/frontend/providers/template/src/pages/index.tsx +++ b/frontend/providers/template/src/pages/index.tsx @@ -16,7 +16,6 @@ export default function AppList() { const { searchValue } = useSearchStore(); const { setInsideCloud, insideCloud } = useCachedStore(); - const { data: PlatformEnvs } = useQuery(['getPlatForm'], () => GET('/api/platform/getEnv')); const { data: FastDeployTemplates } = useQuery(['listTemplte'], () => GET('/api/listTemplate'), { refetchInterval: 5 * 60 * 1000, staleTime: 5 * 60 * 1000 @@ -42,7 +41,6 @@ export default function AppList() { router.push({ pathname: '/deploy', query: { - type: 'form', templateName: name } }); @@ -75,15 +73,13 @@ export default function AppList() { borderRadius={'12px'} background={'linear-gradient(180deg, #FFF 0%, rgba(255, 255, 255, 0.70) 100%)'} py={'36px'} - px="42px" - > + px="42px"> + minW={'765px'}> {filterData && filterData?.map((item: TemplateType) => { return ( @@ -103,8 +99,7 @@ export default function AppList() { borderRadius={'8px'} backgroundColor={'#fff'} boxShadow={'0px 2px 4px 0px rgba(187, 196, 206, 0.25)'} - border={'1px solid #EAEBF0'} - > + border={'1px solid #EAEBF0'}> + border={' 1px solid rgba(255, 255, 255, 0.50)'}> @@ -129,8 +123,7 @@ export default function AppList() { h={'28px'} borderRadius={'4px'} border={'1px solid #DEE0E2'} - backgroundColor={'#F4F6F8'} - > + backgroundColor={'#F4F6F8'}> Deploy @@ -146,8 +139,7 @@ export default function AppList() { mt={'8px'} fontSize={'12px'} color={'5A646E'} - fontWeight={400} - > + fontWeight={400}> {item?.spec?.description} @@ -163,8 +155,7 @@ export default function AppList() { fill="#5A646E" _hover={{ fill: '#0884DD' - }} - > + }}> diff --git a/frontend/providers/template/src/pages/instance/components/appList.tsx b/frontend/providers/template/src/pages/instance/components/appList.tsx index 9fa8d208b35..a6f41bbcf17 100644 --- a/frontend/providers/template/src/pages/instance/components/appList.tsx +++ b/frontend/providers/template/src/pages/instance/components/appList.tsx @@ -8,14 +8,12 @@ import { printMemory } from '@/utils/tools'; import { Box, Button, Flex, Icon, Text } from '@chakra-ui/react'; import { useQuery } from '@tanstack/react-query'; import { useTranslation } from 'next-i18next'; -import { useRouter } from 'next/router'; import { useCallback, useMemo } from 'react'; import { sealosApp } from 'sealos-desktop-sdk/app'; export default function AppList({ instanceName }: { instanceName: string }) { const { t } = useTranslation(); - const router = useRouter(); - const { resource, appendResource } = useResourceStore(); + const { appendResource } = useResourceStore(); const { data, isLoading } = useQuery( ['getAppLaunchpadByName', instanceName], @@ -32,14 +30,14 @@ export default function AppList({ instanceName }: { instanceName: string }) { } ); - const handleToDetailPage = useCallback(() => { + const handleToDetailPage = useCallback((name: string) => { sealosApp.runEvents('openDesktopApp', { appKey: 'system-applaunchpad', pathname: '/app/detail', - query: { name: instanceName }, + query: { name: name }, messageData: {} }); - }, [instanceName]); + }, []); const columns = useMemo< { @@ -114,8 +112,7 @@ export default function AppList({ instanceName }: { instanceName: string }) { variant={'base'} leftIcon={} px={3} - onClick={handleToDetailPage} - > + onClick={() => handleToDetailPage(item.name)}> {t('Details')} @@ -144,16 +141,14 @@ export default function AppList({ instanceName }: { instanceName: string }) { justifyContent={'center'} alignItems={'center'} background={'white'} - p="32px" - > + p="32px"> + alignItems={'center'}> diff --git a/frontend/providers/template/src/pages/instance/components/cronjobList.tsx b/frontend/providers/template/src/pages/instance/components/cronjobList.tsx index f7432b23bf8..724b5edd786 100644 --- a/frontend/providers/template/src/pages/instance/components/cronjobList.tsx +++ b/frontend/providers/template/src/pages/instance/components/cronjobList.tsx @@ -30,14 +30,14 @@ export default function CronJobList({ instanceName }: { instanceName: string }) } } ); - const handleToDetailPage = useCallback(() => { + const handleToDetailPage = useCallback((name: string) => { sealosApp.runEvents('openDesktopApp', { appKey: 'system-cronjob', pathname: '/job/detail', - query: { name: instanceName }, + query: { name: name }, messageData: {} }); - }, [instanceName]); + }, []); const columns = useMemo< { @@ -100,8 +100,7 @@ export default function CronJobList({ instanceName }: { instanceName: string }) variant={'base'} leftIcon={} px={3} - onClick={handleToDetailPage} - > + onClick={() => handleToDetailPage(item.name)}> {t('Details')} @@ -130,16 +129,14 @@ export default function CronJobList({ instanceName }: { instanceName: string }) justifyContent={'center'} alignItems={'center'} background={'white'} - p="32px" - > + p="32px"> + alignItems={'center'}> diff --git a/frontend/providers/template/src/pages/instance/components/dbList.tsx b/frontend/providers/template/src/pages/instance/components/dbList.tsx index 8ea2ce2f8c4..afd3a766da9 100644 --- a/frontend/providers/template/src/pages/instance/components/dbList.tsx +++ b/frontend/providers/template/src/pages/instance/components/dbList.tsx @@ -1,20 +1,18 @@ import { getDBListByName } from '@/api/instance'; -import StatusTag from '@/components/StatusTag'; import MyIcon from '@/components/Icon'; +import StatusTag from '@/components/StatusTag'; import MyTable from '@/components/Table'; +import { useResourceStore } from '@/store/resource'; import { DBListItemType } from '@/types/db'; +import { printMemory } from '@/utils/tools'; import { Box, Button, Flex, Icon, Text } from '@chakra-ui/react'; import { useQuery } from '@tanstack/react-query'; import { useTranslation } from 'next-i18next'; -import { useRouter } from 'next/router'; -import { useCallback, useMemo } from 'react'; -import { printMemory } from '@/utils/tools'; -import { useResourceStore } from '@/store/resource'; +import { useMemo } from 'react'; import { sealosApp } from 'sealos-desktop-sdk/app'; export default function AppList({ instanceName }: { instanceName: string }) { const { t } = useTranslation(); - const router = useRouter(); const { appendResource } = useResourceStore(); const { data } = useQuery( @@ -31,14 +29,14 @@ export default function AppList({ instanceName }: { instanceName: string }) { } ); - const handleToDetailPage = useCallback(() => { + const handleToDetailPage = (name: string) => { sealosApp.runEvents('openDesktopApp', { appKey: 'system-dbprovider', pathname: '/db/detail', - query: { name: instanceName }, + query: { name: name }, messageData: {} }); - }, [instanceName]); + }; const columns = useMemo< { @@ -100,15 +98,14 @@ export default function AppList({ instanceName }: { instanceName: string }) { variant={'base'} leftIcon={} px={3} - onClick={handleToDetailPage} - > + onClick={() => handleToDetailPage(item.name)}> {t('Details')} ) } ], - [handleToDetailPage, t] + [t] ); return ( @@ -132,16 +129,14 @@ export default function AppList({ instanceName }: { instanceName: string }) { justifyContent={'center'} alignItems={'center'} background={'white'} - p="32px" - > + p="32px"> + alignItems={'center'}> diff --git a/frontend/providers/template/src/pages/instance/components/delDodal.tsx b/frontend/providers/template/src/pages/instance/components/delDodal.tsx index c0c130d1bef..669832cf99e 100644 --- a/frontend/providers/template/src/pages/instance/components/delDodal.tsx +++ b/frontend/providers/template/src/pages/instance/components/delDodal.tsx @@ -49,7 +49,7 @@ const DelModal = ({ console.error(error); } setLoading(false); - }, [name, toast, t, onSuccess, onClose]); + }, [resource, toast, t, onSuccess, onClose]); return ( @@ -86,8 +86,7 @@ const DelModal = ({ variant={'solid'} isDisabled={inputValue !== name} isLoading={loading} - onClick={handleDelApp} - > + onClick={handleDelApp}> {t('Confirm deletion')} diff --git a/frontend/providers/template/src/pages/instance/components/otherList.tsx b/frontend/providers/template/src/pages/instance/components/otherList.tsx index 191b351e505..14b1a230521 100644 --- a/frontend/providers/template/src/pages/instance/components/otherList.tsx +++ b/frontend/providers/template/src/pages/instance/components/otherList.tsx @@ -19,7 +19,7 @@ export default function OtherList({ instanceName }: { instanceName: string }) { onSuccess(data) { appendResource( data.map((item) => { - return { id: item.id, name: item.name, kind: item.kind || 'other' }; + return { id: item.id, name: item.name, kind: item.kind }; }) ); } @@ -81,16 +81,14 @@ export default function OtherList({ instanceName }: { instanceName: string }) { justifyContent={'center'} alignItems={'center'} background={'white'} - p="32px" - > + p="32px"> + alignItems={'center'}> diff --git a/frontend/providers/template/src/pages/instance/index.tsx b/frontend/providers/template/src/pages/instance/index.tsx index 042b55fb3aa..2e429aba6a9 100644 --- a/frontend/providers/template/src/pages/instance/index.tsx +++ b/frontend/providers/template/src/pages/instance/index.tsx @@ -1,18 +1,16 @@ -import { getInstanceByName } from '@/api/instance'; +import { useResourceStore } from '@/store/resource'; import { serviceSideProps } from '@/utils/i18n'; -import { Box, Flex, Icon, Text } from '@chakra-ui/react'; -import { useQuery } from '@tanstack/react-query'; +import { Box, Flex } from '@chakra-ui/react'; +import { useEffect } from 'react'; import AppList from './components/appList'; -import Header from './components/header'; -import DBList from './components/dbList'; import CronJobList from './components/cronjobList'; +import DBList from './components/dbList'; +import Header from './components/header'; import OtherList from './components/otherList'; -import { useResourceStore } from '@/store/resource'; -import { useEffect } from 'react'; export default function MyApp({ instanceName }: { instanceName: string }) { const { resource, setInstanceName } = useResourceStore(); - console.log(resource); + console.log(resource, 'resource'); useEffect(() => { setInstanceName(instanceName); diff --git a/frontend/providers/template/src/services/backend/response.ts b/frontend/providers/template/src/services/backend/response.ts index 20355c0509a..dd675391fd6 100644 --- a/frontend/providers/template/src/services/backend/response.ts +++ b/frontend/providers/template/src/services/backend/response.ts @@ -1,12 +1,12 @@ import { NextApiResponse } from 'next'; import { ERROR_TEXT, ERROR_RESPONSE } from '../error'; -export const jsonRes = ( +export const jsonRes = ( res: NextApiResponse, props?: { code?: number; message?: string; - data?: any; + data?: T; error?: any; } ) => { From 6ec63e02620366f726283ffdab2a0d37ca6a59e6 Mon Sep 17 00:00:00 2001 From: sealos-release-robot Date: Mon, 9 Oct 2023 18:26:49 +0800 Subject: [PATCH 09/14] docs: Automated Changelog Update for v4.3.5 (#4054) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🤖 add release changelog using robot. Signed-off-by: sealos-release-robot * Update CHANGELOG.md --------- Signed-off-by: sealos-release-robot Co-authored-by: cuisongliu --- CHANGELOG/CHANGELOG-4.3.5.md | 19 +++++++++++++++++++ CHANGELOG/CHANGELOG.md | 1 + 2 files changed, 20 insertions(+) create mode 100644 CHANGELOG/CHANGELOG-4.3.5.md diff --git a/CHANGELOG/CHANGELOG-4.3.5.md b/CHANGELOG/CHANGELOG-4.3.5.md new file mode 100644 index 00000000000..1f5f8e81612 --- /dev/null +++ b/CHANGELOG/CHANGELOG-4.3.5.md @@ -0,0 +1,19 @@ +Welcome to the v4.3.5 release of Sealos!🎉🎉! + + + +## Changelog +### Bug fixes +* 715a648081df2aa150d88baf1b8a44d40d1df12f: fix: scp files (#4041) (#4042) (#4043) (@sealos-ci-robot) +* 7ad66b4e8055eaf7ad14acf60de605e8af987a47: fix: sync cert failed on non default port (#4034) (@cuisongliu) +### Other work +* ba3d7c932e5461528c292126205a3cbc35cb4e5f: feature(main): using sreg 0.1.4 build image (#4023) (#4028) (#4029) (@sealos-ci-robot) +* 881c10cbb35d03950f4de03c12f5c4e2df33d453: fix(4.3): revert cert feature (#4053) (@cuisongliu) + +**Full Changelog**: https://github.com/labring/sealos/compare/v4.3.4...v4.3.5 + +See [the CHANGELOG](https://github.com/labring/sealos/blob/main/CHANGELOG/CHANGELOG.md) for more details. + +Your patronage towards Sealos is greatly appreciated 🎉🎉. + +If you encounter any problems during its usage, please create an issue in the [GitHub repository](https://github.com/labring/sealos), we're committed to resolving your problem as soon as possible. diff --git a/CHANGELOG/CHANGELOG.md b/CHANGELOG/CHANGELOG.md index a44ad6e960e..7b07fd8ab2b 100644 --- a/CHANGELOG/CHANGELOG.md +++ b/CHANGELOG/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. - [CHANGELOG-5.0.0-alpha1.md](./CHANGELOG-5.0.0-alpha1.md) - [CHANGELOG-4.4.0-alpha3.md](./CHANGELOG-4.4.0-alpha3.md) - [CHANGELOG-4.4.0-alpha1.md](./CHANGELOG-4.4.0-alpha1.md) +- [CHANGELOG-4.3.5.md](./CHANGELOG-4.3.5.md) - [CHANGELOG-4.3.4.md](./CHANGELOG-4.3.4.md) - [CHANGELOG-4.3.3.md](./CHANGELOG-4.3.3.md) - [CHANGELOG-4.3.2.md](./CHANGELOG-4.3.2.md) From 7bc47733ad4aaadd41a0ed4cf76470833c4c0f89 Mon Sep 17 00:00:00 2001 From: zhujingyang <72259332+zjy365@users.noreply.github.com> Date: Tue, 10 Oct 2023 10:03:40 +0800 Subject: [PATCH 10/14] feat:db add quota (#4055) * feat:db add quota Signed-off-by: jingyang <3161362058@qq.com> * add cronjob key Signed-off-by: jingyang <3161362058@qq.com> --------- Signed-off-by: jingyang <3161362058@qq.com> --- .../providers/cronjob/src/constants/keys.ts | 19 +++++ .../src/pages/api/cronjob/getCronJobList.ts | 10 ++- .../providers/cronjob/src/utils/json2Yaml.ts | 4 +- .../dbprovider/public/locales/en/common.json | 12 ++- .../dbprovider/public/locales/zh/common.json | 12 ++- .../providers/dbprovider/src/api/platform.ts | 13 +++- .../src/pages/api/platform/getQuota.ts | 24 ++++++ .../src/pages/db/edit/components/Form.tsx | 10 ++- .../src/pages/db/edit/components/QuotaBox.tsx | 77 +++++++++++++++++++ .../dbprovider/src/pages/db/edit/index.tsx | 63 ++++++++++----- .../src/services/backend/kubernetes.ts | 61 ++++++++++++++- .../providers/dbprovider/src/store/user.ts | 61 +++++++++++++++ .../providers/dbprovider/src/types/user.d.ts | 15 +++- .../providers/template/src/api/platform.ts | 2 +- .../providers/template/src/constants/keys.ts | 2 +- .../src/pages/api/getTemplateSource.ts | 4 +- .../template/src/pages/api/platform/getEnv.ts | 8 +- .../template/src/pages/deploy/index.tsx | 1 + .../template/src/pages/develop/index.tsx | 2 +- .../providers/template/src/types/index.ts | 7 ++ .../providers/template/src/utils/json-yaml.ts | 30 ++++++-- 21 files changed, 387 insertions(+), 50 deletions(-) create mode 100644 frontend/providers/cronjob/src/constants/keys.ts create mode 100644 frontend/providers/dbprovider/src/pages/api/platform/getQuota.ts create mode 100644 frontend/providers/dbprovider/src/pages/db/edit/components/QuotaBox.tsx create mode 100644 frontend/providers/dbprovider/src/store/user.ts diff --git a/frontend/providers/cronjob/src/constants/keys.ts b/frontend/providers/cronjob/src/constants/keys.ts new file mode 100644 index 00000000000..caef2924bd5 --- /dev/null +++ b/frontend/providers/cronjob/src/constants/keys.ts @@ -0,0 +1,19 @@ +// applanuchpad +export const pauseKey = 'deploy.cloud.sealos.io/pause'; +export const deployManagerKey = 'cloud.sealos.io/app-deploy-manager'; +export const noGpuSliderKey = 'NoGpu'; +export const maxReplicasKey = 'deploy.cloud.sealos.io/maxReplicas'; +export const minReplicasKey = 'deploy.cloud.sealos.io/minReplicas'; +export const appDeployKey = 'cloud.sealos.io/app-deploy-manager'; +export const publicDomainKey = `cloud.sealos.io/app-deploy-manager-domain`; +export const gpuNodeSelectorKey = 'nvidia.com/gpu.product'; +export const gpuResourceKey = 'nvidia.com/gpu'; +// template +export const templateDeployKey = 'cloud.sealos.io/deploy-on-sealos'; +// db +export const kubeblocksTypeKey = 'clusterdefinition.kubeblocks.io/name'; +// labels +export const componentLabel = 'app.kubernetes.io/component'; +// cronjob +export const cronJobTypeKey = 'cronjob-type'; +export const cronJobKey = 'cloud.sealos.io/cronjob'; diff --git a/frontend/providers/cronjob/src/pages/api/cronjob/getCronJobList.ts b/frontend/providers/cronjob/src/pages/api/cronjob/getCronJobList.ts index badd8ccf98f..c048f20e90f 100644 --- a/frontend/providers/cronjob/src/pages/api/cronjob/getCronJobList.ts +++ b/frontend/providers/cronjob/src/pages/api/cronjob/getCronJobList.ts @@ -1,3 +1,4 @@ +import { cronJobKey } from '@/constants/keys'; import { authSession } from '@/services/backend/auth'; import { getK8s } from '@/services/backend/kubernetes'; import { jsonRes } from '@/services/backend/response'; @@ -9,7 +10,14 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse< const { namespace, k8sBatch } = await getK8s({ kubeconfig: await authSession(req) }); - const response = await k8sBatch.listNamespacedCronJob(namespace); + const response = await k8sBatch.listNamespacedCronJob( + namespace, + undefined, + undefined, + undefined, + undefined, + cronJobKey + ); jsonRes(res, { data: response?.body?.items }); } catch (err: any) { diff --git a/frontend/providers/cronjob/src/utils/json2Yaml.ts b/frontend/providers/cronjob/src/utils/json2Yaml.ts index 562fd303645..f0dab0f654f 100644 --- a/frontend/providers/cronjob/src/utils/json2Yaml.ts +++ b/frontend/providers/cronjob/src/utils/json2Yaml.ts @@ -2,6 +2,7 @@ import { CronJobEditType } from '@/types/job'; import { getUserTimeZone, str2Num } from '@/utils/tools'; import yaml from 'js-yaml'; import { getUserServiceAccount } from './user'; +import { cronJobKey } from '@/constants/keys'; export const json2CronJob = (data: CronJobEditType) => { const serviceAccount = getUserServiceAccount(); @@ -12,7 +13,8 @@ export const json2CronJob = (data: CronJobEditType) => { annotations: {}, labels: { 'cronjob-type': data.jobType, - 'cronjob-launchpad-name': data.launchpadName + 'cronjob-launchpad-name': data.launchpadName, + [cronJobKey]: data.jobName } }; diff --git a/frontend/providers/dbprovider/public/locales/en/common.json b/frontend/providers/dbprovider/public/locales/en/common.json index d84c5700195..d7afccd3492 100644 --- a/frontend/providers/dbprovider/public/locales/en/common.json +++ b/frontend/providers/dbprovider/public/locales/en/common.json @@ -119,5 +119,15 @@ "Running Time": "Running Time", "InnoDB Buffer Pool": "InnoDB Buffer Pool", "Database Usage": "Database Usage", - "Disk": "Disk" + "Disk": "Disk", + "app": { + "Resource Quota": "Quota", + "The applied CPU exceeds the quota": "The applied CPU exceeds the quota", + "The applied memory exceeds the quota": "The applied memory exceeds the quota", + "The applied GPU exceeds the quota": "The applied GPU exceeds the quota", + "The applied storage exceeds the quota": "The applied storage exceeds the quota", + "The container exposed port cannot be empty": "The container exposed port cannot be empty", + "The minimum exposed port is 1": "The minimum exposed port is 1", + "The maximum number of exposed ports is 65535": "The maximum number of exposed ports is 65535" + } } \ No newline at end of file diff --git a/frontend/providers/dbprovider/public/locales/zh/common.json b/frontend/providers/dbprovider/public/locales/zh/common.json index 2a003735be0..a06d61accfd 100644 --- a/frontend/providers/dbprovider/public/locales/zh/common.json +++ b/frontend/providers/dbprovider/public/locales/zh/common.json @@ -166,5 +166,15 @@ "Running Time": "运行时长", "InnoDB Buffer Pool": "InnoDB 缓冲池", "Database Usage": "数据库用量", - "Disk": "磁盘空间" + "Disk": "磁盘空间", + "app": { + "Resource Quota": "资源配额", + "The applied CPU exceeds the quota": "申请的 CPU 超出限制,请联系管理员", + "The applied memory exceeds the quota": "申请的 '内存' 超出限制,请联系管理员", + "The applied GPU exceeds the quota": "申请的 GPU 超出限制,请联系管理员", + "The applied storage exceeds the quota": "申请的 '存储' 超出限制,请联系管理员", + "The container exposed port cannot be empty": "容器暴露端口不能为空", + "The minimum exposed port is 1": "暴露端口最小为 1", + "The maximum number of exposed ports is 65535": "暴露端口最大为65535" + } } \ No newline at end of file diff --git a/frontend/providers/dbprovider/src/api/platform.ts b/frontend/providers/dbprovider/src/api/platform.ts index 3b0f88bb154..54e236f348a 100644 --- a/frontend/providers/dbprovider/src/api/platform.ts +++ b/frontend/providers/dbprovider/src/api/platform.ts @@ -1,8 +1,15 @@ -import { GET, POST, DELETE } from '@/services/request'; -import type { Response as resourcePriceResponse } from '@/pages/api/platform/resourcePrice'; -import type { Response as DBVersionMapType } from '@/pages/api/platform/getVersion'; import { Response as EnvResponse } from '@/pages/api/getEnv'; +import type { Response as DBVersionMapType } from '@/pages/api/platform/getVersion'; +import type { Response as resourcePriceResponse } from '@/pages/api/platform/resourcePrice'; +import { GET } from '@/services/request'; +import type { UserQuotaItemType } from '@/types/user'; export const getResourcePrice = () => GET('/api/platform/resourcePrice'); export const getAppEnv = () => GET('/api/getEnv'); export const getDBVersionMap = () => GET('/api/platform/getVersion'); + +export const getUserQuota = () => + GET<{ + balance: number; + quota: UserQuotaItemType[]; + }>('/api/platform/getQuota'); diff --git a/frontend/providers/dbprovider/src/pages/api/platform/getQuota.ts b/frontend/providers/dbprovider/src/pages/api/platform/getQuota.ts new file mode 100644 index 00000000000..c7ef0c39b5c --- /dev/null +++ b/frontend/providers/dbprovider/src/pages/api/platform/getQuota.ts @@ -0,0 +1,24 @@ +import type { NextApiRequest, NextApiResponse } from 'next'; +import { getK8s } from '@/services/backend/kubernetes'; +import { jsonRes } from '@/services/backend/response'; +import { authSession } from '@/services/backend/auth'; + +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + try { + // source price + const { getUserQuota, getUserBalance } = await getK8s({ + kubeconfig: await authSession(req) + }); + + const [quota, balance] = await Promise.all([getUserQuota(), getUserBalance()]); + + jsonRes(res, { + data: { + quota, + balance + } + }); + } catch (error) { + jsonRes(res, { code: 500, message: 'get price error' }); + } +} diff --git a/frontend/providers/dbprovider/src/pages/db/edit/components/Form.tsx b/frontend/providers/dbprovider/src/pages/db/edit/components/Form.tsx index 19fc27a70a8..6ed0ae2b2e7 100644 --- a/frontend/providers/dbprovider/src/pages/db/edit/components/Form.tsx +++ b/frontend/providers/dbprovider/src/pages/db/edit/components/Form.tsx @@ -30,7 +30,7 @@ import { useTranslation } from 'next-i18next'; import PriceBox from './PriceBox'; import { INSTALL_ACCOUNT } from '@/store/static'; import Tip from '@/components/Tip'; - +import QuotaBox from './QuotaBox'; import { obj2Query } from '@/api/tools'; import { throttle } from 'lodash'; import { InfoOutlineIcon } from '@chakra-ui/icons'; @@ -196,7 +196,9 @@ const Form = ({ ))} - + + + {INSTALL_ACCOUNT && ( e && setValue('storage', +e)} + onChange={(e) => { + e !== '' ? setValue('storage', +e) : setValue('storage', minStorage); + }} > { + const theme = useTheme(); + const { t } = useTranslation(); + const { userQuota, loadUserQuota } = useUserStore(); + useQuery(['getUserQuota'], loadUserQuota); + + const quotaList = useMemo(() => { + if (!userQuota) return []; + return userQuota + .map((item) => ({ + ...item, + tip: `${t('Total')}: ${`${item.limit} ${sourceMap[item.type]?.unit}`} +${t('common.Used')}: ${`${item.used} ${sourceMap[item.type]?.unit}`} +${t('common.Surplus')}: ${`${item.limit - item.used} ${sourceMap[item.type]?.unit}`} +`, + color: sourceMap[item.type]?.color + })) + .filter((item) => item.limit > 0); + }, [userQuota, t]); + + return userQuota.length === 0 ? null : ( + + + {t('app.Resource Quota')} + + + {quotaList.map((item) => ( + + + {t(item.type)} + div': { + bg: item.color + } + })} + /> + + + ))} + + + ); +}; + +export default QuotaBox; diff --git a/frontend/providers/dbprovider/src/pages/db/edit/index.tsx b/frontend/providers/dbprovider/src/pages/db/edit/index.tsx index 01110b45c55..4cc1a615dad 100644 --- a/frontend/providers/dbprovider/src/pages/db/edit/index.tsx +++ b/frontend/providers/dbprovider/src/pages/db/edit/index.tsx @@ -1,4 +1,4 @@ -import React, { useState, useCallback, useMemo } from 'react'; +import React, { useState, useCallback, useMemo, useRef } from 'react'; import { useRouter } from 'next/router'; import { Flex, Box } from '@chakra-ui/react'; import type { YamlItemType } from '@/types'; @@ -23,6 +23,7 @@ import { DBVersionMap } from '@/store/static'; import Header from './components/Header'; import Form from './components/Form'; import Yaml from './components/Yaml'; +import { useUserStore } from '@/store/user'; const ErrorModal = dynamic(() => import('./components/ErrorModal')); const defaultEdit = { @@ -40,6 +41,8 @@ const EditApp = ({ dbName, tabType }: { dbName?: string; tabType?: 'form' | 'yam const { toast } = useToast(); const { Loading, setIsLoading } = useLoading(); const { loadDBDetail } = useDBStore(); + const oldDBEditData = useRef(); + const { checkQuotaAllow, balance } = useUserStore(); const { title, applyBtnText, applyMessage, applySuccess, applyError } = editModeMap(!!dbName); const { openConfirm, ConfirmChild } = useConfirm({ content: t(applyMessage) @@ -61,24 +64,28 @@ const EditApp = ({ dbName, tabType }: { dbName?: string; tabType?: 'form' | 'yam defaultValues: defaultEdit }); + const generateYamlList = (data: DBEditType) => { + return [ + { + filename: 'cluster.yaml', + value: json2CreateCluster(data) + }, + ...(isEdit + ? [] + : [ + { + filename: 'account.yaml', + value: json2Account(data) + } + ]) + ]; + }; + // eslint-disable-next-line react-hooks/exhaustive-deps const formOnchangeDebounce = useCallback( debounce((data: DBEditType) => { try { - setYamlList([ - { - filename: 'cluster.yaml', - value: json2CreateCluster(data) - }, - ...(isEdit - ? [] - : [ - { - filename: 'account.yaml', - value: json2Account(data) - } - ]) - ]); + setYamlList(generateYamlList(data)); } catch (error) { console.log(error); } @@ -91,16 +98,26 @@ const EditApp = ({ dbName, tabType }: { dbName?: string; tabType?: 'form' | 'yam setForceUpdate(!forceUpdate); }); - const submitSuccess = useCallback(async () => { + const submitSuccess = async (formData: DBEditType) => { setIsLoading(true); try { !isEdit && (await applyYamlList([limitRangeYaml], 'create')); } catch (err) {} try { - const data = yamlList.map((item) => item.value); - - await applyYamlList(data, isEdit ? 'replace' : 'create'); + const yamlList = generateYamlList(formData).map((item) => item.value); + // quote check + const quoteCheckRes = checkQuotaAllow(formData, oldDBEditData.current); + if (quoteCheckRes) { + setIsLoading(false); + return toast({ + status: 'warning', + title: t(quoteCheckRes), + duration: 5000, + isClosable: true + }); + } + await applyYamlList(yamlList, isEdit ? 'replace' : 'create'); toast({ title: t(applySuccess), status: 'success' @@ -111,7 +128,8 @@ const EditApp = ({ dbName, tabType }: { dbName?: string; tabType?: 'form' | 'yam setErrorMessage(JSON.stringify(error)); } setIsLoading(false); - }, [applySuccess, formHook, isEdit, router, setIsLoading, t, toast, yamlList]); + }; + const submitError = useCallback(() => { // deep search message const deepSearch = (obj: any): string => { @@ -152,6 +170,7 @@ const EditApp = ({ dbName, tabType }: { dbName?: string; tabType?: 'form' | 'yam { onSuccess(res) { if (!res) return; + oldDBEditData.current = res; formHook.reset(adaptDBForm(res)); setMinStorage(res.storage); }, @@ -181,7 +200,9 @@ const EditApp = ({ dbName, tabType }: { dbName?: string; tabType?: 'form' | 'yam title={title} yamlList={yamlList} applyBtnText={applyBtnText} - applyCb={() => formHook.handleSubmit(openConfirm(submitSuccess), submitError)()} + applyCb={() => + formHook.handleSubmit((data) => openConfirm(submitSuccess(data)), submitError)() + } /> diff --git a/frontend/providers/dbprovider/src/services/backend/kubernetes.ts b/frontend/providers/dbprovider/src/services/backend/kubernetes.ts index 31802ac42b0..3bd235a1c6f 100644 --- a/frontend/providers/dbprovider/src/services/backend/kubernetes.ts +++ b/frontend/providers/dbprovider/src/services/backend/kubernetes.ts @@ -1,3 +1,5 @@ +import { UserQuotaItemType } from '@/types/user'; +import { cpuFormatToM, memoryFormatToMi } from '@/utils/tools'; import * as k8s from '@kubernetes/client-node'; import * as yaml from 'js-yaml'; @@ -203,6 +205,61 @@ export function GetUserDefaultNameSpace(user: string): string { return 'ns-' + user; } +export async function getUserQuota( + kc: k8s.KubeConfig, + namespace: string +): Promise { + const k8sApi = kc.makeApiClient(k8s.CoreV1Api); + + const { + body: { status } + } = await k8sApi.readNamespacedResourceQuota(`quota-${namespace}`, namespace); + + return [ + { + type: 'cpu', + limit: cpuFormatToM(status?.hard?.['limits.cpu'] || '') / 1000, + used: cpuFormatToM(status?.used?.['limits.cpu'] || '') / 1000 + }, + { + type: 'memory', + limit: memoryFormatToMi(status?.hard?.['limits.memory'] || '') / 1024, + used: memoryFormatToMi(status?.used?.['limits.memory'] || '') / 1024 + }, + { + type: 'storage', + limit: memoryFormatToMi(status?.hard?.['requests.storage'] || '') / 1024, + used: memoryFormatToMi(status?.used?.['requests.storage'] || '') / 1024 + } + // { + // type: 'gpu', + // limit: Number(status?.hard?.['requests.nvidia.com/gpu'] || 0), + // used: Number(status?.used?.['requests.nvidia.com/gpu'] || 0) + // } + ]; +} + +export async function getUserBalance(kc: k8s.KubeConfig) { + const user = kc.getCurrentUser(); + if (!user) return 5; + + const k8sApi = kc.makeApiClient(k8s.CustomObjectsApi); + + const { body } = (await k8sApi.getNamespacedCustomObject( + 'account.sealos.io', + 'v1', + 'sealos-system', + 'accounts', + user.name + )) as { body: { status: { balance: number; deductionBalance: number } } }; + + if (body?.status?.balance !== undefined && body?.status?.deductionBalance !== undefined) { + return (body.status.balance - body.status.deductionBalance) / 1000000; + } + + return 5; +} + export async function getK8s({ kubeconfig }: { kubeconfig: string }) { const kc = K8sApi(kubeconfig); const kube_user = kc.getCurrentUser(); @@ -264,6 +321,8 @@ export async function getK8s({ kubeconfig }: { kubeconfig: string }) { kube_user, namespace, applyYamlList, - delYamlList + delYamlList, + getUserQuota: () => getUserQuota(kc, namespace), + getUserBalance: () => getUserBalance(kc) }); } diff --git a/frontend/providers/dbprovider/src/store/user.ts b/frontend/providers/dbprovider/src/store/user.ts new file mode 100644 index 00000000000..6669063b5a4 --- /dev/null +++ b/frontend/providers/dbprovider/src/store/user.ts @@ -0,0 +1,61 @@ +import { getUserQuota } from '@/api/platform'; +import { DBEditType } from '@/types/db'; +import { UserQuotaItemType } from '@/types/user'; +import { create } from 'zustand'; +import { devtools } from 'zustand/middleware'; +import { immer } from 'zustand/middleware/immer'; + +type State = { + balance: number; + userQuota: UserQuotaItemType[]; + loadUserQuota: () => Promise; + checkQuotaAllow: (request: DBEditType, usedData?: DBEditType) => string; +}; + +export const useUserStore = create()( + devtools( + immer((set, get) => ({ + balance: 5, + userQuota: [], + loadUserQuota: async () => { + const response = await getUserQuota(); + console.log(response); + set((state) => { + state.userQuota = response.quota; + state.balance = response.balance; + }); + return null; + }, + checkQuotaAllow: ({ cpu, memory, storage, replicas }, usedData) => { + const quote = get().userQuota; + + const request = { + cpu: (cpu / 1000) * replicas, + memory: (memory / 1024) * replicas, + storage: storage * replicas + }; + + if (usedData) { + const { cpu, memory, storage, replicas } = usedData; + request.cpu -= (cpu / 1000) * replicas; + request.memory -= (memory / 1024) * replicas; + request.storage -= storage * replicas; + } + + const overLimitTip = { + cpu: 'app.The applied CPU exceeds the quota', + memory: 'app.The applied memory exceeds the quota', + storage: 'app.The applied storage exceeds the quota' + }; + + const exceedQuota = quote.find((item) => { + if (item.used + request[item.type] > item.limit) { + return true; + } + }); + + return exceedQuota?.type ? overLimitTip[exceedQuota.type] : ''; + } + })) + ) +); diff --git a/frontend/providers/dbprovider/src/types/user.d.ts b/frontend/providers/dbprovider/src/types/user.d.ts index 6920181fb58..137c0cd9b00 100644 --- a/frontend/providers/dbprovider/src/types/user.d.ts +++ b/frontend/providers/dbprovider/src/types/user.d.ts @@ -19,6 +19,17 @@ export type Session = { kubeconfig: KubeConfig; }; -const sessionKey = 'session'; +export const sessionKey = 'session'; -export { sessionKey }; +export type userPriceType = { + cpu: number; + memory: number; + storage: number; + gpu?: { alias: string; type: string; price: number; inventory: number; vm: number }[]; +}; + +export type UserQuotaItemType = { + type: 'cpu' | 'memory' | 'storage'; + used: number; + limit: number; +}; diff --git a/frontend/providers/template/src/api/platform.ts b/frontend/providers/template/src/api/platform.ts index 111298c5358..43d0163ffe0 100644 --- a/frontend/providers/template/src/api/platform.ts +++ b/frontend/providers/template/src/api/platform.ts @@ -1,4 +1,4 @@ -import { EnvResponse } from '@/pages/api/platform/getEnv'; +import { EnvResponse } from '@/types/index'; import { GET } from '@/services/request'; export const updateRepo = () => GET('/api/updateRepo'); diff --git a/frontend/providers/template/src/constants/keys.ts b/frontend/providers/template/src/constants/keys.ts index 698b8b34182..85106b77ee1 100644 --- a/frontend/providers/template/src/constants/keys.ts +++ b/frontend/providers/template/src/constants/keys.ts @@ -8,7 +8,7 @@ export const appDeployKey = 'cloud.sealos.io/app-deploy-manager'; export const publicDomainKey = `cloud.sealos.io/app-deploy-manager-domain`; export const gpuNodeSelectorKey = 'nvidia.com/gpu.product'; export const gpuResourceKey = 'nvidia.com/gpu'; -// fastdeploy +// template export const templateDeployKey = 'cloud.sealos.io/deploy-on-sealos'; // db export const kubeblocksTypeKey = 'clusterdefinition.kubeblocks.io/name'; diff --git a/frontend/providers/template/src/pages/api/getTemplateSource.ts b/frontend/providers/template/src/pages/api/getTemplateSource.ts index 19b910ec8c7..537e8dbd656 100644 --- a/frontend/providers/template/src/pages/api/getTemplateSource.ts +++ b/frontend/providers/template/src/pages/api/getTemplateSource.ts @@ -26,6 +26,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse< const TemplateEnvs = { SEALOS_CLOUD_DOMAIN: process.env.SEALOS_CLOUD_DOMAIN || 'cloud.sealos.io', SEALOS_CERT_SECRET_NAME: process.env.SEALOS_CERT_SECRET_NAME || 'wildcard-cert', + TEMPLATE_REPO_URL: + process.env.TEMPLATE_REPO_URL || 'https://github.com/labring-actions/templates', SEALOS_NAMESPACE: user_namespace || '' }; @@ -45,7 +47,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse< }); } const yamlList = yamlData.filter((item: any) => item.kind !== 'Template'); - const dataSource = getTemplateDataSource(templateYaml); + const dataSource = getTemplateDataSource(templateYaml, TemplateEnvs); // Convert template to instance const instanceName = dataSource?.defaults?.['app_name']?.value; if (!instanceName) { diff --git a/frontend/providers/template/src/pages/api/platform/getEnv.ts b/frontend/providers/template/src/pages/api/platform/getEnv.ts index 7f3fa5b3008..8970e830663 100644 --- a/frontend/providers/template/src/pages/api/platform/getEnv.ts +++ b/frontend/providers/template/src/pages/api/platform/getEnv.ts @@ -2,15 +2,9 @@ import { authSession } from '@/services/backend/auth'; import { getK8s } from '@/services/backend/kubernetes'; import { jsonRes } from '@/services/backend/response'; import { ApiResp } from '@/services/kubernet'; +import { EnvResponse } from '@/types/index'; import type { NextApiRequest, NextApiResponse } from 'next'; -export type EnvResponse = { - SEALOS_CLOUD_DOMAIN: string; - SEALOS_CERT_SECRET_NAME: string; - TEMPLATE_REPO_URL: string; - SEALOS_NAMESPACE: string; -}; - export default async function handler(req: NextApiRequest, res: NextApiResponse) { let user_namespace = ''; diff --git a/frontend/providers/template/src/pages/deploy/index.tsx b/frontend/providers/template/src/pages/deploy/index.tsx index 5f5c4f30d38..92da349159b 100644 --- a/frontend/providers/template/src/pages/deploy/index.tsx +++ b/frontend/providers/template/src/pages/deploy/index.tsx @@ -23,6 +23,7 @@ import { useEffect, useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; import Form from './components/Form'; import ReadMe from './components/ReadMe'; +import Yaml from './components/Yaml'; const ErrorModal = dynamic(() => import('./components/ErrorModal')); const Header = dynamic(() => import('./components/Header'), { ssr: false }); diff --git a/frontend/providers/template/src/pages/develop/index.tsx b/frontend/providers/template/src/pages/develop/index.tsx index fab1e5950b3..2a659696b3e 100644 --- a/frontend/providers/template/src/pages/develop/index.tsx +++ b/frontend/providers/template/src/pages/develop/index.tsx @@ -25,7 +25,7 @@ import { debounce, has, isObject, mapValues } from 'lodash'; import { useTranslation } from 'next-i18next'; import { useCallback, useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; -import { EnvResponse } from '../api/platform/getEnv'; +import { EnvResponse } from '@/types/index'; import ErrorModal from '../deploy/components/ErrorModal'; import BreadCrumbHeader from './components/BreadCrumbHeader'; import Form from './components/Form'; diff --git a/frontend/providers/template/src/types/index.ts b/frontend/providers/template/src/types/index.ts index ba382ef814f..e446f46ad9d 100644 --- a/frontend/providers/template/src/types/index.ts +++ b/frontend/providers/template/src/types/index.ts @@ -12,3 +12,10 @@ export type ServiceEnvType = { SEALOS_DOMAIN: string; INGRESS_SECRET: string; }; + +export type EnvResponse = { + SEALOS_CLOUD_DOMAIN: string; + SEALOS_CERT_SECRET_NAME: string; + TEMPLATE_REPO_URL: string; + SEALOS_NAMESPACE: string; +}; diff --git a/frontend/providers/template/src/utils/json-yaml.ts b/frontend/providers/template/src/utils/json-yaml.ts index 8cc98c9b84a..ecaec884bbc 100644 --- a/frontend/providers/template/src/utils/json-yaml.ts +++ b/frontend/providers/template/src/utils/json-yaml.ts @@ -1,9 +1,10 @@ import { YamlItemType } from '@/types'; import { ProcessedTemplateSourceType, TemplateInstanceType, TemplateType } from '@/types/app'; import JSYAML from 'js-yaml'; -import { cloneDeep } from 'lodash'; +import { cloneDeep, mapValues } from 'lodash'; import { customAlphabet } from 'nanoid'; import { processEnvValue } from './tools'; +import { EnvResponse } from '@/types/index'; const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz'); export const generateYamlList = (value: string, labelName: string): YamlItemType[] => { @@ -27,7 +28,11 @@ export const generateYamlList = (value: string, labelName: string): YamlItemType export const parseTemplateString = ( sourceString: string, regex: RegExp = /\$\{\{\s*(.*?)\s*\}\}/g, - dataSource: any + dataSource: { + [key: string]: string | Record; + defaults: Record; + inputs: Record; + } ) => { try { const replacedString = sourceString.replace(regex, (match: string, key: string) => { @@ -46,7 +51,10 @@ export const parseTemplateString = ( } }; -export const getTemplateDataSource = (template: TemplateType): ProcessedTemplateSourceType => { +export const getTemplateDataSource = ( + template: TemplateType, + platformEnvs?: EnvResponse +): ProcessedTemplateSourceType => { try { if (!template) { return { @@ -88,6 +96,13 @@ export const getTemplateDataSource = (template: TemplateType): ProcessedTemplate default: string; required: boolean; } + >, + cloneDefauls: Record< + string, + { + type: string; + value: string; + } > ) => { if (!inputs || Object.keys(inputs).length === 0) { @@ -101,8 +116,13 @@ export const getTemplateDataSource = (template: TemplateType): ProcessedTemplate break; } } + const output = mapValues(cloneDefauls, (value) => value.value); return { - description: item.description, + description: parseTemplateString(item.description, /\$\{\{\s*(.*?)\s*\}\}/g, { + ...platformEnvs, + defaults: output, + inputs: {} + }), type: item.type, default: item.default, required: item.required, @@ -115,7 +135,7 @@ export const getTemplateDataSource = (template: TemplateType): ProcessedTemplate // // handle input value const cloneInputs = cloneDeep(inputs); - const transformedInput = handleInputs(cloneInputs); + const transformedInput = handleInputs(cloneInputs, cloneDefauls); // console.log(cloneDefauls, transformedInput); return { From d6b1f6d61cc32bf4d9eae1f7c3890c14a8bde3aa Mon Sep 17 00:00:00 2001 From: xudaotutou <13435638964@163.com> Date: Tue, 10 Oct 2023 13:23:37 +0800 Subject: [PATCH 11/14] styles(chore): add theme package (#4052) --- frontend/Dockerfile | 50 +- frontend/desktop/package.json | 5 +- frontend/desktop/src/styles/chakraTheme.ts | 4 +- frontend/package.json | 16 +- frontend/packages/ui/next-env.d.ts | 5 + frontend/packages/ui/package.json | 19 + frontend/packages/ui/src/colors.ts | 84 ++ frontend/packages/ui/src/components/Button.ts | 22 + frontend/packages/ui/src/components/index.ts | 5 + frontend/packages/ui/src/fontSizes.ts | 9 + frontend/packages/ui/src/index.ts | 4 + frontend/packages/ui/src/theme.ts | 9 + frontend/packages/ui/tsconfig.json | 8 + frontend/pnpm-lock.yaml | 1283 ++++++----------- frontend/providers/adminer/package.json | 3 + frontend/providers/applaunchpad/package.json | 4 - frontend/providers/bytebase/package.json | 3 + frontend/providers/costcenter/package.json | 7 +- .../src/components/billing/SwitchPage.tsx | 35 +- .../cost_overview/components/user.module.scss | 38 - .../cost_overview/components/user.tsx | 34 +- .../costcenter/src/layout/index.module.scss | 24 - .../providers/costcenter/src/layout/index.tsx | 22 +- .../costcenter/src/layout/sidebar.tsx | 1 - .../providers/costcenter/src/pages/_app.tsx | 2 +- .../src/pages/billing/index.module.scss | 0 .../costcenter/src/styles/chakraTheme.ts | 23 +- frontend/providers/cronjob/package.json | 5 - frontend/providers/dbprovider/package.json | 5 - frontend/providers/imagehub/package.json | 3 + frontend/providers/license/package.json | 5 - frontend/providers/template/package.json | 6 +- frontend/providers/terminal/package.json | 7 +- frontend/tsconfig.base.json | 1 - 34 files changed, 759 insertions(+), 992 deletions(-) create mode 100644 frontend/packages/ui/next-env.d.ts create mode 100644 frontend/packages/ui/package.json create mode 100644 frontend/packages/ui/src/colors.ts create mode 100644 frontend/packages/ui/src/components/Button.ts create mode 100644 frontend/packages/ui/src/components/index.ts create mode 100644 frontend/packages/ui/src/fontSizes.ts create mode 100644 frontend/packages/ui/src/index.ts create mode 100644 frontend/packages/ui/src/theme.ts create mode 100644 frontend/packages/ui/tsconfig.json delete mode 100644 frontend/providers/costcenter/src/components/cost_overview/components/user.module.scss delete mode 100644 frontend/providers/costcenter/src/layout/index.module.scss delete mode 100644 frontend/providers/costcenter/src/pages/billing/index.module.scss diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 084de171bfd..b932192cbdb 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -15,32 +15,6 @@ FROM node:current-alpine As base ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" -FROM base AS runner -WORKDIR /app - -ENV NODE_ENV production -# Uncomment the following line in case you want to disable telemetry during runtime. -ENV NEXT_TELEMETRY_DISABLED 1 - -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 nextjs - -RUN apk add curl \ - && apk add ca-certificates \ - && update-ca-certificates - -ARG name -ARG path - -# Install Git and OpenSSH client if $name is equal to template -RUN if [ "$name" = "template" ]; then \ - apk add --no-cache git openssh-client; \ -fi -USER nextjs - -EXPOSE 3000 - -ENV PORT 3000 # Install dependencies only when needed FROM base AS deps @@ -86,17 +60,39 @@ ARG path RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm --offline --filter=$name install && pnpm --filter=$name run build # Production image, copy all the files and run next -FROM runner As runner +FROM node:current-alpine AS runner +WORKDIR /app + +ENV NODE_ENV production +# Uncomment the following line in case you want to disable telemetry during runtime. +ENV NEXT_TELEMETRY_DISABLED 1 + +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs + +RUN apk add curl \ + && apk add ca-certificates \ + && update-ca-certificates ARG name ARG path +# Install Git and OpenSSH client if $name is equal to template +RUN if [ "$name" = "template" ]; then \ + apk add --no-cache git openssh-client; \ +fi +USER nextjs + # You only need to copy next.config.js if you are NOT using the default configuration # COPY --from=builder /app/desktop/next.config.js ./ COPY --from=builder /app/$path/public ./$path/public COPY --from=builder --chown=nextjs:nodejs /app/$path/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/$path/.next/static ./$path/.next/static +EXPOSE 3000 + +ENV PORT 3000 + ENV launchpath=./${path}/server.js ENTRYPOINT ["sh","-c","node ${launchpath}"] diff --git a/frontend/desktop/package.json b/frontend/desktop/package.json index 3c058f62ed5..36d370b4244 100644 --- a/frontend/desktop/package.json +++ b/frontend/desktop/package.json @@ -14,10 +14,8 @@ "@alicloud/dysmsapi20170525": "^2.0.24", "@alicloud/openapi-client": "^0.4.6", "@alicloud/tea-util": "^1.4.7", - "@chakra-ui/react": "^2.8.1", - "@emotion/react": "^11.11.1", - "@emotion/styled": "^11.11.0", "@kubernetes/client-node": "^0.18.1", + "@sealos/ui": "workspace:^", "@tanstack/react-query": "^4.35.3", "axios": "^1.5.1", "clsx": "^1.2.1", @@ -25,7 +23,6 @@ "dayjs": "^1.11.10", "eslint": "8.38.0", "eslint-config-next": "13.3.0", - "framer-motion": "^10.16.4", "i18next": "^22.5.1", "immer": "^10.0.2", "js-cookie": "^3.0.5", diff --git a/frontend/desktop/src/styles/chakraTheme.ts b/frontend/desktop/src/styles/chakraTheme.ts index 71252035400..d71cc1117f6 100644 --- a/frontend/desktop/src/styles/chakraTheme.ts +++ b/frontend/desktop/src/styles/chakraTheme.ts @@ -1,5 +1,5 @@ import { defineStyleConfig, extendTheme } from '@chakra-ui/react'; - +import { theme as originTheme } from '@sealos/ui'; const Button = defineStyleConfig({ baseStyle: { borderRadius: '4px' @@ -42,7 +42,7 @@ const Select = defineStyleConfig({ } }); -export const theme = extendTheme({ +export const theme = extendTheme(originTheme, { initialColorMode: 'light', // 'dark | 'light' components: { Button, diff --git a/frontend/package.json b/frontend/package.json index 445dbb81bd0..7d00269320c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,5 +1,5 @@ { - "name": "kf-web", + "name": "sealos", "private": true, "version": "0.1.0", "scripts": { @@ -12,7 +12,9 @@ "dev-terminal": "pnpm -r --filter ./providers/terminal run dev", "dev-template": "pnpm -r --filter ./providers/template run dev", "dev-cronjob": "pnpm -r --filter ./providers/cronjob run dev", - "dev-license": "pnpm -r --filter ./providers/license run dev" + "dev-license": "pnpm -r --filter ./providers/license run dev", + "gen:theme-typings": "pnpm chakra-cli tokens packages/ui/src/theme.ts --out node_modules/.pnpm/node_modules/@chakra-ui/styled-system/dist/theming.types.d.ts", + "postinstall": "pnpm run gen:theme-typings" }, "workspaces": [ "./packages/*", @@ -20,10 +22,16 @@ "./desktop" ], "devDependencies": { - "prettier": "^2.8.8", - "react-i18next": "^12.3.1" + "@chakra-ui/cli": "^2.4.1", + "prettier": "^2.8.8" }, "dependencies": { + "@chakra-ui/anatomy": "^2.2.1", + "@chakra-ui/next-js": "^2.1.5", + "@chakra-ui/react": "^2.8.1", + "@emotion/react": "^11.11.1", + "@emotion/styled": "^11.11.0", + "framer-motion": "^10.16.4", "typescript": "^5.2.2" } } \ No newline at end of file diff --git a/frontend/packages/ui/next-env.d.ts b/frontend/packages/ui/next-env.d.ts new file mode 100644 index 00000000000..4f11a03dc6c --- /dev/null +++ b/frontend/packages/ui/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/frontend/packages/ui/package.json b/frontend/packages/ui/package.json new file mode 100644 index 00000000000..fb5a8ea86ea --- /dev/null +++ b/frontend/packages/ui/package.json @@ -0,0 +1,19 @@ +{ + "name": "@sealos/ui", + "version": "1.0.0", + "description": "", + "exports": { + ".": { + "import": "./src/index.ts", + "types": "./src/index.ts" + } + }, + "main": "./src/index.ts", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "dev": "next dev" + }, + "keywords": [], + "author": "", + "license": "ISC" +} \ No newline at end of file diff --git a/frontend/packages/ui/src/colors.ts b/frontend/packages/ui/src/colors.ts new file mode 100644 index 00000000000..da42d046e82 --- /dev/null +++ b/frontend/packages/ui/src/colors.ts @@ -0,0 +1,84 @@ +export const colors = { + primary: { + 100: '#E6F6F6', + 200: '#CCEEED', + 300: '#99DDDB', + 400: '#66CBCA', + 500: '#33BABB', + 600: '#00A9A6', + 700: '#008F8D', + 800: '#006B6A', + 900: '#004846', + 1000: '#002423' + }, + // 避免和 white 冲突, black也是同理 + white_: { + 100: '#FEFEFE', + 200: '#FDFDFE', + 300: '#FBFBFC', + 400: '#F8FAFB', + 500: '#F6F8F9', + 600: '#F4F6F8', + 700: '#C3C5C6', + 800: '#929495', + 900: '#626263', + 1000: '#313132' + }, + grayModern: { + 100: '#EFF0F1', + 200: '#DEE0E2', + 300: '#BDC1C5', + 400: '#9CA2A8', + 500: '#7B838B', + 600: '#5A646E', + 700: '#485058', + 800: '#363C42', + 900: '#24282C', + 1000: '#121416' + }, + grayIron: { + 100: '#F3F3F3', + 200: '#E6E6E7', + 300: '#CDCDD0', + 400: '#B4B4B8', + 500: '#9B9BA1', + 600: '#828289', + 700: '#68686E', + 800: '#4E4E52', + 900: '#343437', + 1000: '#1A1A1B' + }, + error: { + 100: '#FFEBED', + 200: '#FFD6DB', + 300: '#FFADB7', + 400: '#FF8492', + 500: '#FF5B6E', + 600: '#FF324A' + }, + warn: { + 100: '#FFF2EC', + 400: '#FDB08A', + 600: '#FB7C3C', + 700: '#C96330' + }, + rose: { + 100: '#FDEAF1' + }, + blue: { + 100: '#EBF7FD', + 400: '#86CEF5', + 500: '#5EBDF2', + 600: '#36ADEF', + 700: '#2B8ABF' + }, + purple: { + 300: '#DBBDE9', + 400: '#C99CDF', + 600: '#A55AC9', + 700: '#7167AA' + }, + frostyNightfall: { + 200: '#EAEBF0' + } +}; diff --git a/frontend/packages/ui/src/components/Button.ts b/frontend/packages/ui/src/components/Button.ts new file mode 100644 index 00000000000..083db64e9f1 --- /dev/null +++ b/frontend/packages/ui/src/components/Button.ts @@ -0,0 +1,22 @@ +import { defineStyleConfig } from '@chakra-ui/react'; + +export const Button = defineStyleConfig({ + baseStyle: { + borderRadius: '4px' + }, + variants: { + primary: { + background: 'grayModern.900', + color: 'white' + }, + secondary: { + border: '1px solid', + borderColor: 'grayModern.200', + background: 'white_.400' + }, + warn: { + bgColor: 'error.500', + color: 'white_.100' + } + } +}); diff --git a/frontend/packages/ui/src/components/index.ts b/frontend/packages/ui/src/components/index.ts new file mode 100644 index 00000000000..766e7b6ceb1 --- /dev/null +++ b/frontend/packages/ui/src/components/index.ts @@ -0,0 +1,5 @@ +import { Button } from './Button'; +export const components = { + Button +}; +export * from './Button'; diff --git a/frontend/packages/ui/src/fontSizes.ts b/frontend/packages/ui/src/fontSizes.ts new file mode 100644 index 00000000000..c98a3c2314f --- /dev/null +++ b/frontend/packages/ui/src/fontSizes.ts @@ -0,0 +1,9 @@ +export const fontSizes = { + sm: '10px', + base: '12px', + md: '14px', + lg: '16px', + xl: '16px', + '2xl': '18px', + '3xl': '22px' +}; diff --git a/frontend/packages/ui/src/index.ts b/frontend/packages/ui/src/index.ts new file mode 100644 index 00000000000..706eca8ebad --- /dev/null +++ b/frontend/packages/ui/src/index.ts @@ -0,0 +1,4 @@ +export * from './colors'; +export * from './theme'; +export * from './components'; +export * from './fontSizes'; diff --git a/frontend/packages/ui/src/theme.ts b/frontend/packages/ui/src/theme.ts new file mode 100644 index 00000000000..a41f6f6c959 --- /dev/null +++ b/frontend/packages/ui/src/theme.ts @@ -0,0 +1,9 @@ +import { extendTheme } from '@chakra-ui/react'; +import { colors } from './colors'; +import { components } from './components'; +import { fontSizes } from './fontSizes'; +export const theme = extendTheme({ + colors, + components, + fontSizes +}); diff --git a/frontend/packages/ui/tsconfig.json b/frontend/packages/ui/tsconfig.json new file mode 100644 index 00000000000..0a3133f169c --- /dev/null +++ b/frontend/packages/ui/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "lib": ["dom", "dom.iterable", "esnext"] + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"], + "extends": "../../tsconfig.web.json" +} diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 1713d0047c3..99249a82e11 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -8,16 +8,34 @@ importers: .: dependencies: + '@chakra-ui/anatomy': + specifier: ^2.2.1 + version: 2.2.1 + '@chakra-ui/next-js': + specifier: ^2.1.5 + version: 2.1.5(@chakra-ui/react@2.8.1)(@emotion/react@11.11.1)(next@13.4.5)(react@18.2.0) + '@chakra-ui/react': + specifier: ^2.8.1 + version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) + '@emotion/react': + specifier: ^11.11.1 + version: 11.11.1(@types/react@18.0.27)(react@18.2.0) + '@emotion/styled': + specifier: ^11.11.0 + version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) + framer-motion: + specifier: ^10.16.4 + version: 10.16.4(react-dom@18.2.0)(react@18.2.0) typescript: specifier: ^5.2.2 version: 5.2.2 devDependencies: + '@chakra-ui/cli': + specifier: ^2.4.1 + version: 2.4.1 prettier: specifier: ^2.8.8 version: 2.8.8 - react-i18next: - specifier: ^12.3.1 - version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) desktop: dependencies: @@ -30,18 +48,12 @@ importers: '@alicloud/tea-util': specifier: ^1.4.7 version: 1.4.7 - '@chakra-ui/react': - specifier: ^2.8.1 - version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.37)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) - '@emotion/react': - specifier: ^11.11.1 - version: 11.11.1(@types/react@18.0.37)(react@18.2.0) - '@emotion/styled': - specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.37)(react@18.2.0) '@kubernetes/client-node': specifier: ^0.18.1 version: 0.18.1 + '@sealos/ui': + specifier: workspace:^ + version: link:../packages/ui '@tanstack/react-query': specifier: ^4.35.3 version: 4.35.3(react-dom@18.2.0)(react@18.2.0) @@ -63,9 +75,6 @@ importers: eslint-config-next: specifier: 13.3.0 version: 13.3.0(eslint@8.38.0)(typescript@5.2.2) - framer-motion: - specifier: ^10.16.4 - version: 10.16.4(react-dom@18.2.0)(react@18.2.0) i18next: specifier: ^22.5.1 version: 22.5.1 @@ -228,6 +237,8 @@ importers: specifier: ^2.6.2 version: 2.6.2 + packages/ui: {} + providers/adminer: dependencies: '@kubernetes/client-node': @@ -242,6 +253,9 @@ importers: clsx: specifier: ^1.2.1 version: 1.2.1 + i18next: + specifier: ^22.5.1 + version: 22.5.1 immer: specifier: ^10.0.2 version: 10.0.2 @@ -251,9 +265,15 @@ importers: next: specifier: 13.4.5 version: 13.4.5(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0) + next-i18next: + specifier: ^13.3.0 + version: 13.3.0(i18next@22.5.1)(next@13.4.5)(react-i18next@12.3.1)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 + react-i18next: + specifier: ^12.3.1 + version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) sealos-desktop-sdk: specifier: workspace:* version: link:../../packages/client-sdk @@ -285,18 +305,9 @@ importers: '@chakra-ui/icons': specifier: ^2.1.1 version: 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/react': - specifier: ^2.8.1 - version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.27)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0) '@chakra-ui/system': specifier: ^2.6.1 version: 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@emotion/react': - specifier: ^11.11.1 - version: 11.11.1(@types/react@18.0.27)(react@18.2.0) - '@emotion/styled': - specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) '@kubernetes/client-node': specifier: ^0.18.1 version: 0.18.1 @@ -324,9 +335,6 @@ importers: fast-json-patch: specifier: ^3.1.1 version: 3.1.1 - framer-motion: - specifier: ^9.1.7 - version: 9.1.7(react-dom@18.2.0)(react@18.2.0) i18next: specifier: ^22.5.1 version: 22.5.1 @@ -448,6 +456,9 @@ importers: eslint-config-next: specifier: 13.2.4 version: 13.2.4(eslint@8.36.0)(typescript@5.2.2) + i18next: + specifier: ^22.5.1 + version: 22.5.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -457,12 +468,18 @@ importers: next: specifier: 13.2.4 version: 13.2.4(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0) + next-i18next: + specifier: ^13.3.0 + version: 13.3.0(i18next@22.5.1)(next@13.2.4)(react-i18next@12.3.1)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 react-dom: specifier: 18.2.0 version: 18.2.0(react@18.2.0) + react-i18next: + specifier: ^12.3.1 + version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) sealos-desktop-sdk: specifier: workspace:* version: link:../../packages/client-sdk @@ -497,21 +514,12 @@ importers: '@alicloud/tea-util': specifier: ^1.4.7 version: 1.4.7 - '@chakra-ui/anatomy': - specifier: ^2.2.1 - version: 2.2.1 - '@chakra-ui/react': - specifier: ^2.8.1 - version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.28)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) - '@emotion/react': - specifier: ^11.11.1 - version: 11.11.1(@types/react@18.0.28)(react@18.2.0) - '@emotion/styled': - specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.28)(react@18.2.0) '@kubernetes/client-node': specifier: 0.18.0 version: 0.18.0 + '@sealos/ui': + specifier: workspace:^ + version: link:../../packages/ui '@stripe/stripe-js': specifier: ^1.54.2 version: 1.54.2 @@ -527,9 +535,6 @@ importers: axios: specifier: 1.2.1 version: 1.2.1 - clsx: - specifier: ^1.2.1 - version: 1.2.1 date-fns: specifier: ^2.30.0 version: 2.30.0 @@ -542,9 +547,6 @@ importers: formik: specifier: ^2.4.5 version: 2.4.5(react@18.2.0) - framer-motion: - specifier: ^10.16.4 - version: 10.16.4(react-dom@18.2.0)(react@18.2.0) i18next: specifier: ^22.5.1 version: 22.5.1 @@ -630,24 +632,12 @@ importers: providers/cronjob: dependencies: - '@chakra-ui/anatomy': - specifier: ^2.2.1 - version: 2.2.1 '@chakra-ui/icons': specifier: ^2.1.1 version: 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/react': - specifier: ^2.8.1 - version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.27)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0) '@chakra-ui/system': specifier: ^2.6.1 version: 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@emotion/react': - specifier: ^11.11.1 - version: 11.11.1(@types/react@18.0.27)(react@18.2.0) - '@emotion/styled': - specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) '@kubernetes/client-node': specifier: ^0.18.1 version: 0.18.1 @@ -678,9 +668,6 @@ importers: echarts: specifier: ^5.4.3 version: 5.4.3 - framer-motion: - specifier: ^9.1.7 - version: 9.1.7(react-dom@18.2.0)(react@18.2.0) i18next: specifier: ^22.5.1 version: 22.5.1 @@ -787,24 +774,12 @@ importers: providers/dbprovider: dependencies: - '@chakra-ui/anatomy': - specifier: ^2.2.1 - version: 2.2.1 '@chakra-ui/icons': specifier: ^2.1.1 version: 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/react': - specifier: ^2.8.1 - version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.27)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0) '@chakra-ui/system': specifier: ^2.6.1 version: 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@emotion/react': - specifier: ^11.11.1 - version: 11.11.1(@types/react@18.0.27)(react@18.2.0) - '@emotion/styled': - specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) '@kubernetes/client-node': specifier: ^0.18.1 version: 0.18.1 @@ -829,9 +804,6 @@ importers: echarts: specifier: ^5.4.3 version: 5.4.3 - framer-motion: - specifier: ^9.1.7 - version: 9.1.7(react-dom@18.2.0)(react@18.2.0) i18next: specifier: ^22.5.1 version: 22.5.1 @@ -965,6 +937,9 @@ importers: github-markdown-css: specifier: ^5.2.0 version: 5.2.0 + i18next: + specifier: ^22.5.1 + version: 22.5.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -977,12 +952,18 @@ importers: next: specifier: 13.1.0 version: 13.1.0(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0) + next-i18next: + specifier: ^13.3.0 + version: 13.3.0(i18next@22.5.1)(next@13.1.0)(react-i18next@12.3.1)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 react-dom: specifier: 18.2.0 version: 18.2.0(react@18.2.0) + react-i18next: + specifier: ^12.3.1 + version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: ^8.0.7 version: 8.0.7(@types/react@18.0.27)(react@18.2.0) @@ -1032,24 +1013,12 @@ importers: providers/license: dependencies: - '@chakra-ui/anatomy': - specifier: ^2.2.1 - version: 2.2.1 '@chakra-ui/icons': specifier: ^2.1.1 version: 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/react': - specifier: ^2.8.1 - version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.27)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0) '@chakra-ui/system': specifier: ^2.6.1 version: 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@emotion/react': - specifier: ^11.11.1 - version: 11.11.1(@types/react@18.0.27)(react@18.2.0) - '@emotion/styled': - specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) '@kubernetes/client-node': specifier: ^0.18.1 version: 0.18.1 @@ -1074,9 +1043,6 @@ importers: echarts: specifier: ^5.4.3 version: 5.4.3 - framer-motion: - specifier: ^9.1.7 - version: 9.1.7(react-dom@18.2.0)(react@18.2.0) i18next: specifier: ^22.5.1 version: 22.5.1 @@ -1189,9 +1155,6 @@ importers: '@chakra-ui/icons': specifier: ^2.1.1 version: 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/react': - specifier: ^2.8.1 - version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.27)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0) '@chakra-ui/system': specifier: ^2.6.1 version: 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) @@ -1201,12 +1164,6 @@ importers: '@codemirror/legacy-modes': specifier: ^6.3.3 version: 6.3.3 - '@emotion/react': - specifier: ^11.11.1 - version: 11.11.1(@types/react@18.0.27)(react@18.2.0) - '@emotion/styled': - specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) '@kubernetes/client-node': specifier: ^0.18.1 version: 0.18.1 @@ -1237,9 +1194,6 @@ importers: fast-json-patch: specifier: ^3.1.1 version: 3.1.1 - framer-motion: - specifier: ^9.1.7 - version: 9.1.7(react-dom@18.2.0)(react@18.2.0) github-markdown-css: specifier: ^5.2.0 version: 5.2.0 @@ -1364,15 +1318,6 @@ importers: providers/terminal: dependencies: - '@chakra-ui/react': - specifier: ^2.8.1 - version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.28)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) - '@emotion/react': - specifier: ^11.11.1 - version: 11.11.1(@types/react@18.0.28)(react@18.2.0) - '@emotion/styled': - specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.28)(react@18.2.0) '@kubernetes/client-node': specifier: 0.18.0 version: 0.18.0 @@ -1391,9 +1336,9 @@ importers: eslint-config-next: specifier: 13.2.4 version: 13.2.4(eslint@8.36.0)(typescript@5.2.2) - framer-motion: - specifier: ^10.16.4 - version: 10.16.4(react-dom@18.2.0)(react@18.2.0) + i18next: + specifier: ^22.5.1 + version: 22.5.1 immer: specifier: ^9.0.21 version: 9.0.21 @@ -1409,12 +1354,18 @@ importers: next: specifier: 13.2.4 version: 13.2.4(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0) + next-i18next: + specifier: ^13.3.0 + version: 13.3.0(i18next@22.5.1)(next@13.2.4)(react-i18next@12.3.1)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 react-dom: specifier: 18.2.0 version: 18.2.0(react@18.2.0) + react-i18next: + specifier: ^12.3.1 + version: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) sealos-desktop-sdk: specifier: workspace:* version: link:../../packages/client-sdk @@ -2765,25 +2716,6 @@ packages: react: 18.2.0 dev: false - /@chakra-ui/accordion@2.3.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react@18.2.0): - resolution: {integrity: sha512-FSXRm8iClFyU+gVaXisOSEw0/4Q+qZbFRiuhIAkVU6Boj0FxAMrlo9a8AV5TuF77rgaHytCdHk0Ng+cyUijrag==} - peerDependencies: - '@chakra-ui/system': '>=2.0.0' - framer-motion: '>=4.0.0' - react: '>=18' - dependencies: - '@chakra-ui/descendant': 3.1.0(react@18.2.0) - '@chakra-ui/icon': 3.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/react-context': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-controllable-state': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-merge-refs': 2.1.0(react@18.2.0) - '@chakra-ui/shared-utils': 2.0.5 - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@chakra-ui/transition': 2.1.0(framer-motion@9.1.7)(react@18.2.0) - framer-motion: 9.1.7(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - dev: false - /@chakra-ui/alert@2.2.1(@chakra-ui/system@2.6.1)(react@18.2.0): resolution: {integrity: sha512-GduIqqWCkvID8hxRlKw29Jp3w93r/E9S30J2F8By3ODon9Bhk1o/KVolcPiSiQvRwKNBJCd/rBTpPpLkB+s7pw==} peerDependencies: @@ -2881,6 +2813,19 @@ packages: react: 18.2.0 dev: false + /@chakra-ui/cli@2.4.1: + resolution: {integrity: sha512-GZZuHUA1cXJWpmYNiVTLPihvY4VhIssRl+AXgw/0IbeodTMop3jWlIioPKLAQeXu5CwvRA6iESyGjnu1V8Zykg==} + hasBin: true + dependencies: + chokidar: 3.5.3 + cli-check-node: 1.3.4 + cli-handle-unhandled: 1.1.1 + cli-welcome: 2.2.2 + commander: 9.5.0 + esbuild: 0.17.19 + prettier: 2.8.8 + dev: true + /@chakra-ui/clickable@2.1.0(react@18.2.0): resolution: {integrity: sha512-flRA/ClPUGPYabu+/GLREZVZr9j2uyyazCAUHAdrTUEdDYCr31SVGhgh7dgKdtq23bOvAQJpIJjw/0Bs0WvbXw==} peerDependencies: @@ -2938,7 +2883,7 @@ packages: '@emotion/react': '>=10.0.35' react: '>=18' dependencies: - '@emotion/react': 11.11.1(@types/react@18.0.37)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.0.27)(react@18.2.0) react: 18.2.0 dev: false @@ -2979,38 +2924,14 @@ packages: resolution: {integrity: sha512-IGM/yGUHS+8TOQrZGpAKOJl/xGBrmRYJrmbHfUE7zrG3PpQyXvbLDP1M+RggkCFVgHlJi2wpYIf0QtQlU0XZfw==} dev: false - /@chakra-ui/focus-lock@2.1.0(@types/react@18.0.27)(react@18.2.0): - resolution: {integrity: sha512-EmGx4PhWGjm4dpjRqM4Aa+rCWBxP+Rq8Uc/nAVnD4YVqkEhBkrPTpui2lnjsuxqNaZ24fIAZ10cF1hlpemte/w==} - peerDependencies: - react: '>=18' - dependencies: - '@chakra-ui/dom-utils': 2.1.0 - react: 18.2.0 - react-focus-lock: 2.9.5(@types/react@18.0.27)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - dev: false - - /@chakra-ui/focus-lock@2.1.0(@types/react@18.0.28)(react@18.2.0): + /@chakra-ui/focus-lock@2.1.0(react@18.2.0): resolution: {integrity: sha512-EmGx4PhWGjm4dpjRqM4Aa+rCWBxP+Rq8Uc/nAVnD4YVqkEhBkrPTpui2lnjsuxqNaZ24fIAZ10cF1hlpemte/w==} peerDependencies: react: '>=18' dependencies: '@chakra-ui/dom-utils': 2.1.0 react: 18.2.0 - react-focus-lock: 2.9.5(@types/react@18.0.28)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - dev: false - - /@chakra-ui/focus-lock@2.1.0(@types/react@18.0.37)(react@18.2.0): - resolution: {integrity: sha512-EmGx4PhWGjm4dpjRqM4Aa+rCWBxP+Rq8Uc/nAVnD4YVqkEhBkrPTpui2lnjsuxqNaZ24fIAZ10cF1hlpemte/w==} - peerDependencies: - react: '>=18' - dependencies: - '@chakra-ui/dom-utils': 2.1.0 - react: 18.2.0 - react-focus-lock: 2.9.5(@types/react@18.0.37)(react@18.2.0) + react-focus-lock: 2.9.5(react@18.2.0) transitivePeerDependencies: - '@types/react' dev: false @@ -3159,34 +3080,7 @@ packages: react: 18.2.0 dev: false - /@chakra-ui/menu@2.2.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react@18.2.0): - resolution: {integrity: sha512-lJS7XEObzJxsOwWQh7yfG4H8FzFPRP5hVPN/CL+JzytEINCSBvsCDHrYPQGp7jzpCi8vnTqQQGQe0f8dwnXd2g==} - peerDependencies: - '@chakra-ui/system': '>=2.0.0' - framer-motion: '>=4.0.0' - react: '>=18' - dependencies: - '@chakra-ui/clickable': 2.1.0(react@18.2.0) - '@chakra-ui/descendant': 3.1.0(react@18.2.0) - '@chakra-ui/lazy-utils': 2.0.5 - '@chakra-ui/popper': 3.1.0(react@18.2.0) - '@chakra-ui/react-children-utils': 2.0.6(react@18.2.0) - '@chakra-ui/react-context': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-animation-state': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-controllable-state': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-disclosure': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-focus-effect': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-merge-refs': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-outside-click': 2.2.0(react@18.2.0) - '@chakra-ui/react-use-update-effect': 2.1.0(react@18.2.0) - '@chakra-ui/shared-utils': 2.0.5 - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@chakra-ui/transition': 2.1.0(framer-motion@9.1.7)(react@18.2.0) - framer-motion: 9.1.7(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - dev: false - - /@chakra-ui/modal@2.3.1(@chakra-ui/system@2.6.1)(@types/react@18.0.27)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0): + /@chakra-ui/modal@2.3.1(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-TQv1ZaiJMZN+rR9DK0snx/OPwmtaGH1HbZtlYt4W4s6CzyK541fxLRTjIXfEzIGpvNW+b6VFuFjbcR78p4DEoQ==} peerDependencies: '@chakra-ui/system': '>=2.0.0' @@ -3195,33 +3089,7 @@ packages: react-dom: '>=18' dependencies: '@chakra-ui/close-button': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/focus-lock': 2.1.0(@types/react@18.0.27)(react@18.2.0) - '@chakra-ui/portal': 2.1.0(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/react-context': 2.1.0(react@18.2.0) - '@chakra-ui/react-types': 2.0.7(react@18.2.0) - '@chakra-ui/react-use-merge-refs': 2.1.0(react@18.2.0) - '@chakra-ui/shared-utils': 2.0.5 - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@chakra-ui/transition': 2.1.0(framer-motion@9.1.7)(react@18.2.0) - aria-hidden: 1.2.3 - framer-motion: 9.1.7(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.5.6(@types/react@18.0.27)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - dev: false - - /@chakra-ui/modal@2.3.1(@chakra-ui/system@2.6.1)(@types/react@18.0.28)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-TQv1ZaiJMZN+rR9DK0snx/OPwmtaGH1HbZtlYt4W4s6CzyK541fxLRTjIXfEzIGpvNW+b6VFuFjbcR78p4DEoQ==} - peerDependencies: - '@chakra-ui/system': '>=2.0.0' - framer-motion: '>=4.0.0' - react: '>=18' - react-dom: '>=18' - dependencies: - '@chakra-ui/close-button': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/focus-lock': 2.1.0(@types/react@18.0.28)(react@18.2.0) + '@chakra-ui/focus-lock': 2.1.0(react@18.2.0) '@chakra-ui/portal': 2.1.0(react-dom@18.2.0)(react@18.2.0) '@chakra-ui/react-context': 2.1.0(react@18.2.0) '@chakra-ui/react-types': 2.0.7(react@18.2.0) @@ -3233,35 +3101,24 @@ packages: framer-motion: 10.16.4(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.5.6(@types/react@18.0.28)(react@18.2.0) + react-remove-scroll: 2.5.6(react@18.2.0) transitivePeerDependencies: - '@types/react' dev: false - /@chakra-ui/modal@2.3.1(@chakra-ui/system@2.6.1)(@types/react@18.0.37)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-TQv1ZaiJMZN+rR9DK0snx/OPwmtaGH1HbZtlYt4W4s6CzyK541fxLRTjIXfEzIGpvNW+b6VFuFjbcR78p4DEoQ==} + /@chakra-ui/next-js@2.1.5(@chakra-ui/react@2.8.1)(@emotion/react@11.11.1)(next@13.4.5)(react@18.2.0): + resolution: {integrity: sha512-bBd8zeXlAuVwDsjGN0/5ZZJknSbFeiZgJiGdbJo91v2lxKkOwo26b4ggc1ck1t+JR+daU6SrGBjlbQqSuWzyaA==} peerDependencies: - '@chakra-ui/system': '>=2.0.0' - framer-motion: '>=4.0.0' + '@chakra-ui/react': '>=2.4.0' + '@emotion/react': '>=11' + next: '>=13' react: '>=18' - react-dom: '>=18' dependencies: - '@chakra-ui/close-button': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/focus-lock': 2.1.0(@types/react@18.0.37)(react@18.2.0) - '@chakra-ui/portal': 2.1.0(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/react-context': 2.1.0(react@18.2.0) - '@chakra-ui/react-types': 2.0.7(react@18.2.0) - '@chakra-ui/react-use-merge-refs': 2.1.0(react@18.2.0) - '@chakra-ui/shared-utils': 2.0.5 - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@chakra-ui/transition': 2.1.0(framer-motion@10.16.4)(react@18.2.0) - aria-hidden: 1.2.3 - framer-motion: 10.16.4(react-dom@18.2.0)(react@18.2.0) + '@chakra-ui/react': 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) + '@emotion/cache': 11.11.0 + '@emotion/react': 11.11.1(@types/react@18.0.27)(react@18.2.0) + next: 13.4.5(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0) react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.5.6(@types/react@18.0.37)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' dev: false /@chakra-ui/number-input@2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0): @@ -3333,29 +3190,6 @@ packages: react: 18.2.0 dev: false - /@chakra-ui/popover@2.2.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react@18.2.0): - resolution: {integrity: sha512-K+2ai2dD0ljvJnlrzesCDT9mNzLifE3noGKZ3QwLqd/K34Ym1W/0aL1ERSynrcG78NKoXS54SdEzkhCZ4Gn/Zg==} - peerDependencies: - '@chakra-ui/system': '>=2.0.0' - framer-motion: '>=4.0.0' - react: '>=18' - dependencies: - '@chakra-ui/close-button': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/lazy-utils': 2.0.5 - '@chakra-ui/popper': 3.1.0(react@18.2.0) - '@chakra-ui/react-context': 2.1.0(react@18.2.0) - '@chakra-ui/react-types': 2.0.7(react@18.2.0) - '@chakra-ui/react-use-animation-state': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-disclosure': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-focus-effect': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-focus-on-pointer-down': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-merge-refs': 2.1.0(react@18.2.0) - '@chakra-ui/shared-utils': 2.0.5 - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - framer-motion: 9.1.7(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - dev: false - /@chakra-ui/popper@3.1.0(react@18.2.0): resolution: {integrity: sha512-ciDdpdYbeFG7og6/6J8lkTFxsSvwTdMLFkpVylAF6VNC22jssiWfquj2eyD4rJnzkRFPvIWJq8hvbfhsm+AjSg==} peerDependencies: @@ -3403,8 +3237,8 @@ packages: '@chakra-ui/react-env': 3.1.0(react@18.2.0) '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) '@chakra-ui/utils': 2.0.15 - '@emotion/react': 11.11.1(@types/react@18.0.37)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.37)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.0.27)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -3620,78 +3454,7 @@ packages: react: 18.2.0 dev: false - /@chakra-ui/react@2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.27)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-UL9Rtj4DovP3+oVbI06gsdfyJJb+wmS2RYnGNXjW9tsjCyXxjlBw9TAUj0jyOfWe0+zd/4juL8+J+QCwmdhptg==} - peerDependencies: - '@emotion/react': ^11.0.0 - '@emotion/styled': ^11.0.0 - framer-motion: '>=4.0.0' - react: '>=18' - react-dom: '>=18' - dependencies: - '@chakra-ui/accordion': 2.3.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react@18.2.0) - '@chakra-ui/alert': 2.2.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/avatar': 2.3.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/breadcrumb': 2.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/button': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/card': 2.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/checkbox': 2.3.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/close-button': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/control-box': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/counter': 2.1.0(react@18.2.0) - '@chakra-ui/css-reset': 2.3.0(@emotion/react@11.11.1)(react@18.2.0) - '@chakra-ui/editable': 3.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/focus-lock': 2.1.0(@types/react@18.0.27)(react@18.2.0) - '@chakra-ui/form-control': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/hooks': 2.2.1(react@18.2.0) - '@chakra-ui/icon': 3.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/image': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/input': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/layout': 2.3.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/live-region': 2.1.0(react@18.2.0) - '@chakra-ui/media-query': 3.3.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/menu': 2.2.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react@18.2.0) - '@chakra-ui/modal': 2.3.1(@chakra-ui/system@2.6.1)(@types/react@18.0.27)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/number-input': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/pin-input': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/popover': 2.2.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react@18.2.0) - '@chakra-ui/popper': 3.1.0(react@18.2.0) - '@chakra-ui/portal': 2.1.0(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/progress': 2.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/provider': 2.4.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/radio': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/react-env': 3.1.0(react@18.2.0) - '@chakra-ui/select': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/skeleton': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/skip-nav': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/slider': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/spinner': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/stat': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/stepper': 2.3.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/styled-system': 2.9.1 - '@chakra-ui/switch': 2.1.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react@18.2.0) - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@chakra-ui/table': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/tabs': 3.0.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/tag': 3.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/textarea': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/theme': 3.3.0(@chakra-ui/styled-system@2.9.1) - '@chakra-ui/theme-utils': 2.0.20 - '@chakra-ui/toast': 7.0.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/tooltip': 2.3.0(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/transition': 2.1.0(framer-motion@9.1.7)(react@18.2.0) - '@chakra-ui/utils': 2.0.15 - '@chakra-ui/visually-hidden': 2.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@emotion/react': 11.11.1(@types/react@18.0.27)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) - framer-motion: 9.1.7(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - dev: false - - /@chakra-ui/react@2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.28)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0): + /@chakra-ui/react@2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-UL9Rtj4DovP3+oVbI06gsdfyJJb+wmS2RYnGNXjW9tsjCyXxjlBw9TAUj0jyOfWe0+zd/4juL8+J+QCwmdhptg==} peerDependencies: '@emotion/react': ^11.0.0 @@ -3712,7 +3475,7 @@ packages: '@chakra-ui/counter': 2.1.0(react@18.2.0) '@chakra-ui/css-reset': 2.3.0(@emotion/react@11.11.1)(react@18.2.0) '@chakra-ui/editable': 3.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/focus-lock': 2.1.0(@types/react@18.0.28)(react@18.2.0) + '@chakra-ui/focus-lock': 2.1.0(react@18.2.0) '@chakra-ui/form-control': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) '@chakra-ui/hooks': 2.2.1(react@18.2.0) '@chakra-ui/icon': 3.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) @@ -3722,7 +3485,7 @@ packages: '@chakra-ui/live-region': 2.1.0(react@18.2.0) '@chakra-ui/media-query': 3.3.0(@chakra-ui/system@2.6.1)(react@18.2.0) '@chakra-ui/menu': 2.2.1(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react@18.2.0) - '@chakra-ui/modal': 2.3.1(@chakra-ui/system@2.6.1)(@types/react@18.0.28)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) + '@chakra-ui/modal': 2.3.1(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) '@chakra-ui/number-input': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) '@chakra-ui/pin-input': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) '@chakra-ui/popover': 2.2.1(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react@18.2.0) @@ -3753,79 +3516,8 @@ packages: '@chakra-ui/transition': 2.1.0(framer-motion@10.16.4)(react@18.2.0) '@chakra-ui/utils': 2.0.15 '@chakra-ui/visually-hidden': 2.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@emotion/react': 11.11.1(@types/react@18.0.28)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.28)(react@18.2.0) - framer-motion: 10.16.4(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - dev: false - - /@chakra-ui/react@2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.0.37)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-UL9Rtj4DovP3+oVbI06gsdfyJJb+wmS2RYnGNXjW9tsjCyXxjlBw9TAUj0jyOfWe0+zd/4juL8+J+QCwmdhptg==} - peerDependencies: - '@emotion/react': ^11.0.0 - '@emotion/styled': ^11.0.0 - framer-motion: '>=4.0.0' - react: '>=18' - react-dom: '>=18' - dependencies: - '@chakra-ui/accordion': 2.3.1(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react@18.2.0) - '@chakra-ui/alert': 2.2.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/avatar': 2.3.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/breadcrumb': 2.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/button': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/card': 2.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/checkbox': 2.3.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/close-button': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/control-box': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/counter': 2.1.0(react@18.2.0) - '@chakra-ui/css-reset': 2.3.0(@emotion/react@11.11.1)(react@18.2.0) - '@chakra-ui/editable': 3.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/focus-lock': 2.1.0(@types/react@18.0.37)(react@18.2.0) - '@chakra-ui/form-control': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/hooks': 2.2.1(react@18.2.0) - '@chakra-ui/icon': 3.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/image': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/input': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/layout': 2.3.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/live-region': 2.1.0(react@18.2.0) - '@chakra-ui/media-query': 3.3.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/menu': 2.2.1(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react@18.2.0) - '@chakra-ui/modal': 2.3.1(@chakra-ui/system@2.6.1)(@types/react@18.0.37)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/number-input': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/pin-input': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/popover': 2.2.1(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react@18.2.0) - '@chakra-ui/popper': 3.1.0(react@18.2.0) - '@chakra-ui/portal': 2.1.0(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/progress': 2.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/provider': 2.4.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/radio': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/react-env': 3.1.0(react@18.2.0) - '@chakra-ui/select': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/skeleton': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/skip-nav': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/slider': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/spinner': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/stat': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/stepper': 2.3.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/styled-system': 2.9.1 - '@chakra-ui/switch': 2.1.1(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react@18.2.0) - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@chakra-ui/table': 2.1.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/tabs': 3.0.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/tag': 3.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/textarea': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/theme': 3.3.0(@chakra-ui/styled-system@2.9.1) - '@chakra-ui/theme-utils': 2.0.20 - '@chakra-ui/toast': 7.0.1(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/tooltip': 2.3.0(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/transition': 2.1.0(framer-motion@10.16.4)(react@18.2.0) - '@chakra-ui/utils': 2.0.15 - '@chakra-ui/visually-hidden': 2.2.0(@chakra-ui/system@2.6.1)(react@18.2.0) - '@emotion/react': 11.11.1(@types/react@18.0.37)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.37)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.0.27)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) framer-motion: 10.16.4(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -3951,20 +3643,6 @@ packages: react: 18.2.0 dev: false - /@chakra-ui/switch@2.1.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react@18.2.0): - resolution: {integrity: sha512-cOHIhW5AlLZSFENxFEBYTBniqiduOowa1WdzslP1Fd0usBFaD5iAgOY1Fvr7xKhE8nmzzeMCkPB3XBvUSWnawQ==} - peerDependencies: - '@chakra-ui/system': '>=2.0.0' - framer-motion: '>=4.0.0' - react: '>=18' - dependencies: - '@chakra-ui/checkbox': 2.3.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/shared-utils': 2.0.5 - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - framer-motion: 9.1.7(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - dev: false - /@chakra-ui/system@2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0): resolution: {integrity: sha512-P5Q/XRWy3f1pXJ7IxDkV+Z6AT7GJeR2JlBnQl109xewVQcBLWWMIp702fFMFw8KZ2ALB/aYKtWm5EmQMddC/tg==} peerDependencies: @@ -3978,8 +3656,8 @@ packages: '@chakra-ui/styled-system': 2.9.1 '@chakra-ui/theme-utils': 2.0.20 '@chakra-ui/utils': 2.0.15 - '@emotion/react': 11.11.1(@types/react@18.0.37)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.37)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.0.27)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.0.27)(react@18.2.0) react: 18.2.0 react-fast-compare: 3.2.2 dev: false @@ -4093,29 +3771,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@chakra-ui/toast@7.0.1(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-V5JUhw6RZxbGRTijvd5k4iEMLCfbzTLNWbZLZhRZk10YvFfAP5OYfRCm68zpE/t3orN/f+4ZLL3P+Wb4E7oSmw==} - peerDependencies: - '@chakra-ui/system': 2.6.1 - framer-motion: '>=4.0.0' - react: '>=18' - react-dom: '>=18' - dependencies: - '@chakra-ui/alert': 2.2.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/close-button': 2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0) - '@chakra-ui/portal': 2.1.0(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/react-context': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-timeout': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-update-effect': 2.1.0(react@18.2.0) - '@chakra-ui/shared-utils': 2.0.5 - '@chakra-ui/styled-system': 2.9.1 - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@chakra-ui/theme': 3.3.0(@chakra-ui/styled-system@2.9.1) - framer-motion: 9.1.7(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: false - /@chakra-ui/tooltip@2.3.0(@chakra-ui/system@2.6.1)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-2s23f93YIij1qEDwIK//KtEu4LLYOslhR1cUhDBk/WUzyFR3Ez0Ee+HlqlGEGfGe9x77E6/UXPnSAKKdF/cpsg==} peerDependencies: @@ -4138,28 +3793,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@chakra-ui/tooltip@2.3.0(@chakra-ui/system@2.6.1)(framer-motion@9.1.7)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-2s23f93YIij1qEDwIK//KtEu4LLYOslhR1cUhDBk/WUzyFR3Ez0Ee+HlqlGEGfGe9x77E6/UXPnSAKKdF/cpsg==} - peerDependencies: - '@chakra-ui/system': '>=2.0.0' - framer-motion: '>=4.0.0' - react: '>=18' - react-dom: '>=18' - dependencies: - '@chakra-ui/dom-utils': 2.1.0 - '@chakra-ui/popper': 3.1.0(react@18.2.0) - '@chakra-ui/portal': 2.1.0(react-dom@18.2.0)(react@18.2.0) - '@chakra-ui/react-types': 2.0.7(react@18.2.0) - '@chakra-ui/react-use-disclosure': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-event-listener': 2.1.0(react@18.2.0) - '@chakra-ui/react-use-merge-refs': 2.1.0(react@18.2.0) - '@chakra-ui/shared-utils': 2.0.5 - '@chakra-ui/system': 2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - framer-motion: 9.1.7(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: false - /@chakra-ui/transition@2.1.0(framer-motion@10.16.4)(react@18.2.0): resolution: {integrity: sha512-orkT6T/Dt+/+kVwJNy7zwJ+U2xAZ3EU7M3XCs45RBvUnZDr/u9vdmaM/3D/rOpmQJWgQBwKPJleUXrYWUagEDQ==} peerDependencies: @@ -4171,17 +3804,6 @@ packages: react: 18.2.0 dev: false - /@chakra-ui/transition@2.1.0(framer-motion@9.1.7)(react@18.2.0): - resolution: {integrity: sha512-orkT6T/Dt+/+kVwJNy7zwJ+U2xAZ3EU7M3XCs45RBvUnZDr/u9vdmaM/3D/rOpmQJWgQBwKPJleUXrYWUagEDQ==} - peerDependencies: - framer-motion: '>=4.0.0' - react: '>=18' - dependencies: - '@chakra-ui/shared-utils': 2.0.5 - framer-motion: 9.1.7(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - dev: false - /@chakra-ui/utils@2.0.15: resolution: {integrity: sha512-El4+jL0WSaYYs+rJbuYFDbjmfCcfGDmRY95GO4xwzit6YAPZBLcR65rOEwLps+XWluZTy1xdMrusg/hW0c1aAA==} dependencies: @@ -4333,57 +3955,15 @@ packages: dev: false /@emotion/memoize@0.7.4: - resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==} - dev: false - optional: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: false - - /@emotion/react@11.11.1(@types/react@18.0.27)(react@18.2.0): - resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} - peerDependencies: - '@types/react': '*' - react: '>=16.8.0' - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@babel/runtime': 7.23.1 - '@emotion/babel-plugin': 11.11.0 - '@emotion/cache': 11.11.0 - '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) - '@emotion/utils': 1.2.1 - '@emotion/weak-memoize': 0.3.1 - '@types/react': 18.0.27 - hoist-non-react-statics: 3.3.2 - react: 18.2.0 + resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==} dev: false + optional: true - /@emotion/react@11.11.1(@types/react@18.0.28)(react@18.2.0): - resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} - peerDependencies: - '@types/react': '*' - react: '>=16.8.0' - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@babel/runtime': 7.23.1 - '@emotion/babel-plugin': 11.11.0 - '@emotion/cache': 11.11.0 - '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) - '@emotion/utils': 1.2.1 - '@emotion/weak-memoize': 0.3.1 - '@types/react': 18.0.28 - hoist-non-react-statics: 3.3.2 - react: 18.2.0 + /@emotion/memoize@0.8.1: + resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: false - /@emotion/react@11.11.1(@types/react@18.0.37)(react@18.2.0): + /@emotion/react@11.11.1(@types/react@18.0.27)(react@18.2.0): resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} peerDependencies: '@types/react': '*' @@ -4399,7 +3979,7 @@ packages: '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 - '@types/react': 18.0.37 + '@types/react': 18.0.27 hoist-non-react-statics: 3.3.2 react: 18.2.0 dev: false @@ -4439,48 +4019,6 @@ packages: react: 18.2.0 dev: false - /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.0.28)(react@18.2.0): - resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} - peerDependencies: - '@emotion/react': ^11.0.0-rc.0 - '@types/react': '*' - react: '>=16.8.0' - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@babel/runtime': 7.23.1 - '@emotion/babel-plugin': 11.11.0 - '@emotion/is-prop-valid': 1.2.1 - '@emotion/react': 11.11.1(@types/react@18.0.28)(react@18.2.0) - '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) - '@emotion/utils': 1.2.1 - '@types/react': 18.0.28 - react: 18.2.0 - dev: false - - /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.0.37)(react@18.2.0): - resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} - peerDependencies: - '@emotion/react': ^11.0.0-rc.0 - '@types/react': '*' - react: '>=16.8.0' - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@babel/runtime': 7.23.1 - '@emotion/babel-plugin': 11.11.0 - '@emotion/is-prop-valid': 1.2.1 - '@emotion/react': 11.11.1(@types/react@18.0.37)(react@18.2.0) - '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) - '@emotion/utils': 1.2.1 - '@types/react': 18.0.37 - react: 18.2.0 - dev: false - /@emotion/unitless@0.8.1: resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} dev: false @@ -4501,6 +4039,204 @@ packages: resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==} dev: false + /@esbuild/android-arm64@0.17.19: + resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.17.19: + resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.17.19: + resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.17.19: + resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.17.19: + resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.17.19: + resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.17.19: + resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.17.19: + resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.17.19: + resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.17.19: + resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.17.19: + resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.17.19: + resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.17.19: + resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.17.19: + resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.17.19: + resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.17.19: + resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.17.19: + resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.17.19: + resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.17.19: + resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.17.19: + resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.17.19: + resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.17.19: + resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.36.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -6297,7 +6033,7 @@ packages: /@types/hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-YIQtIg4PKr7ZyqNPZObpxfHsHEmuB8dXCxd6qVcGuQVDK2bpsF7bYNnBJ4Nn7giuACZg+WewExgrtAJ3XnA4Xw==} dependencies: - '@types/react': 18.0.27 + '@types/react': 18.2.12 hoist-non-react-statics: 3.3.2 dev: false @@ -7653,6 +7389,38 @@ packages: webpack: 5.88.2 dev: false + /clear-any-console@1.16.2: + resolution: {integrity: sha512-OL/7wZpNy9x0GBSzz3poWja84Nr7iaH8aYNsJ5Uet2BVLj6Lm1zvWpZN/yH46Vv3ae7YfHmLLMmfHj911fshJg==} + dev: true + + /cli-check-node@1.3.4: + resolution: {integrity: sha512-iLGgQXm82iP8eH3R67qbOWs5qqUOLmNnMy5Lzl/RybcMh3y+H2zWU5POzuQ6oDUOdz4XWuxcFhP75szqd6frLg==} + dependencies: + chalk: 3.0.0 + log-symbols: 3.0.0 + dev: true + + /cli-handle-error@4.4.0: + resolution: {integrity: sha512-RyBCnKlc7xVr79cKb9RfBq+4fjwQeX8HKeNzIPnI/W+DWWIUUKh2ur576DpwJ3kZt2UGHlIAOF7N9txy+mgZsA==} + dependencies: + chalk: 3.0.0 + log-symbols: 3.0.0 + dev: true + + /cli-handle-unhandled@1.1.1: + resolution: {integrity: sha512-Em91mJvU7VdgT2MxQpyY633vW1tDzRjPDbii6ZjEBHHLLh0xDoVkFt/wjvi9nSvJcz9rJmvtJSK8KL/hvF0Stg==} + dependencies: + cli-handle-error: 4.4.0 + dev: true + + /cli-welcome@2.2.2: + resolution: {integrity: sha512-LgDGS0TW4nIf8v81wpuZzfOEDPcy68u0jKR0Fy5IaWftqdminI6FoDiMFt1mjPylqKGNv/wFsZ7fCs93IeDMIw==} + dependencies: + chalk: 2.4.2 + clear-any-console: 1.16.2 + prettier: 2.8.8 + dev: true + /client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} dev: false @@ -7764,6 +7532,11 @@ packages: engines: {node: '>= 10'} dev: true + /commander@9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + dev: true + /common-tags@1.8.2: resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} engines: {node: '>=4.0.0'} @@ -8556,6 +8329,36 @@ packages: is-date-object: 1.0.5 is-symbol: 1.0.4 + /esbuild@0.17.19: + resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.17.19 + '@esbuild/android-arm64': 0.17.19 + '@esbuild/android-x64': 0.17.19 + '@esbuild/darwin-arm64': 0.17.19 + '@esbuild/darwin-x64': 0.17.19 + '@esbuild/freebsd-arm64': 0.17.19 + '@esbuild/freebsd-x64': 0.17.19 + '@esbuild/linux-arm': 0.17.19 + '@esbuild/linux-arm64': 0.17.19 + '@esbuild/linux-ia32': 0.17.19 + '@esbuild/linux-loong64': 0.17.19 + '@esbuild/linux-mips64el': 0.17.19 + '@esbuild/linux-ppc64': 0.17.19 + '@esbuild/linux-riscv64': 0.17.19 + '@esbuild/linux-s390x': 0.17.19 + '@esbuild/linux-x64': 0.17.19 + '@esbuild/netbsd-x64': 0.17.19 + '@esbuild/openbsd-x64': 0.17.19 + '@esbuild/sunos-x64': 0.17.19 + '@esbuild/win32-arm64': 0.17.19 + '@esbuild/win32-ia32': 0.17.19 + '@esbuild/win32-x64': 0.17.19 + dev: true + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -9908,32 +9711,19 @@ packages: dev: false /fraction.js@4.3.6: - resolution: {integrity: sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg==} - dev: true - - /framer-motion@10.16.4(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-p9V9nGomS3m6/CALXqv6nFGMuFOxbWsmaOrdmhyQimMIlLl3LC7h7l86wge/Js/8cRu5ktutS/zlzgR7eBOtFA==} - peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - dependencies: - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - tslib: 2.6.2 - optionalDependencies: - '@emotion/is-prop-valid': 0.8.8 - dev: false + resolution: {integrity: sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg==} + dev: true - /framer-motion@9.1.7(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-nKxBkIO4IPkMEqcBbbATxsVjwPYShKl051yhBv9628iAH6JLeHD0siBHxkL62oQzMC1+GNX73XtPjgP753ufuw==} + /framer-motion@10.16.4(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-p9V9nGomS3m6/CALXqv6nFGMuFOxbWsmaOrdmhyQimMIlLl3LC7h7l86wge/Js/8cRu5ktutS/zlzgR7eBOtFA==} peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true dependencies: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -10400,6 +10190,7 @@ packages: resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==} dependencies: void-elements: 3.1.0 + dev: false /html-void-elements@2.0.1: resolution: {integrity: sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==} @@ -10456,6 +10247,7 @@ packages: resolution: {integrity: sha512-8TGPgM3pAD+VRsMtUMNknRz3kzqwp/gPALrWMsDnmC1mKqJwpWyooQRLMcbTwq8z8YwSmuj+ZYvc+xCuEpkssA==} dependencies: '@babel/runtime': 7.23.1 + dev: false /iconv-lite@0.4.4: resolution: {integrity: sha512-BnjNp13aZpK4WBGbmjaNHN2MCp3P850n8zd/JLinQJ8Lsnq2Br4o2467C2waMsY5kr7Z41SL1gEqh8Vbfzg15A==} @@ -11760,6 +11552,13 @@ packages: /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + /log-symbols@3.0.0: + resolution: {integrity: sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==} + engines: {node: '>=8'} + dependencies: + chalk: 2.4.2 + dev: true + /longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} dev: false @@ -12447,6 +12246,26 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: false + /next-i18next@13.3.0(i18next@22.5.1)(next@13.1.0)(react-i18next@12.3.1)(react@18.2.0): + resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} + engines: {node: '>=14'} + peerDependencies: + i18next: ^22.0.6 + next: '>= 12.0.0' + react: '>= 17.0.2' + react-i18next: ^12.2.0 + dependencies: + '@babel/runtime': 7.23.1 + '@types/hoist-non-react-statics': 3.3.2 + core-js: 3.32.2 + hoist-non-react-statics: 3.3.2 + i18next: 22.5.1 + i18next-fs-backend: 2.2.0 + next: 13.1.0(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0) + react: 18.2.0 + react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + dev: false + /next-i18next@13.3.0(i18next@22.5.1)(next@13.1.6)(react-i18next@12.3.1)(react@18.2.0): resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} engines: {node: '>=14'} @@ -12467,6 +12286,26 @@ packages: react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) dev: false + /next-i18next@13.3.0(i18next@22.5.1)(next@13.2.4)(react-i18next@12.3.1)(react@18.2.0): + resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} + engines: {node: '>=14'} + peerDependencies: + i18next: ^22.0.6 + next: '>= 12.0.0' + react: '>= 17.0.2' + react-i18next: ^12.2.0 + dependencies: + '@babel/runtime': 7.23.1 + '@types/hoist-non-react-statics': 3.3.2 + core-js: 3.32.2 + hoist-non-react-statics: 3.3.2 + i18next: 22.5.1 + i18next-fs-backend: 2.2.0 + next: 13.2.4(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0) + react: 18.2.0 + react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + dev: false + /next-i18next@13.3.0(i18next@22.5.1)(next@13.3.0)(react-i18next@12.3.1)(react@18.2.0): resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} engines: {node: '>=14'} @@ -12487,6 +12326,26 @@ packages: react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) dev: false + /next-i18next@13.3.0(i18next@22.5.1)(next@13.4.5)(react-i18next@12.3.1)(react@18.2.0): + resolution: {integrity: sha512-X4kgi51BCOoGdKbv87eZ8OU7ICQDg5IP+T5fNjqDY3os9ea0OKTY4YpAiVFiwcI9XimcUmSPbKO4a9jFUyYSgg==} + engines: {node: '>=14'} + peerDependencies: + i18next: ^22.0.6 + next: '>= 12.0.0' + react: '>= 17.0.2' + react-i18next: ^12.2.0 + dependencies: + '@babel/runtime': 7.23.1 + '@types/hoist-non-react-statics': 3.3.2 + core-js: 3.32.2 + hoist-non-react-statics: 3.3.2 + i18next: 22.5.1 + i18next-fs-backend: 2.2.0 + next: 13.4.5(react-dom@18.2.0)(react@18.2.0)(sass@1.68.0) + react: 18.2.0 + react-i18next: 12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0) + dev: false + /next-pwa@5.6.0(@babel/core@7.23.0)(next@13.3.0)(webpack@5.88.2): resolution: {integrity: sha512-XV8g8C6B7UmViXU8askMEYhWwQ4qc/XqJGnexbLV68hzKaGHZDMtHsm2TNxFcbR7+ypVuth/wwpiIlMwpRJJ5A==} peerDependencies: @@ -13396,45 +13255,7 @@ packages: resolution: {integrity: sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==} dev: false - /react-focus-lock@2.9.5(@types/react@18.0.27)(react@18.2.0): - resolution: {integrity: sha512-h6vrdgUbsH2HeD5I7I3Cx1PPrmwGuKYICS+kB9m+32X/9xHRrAbxgvaBpG7BFBN9h3tO+C3qX1QAVESmi4CiIA==} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@babel/runtime': 7.23.1 - '@types/react': 18.0.27 - focus-lock: 0.11.6 - prop-types: 15.8.1 - react: 18.2.0 - react-clientside-effect: 1.2.6(react@18.2.0) - use-callback-ref: 1.3.0(@types/react@18.0.27)(react@18.2.0) - use-sidecar: 1.1.2(@types/react@18.0.27)(react@18.2.0) - dev: false - - /react-focus-lock@2.9.5(@types/react@18.0.28)(react@18.2.0): - resolution: {integrity: sha512-h6vrdgUbsH2HeD5I7I3Cx1PPrmwGuKYICS+kB9m+32X/9xHRrAbxgvaBpG7BFBN9h3tO+C3qX1QAVESmi4CiIA==} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@babel/runtime': 7.23.1 - '@types/react': 18.0.28 - focus-lock: 0.11.6 - prop-types: 15.8.1 - react: 18.2.0 - react-clientside-effect: 1.2.6(react@18.2.0) - use-callback-ref: 1.3.0(@types/react@18.0.28)(react@18.2.0) - use-sidecar: 1.1.2(@types/react@18.0.28)(react@18.2.0) - dev: false - - /react-focus-lock@2.9.5(@types/react@18.0.37)(react@18.2.0): + /react-focus-lock@2.9.5(react@18.2.0): resolution: {integrity: sha512-h6vrdgUbsH2HeD5I7I3Cx1PPrmwGuKYICS+kB9m+32X/9xHRrAbxgvaBpG7BFBN9h3tO+C3qX1QAVESmi4CiIA==} peerDependencies: '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -13444,13 +13265,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.1 - '@types/react': 18.0.37 focus-lock: 0.11.6 prop-types: 15.8.1 react: 18.2.0 react-clientside-effect: 1.2.6(react@18.2.0) - use-callback-ref: 1.3.0(@types/react@18.0.37)(react@18.2.0) - use-sidecar: 1.1.2(@types/react@18.0.37)(react@18.2.0) + use-callback-ref: 1.3.0(react@18.2.0) + use-sidecar: 1.1.2(react@18.2.0) dev: false /react-hook-form@7.46.2(react@18.2.0): @@ -13480,6 +13300,7 @@ packages: i18next: 22.5.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: false /react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -13528,39 +13349,7 @@ packages: szfe-tools: 0.0.0-beta.7 dev: false - /react-remove-scroll-bar@2.3.4(@types/react@18.0.27)(react@18.2.0): - resolution: {integrity: sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.27 - react: 18.2.0 - react-style-singleton: 2.2.1(@types/react@18.0.27)(react@18.2.0) - tslib: 2.6.2 - dev: false - - /react-remove-scroll-bar@2.3.4(@types/react@18.0.28)(react@18.2.0): - resolution: {integrity: sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.28 - react: 18.2.0 - react-style-singleton: 2.2.1(@types/react@18.0.28)(react@18.2.0) - tslib: 2.6.2 - dev: false - - /react-remove-scroll-bar@2.3.4(@types/react@18.0.37)(react@18.2.0): + /react-remove-scroll-bar@2.3.4(react@18.2.0): resolution: {integrity: sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==} engines: {node: '>=10'} peerDependencies: @@ -13570,51 +13359,12 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.0.37 - react: 18.2.0 - react-style-singleton: 2.2.1(@types/react@18.0.37)(react@18.2.0) - tslib: 2.6.2 - dev: false - - /react-remove-scroll@2.5.6(@types/react@18.0.27)(react@18.2.0): - resolution: {integrity: sha512-bO856ad1uDYLefgArk559IzUNeQ6SWH4QnrevIUjH+GczV56giDfl3h0Idptf2oIKxQmd1p9BN25jleKodTALg==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.27 - react: 18.2.0 - react-remove-scroll-bar: 2.3.4(@types/react@18.0.27)(react@18.2.0) - react-style-singleton: 2.2.1(@types/react@18.0.27)(react@18.2.0) - tslib: 2.6.2 - use-callback-ref: 1.3.0(@types/react@18.0.27)(react@18.2.0) - use-sidecar: 1.1.2(@types/react@18.0.27)(react@18.2.0) - dev: false - - /react-remove-scroll@2.5.6(@types/react@18.0.28)(react@18.2.0): - resolution: {integrity: sha512-bO856ad1uDYLefgArk559IzUNeQ6SWH4QnrevIUjH+GczV56giDfl3h0Idptf2oIKxQmd1p9BN25jleKodTALg==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.28 react: 18.2.0 - react-remove-scroll-bar: 2.3.4(@types/react@18.0.28)(react@18.2.0) - react-style-singleton: 2.2.1(@types/react@18.0.28)(react@18.2.0) + react-style-singleton: 2.2.1(react@18.2.0) tslib: 2.6.2 - use-callback-ref: 1.3.0(@types/react@18.0.28)(react@18.2.0) - use-sidecar: 1.1.2(@types/react@18.0.28)(react@18.2.0) dev: false - /react-remove-scroll@2.5.6(@types/react@18.0.37)(react@18.2.0): + /react-remove-scroll@2.5.6(react@18.2.0): resolution: {integrity: sha512-bO856ad1uDYLefgArk559IzUNeQ6SWH4QnrevIUjH+GczV56giDfl3h0Idptf2oIKxQmd1p9BN25jleKodTALg==} engines: {node: '>=10'} peerDependencies: @@ -13624,50 +13374,15 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.0.37 - react: 18.2.0 - react-remove-scroll-bar: 2.3.4(@types/react@18.0.37)(react@18.2.0) - react-style-singleton: 2.2.1(@types/react@18.0.37)(react@18.2.0) - tslib: 2.6.2 - use-callback-ref: 1.3.0(@types/react@18.0.37)(react@18.2.0) - use-sidecar: 1.1.2(@types/react@18.0.37)(react@18.2.0) - dev: false - - /react-style-singleton@2.2.1(@types/react@18.0.27)(react@18.2.0): - resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.27 - get-nonce: 1.0.1 - invariant: 2.2.4 - react: 18.2.0 - tslib: 2.6.2 - dev: false - - /react-style-singleton@2.2.1(@types/react@18.0.28)(react@18.2.0): - resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.28 - get-nonce: 1.0.1 - invariant: 2.2.4 react: 18.2.0 + react-remove-scroll-bar: 2.3.4(react@18.2.0) + react-style-singleton: 2.2.1(react@18.2.0) tslib: 2.6.2 + use-callback-ref: 1.3.0(react@18.2.0) + use-sidecar: 1.1.2(react@18.2.0) dev: false - /react-style-singleton@2.2.1(@types/react@18.0.37)(react@18.2.0): + /react-style-singleton@2.2.1(react@18.2.0): resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} peerDependencies: @@ -13677,7 +13392,6 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.0.37 get-nonce: 1.0.1 invariant: 2.2.4 react: 18.2.0 @@ -15150,37 +14864,7 @@ packages: requires-port: 1.0.0 dev: true - /use-callback-ref@1.3.0(@types/react@18.0.27)(react@18.2.0): - resolution: {integrity: sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.27 - react: 18.2.0 - tslib: 2.6.2 - dev: false - - /use-callback-ref@1.3.0(@types/react@18.0.28)(react@18.2.0): - resolution: {integrity: sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.28 - react: 18.2.0 - tslib: 2.6.2 - dev: false - - /use-callback-ref@1.3.0(@types/react@18.0.37)(react@18.2.0): + /use-callback-ref@1.3.0(react@18.2.0): resolution: {integrity: sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==} engines: {node: '>=10'} peerDependencies: @@ -15190,44 +14874,11 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.0.37 - react: 18.2.0 - tslib: 2.6.2 - dev: false - - /use-sidecar@1.1.2(@types/react@18.0.27)(react@18.2.0): - resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.9.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.27 - detect-node-es: 1.1.0 - react: 18.2.0 - tslib: 2.6.2 - dev: false - - /use-sidecar@1.1.2(@types/react@18.0.28)(react@18.2.0): - resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.9.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.0.28 - detect-node-es: 1.1.0 react: 18.2.0 tslib: 2.6.2 dev: false - /use-sidecar@1.1.2(@types/react@18.0.37)(react@18.2.0): + /use-sidecar@1.1.2(react@18.2.0): resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==} engines: {node: '>=10'} peerDependencies: @@ -15237,7 +14888,6 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.0.37 detect-node-es: 1.1.0 react: 18.2.0 tslib: 2.6.2 @@ -15348,6 +14998,7 @@ packages: /void-elements@3.1.0: resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} engines: {node: '>=0.10.0'} + dev: false /w3c-keyname@2.2.8: resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==} diff --git a/frontend/providers/adminer/package.json b/frontend/providers/adminer/package.json index cb0d6919e4a..a98236d8fc7 100644 --- a/frontend/providers/adminer/package.json +++ b/frontend/providers/adminer/package.json @@ -13,10 +13,13 @@ "@tanstack/react-query": "^4.35.3", "axios": "1.4.0", "clsx": "^1.2.1", + "i18next": "^22.5.1", "immer": "^10.0.2", "js-yaml": "^4.1.0", "next": "13.4.5", + "next-i18next": "^13.3.0", "react": "18.2.0", + "react-i18next": "^12.3.1", "sealos-desktop-sdk": "workspace:*", "zustand": "^4.4.1" }, diff --git a/frontend/providers/applaunchpad/package.json b/frontend/providers/applaunchpad/package.json index e80b84f566e..fa0598bbb82 100644 --- a/frontend/providers/applaunchpad/package.json +++ b/frontend/providers/applaunchpad/package.json @@ -12,10 +12,7 @@ }, "dependencies": { "@chakra-ui/icons": "^2.1.1", - "@chakra-ui/react": "^2.8.1", "@chakra-ui/system": "^2.6.1", - "@emotion/react": "^11.11.1", - "@emotion/styled": "^11.11.0", "@kubernetes/client-node": "^0.18.1", "@next/font": "13.1.6", "@tanstack/react-query": "^4.35.3", @@ -25,7 +22,6 @@ "dns": "^0.2.2", "echarts": "^5.4.3", "fast-json-patch": "^3.1.1", - "framer-motion": "^9.1.7", "i18next": "^22.5.1", "immer": "^9.0.21", "js-cookie": "^3.0.5", diff --git a/frontend/providers/bytebase/package.json b/frontend/providers/bytebase/package.json index 8f58a29a9d2..35f9a34410e 100644 --- a/frontend/providers/bytebase/package.json +++ b/frontend/providers/bytebase/package.json @@ -15,11 +15,14 @@ "clsx": "^1.2.1", "eslint": "8.36.0", "eslint-config-next": "13.2.4", + "i18next": "^22.5.1", "immer": "^9.0.21", "js-yaml": "^4.1.0", "next": "13.2.4", + "next-i18next": "^13.3.0", "react": "18.2.0", "react-dom": "18.2.0", + "react-i18next": "^12.3.1", "sealos-desktop-sdk": "workspace:*", "zustand": "^4.4.1" }, diff --git a/frontend/providers/costcenter/package.json b/frontend/providers/costcenter/package.json index f516f658322..1a9e981d1a8 100644 --- a/frontend/providers/costcenter/package.json +++ b/frontend/providers/costcenter/package.json @@ -12,22 +12,17 @@ "@alicloud/dysmsapi20170525": "^2.0.24", "@alicloud/openapi-client": "^0.4.6", "@alicloud/tea-util": "^1.4.7", - "@chakra-ui/anatomy": "^2.2.1", - "@chakra-ui/react": "^2.8.1", - "@emotion/react": "^11.11.1", - "@emotion/styled": "^11.11.0", "@kubernetes/client-node": "0.18.0", + "@sealos/ui": "workspace:^", "@stripe/stripe-js": "^1.54.2", "@tanstack/query-sync-storage-persister": "^4.35.3", "@tanstack/react-query": "^4.35.3", "@tanstack/react-query-persist-client": "^4.35.5", "axios": "1.2.1", - "clsx": "^1.2.1", "date-fns": "^2.30.0", "echarts": "^5.4.3", "echarts-for-react": "^3.0.2", "formik": "^2.4.5", - "framer-motion": "^10.16.4", "i18next": "^22.5.1", "immer": "^9.0.21", "js-cookie": "^3.0.5", diff --git a/frontend/providers/costcenter/src/components/billing/SwitchPage.tsx b/frontend/providers/costcenter/src/components/billing/SwitchPage.tsx index e5c67776b06..d976be1b863 100644 --- a/frontend/providers/costcenter/src/components/billing/SwitchPage.tsx +++ b/frontend/providers/costcenter/src/components/billing/SwitchPage.tsx @@ -1,4 +1,13 @@ -import { Button, Flex, FlexProps, Img, Text } from '@chakra-ui/react'; +import { + Button, + ButtonProps, + Flex, + FlexProps, + Img, + SystemCSSProperties, + SystemStyleObject, + Text +} from '@chakra-ui/react'; import { Dispatch, SetStateAction } from 'react'; import { useTranslation } from 'react-i18next'; import arrow_icon from '@/assert/Vector.svg'; @@ -19,13 +28,29 @@ export default function SwitchPage({ setCurrentPage: Dispatch>; } & FlexProps) { const { t } = useTranslation(); + const switchStyle: ButtonProps = { + width: '24px', + height: '24px', + background: '#EDEFF1', + // '#EDEFF1':'#F1F4F6' + borderRadius: '9999px', + color: '#262A32', + flexGrow: '0', + _hover: { + opacity: '0.7' + }, + _disabled: { + color: '828289', + background: '#F1F4F6' + } + }; return ( {t('Total')}: {totalItem} {currentPage}/{totalPage}