mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-25 07:29:38 -05:00
operator: test JoiningNode in correct order (#988)
This commit is contained in:
parent
9023482ce0
commit
5ee69d2647
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user