l-94 校验webhook02

master
dongming 2 years ago
parent ae487dacd3
commit 1f132e148b

@ -161,7 +161,10 @@ $(ENVTEST): $(LOCALBIN)
.PHONY: wait-dep
wait-dep:
kubectl -n ingress-nginx rollout status deploy/ingress-nginx-controller -w --timeout=40m
kubectl -n ingress-nginx rollout status deploy/ingress-nginx-controller -w --timeout=40m && \
kubectl -n cert-manager rollout status deploy/cert-manager -w --timeout=40m && \
kubectl -n cert-manager rollout status deploy/cert-manager-cainjector -w --timeout=40m && \
kubectl -n cert-manager rollout status deploy/cert-manager-webhook -w --timeout=40m
.PHONY: wait-deploy
wait-deploy:

@ -18,9 +18,11 @@ package v1
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation/field"
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"strings"
)
// log is for logging in this package.
@ -42,7 +44,18 @@ var _ webhook.Defaulter = &MsbDeployment{}
func (r *MsbDeployment) Default() {
msbdeploymentlog.Info("default", "name", r.Name)
// TODO(user): fill in your defaulting logic.
if r.Spec.Replicas == 0 {
// 因为我们不能确定用户给定的服务是否是一个无状态的应用,如果是有状态的,
// 多个副本会造成数据错乱。所以我们保守的,只给一个副本
r.Spec.Replicas = 1
}
if r.Spec.Expose.ServicePort == 0 {
// 允许用户自己指定service的port值如果不指定则使用服务的port值来代替
r.Spec.Expose.ServicePort = r.Spec.Port
}
// 增加每个字符串字段的空格处理
}
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
@ -54,22 +67,57 @@ var _ webhook.Validator = &MsbDeployment{}
func (r *MsbDeployment) ValidateCreate() error {
msbdeploymentlog.Info("validate create", "name", r.Name)
// TODO(user): fill in your validation logic upon object creation.
return nil
return r.validateCreateAndUpdate()
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (r *MsbDeployment) ValidateUpdate(old runtime.Object) error {
func (r *MsbDeployment) ValidateUpdate(_ runtime.Object) error {
msbdeploymentlog.Info("validate update", "name", r.Name)
// TODO(user): fill in your validation logic upon object update.
return nil
return r.validateCreateAndUpdate()
}
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (r *MsbDeployment) ValidateDelete() error {
msbdeploymentlog.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
return nil
}
func (r *MsbDeployment) validateCreateAndUpdate() error {
// 定义错误切片,在后续出现错误的时候,不断的向其中追加,最后合并返回
errs := field.ErrorList{}
exposePath := field.NewPath("spec", "expose")
// 1. 传入的 spec.expose.mode 值是否为 ingress 或 nodeport
if strings.ToLower(r.Spec.Expose.Mode) != ModeIngress &&
strings.ToLower(r.Spec.Expose.Mode) != ModeNodePort {
errs = append(errs,
field.NotSupported(
exposePath,
r.Spec.Expose.Mode,
[]string{ModeIngress, ModeNodePort}))
}
// 2. 如果传入的 spec.expose.mode 是 ingress那么spec.expose.ingressDomain 不能为空
if strings.ToLower(r.Spec.Expose.Mode) == ModeIngress &&
r.Spec.Expose.IngressDomain == "" {
errs = append(errs,
field.Invalid(
exposePath,
r.Spec.Expose.Mode,
"如果`spec.expose.mode` 是 `ingress`,那么,`spec.expose.ingressDomain` 不能为空"))
}
// 3. 如果传入的 spec.expose.mode 是 nodeport那么spec.expose.nodeport 取值范围是否是 30000-32767
if strings.ToLower(r.Spec.Expose.Mode) == ModeNodePort &&
(r.Spec.Expose.NodePort == 0 ||
r.Spec.Expose.NodePort < 30000 ||
r.Spec.Expose.NodePort > 32767) {
errs = append(errs,
field.Invalid(
exposePath,
r.Spec.Expose.Mode,
"如果 `spec.expose.mode` 是 `nodeport`,那么,`spec.expose.nodeport` 取值范围是否是 30000-32767"))
}
return errs.ToAggregate()
}

@ -18,9 +18,9 @@ bases:
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- ../webhook
- ../webhook
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
#- ../certmanager
- ../certmanager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
@ -34,39 +34,39 @@ patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml
- manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
#- webhookcainjection_patch.yaml
- webhookcainjection_patch.yaml
# the following config is for teaching kustomize how to do var substitution
vars:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
# fieldref:
# fieldpath: metadata.namespace
#- name: CERTIFICATE_NAME
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
#- name: SERVICE_NAMESPACE # namespace of the service
# objref:
# kind: Service
# version: v1
# name: webhook-service
# fieldref:
# fieldpath: metadata.namespace
#- name: SERVICE_NAME
# objref:
# kind: Service
# version: v1
# name: webhook-service
- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
objref:
kind: Certificate
group: cert-manager.io
version: v1
name: serving-cert # this name should match the one in certificate.yaml
fieldref:
fieldpath: metadata.namespace
- name: CERTIFICATE_NAME
objref:
kind: Certificate
group: cert-manager.io
version: v1
name: serving-cert # this name should match the one in certificate.yaml
- name: SERVICE_NAMESPACE # namespace of the service
objref:
kind: Service
version: v1
name: webhook-service
fieldref:
fieldpath: metadata.namespace
- name: SERVICE_NAME
objref:
kind: Service
version: v1
name: webhook-service

@ -0,0 +1,54 @@
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
creationTimestamp: null
name: mutating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-apps-mashibing-com-v1-msbdeployment
failurePolicy: Fail
name: mmsbdeployment.kb.io
rules:
- apiGroups:
- apps.mashibing.com
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- msbdeployments
sideEffects: None
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
creationTimestamp: null
name: validating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-apps-mashibing-com-v1-msbdeployment
failurePolicy: Fail
name: vmsbdeployment.kb.io
rules:
- apiGroups:
- apps.mashibing.com
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- msbdeployments
sideEffects: None

@ -15,4 +15,4 @@ spec:
service:
name: {{ .ObjectMeta.Name }}
port:
number: {{ .Spec.Port }}
number: {{ .Spec.Expose.ServicePort }}

@ -9,7 +9,7 @@ spec:
app: {{ .ObjectMeta.Name }}
ports:
# 默认情况下,为了方便起见,`targetPort` 被设置为与 `port` 字段相同的值。
- port: {{ .Spec.Port }}
- port: {{ .Spec.Expose.ServicePort }}
targetPort: {{ .Spec.Port }}
# 可选字段
# 默认情况下为了方便起见Kubernetes 控制平面会从某个范围内分配一个端口号默认30000-32767

@ -8,5 +8,5 @@ spec:
app: {{ .ObjectMeta.Name }}
ports:
- protocol: TCP
port: {{ .Spec.Port }}
port: {{ .Spec.Expose.ServicePort }}
targetPort: {{ .Spec.Port }}

@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="e2e" tests="0" failures="0" errors="0" time="446.979"></testsuite>
<testsuite name="e2e" tests="52" failures="52" errors="0" time="15.789"></testsuite>

@ -89,6 +89,7 @@ func main() {
os.Exit(1)
}
// 把我们的controller注册到manager中
if err = (&controllers.MsbDeploymentReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
@ -96,6 +97,8 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "MsbDeployment")
os.Exit(1)
}
// 把我们的webhook注册到manager
if err = (&appsv1.MsbDeployment{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "MsbDeployment")
os.Exit(1)

@ -1,7 +1,7 @@
cluster:
kind:
name: e2e
retain: true
retain: false
config: |
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
@ -45,6 +45,14 @@ install:
- ./test/e2e/yamls/ingress-nginx-deploy.yaml
path: ../..
ignoreFail: false
- name: cert-manager-controller
cmd: kubectl
args:
- apply
- -f
- ./test/e2e/yamls/cert-manager.yaml
path: ../..
ignoreFail: false
- name: wait-dep
cmd: make
args:

@ -73,8 +73,8 @@ func CreateIngressMsbDeployment(ctx *framework.TestContext, f *framework.Framewo
err = dc.Resource(msbGVR).Namespace("default").Delete(context.TODO(), obj.GetName(), metav1.DeleteOptions{})
Expect(err).Should(BeNil())
By("Sleep 1 second wait deleting done")
time.Sleep(time.Second)
By("Sleep 3 second wait deleting done")
time.Sleep(3 * time.Second)
})
It("Should not be exist msbdeployment", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Get(context.TODO(), obj.GetName(), metav1.GetOptions{})
@ -94,3 +94,106 @@ func CreateIngressMsbDeployment(ctx *framework.TestContext, f *framework.Framewo
})
})
}
func CreateIngressMsbDeploymentDefaultValue(ctx *framework.TestContext, f *framework.Framework) {
var (
// 1. 准备测试数据
ctFileRepPath = "create/testdata/create-ingress-default-no-replicas.yaml"
ctFileSvcPath = "create/testdata/create-ingress-default-no-serviceport.yaml"
objRep = &unstructured.Unstructured{Object: make(map[string]interface{})}
objSvc = &unstructured.Unstructured{Object: make(map[string]interface{})}
dc dynamic.Interface
// 3. 准备测试用到的全局变量
msbGVR = schema.GroupVersionResource{
Group: "apps.mashibing.com",
Version: "v1",
Resource: "msbdeployments",
}
err error
)
BeforeEach(func() {
// 2. 加载测试数据
err = f.LoadYamlToUnstructured(ctFileRepPath, objRep)
Expect(err).Should(BeNil())
err = f.LoadYamlToUnstructured(ctFileSvcPath, objSvc)
Expect(err).Should(BeNil())
// 4. 初始化测试用到的全局变量
dc = ctx.CreateDynamicClient()
})
Context("Create msbdeployment mod ingress, but no replicas", func() {
It("Create msbdeployment mod ingress success", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Create(context.TODO(), objRep, metav1.CreateOptions{})
Expect(err).Should(BeNil())
By("Sleep 1 second wait creating done")
time.Sleep(time.Second)
})
It("Should be exist msbdeployment, and have a default replicas", func() {
var md *unstructured.Unstructured
md, err = dc.Resource(msbGVR).Namespace("default").Get(context.TODO(), objRep.GetName(), metav1.GetOptions{})
Expect(err).Should(BeNil())
data := md.UnstructuredContent()
port, ok := data["spec"].(map[string]interface{})["replicas"].(int64)
Expect(ok).To(Equal(true))
Expect(port).To(Equal(int64(1)))
})
})
Context("Create msbdeployment mod ingress, but no svcport", func() {
It("Create msbdeployment mod ingress success", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Create(context.TODO(), objSvc, metav1.CreateOptions{})
Expect(err).Should(BeNil())
By("Sleep 1 second wait creating done")
time.Sleep(time.Second)
})
It("Should be exist msbdeployment, and have a default svcport", func() {
var md *unstructured.Unstructured
md, err = dc.Resource(msbGVR).Namespace("default").Get(context.TODO(), objSvc.GetName(), metav1.GetOptions{})
Expect(err).Should(BeNil())
data := md.UnstructuredContent()
port, ok := data["spec"].(map[string]interface{})["port"].(int64)
Expect(ok).To(Equal(true))
svcPort, svcOk := data["spec"].(map[string]interface{})["expose"].(map[string]interface{})["servicePort"].(int64)
Expect(svcOk).To(Equal(true))
Expect(port).To(Equal(svcPort))
})
})
}
func CreateIngressMsbDeploymentMustFailed(ctx *framework.TestContext, f *framework.Framework) {
var (
// 1. 准备测试数据
ctFilePath = "create/testdata/create-ingress-error-no-domain.yaml"
obj = &unstructured.Unstructured{Object: make(map[string]interface{})}
dc dynamic.Interface
// 3. 准备测试用到的全局变量
msbGVR = schema.GroupVersionResource{
Group: "apps.mashibing.com",
Version: "v1",
Resource: "msbdeployments",
}
err error
)
BeforeEach(func() {
// 2. 加载测试数据
err = f.LoadYamlToUnstructured(ctFilePath, obj)
Expect(err).Should(BeNil())
// 4. 初始化测试用到的全局变量
dc = ctx.CreateDynamicClient()
})
Context("Create msbdeployment mod ingress no domain", func() {
It("Should be create mod ingress no domain failed", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Create(context.TODO(), obj, metav1.CreateOptions{})
Expect(err).ShouldNot(BeNil())
})
})
}

