Skip to content

Commit

Permalink
Check for approval removal in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckal777 committed Jun 7, 2022
1 parent 59da948 commit 4285803
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 20 additions & 0 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,26 @@ var _ = Describe("The maintenance controller", func() {
Expect(eventList.Items).To(HaveLen(3))
})

It("should remove the maintenance approval", func() {
Eventually(func(g Gomega) bool {
node := &corev1.Node{}
err := k8sClient.Get(context.Background(), maintainedKey, node)
g.Expect(err).To(Succeed())
_, exists := node.Labels["cloud.sap/maintenance-approved"]
return exists
}).Should(BeFalse())
})

It("should remove the flatcar approval", func() {
Eventually(func(g Gomega) bool {
node := &corev1.Node{}
err := k8sClient.Get(context.Background(), maintainedKey, node)
g.Expect(err).To(Succeed())
_, exists := node.Labels["flatcar-linux-update.v1.flatcar-linux.net/reboot-ok"]
return exists
}).Should(BeFalse())
})

It("should recreate nodes with the kubernikus controller", func() {
By("fetch node names")
nodes := &v1.NodeList{}
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,6 @@ gopkg.in/hjson/hjson-go.v3 v3.0.1/go.mod h1:X6zrTSVeImfwfZLfgQdInl9mWjqPqgH90jom
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.66.5 h1:zfiCO0p88Fj4f6NR6KR5WdGMQ02U8vlDnN6HuD2xv5o=
gopkg.in/ini.v1 v1.66.5/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI=
gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
Expand Down

0 comments on commit 4285803

Please sign in to comment.