@@ -198,8 +198,8 @@ var _ = g.Describe("[sig-imagepolicy][OCPFeatureGate:SigstoreImageVerificationPK
198198
199199func updateImageConfig (oc * exutil.CLI , allowedRegistries []string ) {
200200 e2e .Logf ("Updating image config with allowed registries" )
201- initialWorkerSpec := getMCPCurrentSpecConfigName (oc , workerPool )
202- initialMasterSpec := getMCPCurrentSpecConfigName (oc , masterPool )
201+ initialWorkerSpec := GetMCPCurrentSpecConfigName (oc , workerPool )
202+ initialMasterSpec := GetMCPCurrentSpecConfigName (oc , masterPool )
203203
204204 err := retry .RetryOnConflict (retry .DefaultBackoff , func () error {
205205 imageConfig , err := oc .AdminConfigClient ().ConfigV1 ().Images ().Get (
@@ -215,13 +215,13 @@ func updateImageConfig(oc *exutil.CLI, allowedRegistries []string) {
215215 return err
216216 })
217217 o .Expect (err ).NotTo (o .HaveOccurred (), "error updating image config" )
218- waitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
219- waitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
218+ WaitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
219+ WaitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
220220}
221221
222222func cleanupImageConfig (oc * exutil.CLI ) error {
223- initialWorkerSpec := getMCPCurrentSpecConfigName (oc , workerPool )
224- initialMasterSpec := getMCPCurrentSpecConfigName (oc , masterPool )
223+ initialWorkerSpec := GetMCPCurrentSpecConfigName (oc , workerPool )
224+ initialMasterSpec := GetMCPCurrentSpecConfigName (oc , masterPool )
225225
226226 err := retry .RetryOnConflict (retry .DefaultBackoff , func () error {
227227 imageConfig , err := oc .AdminConfigClient ().ConfigV1 ().Images ().Get (
@@ -237,8 +237,8 @@ func cleanupImageConfig(oc *exutil.CLI) error {
237237 return err
238238 })
239239 o .Expect (err ).NotTo (o .HaveOccurred (), "error cleaning up image config" )
240- waitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
241- waitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
240+ WaitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
241+ WaitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
242242 return nil
243243}
244244
@@ -278,52 +278,52 @@ func waitForTestPodContainerToFailSignatureValidation(ctx context.Context, f *e2
278278
279279func createClusterImagePolicy (oc * exutil.CLI , policy configv1.ClusterImagePolicy ) {
280280 e2e .Logf ("Creating cluster image policy %s" , policy .Name )
281- initialWorkerSpec := getMCPCurrentSpecConfigName (oc , workerPool )
282- initialMasterSpec := getMCPCurrentSpecConfigName (oc , masterPool )
281+ initialWorkerSpec := GetMCPCurrentSpecConfigName (oc , workerPool )
282+ initialMasterSpec := GetMCPCurrentSpecConfigName (oc , masterPool )
283283
284284 _ , err := oc .AdminConfigClient ().ConfigV1 ().ClusterImagePolicies ().Create (context .TODO (), & policy , metav1.CreateOptions {})
285285 o .Expect (err ).NotTo (o .HaveOccurred ())
286286
287- waitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
288- waitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
287+ WaitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
288+ WaitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
289289}
290290
291291func deleteClusterImagePolicy (oc * exutil.CLI , policyName string ) error {
292- initialWorkerSpec := getMCPCurrentSpecConfigName (oc , workerPool )
293- initialMasterSpec := getMCPCurrentSpecConfigName (oc , masterPool )
292+ initialWorkerSpec := GetMCPCurrentSpecConfigName (oc , workerPool )
293+ initialMasterSpec := GetMCPCurrentSpecConfigName (oc , masterPool )
294294
295295 if err := oc .AdminConfigClient ().ConfigV1 ().ClusterImagePolicies ().Delete (context .TODO (), policyName , metav1.DeleteOptions {}); err != nil && ! errors .IsNotFound (err ) {
296296 return fmt .Errorf ("failed to delete cluster image policy %s: %v" , policyName , err )
297297 }
298- waitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
299- waitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
298+ WaitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
299+ WaitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
300300 return nil
301301}
302302
303303func createImagePolicy (oc * exutil.CLI , policy configv1.ImagePolicy , namespace string ) {
304304 // Capture initial rendered config names for both pools before creating the policy
305- initialWorkerSpec := getMCPCurrentSpecConfigName (oc , workerPool )
306- initialMasterSpec := getMCPCurrentSpecConfigName (oc , masterPool )
305+ initialWorkerSpec := GetMCPCurrentSpecConfigName (oc , workerPool )
306+ initialMasterSpec := GetMCPCurrentSpecConfigName (oc , masterPool )
307307
308308 e2e .Logf ("Creating image policy %s in namespace %s" , policy .Name , namespace )
309309 _ , err := oc .AdminConfigClient ().ConfigV1 ().ImagePolicies (namespace ).Create (context .TODO (), & policy , metav1.CreateOptions {})
310310 o .Expect (err ).NotTo (o .HaveOccurred ())
311311
312312 // Wait until each pool's Spec.Configuration.Name changes from the initial value
313313 // and the pool reports Updated=true
314- waitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
315- waitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
314+ WaitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
315+ WaitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
316316}
317317
318318func deleteImagePolicy (oc * exutil.CLI , policyName string , namespace string ) error {
319- initialWorkerSpec := getMCPCurrentSpecConfigName (oc , workerPool )
320- initialMasterSpec := getMCPCurrentSpecConfigName (oc , masterPool )
319+ initialWorkerSpec := GetMCPCurrentSpecConfigName (oc , workerPool )
320+ initialMasterSpec := GetMCPCurrentSpecConfigName (oc , masterPool )
321321
322322 if err := oc .AdminConfigClient ().ConfigV1 ().ImagePolicies (namespace ).Delete (context .TODO (), policyName , metav1.DeleteOptions {}); err != nil && ! errors .IsNotFound (err ) {
323323 return fmt .Errorf ("failed to delete image policy %s in namespace %s: %v" , policyName , namespace , err )
324324 }
325- waitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
326- waitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
325+ WaitForMCPConfigSpecChangeAndUpdated (oc , workerPool , initialWorkerSpec )
326+ WaitForMCPConfigSpecChangeAndUpdated (oc , masterPool , initialMasterSpec )
327327 return nil
328328}
329329
@@ -679,18 +679,18 @@ L8ITFP+Nw9Meiw4etw59CTAPCc7l4Zvwr1K2ZTBmVGxrqdasiqpI0utG69aItsPi
679679 return testImagePolicies
680680}
681681
682- // getMCPCurrentSpecConfigName returns the current Spec.Configuration.Name for the given MCP
683- func getMCPCurrentSpecConfigName (oc * exutil.CLI , pool string ) string {
682+ // GetMCPCurrentSpecConfigName returns the current Spec.Configuration.Name for the given MCP
683+ func GetMCPCurrentSpecConfigName (oc * exutil.CLI , pool string ) string {
684684 clientSet , err := machineconfigclient .NewForConfig (oc .KubeFramework ().ClientConfig ())
685685 o .Expect (err ).NotTo (o .HaveOccurred ())
686686 mcp , err := clientSet .MachineconfigurationV1 ().MachineConfigPools ().Get (context .TODO (), pool , metav1.GetOptions {})
687687 o .Expect (err ).NotTo (o .HaveOccurred ())
688688 return mcp .Spec .Configuration .Name
689689}
690690
691- // waitForMCPConfigSpecChangeAndUpdated waits until Spec.Configuration.Name changes from the provided initial value
691+ // WaitForMCPConfigSpecChangeAndUpdated waits until Spec.Configuration.Name changes from the provided initial value
692692// and the MCP reports Updated=true
693- func waitForMCPConfigSpecChangeAndUpdated (oc * exutil.CLI , pool string , initialSpecName string ) {
693+ func WaitForMCPConfigSpecChangeAndUpdated (oc * exutil.CLI , pool string , initialSpecName string ) {
694694 e2e .Logf ("Waiting for pool %s to complete" , pool )
695695 clientSet , err := machineconfigclient .NewForConfig (oc .KubeFramework ().ClientConfig ())
696696 o .Expect (err ).NotTo (o .HaveOccurred ())
0 commit comments