@ -74,8 +74,8 @@ func CreateNodeportMsbDeployment(ctx *framework.TestContext, f *framework.Framew
err = dc.Resource(msbGVR).Namespace("default").Delete(context.TODO(), obj.GetName(), metav1.DeleteOptions{})
Expect(err).Should(BeNil())
By("Sleep 1 second wait deleting done")
time.Sleep(time.Second)
By("Sleep 3 second wait deleting done")
time.Sleep(3 * time.Second)
})
It("Should not be exist msbdeployment", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Get(context.TODO(), obj.GetName(), metav1.GetOptions{})
@ -95,3 +95,50 @@ func CreateNodeportMsbDeployment(ctx *framework.TestContext, f *framework.Framew
})
})
}
func CreateNodeportMsbDeploymentMustFailed(ctx *framework.TestContext, f *framework.Framework) {
var (
// 1. 准备测试数据
ctFileNoPath = "create/testdata/create-nodeport-error-no-nodeport.yaml"
ctFileLiPath = "create/testdata/create-nodeport-error-li-30000.yaml"
ctFileGtPath = "create/testdata/create-nodeport-error-gt-32767.yaml"
objNo = &unstructured.Unstructured{Object: make(map[string]interface{})}
objLi = &unstructured.Unstructured{Object: make(map[string]interface{})}
objGt = &unstructured.Unstructured{Object: make(map[string]interface{})}
dc dynamic.Interface
// 3. 准备测试用到的全局变量
msbGVR = schema.GroupVersionResource{
Group: "apps.mashibing.com",
Version: "v1",
Resource: "msbdeployments",
}
err error
)
BeforeEach(func() {
// 2. 加载测试数据
err = f.LoadYamlToUnstructured(ctFileNoPath, objNo)
Expect(err).Should(BeNil())
err = f.LoadYamlToUnstructured(ctFileLiPath, objLi)
Expect(err).Should(BeNil())
err = f.LoadYamlToUnstructured(ctFileGtPath, objGt)
Expect(err).Should(BeNil())
// 4. 初始化测试用到的全局变量
dc = ctx.CreateDynamicClient()
})
Context("Create msbdeployment mod nodeport", func() {
It("Should be create mod nodeport no nodeport, must failed", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Create(context.TODO(), objNo, metav1.CreateOptions{})
Expect(err).ShouldNot(BeNil())
})
It("Should be create mod nodeport li nodeport, must failed", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Create(context.TODO(), objLi, metav1.CreateOptions{})
Expect(err).ShouldNot(BeNil())
})
It("Should be create mod nodeport gt nodeport, must failed", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Create(context.TODO(), objGt, metav1.CreateOptions{})
Expect(err).ShouldNot(BeNil())
})
})
}

