Skip to content

Commit

Permalink
chore: delete valiedate webhook and default webhook for emqx
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory-Z committed Aug 17, 2023
1 parent 87d43d1 commit fbe9a9c
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 210 deletions.
2 changes: 0 additions & 2 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ resources:
version: v2beta1
webhooks:
conversion: true
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
Expand Down
70 changes: 0 additions & 70 deletions apis/apps/v2beta1/emqx_webhook.go

This file was deleted.

33 changes: 0 additions & 33 deletions apis/apps/v2beta1/emqx_webhook_test.go

This file was deleted.

3 changes: 0 additions & 3 deletions apis/apps/v2beta1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ var _ = BeforeSuite(func() {
})
Expect(err).NotTo(HaveOccurred())

err = (&EMQX{}).SetupWebhookWithManager(mgr)
Expect(err).NotTo(HaveOccurred())

err = (&Rebalance{}).SetupWebhookWithManager(mgr)
Expect(err).NotTo(HaveOccurred())

Expand Down
42 changes: 0 additions & 42 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,6 @@ metadata:
creationTimestamp: null
name: mutating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-apps-emqx-io-v2beta1-emqx
failurePolicy: Fail
name: mutating.apps.emqx.io
rules:
- apiGroups:
- apps.emqx.io
apiVersions:
- v2beta1
operations:
- CREATE
- UPDATE
resources:
- emqxes
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
Expand Down Expand Up @@ -96,27 +75,6 @@ metadata:
creationTimestamp: null
name: validating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-apps-emqx-io-v2beta1-emqx
failurePolicy: Fail
name: validator.apps.emqx.io
rules:
- apiGroups:
- apps.emqx.io
apiVersions:
- v2beta1
operations:
- CREATE
- UPDATE
resources:
- emqxes
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
Expand Down
2 changes: 0 additions & 2 deletions controllers/apps/v2beta1/add_emqx_core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ func TestGenerateStatefulSet(t *testing.T) {
},
}
instance.Spec.CoreTemplate.Spec.Replicas = pointer.Int32(3)
instance.Default()
assert.Nil(t, instance.ValidateCreate())

t.Run("check metadata", func(t *testing.T) {
emqx := instance.DeepCopy()
Expand Down
1 change: 0 additions & 1 deletion controllers/apps/v2beta1/add_emqx_repl_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ var _ = Describe("Check add repl controller", Ordered, Label("repl"), func() {
},
},
}
instance.Default()
})

It("create namespace", func() {
Expand Down
1 change: 0 additions & 1 deletion controllers/apps/v2beta1/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ var _ = BeforeSuite(func() {
timeout = time.Second * 5
interval = time.Millisecond * 500
ctx = context.TODO()
emqx.Default()

Expect(os.Setenv("USE_EXISTING_CLUSTER", "false")).To(Succeed())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,6 @@ metadata:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "emqx-operator.fullname" . }}-serving-cert
name: {{ include "emqx-operator.fullname" . }}-mutating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: {{ include "emqx-operator.fullname" . }}-webhook-service
namespace: {{ .Release.Namespace }}
path: /mutate-apps-emqx-io-v2beta1-emqx
failurePolicy: Fail
name: mutating.apps.emqx.io
rules:
- apiGroups:
- apps.emqx.io
apiVersions:
- v2beta1
operations:
- CREATE
- UPDATE
resources:
- emqxes
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,6 @@ metadata:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "emqx-operator.fullname" . }}-serving-cert
name: {{ include "emqx-operator.fullname" . }}-validating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: {{ include "emqx-operator.fullname" . }}-webhook-service
namespace: {{ .Release.Namespace }}
path: /validate-apps-emqx-io-v2beta1-emqx
failurePolicy: Fail
name: validator.apps.emqx.io
rules:
- apiGroups:
- apps.emqx.io
apiVersions:
- v2beta1
operations:
- CREATE
- UPDATE
resources:
- emqxes
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
Expand Down
5 changes: 0 additions & 5 deletions e2e/v2beta1/e2e_rebalance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ var _ = Describe("EMQX 5 Rebalance Test", Label("rebalance"), func() {
BeforeEach(func() {
instance = genEMQX().DeepCopy()
instance.Spec.Image = "emqx/emqx-enterprise:5.1"
instance.Default()
})

Context("EMQX is not found", func() {
Expand Down Expand Up @@ -135,8 +134,6 @@ var _ = Describe("EMQX 5 Rebalance Test", Label("rebalance"), func() {
// create EMQX CR
instance.Spec.ReplicantTemplate = nil
instance.Spec.CoreTemplate.Spec.Replicas = pointer.Int32Ptr(2)
instance.Default()
Expect(instance.ValidateCreate()).Should(Succeed())
Expect(k8sClient.Create(context.TODO(), instance)).Should(Succeed())

// check EMQX CR if created successfully
Expand Down Expand Up @@ -209,8 +206,6 @@ var _ = Describe("EMQX 5 Rebalance Test", Label("rebalance"), func() {
// create EMQX CR
instance.Spec.ReplicantTemplate = nil
instance.Spec.CoreTemplate.Spec.Replicas = pointer.Int32Ptr(2)
instance.Default()
Expect(instance.ValidateCreate()).Should(Succeed())
Expect(k8sClient.Create(context.TODO(), instance)).Should(Succeed())

// check EMQX CR if created successfully
Expand Down
3 changes: 0 additions & 3 deletions e2e/v2beta1/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ var _ = Describe("E2E Test", Label("base"), Ordered, func() {
JustBeforeEach(func() {
instance.Spec.ReplicantTemplate = nil
instance.Spec.CoreTemplate.Spec.Replicas = pointer.Int32Ptr(2)
instance.Default()
Expect(instance.ValidateCreate()).Should(Succeed())
})

It("should create namespace and EMQX CR", func() {
Expand Down Expand Up @@ -286,7 +284,6 @@ var _ = Describe("E2E Test", Label("base"), Ordered, func() {
Replicas: pointer.Int32Ptr(2),
},
}
instance.Default()
Expect(k8sClient.Update(context.TODO(), instance)).Should(Succeed())
})

Expand Down
1 change: 0 additions & 1 deletion e2e/v2beta1/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,5 @@ func genEMQX() *appsv2beta1.EMQX {
},
},
}
emqx.Default()
return emqx
}
5 changes: 0 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ func main() {
os.Exit(1)
}

if err = (&appsv2beta1.EMQX{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "EMQX")
os.Exit(1)
}

if err = (&appsv2beta1.Rebalance{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "Rebalance")
os.Exit(1)
Expand Down

0 comments on commit fbe9a9c

Please sign in to comment.