operator: test JoiningNode in correct order (#988)

This commit is contained in:
3u13r 2023-01-17 11:32:39 +01:00 committed by GitHub
parent 9023482ce0
commit 5ee69d2647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,23 +92,6 @@ var _ = Describe("JoiningNode controller", func() {
})
It("Should annotate the corresponding node when creating the node first", func() {
ctx := context.Background()
By("creating a node")
node := &corev1.Node{
TypeMeta: metav1.TypeMeta{
APIVersion: "update.edgeless.systems/v1alpha1",
Kind: "Node",
},
ObjectMeta: metav1.ObjectMeta{
Name: nodeName2,
},
Spec: corev1.NodeSpec{},
}
Expect(k8sClient.Create(ctx, node)).Should(Succeed())
createdNode := &corev1.Node{}
Eventually(func() error {
return k8sClient.Get(ctx, types.NamespacedName{Name: nodeName2}, createdNode)
}, timeout, interval).Should(Succeed())
Expect(createdNode.ObjectMeta.Name).Should(Equal(nodeName2))
By("creating a joining node resource")
joiningNode := &updatev1alpha1.JoiningNode{
@ -132,6 +115,24 @@ var _ = Describe("JoiningNode controller", func() {
Expect(createdJoiningNode.Spec.Name).Should(Equal(nodeName2))
Expect(createdJoiningNode.Spec.ComponentsReference).Should(Equal(ComponentsReference2))
By("creating a node")
node := &corev1.Node{
TypeMeta: metav1.TypeMeta{
APIVersion: "update.edgeless.systems/v1alpha1",
Kind: "Node",
},
ObjectMeta: metav1.ObjectMeta{
Name: nodeName2,
},
Spec: corev1.NodeSpec{},
}
Expect(k8sClient.Create(ctx, node)).Should(Succeed())
createdNode := &corev1.Node{}
Eventually(func() error {
return k8sClient.Get(ctx, types.NamespacedName{Name: nodeName2}, createdNode)
}, timeout, interval).Should(Succeed())
Expect(createdNode.ObjectMeta.Name).Should(Equal(nodeName2))
By("annotating the node")
Eventually(func() string {
_ = k8sClient.Get(ctx, types.NamespacedName{Name: createdNode.Name}, createdNode)