@ -0,0 +1,10 @@
apiVersion: apps.mashibing.com/v1
kind: MsbDeployment
metadata:
name: create-ingress-default-no-replicas
spec:
image: nginx
port: 80
expose:
mode: ingress
ingressDomain: www.mashingbing-test-r.com

@ -0,0 +1,11 @@
apiVersion: apps.mashibing.com/v1
kind: MsbDeployment
metadata:
name: create-ingress-default-no-serviceport
spec:
image: nginx
port: 80
replicas: 2
expose:
mode: ingress
ingressDomain: www.mashingbing-test-s.com

@ -0,0 +1,10 @@
apiVersion: apps.mashibing.com/v1
kind: MsbDeployment
metadata:
name: create-ingress-error-no-domain
spec:
image: nginx
port: 80
replicas: 2
expose:
mode: ingress

@ -0,0 +1,11 @@
apiVersion: apps.mashibing.com/v1
kind: MsbDeployment
metadata:
name: create-nodeport-error-gt-nodeport
spec:
image: nginx
port: 80
replicas: 2
expose:
mode: nodeport
nodePort: 32768

@ -0,0 +1,11 @@
apiVersion: apps.mashibing.com/v1
kind: MsbDeployment
metadata:
name: create-nodeport-error-li-nodeport
spec:
image: nginx
port: 80
replicas: 2
expose:
mode: nodeport
nodePort: 29999

