From b4bc8a88ab80f9c35af6c0e8c9e28f5470ef8539 Mon Sep 17 00:00:00 2001 From: yamatcha Date: Fri, 29 Nov 2024 08:58:02 +0000 Subject: [PATCH] fix --- api/v1beta2/mysqlcluster_webhook_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/api/v1beta2/mysqlcluster_webhook_test.go b/api/v1beta2/mysqlcluster_webhook_test.go index c2964ee5..dfe9a73e 100644 --- a/api/v1beta2/mysqlcluster_webhook_test.go +++ b/api/v1beta2/mysqlcluster_webhook_test.go @@ -151,6 +151,13 @@ var _ = Describe("MySQLCluster Webhook", func() { Expect(err).NotTo(HaveOccurred()) }) + It("should deny an invalid logRotationSchedule", func() { + r := makeMySQLCluster() + r.Spec.LogRotationSchedule = "hoge fuga" + err := k8sClient.Create(ctx, r) + Expect(err).To(HaveOccurred()) + }) + It("should allow a valid logRotationSize", func() { r := makeMySQLCluster() r.Spec.LogRotationSize = 1024 @@ -158,9 +165,9 @@ var _ = Describe("MySQLCluster Webhook", func() { Expect(err).NotTo(HaveOccurred()) }) - It("should deny an invalid logRotationSchedule", func() { + It("should deny an invalid logRotationSize", func() { r := makeMySQLCluster() - r.Spec.LogRotationSchedule = "hoge fuga" + r.Spec.LogRotationSize = -1 err := k8sClient.Create(ctx, r) Expect(err).To(HaveOccurred()) })