Skip to content

Commit 25c1131

Browse files
committed
Added tests
1 parent 58136dd commit 25c1131

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/component_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ func (s *ComponentSuite) TestBasic() {
7777
assert.NoError(s.T(), err)
7878
assert.NotNil(s.T(), clientset)
7979

80-
namespaces, err := clientset.CoreV1().Namespaces().List(context.Background(), metav1.ListOptions{})
81-
assert.NoError(s.T(), err)
82-
assert.NotNil(s.T(), namespaces)
83-
assert.Equal(s.T(), len(namespaces.Items), 5)
84-
8580
deployment, err := clientset.AppsV1().Deployments(controllerNamespace).Get(context.Background(), "aws-load-balancer-controller", metav1.GetOptions{})
8681
assert.NoError(s.T(), err)
8782
assert.NotNil(s.T(), deployment)
@@ -93,6 +88,15 @@ func (s *ComponentSuite) TestBasic() {
9388
ingressNamespace := fmt.Sprintf("example-%s", randomID)
9489
ingressName := fmt.Sprintf("example-ingress-%s", randomID)
9590

91+
defer clientset.CoreV1().Namespaces().Delete(context.Background(), ingressNamespace, metav1.DeleteOptions{})
92+
_, err := clientset.CoreV1().Namespaces().Create(context.Background(), &corev1.Namespace{
93+
ObjectMeta: metav1.ObjectMeta{
94+
Name: ingressNamespace,
95+
},
96+
}, metav1.CreateOptions{})
97+
assert.NoError(s.T(), err)
98+
99+
96100
pathType := networkingv1.PathTypeImplementationSpecific
97101

98102
ingress := &networkingv1.Ingress{

0 commit comments

Comments
 (0)