@@ -58,8 +58,13 @@ var _ = Describe("Operator", func() {
5858 Expect (err ).NotTo (HaveOccurred ())
5959 DeferCleanup (os .RemoveAll , repoDir )
6060
61+ functionNamespace , err = utils .GetTestNamespace ()
62+ Expect (err ).NotTo (HaveOccurred ())
63+ DeferCleanup (cleanupNamespaces , functionNamespace )
64+
6165 // Deploy function using func CLI
6266 cmd := exec .Command ("func" , "deploy" ,
67+ "--namespace" , functionNamespace ,
6368 "--path" , repoDir ,
6469 "--registry" , registry ,
6570 "--registry-insecure" , strconv .FormatBool (registryInsecure ))
@@ -69,7 +74,7 @@ var _ = Describe("Operator", func() {
6974
7075 // Cleanup func deployment
7176 DeferCleanup (func () {
72- cmd := exec .Command ("func" , "delete" , "--path" , repoDir )
77+ cmd := exec .Command ("func" , "delete" , "--path" , repoDir , "--namespace" , functionNamespace )
7378 _ , _ = utils .Run (cmd )
7479 })
7580
@@ -114,7 +119,7 @@ var _ = Describe("Operator", func() {
114119 function := & functionsdevv1alpha1.Function {
115120 ObjectMeta : metav1.ObjectMeta {
116121 GenerateName : "my-function-" ,
117- Namespace : "default" ,
122+ Namespace : functionNamespace ,
118123 },
119124 Spec : functionsdevv1alpha1.FunctionSpec {
120125 Source : functionsdevv1alpha1.FunctionSpecSource {
@@ -131,7 +136,6 @@ var _ = Describe("Operator", func() {
131136 Expect (err ).NotTo (HaveOccurred ())
132137
133138 functionName = function .Name
134- functionNamespace = function .Namespace
135139
136140 funcBecomeReady := func (g Gomega ) {
137141 fn := & functionsdevv1alpha1.Function {}
@@ -172,6 +176,10 @@ var _ = Describe("Operator", func() {
172176 repoDir , err = InitializeRepoWithFunction (repoURL , username , password , "go" )
173177 Expect (err ).NotTo (HaveOccurred ())
174178 DeferCleanup (os .RemoveAll , repoDir )
179+
180+ functionNamespace , err = utils .GetTestNamespace ()
181+ Expect (err ).NotTo (HaveOccurred ())
182+ DeferCleanup (cleanupNamespaces , functionNamespace )
175183 })
176184
177185 AfterEach (func () {
@@ -188,7 +196,7 @@ var _ = Describe("Operator", func() {
188196 function := & functionsdevv1alpha1.Function {
189197 ObjectMeta : metav1.ObjectMeta {
190198 GenerateName : "my-undeployed-function-" ,
191- Namespace : "default" ,
199+ Namespace : functionNamespace ,
192200 },
193201 Spec : functionsdevv1alpha1.FunctionSpec {
194202 Source : functionsdevv1alpha1.FunctionSpecSource {
@@ -205,7 +213,6 @@ var _ = Describe("Operator", func() {
205213 Expect (err ).NotTo (HaveOccurred ())
206214
207215 functionName = function .Name
208- functionNamespace = function .Namespace
209216
210217 funcBecomeReady := func (g Gomega ) {
211218 fn := & functionsdevv1alpha1.Function {}
0 commit comments