@@ -100,35 +100,11 @@ var _ = Describe("Automatic Approval", Ordered, func() {
100100 })
101101
102102 BeforeAll (func () {
103- By ("creating the owner namespace" )
104- cmd := exec .Command ("kubectl" , "create" , "ns" , ownerNamespace )
105- _ , err := utils .Run (cmd )
106- Expect (err ).NotTo (HaveOccurred (), "Failed to create owner namespace" )
107-
108- By ("creating the consumer namespace" )
109- cmd = exec .Command ("kubectl" , "create" , "ns" , consumerNamespace )
110- _ , err = utils .Run (cmd )
111- Expect (err ).NotTo (HaveOccurred (), "Failed to create consumer namespace" )
112-
113- By ("creating the kuadrant namespace" )
114- cmd = exec .Command ("kubectl" , "create" , "ns" , kuadrantNamespace )
115- _ , err = utils .Run (cmd )
116- Expect (err ).NotTo (HaveOccurred (), "Failed to create kuadrant namespace" )
117-
118- By ("creating the kuadrant instance" )
119- kuadrantYAML := fmt .Sprintf (`
120- apiVersion: kuadrant.io/v1beta1
121- kind: Kuadrant
122- metadata:
123- name: kuadrant
124- namespace: %s
125- spec: {}
126- ` , kuadrantNamespace )
103+ SetDefaultEventuallyTimeout (2 * time .Minute )
104+ SetDefaultEventuallyPollingInterval (2 * time .Second )
127105
128- cmd = exec .Command ("kubectl" , "apply" , "-f" , "-" )
129- cmd .Stdin = utils .StringReader (kuadrantYAML )
130- _ , err = utils .Run (cmd )
131- Expect (err ).NotTo (HaveOccurred (), "Failed to create Kuadrant" )
106+ By ("setting up namespaces and Kuadrant instance" )
107+ SetupNamespacesAndKuadrant (ownerNamespace , consumerNamespace , kuadrantNamespace )
132108 })
133109
134110 AfterAll (func () {
@@ -145,9 +121,6 @@ spec: {}
145121 _ , _ = utils .Run (cmd )
146122 })
147123
148- SetDefaultEventuallyTimeout (2 * time .Minute )
149- SetDefaultEventuallyPollingInterval (2 * time .Second )
150-
151124 Context ("APIKey with automatic approval mode" , func () {
152125 It ("should create APIKeyRequest, automatic approval, and approve the APIKey" , func () {
153126 By ("creating an HTTPRoute as a reference target" )
0 commit comments