Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add 2 more webhook acceptance tests
  • Loading branch information
sklarsa committed Jun 20, 2023
commit 221a27f4d8fb47f2aeb163cd016dd6da3655f076
14 changes: 14 additions & 0 deletions api/v1beta1/questdbsnapshot_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,25 @@ var _ = Describe("QuestDBSnapshot Webhook", func() {
Expect(k8sClient.Update(ctx, snap)).ToNot(Succeed())
})

It("should reject nil-to-value changes to volume snapshot class names", func() {
snap.Spec.VolumeSnapshotClassName = nil
Expect(k8sClient.Create(ctx, snap)).To(Succeed())
snap.Spec.VolumeSnapshotClassName = pointer.String("foo")
Expect(k8sClient.Update(ctx, snap)).ToNot(Succeed())
})

It("should reject updates to backoff limit", func() {
Expect(k8sClient.Create(ctx, snap)).To(Succeed())
snap.Spec.JobBackoffLimit = 500
Expect(k8sClient.Update(ctx, snap)).ToNot(Succeed())
})

It("should accept updates if nothing has changed and volume snapshot class name is nil", func() {
snap.Spec.VolumeSnapshotClassName = nil
Expect(k8sClient.Create(ctx, snap)).To(Succeed())
Expect(k8sClient.Update(ctx, snap)).To(Succeed())
})

})

})