-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added owner reference for nns to node (#211)
Thanks to that, NNS will be removed when respective Node is removed. This patch also adds test coverage. Since we remove a Node as part of the test, we run this test in a separate test lane.
- Loading branch information
Showing
11 changed files
with
72 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
check-patch.mounts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
check-patch.packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
check-patch.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
sub-stages: | ||
- k8s-1.14.6.default-bridge | ||
- k8s-1.14.6.node-removal | ||
- k8s-1.14.6 | ||
- os-3.11.0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package e2e | ||
|
||
import ( | ||
"context" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
corev1 "k8s.io/api/core/v1" | ||
"k8s.io/apimachinery/pkg/types" | ||
|
||
framework "github.com/operator-framework/operator-sdk/pkg/test" | ||
|
||
nmstatev1alpha1 "github.com/nmstate/kubernetes-nmstate/pkg/apis/nmstate/v1alpha1" | ||
) | ||
|
||
var _ = Describe("NNS cleanup", func() { | ||
var nodeName types.NamespacedName | ||
|
||
BeforeEach(func() { | ||
nodeName = types.NamespacedName{Name: nodes[0]} | ||
|
||
By("Checking that NNS exists") | ||
Eventually(func() error { | ||
return framework.Global.Client.Get(context.TODO(), nodeName, &nmstatev1alpha1.NodeNetworkState{}) | ||
}, ReadTimeout, ReadInterval).ShouldNot(HaveOccurred()) | ||
}) | ||
|
||
Context("after node removal", func() { | ||
nodeToDelete := &corev1.Node{} | ||
|
||
BeforeEach(func() { | ||
By("Getting the node we want to delete") | ||
err := framework.Global.Client.Get(context.TODO(), nodeName, nodeToDelete) | ||
Expect(err).To(BeNil()) | ||
|
||
By("Deleting the node") | ||
err = framework.Global.Client.Delete(context.TODO(), nodeToDelete) | ||
Expect(err).To(BeNil()) | ||
}) | ||
|
||
It("should remove NNS of that node", func() { | ||
Eventually(func() error { | ||
return framework.Global.Client.Get(context.TODO(), nodeName, &nmstatev1alpha1.NodeNetworkState{}) | ||
}, ReadTimeout, ReadInterval).Should(HaveOccurred()) | ||
}) | ||
}) | ||
}) |