@ -0,0 +1,10 @@
apiVersion: apps.mashibing.com/v1
kind: MsbDeployment
metadata:
name: create-nodeport-error-no-nodeport
spec:
image: nginx
port: 80
replicas: 2
expose:
mode: nodeport

@ -7,3 +7,6 @@ import "mashibing.com/pkg/mashibing-deployment/test/e2e/create"
var _ = fmw.Describe("Create msbdeployment mod ingress", create.CreateIngressMsbDeployment)
var _ = fmw.Describe("Create msbdeployment mod nodeport", create.CreateNodeportMsbDeployment)
var _ = fmw.Describe("Create msbdeployment mod ingress default value", create.CreateIngressMsbDeploymentDefaultValue)
var _ = fmw.Describe("Create msbdeployment mod ingress must failed", create.CreateIngressMsbDeploymentMustFailed)
var _ = fmw.Describe("Create msbdeployment mod nodeport must failed", create.CreateNodeportMsbDeploymentMustFailed)

@ -1,47 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="e2e" tests="44" failures="0" errors="0" time="97.662">
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be create mod nodeport success" classname="e2e" time="1.026717149"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be exist msbdeployment" classname="e2e" time="0.030551428"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be exist deployment" classname="e2e" time="0.024435618"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be exist service" classname="e2e" time="0.037999962"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should not be exist ingress" classname="e2e" time="0.020698391"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be update to ingress success" classname="e2e" time="1.022973247"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be exist ingress" classname="e2e" time="0.035940753"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should be delete mod nodeport success" classname="e2e" time="1.017934112"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should not be exist msbdeployment" classname="e2e" time="0.008005493"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should not be exist deployment" classname="e2e" time="0.010767817"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should not be exist service" classname="e2e" time="0.009286801"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should not be exist ingress" classname="e2e" time="0.372336887"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should be create mod nodeport success" classname="e2e" time="1.219922741"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should be exist msbdeployment" classname="e2e" time="0.050279079"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should be exist deployment" classname="e2e" time="0.0223911"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should be exist service" classname="e2e" time="0.3076832"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should not be exist ingress" classname="e2e" time="0.403548755"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should be delete mod nodeport success" classname="e2e" time="1.2189811879999999"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should not be exist msbdeployment" classname="e2e" time="0.036602463"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should not be exist deployment" classname="e2e" time="0.028695034"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should not be exist service" classname="e2e" time="0.317578804"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should not be exist ingress" classname="e2e" time="0.394650602"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be create mod ingress success" classname="e2e" time="1.20767007"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be exist msbdeployment" classname="e2e" time="0.011088203"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be exist deployment" classname="e2e" time="0.00989582"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be exist service" classname="e2e" time="0.371392181"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be exist ingress" classname="e2e" time="0.399642944"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be update to nodeport success" classname="e2e" time="1.208255044"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should not be exist ingress" classname="e2e" time="0.030754518"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should be delete mod ingress success" classname="e2e" time="1.023413829"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should not be exist msbdeployment" classname="e2e" time="0.011419424"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should not be exist deployment" classname="e2e" time="0.012140784"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should not be exist service" classname="e2e" time="0.114740463"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should not be exist ingress" classname="e2e" time="0.399506273"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be create mod ingress success" classname="e2e" time="1.20592297"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be exist msbdeployment" classname="e2e" time="0.02226977"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be exist deployment" classname="e2e" time="0.054546523"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be exist service" classname="e2e" time="0.316390433"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be exist ingress" classname="e2e" time="0.401976745"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should be delete mod ingress success" classname="e2e" time="1.208420674"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should not be exist msbdeployment" classname="e2e" time="0.024650323"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should not be exist deployment" classname="e2e" time="0.015709386"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should not be exist service" classname="e2e" time="0.349153042"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should not be exist ingress" classname="e2e" time="0.404473546"></testcase>
<testsuite name="e2e" tests="52" failures="0" errors="0" time="103.132">
<testcase name="Create msbdeployment mod ingress default value Create msbdeployment mod ingress, but no replicas Create msbdeployment mod ingress success" classname="e2e" time="1.024714624"></testcase>
<testcase name="Create msbdeployment mod ingress default value Create msbdeployment mod ingress, but no replicas Should be exist msbdeployment, and have a default replicas" classname="e2e" time="0.034046703"></testcase>
<testcase name="Create msbdeployment mod ingress default value Create msbdeployment mod ingress, but no svcport Create msbdeployment mod ingress success" classname="e2e" time="1.014796493"></testcase>
<testcase name="Create msbdeployment mod ingress default value Create msbdeployment mod ingress, but no svcport Should be exist msbdeployment, and have a default svcport" classname="e2e" time="0.049601336"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be create mod ingress success" classname="e2e" time="1.018053622"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be exist msbdeployment" classname="e2e" time="0.027116575"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be exist deployment" classname="e2e" time="0.03691608"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be exist service" classname="e2e" time="0.026199255"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be exist ingress" classname="e2e" time="0.0240624"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should be update to nodeport success" classname="e2e" time="1.018868619"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Update msbdeployment mod ingress to nodeport Should not be exist ingress" classname="e2e" time="0.020853737"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should be delete mod ingress success" classname="e2e" time="3.018281877"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should not be exist msbdeployment" classname="e2e" time="0.025819521"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should not be exist deployment" classname="e2e" time="0.024420258"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should not be exist service" classname="e2e" time="0.023434622"></testcase>
<testcase name="Update msbdeployment mod ingress to Nodeport Delete msbdeployment i2n Should not be exist ingress" classname="e2e" time="0.033312724"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should be create mod nodeport success" classname="e2e" time="1.011158552"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should be exist msbdeployment" classname="e2e" time="0.023825435"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should be exist deployment" classname="e2e" time="0.02605187"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should be exist service" classname="e2e" time="0.231335973"></testcase>
<testcase name="Create msbdeployment mod nodeport Create msbdeployment mod nodeport Should not be exist ingress" classname="e2e" time="0.400675299"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should be delete mod nodeport success" classname="e2e" time="3.208082116"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should not be exist msbdeployment" classname="e2e" time="0.015857195"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should not be exist deployment" classname="e2e" time="0.010506538"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should not be exist service" classname="e2e" time="0.011332014"></testcase>
<testcase name="Create msbdeployment mod nodeport Delete msbdeployment mod nodeport Should not be exist ingress" classname="e2e" time="0.015085619"></testcase>
<testcase name="Create msbdeployment mod ingress must failed Create msbdeployment mod ingress no domain Should be create mod ingress no domain failed" classname="e2e" time="0.15045463"></testcase>
<testcase name="Create msbdeployment mod nodeport must failed Create msbdeployment mod nodeport Should be create mod nodeport no nodeport, must failed" classname="e2e" time="0.397724624"></testcase>
<testcase name="Create msbdeployment mod nodeport must failed Create msbdeployment mod nodeport Should be create mod nodeport li nodeport, must failed" classname="e2e" time="0.400529014"></testcase>
<testcase name="Create msbdeployment mod nodeport must failed Create msbdeployment mod nodeport Should be create mod nodeport gt nodeport, must failed" classname="e2e" time="0.39856686"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be create mod nodeport success" classname="e2e" time="1.21051683"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be exist msbdeployment" classname="e2e" time="0.009861803"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be exist deployment" classname="e2e" time="0.009315362"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be exist service" classname="e2e" time="0.371582946"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should not be exist ingress" classname="e2e" time="0.399281601"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be update to ingress success" classname="e2e" time="1.22319023"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Update msbdeployment mod nodeport to ingress Should be exist ingress" classname="e2e" time="0.037784744"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should be delete mod nodeport success" classname="e2e" time="3.024074478"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should not be exist msbdeployment" classname="e2e" time="0.011734979"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should not be exist deployment" classname="e2e" time="0.010076596"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should not be exist service" classname="e2e" time="0.022724573"></testcase>
<testcase name="Update msbdeployment mod nodeport to Ingress Delete msbdeployment n2i Should not be exist ingress" classname="e2e" time="0.011975673"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be create mod ingress success" classname="e2e" time="1.015942845"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be exist msbdeployment" classname="e2e" time="0.009958198"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be exist deployment" classname="e2e" time="0.009730456"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be exist service" classname="e2e" time="0.308626199"></testcase>
<testcase name="Create msbdeployment mod ingress Create msbdeployment mod ingress Should be exist ingress" classname="e2e" time="0.399883799"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should be delete mod ingress success" classname="e2e" time="3.209498764"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should not be exist msbdeployment" classname="e2e" time="0.016065333"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should not be exist deployment" classname="e2e" time="0.017829572"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should not be exist service" classname="e2e" time="0.012815124"></testcase>
<testcase name="Create msbdeployment mod ingress Delete msbdeployment mod ingress Should not be exist ingress" classname="e2e" time="0.013745713"></testcase>
</testsuite>

