@@ -16,6 +16,7 @@ import (
1616 "github.com/stretchr/testify/assert"
1717
1818 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
19+ corev1 "k8s.io/api/core/v1"
1920 "k8s.io/apimachinery/pkg/runtime/schema"
2021 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2122
@@ -73,6 +74,10 @@ func (s *ComponentSuite) TestBasic() {
7374 assert .NotNil (s .T (), metadata .Values )
7475 assert .Equal (s .T (), metadata .Version , "0.8.3" )
7576
77+ // Deploy second time to create ClusterSecretStore resource
78+ options , _ = s .DeployAtmosComponent (s .T (), component , stack , & inputs )
79+ assert .NotNil (s .T (), options )
80+
7681 config , err := awsHelper .NewK8SClientConfig (cluster )
7782 assert .NoError (s .T (), err )
7883 assert .NotNil (s .T (), config )
@@ -121,8 +126,7 @@ func (s *ComponentSuite) TestBasic() {
121126 },
122127 }
123128
124-
125- factory := dynamicinformer .NewDynamicSharedInformerFactory (dynamicClient , 0 )
129+ factory := dynamicinformer .NewFilteredDynamicSharedInformerFactory (dynamicClient , time .Minute , corev1 .NamespaceAll , nil )
126130 informer := factory .ForResource (externalSecretGVR ).Informer ()
127131
128132 stopChannel := make (chan struct {})
@@ -136,6 +140,7 @@ func (s *ComponentSuite) TestBasic() {
136140 return
137141 }
138142
143+ // Ensure we are checking the status of the correct object
139144 conditions , found , err := unstructured .NestedSlice (externalSecret .Object , "status" , "conditions" )
140145
141146 if err != nil || ! found {
@@ -171,6 +176,7 @@ func (s *ComponentSuite) TestBasic() {
171176 msg := "ExternalSecret is ready"
172177 fmt .Println (msg )
173178 case <- time .After (1 * time .Minute ):
179+ defer close (stopChannel )
174180 msg := "ExternalSecret is not ready"
175181 assert .Fail (s .T (), msg )
176182 }
0 commit comments