@@ -30,7 +30,6 @@ import (
3030
3131 ign3types "github.com/coreos/ignition/v2/config/v3_5/types"
3232 apicfgv1 "github.com/openshift/api/config/v1"
33- apicfgv1alpha1 "github.com/openshift/api/config/v1alpha1"
3433 features "github.com/openshift/api/features"
3534 mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
3635 apioperatorsv1alpha1 "github.com/openshift/api/operator/v1alpha1"
@@ -74,8 +73,8 @@ type fixture struct {
7473 icspLister []* apioperatorsv1alpha1.ImageContentSourcePolicy
7574 idmsLister []* apicfgv1.ImageDigestMirrorSet
7675 itmsLister []* apicfgv1.ImageTagMirrorSet
77- clusterImagePolicyLister []* apicfgv1alpha1 .ClusterImagePolicy
78- imagePolicyLister []* apicfgv1alpha1 .ImagePolicy
76+ clusterImagePolicyLister []* apicfgv1 .ClusterImagePolicy
77+ imagePolicyLister []* apicfgv1 .ImagePolicy
7978
8079 actions []core.Action
8180 skipActionsValidation bool
@@ -211,20 +210,20 @@ func newClusterVersionConfig(name, desiredImage string) *apicfgv1.ClusterVersion
211210 }
212211}
213212
214- func newClusterImagePolicyWithPublicKey (name string , scopes []string , keyData []byte ) * apicfgv1alpha1 .ClusterImagePolicy {
215- imgScopes := []apicfgv1alpha1 .ImageScope {}
213+ func newClusterImagePolicyWithPublicKey (name string , scopes []string , keyData []byte ) * apicfgv1 .ClusterImagePolicy {
214+ imgScopes := []apicfgv1 .ImageScope {}
216215 for _ , scope := range scopes {
217- imgScopes = append (imgScopes , apicfgv1alpha1 .ImageScope (scope ))
216+ imgScopes = append (imgScopes , apicfgv1 .ImageScope (scope ))
218217 }
219- return & apicfgv1alpha1 .ClusterImagePolicy {
220- TypeMeta : metav1.TypeMeta {APIVersion : apicfgv1alpha1 .SchemeGroupVersion .String ()},
218+ return & apicfgv1 .ClusterImagePolicy {
219+ TypeMeta : metav1.TypeMeta {APIVersion : apicfgv1 .SchemeGroupVersion .String ()},
221220 ObjectMeta : metav1.ObjectMeta {Name : name , UID : types .UID (utilrand .String (5 )), Generation : 1 },
222- Spec : apicfgv1alpha1 .ClusterImagePolicySpec {
221+ Spec : apicfgv1 .ClusterImagePolicySpec {
223222 Scopes : imgScopes ,
224- Policy : apicfgv1alpha1 .Policy {
225- RootOfTrust : apicfgv1alpha1 .PolicyRootOfTrust {
226- PolicyType : apicfgv1alpha1 .PublicKeyRootOfTrust ,
227- PublicKey : & apicfgv1alpha1 .PublicKey {
223+ Policy : apicfgv1 .Policy {
224+ RootOfTrust : apicfgv1 .PolicyRootOfTrust {
225+ PolicyType : apicfgv1 .PublicKeyRootOfTrust ,
226+ PublicKey : & apicfgv1 .PublicKey {
228227 KeyData : keyData ,
229228 },
230229 },
@@ -233,20 +232,20 @@ func newClusterImagePolicyWithPublicKey(name string, scopes []string, keyData []
233232 }
234233}
235234
236- func newImagePolicyWithPublicKey (name , namespace string , scopes []string , keyData []byte ) * apicfgv1alpha1 .ImagePolicy {
237- imgScopes := []apicfgv1alpha1 .ImageScope {}
235+ func newImagePolicyWithPublicKey (name , namespace string , scopes []string , keyData []byte ) * apicfgv1 .ImagePolicy {
236+ imgScopes := []apicfgv1 .ImageScope {}
238237 for _ , scope := range scopes {
239- imgScopes = append (imgScopes , apicfgv1alpha1 .ImageScope (scope ))
238+ imgScopes = append (imgScopes , apicfgv1 .ImageScope (scope ))
240239 }
241- return & apicfgv1alpha1 .ImagePolicy {
242- TypeMeta : metav1.TypeMeta {APIVersion : apicfgv1alpha1 .SchemeGroupVersion .String ()},
240+ return & apicfgv1 .ImagePolicy {
241+ TypeMeta : metav1.TypeMeta {APIVersion : apicfgv1 .SchemeGroupVersion .String ()},
243242 ObjectMeta : metav1.ObjectMeta {Name : name , Namespace : namespace , UID : types .UID (utilrand .String (5 )), Generation : 1 },
244- Spec : apicfgv1alpha1 .ImagePolicySpec {
243+ Spec : apicfgv1 .ImagePolicySpec {
245244 Scopes : imgScopes ,
246- Policy : apicfgv1alpha1 .Policy {
247- RootOfTrust : apicfgv1alpha1 .PolicyRootOfTrust {
248- PolicyType : apicfgv1alpha1 .PublicKeyRootOfTrust ,
249- PublicKey : & apicfgv1alpha1 .PublicKey {
245+ Policy : apicfgv1 .Policy {
246+ RootOfTrust : apicfgv1 .PolicyRootOfTrust {
247+ PolicyType : apicfgv1 .PublicKeyRootOfTrust ,
248+ PublicKey : & apicfgv1 .PublicKey {
250249 KeyData : keyData ,
251250 },
252251 },
@@ -323,10 +322,10 @@ func (f *fixture) newController() *Controller {
323322 ci .Config ().V1 ().ImageTagMirrorSets ().Informer ().GetIndexer ().Add (c )
324323 }
325324 for _ , c := range f .clusterImagePolicyLister {
326- ci .Config ().V1alpha1 ().ClusterImagePolicies ().Informer ().GetIndexer ().Add (c )
325+ ci .Config ().V1 ().ClusterImagePolicies ().Informer ().GetIndexer ().Add (c )
327326 }
328327 for _ , c := range f .imagePolicyLister {
329- ci .Config ().V1alpha1 ().ImagePolicies ().Informer ().GetIndexer ().Add (c )
328+ ci .Config ().V1 ().ImagePolicies ().Informer ().GetIndexer ().Add (c )
330329 }
331330
332331 return c
@@ -473,7 +472,7 @@ type registriesConfigAndPolicyVerifyOptions struct {
473472 numberOfImagePolicyNamespaces int
474473}
475474
476- func (f * fixture ) verifyRegistriesConfigAndPolicyJSONContents (t * testing.T , mcName string , imgcfg * apicfgv1.Image , icsp * apioperatorsv1alpha1.ImageContentSourcePolicy , idms * apicfgv1.ImageDigestMirrorSet , itms * apicfgv1.ImageTagMirrorSet , clusterImagePolicy * apicfgv1alpha1 .ClusterImagePolicy , imagePolicy * apicfgv1alpha1 .ImagePolicy , releaseImageReg string , opts registriesConfigAndPolicyVerifyOptions ) {
475+ func (f * fixture ) verifyRegistriesConfigAndPolicyJSONContents (t * testing.T , mcName string , imgcfg * apicfgv1.Image , icsp * apioperatorsv1alpha1.ImageContentSourcePolicy , idms * apicfgv1.ImageDigestMirrorSet , itms * apicfgv1.ImageTagMirrorSet , clusterImagePolicy * apicfgv1 .ClusterImagePolicy , imagePolicy * apicfgv1 .ImagePolicy , releaseImageReg string , opts registriesConfigAndPolicyVerifyOptions ) {
477476 icsps := []* apioperatorsv1alpha1.ImageContentSourcePolicy {}
478477 if icsp != nil {
479478 icsps = append (icsps , icsp )
@@ -486,11 +485,11 @@ func (f *fixture) verifyRegistriesConfigAndPolicyJSONContents(t *testing.T, mcNa
486485 if itms != nil {
487486 itmss = append (itmss , itms )
488487 }
489- clusterImagePolicies := []* apicfgv1alpha1 .ClusterImagePolicy {}
488+ clusterImagePolicies := []* apicfgv1 .ClusterImagePolicy {}
490489 if clusterImagePolicy != nil {
491490 clusterImagePolicies = append (clusterImagePolicies , clusterImagePolicy )
492491 }
493- imagePolicies := []* apicfgv1alpha1 .ImagePolicy {}
492+ imagePolicies := []* apicfgv1 .ImagePolicy {}
494493 if imagePolicy != nil {
495494 imagePolicies = append (imagePolicies , imagePolicy )
496495 }
@@ -499,7 +498,7 @@ func (f *fixture) verifyRegistriesConfigAndPolicyJSONContents(t *testing.T, mcNa
499498 verifyRegistriesConfigAndPolicyJSONContents (t , updatedMC , mcName , imgcfg , icsps , idmss , itmss , clusterImagePolicies , imagePolicies , releaseImageReg , opts )
500499}
501500
502- func verifyRegistriesConfigAndPolicyJSONContents (t * testing.T , mc * mcfgv1.MachineConfig , mcName string , imgcfg * apicfgv1.Image , icsps []* apioperatorsv1alpha1.ImageContentSourcePolicy , idmss []* apicfgv1.ImageDigestMirrorSet , itmss []* apicfgv1.ImageTagMirrorSet , clusterImagePolicies []* apicfgv1alpha1 .ClusterImagePolicy , imagePolicies []* apicfgv1alpha1 .ImagePolicy , releaseImageReg string , opts registriesConfigAndPolicyVerifyOptions ) {
501+ func verifyRegistriesConfigAndPolicyJSONContents (t * testing.T , mc * mcfgv1.MachineConfig , mcName string , imgcfg * apicfgv1.Image , icsps []* apioperatorsv1alpha1.ImageContentSourcePolicy , idmss []* apicfgv1.ImageDigestMirrorSet , itmss []* apicfgv1.ImageTagMirrorSet , clusterImagePolicies []* apicfgv1 .ClusterImagePolicy , imagePolicies []* apicfgv1 .ImagePolicy , releaseImageReg string , opts registriesConfigAndPolicyVerifyOptions ) {
503502 // This is not testing updateRegistriesConfig, which has its own tests; this verifies the created object contains the expected
504503 // configuration file.
505504 // First get the valid blocked registries to ensure we don't block the registry where the release image is from
@@ -1237,8 +1236,8 @@ func TestRunImageBootstrap(t *testing.T) {
12371236 icspRules []* apioperatorsv1alpha1.ImageContentSourcePolicy
12381237 idmsRules []* apicfgv1.ImageDigestMirrorSet
12391238 itmsRules []* apicfgv1.ImageTagMirrorSet
1240- clusterImagePolicies []* apicfgv1alpha1 .ClusterImagePolicy
1241- imagePolicies []* apicfgv1alpha1 .ImagePolicy
1239+ clusterImagePolicies []* apicfgv1 .ClusterImagePolicy
1240+ imagePolicies []* apicfgv1 .ImagePolicy
12421241 imagePolicyNamespaces int
12431242 }{
12441243 {
@@ -1267,10 +1266,10 @@ func TestRunImageBootstrap(t *testing.T) {
12671266 },
12681267 },
12691268 {
1270- clusterImagePolicies : []* apicfgv1alpha1 .ClusterImagePolicy {
1269+ clusterImagePolicies : []* apicfgv1 .ClusterImagePolicy {
12711270 & testClusterImagePolicy ,
12721271 },
1273- imagePolicies : []* apicfgv1alpha1 .ImagePolicy {
1272+ imagePolicies : []* apicfgv1 .ImagePolicy {
12741273 & testImagePolicy ,
12751274 },
12761275 imagePolicyNamespaces : 1 ,
0 commit comments