@ -96,8 +96,8 @@ func UpdateI2NMsbDeployment(ctx *framework.TestContext, f *framework.Framework)
err = dc.Resource(msbGVR).Namespace("default").Delete(context.TODO(), objUpdate.GetName(), metav1.DeleteOptions{})
Expect(err).Should(BeNil())
By("Sleep 1 second wait deleting done")
time.Sleep(time.Second)
By("Sleep 3 second wait deleting done")
time.Sleep(3 * time.Second)
})
It("Should not be exist msbdeployment", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Get(context.TODO(), objUpdate.GetName(), metav1.GetOptions{})

@ -96,8 +96,8 @@ func UpdateN2IMsbDeployment(ctx *framework.TestContext, f *framework.Framework)
err = dc.Resource(msbGVR).Namespace("default").Delete(context.TODO(), objUpdate.GetName(), metav1.DeleteOptions{})
Expect(err).Should(BeNil())
By("Sleep 1 second wait deleting done")
time.Sleep(time.Second)
By("Sleep 3 second wait deleting done")
time.Sleep(3 * time.Second)
})
It("Should not be exist msbdeployment", func() {
_, err = dc.Resource(msbGVR).Namespace("default").Get(context.TODO(), objUpdate.GetName(), metav1.GetOptions{})

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save