@@ -2597,19 +2597,24 @@ var _ = Describe("Subscription", func() {
2597
2597
err = magicCatalog .UpdateCatalog (context .Background (), provider )
2598
2598
Expect (err ).To (BeNil ())
2599
2599
2600
- By ("waiting for the subscription to have v0.3.0 installed " )
2600
+ By ("waiting for the subscription to switch to v0.3.0" )
2601
2601
sub , err = fetchSubscription (crc , generatedNamespace .GetName (), subName , subscriptionHasCurrentCSV ("example-operator.v0.3.0" ))
2602
2602
Expect (err ).Should (BeNil ())
2603
2603
2604
- By ("waiting for the subscription to have v0.3.0 installed with a Package deprecated condition" )
2604
+ By ("waiting for the subscription to have be at latest known" )
2605
+ sub , err = fetchSubscription (crc , generatedNamespace .GetName (), subName , subscriptionStateAtLatestChecker ())
2606
+ Expect (err ).Should (BeNil ())
2607
+
2608
+ By ("waiting for the subscription to have v0.3.0 installed without a bundle deprecated condition" )
2605
2609
sub , err = fetchSubscription (crc , generatedNamespace .GetName (), subName ,
2606
2610
subscriptionHasCondition (
2607
- operatorsv1alpha1 .SubscriptionPackageDeprecated ,
2608
- corev1 .ConditionTrue ,
2611
+ operatorsv1alpha1 .SubscriptionInstallPlanPending ,
2612
+ corev1 .ConditionUnknown ,
2613
+ "" ,
2609
2614
"" ,
2610
- "olm.package/test-package: test-package has been deprecated. Please switch to another-package." ,
2611
2615
),
2612
2616
)
2617
+ Expect (err ).Should (BeNil ())
2613
2618
2614
2619
By ("checking for the deprecated conditions" )
2615
2620
By (`Operator is deprecated at only Package and Channel levels` )
@@ -2705,7 +2710,7 @@ var _ = Describe("Subscription", func() {
2705
2710
}
2706
2711
} else {
2707
2712
registryURL = fmt .Sprintf ("%s/%s" , openshiftregistryFQDN , generatedNamespace .GetName ())
2708
- registryAuth , err := openshiftRegistryAuth (c , generatedNamespace .GetName ())
2713
+ registryAuthSecretName , err := getRegistryAuthSecretName (c , generatedNamespace .GetName ())
2709
2714
Expect (err ).NotTo (HaveOccurred (), "error getting openshift registry authentication: %s" , err )
2710
2715
copyImage = func (dst , dstTag , src , srcTag string ) error {
2711
2716
if ! strings .HasPrefix (src , "docker://" ) {
@@ -2714,14 +2719,15 @@ var _ = Describe("Subscription", func() {
2714
2719
if ! strings .HasPrefix (dst , "docker://" ) {
2715
2720
dst = fmt .Sprintf ("docker://%s" , dst )
2716
2721
}
2717
- skopeoArgs := skopeoCopyCmd (dst , dstTag , src , srcTag , registryAuth )
2718
- err = createSkopeoPod (c , skopeoArgs , generatedNamespace .GetName ())
2722
+ skopeoArgs := skopeoCopyCmd (dst , dstTag , src , srcTag , registryAuthSecretName )
2723
+ err = createSkopeoPod (c , skopeoArgs , generatedNamespace .GetName (), registryAuthSecretName )
2719
2724
if err != nil {
2720
2725
return fmt .Errorf ("error creating skopeo pod: %v" , err )
2721
2726
}
2722
2727
2723
2728
By (`wait for skopeo pod to exit successfully` )
2724
2729
awaitPod (GinkgoT (), c , generatedNamespace .GetName (), skopeo , func (pod * corev1.Pod ) bool {
2730
+ ctx .Ctx ().Logf ("skopeo pod status: %s (waiting for: %s)" , pod .Status .Phase , corev1 .PodSucceeded )
2725
2731
return pod .Status .Phase == corev1 .PodSucceeded
2726
2732
})
2727
2733
@@ -3609,12 +3615,6 @@ func updateInternalCatalog(t GinkgoTInterface, c operatorclient.ClientInterface,
3609
3615
require .NoError (t , err )
3610
3616
}
3611
3617
3612
- func updateCatSrcPriority (crClient versioned.Interface , namespace string , catsrc * operatorsv1alpha1.CatalogSource , priority int ) {
3613
- catsrc .Spec .Priority = priority
3614
- _ , err := crClient .OperatorsV1alpha1 ().CatalogSources (namespace ).Update (context .Background (), catsrc , metav1.UpdateOptions {})
3615
- Expect (err ).Should (BeNil ())
3616
- }
3617
-
3618
3618
func subscriptionCurrentCSVGetter (crclient versioned.Interface , namespace , subName string ) func () string {
3619
3619
return func () string {
3620
3620
subscription , err := crclient .OperatorsV1alpha1 ().Subscriptions (namespace ).Get (context .Background (), subName , metav1.GetOptions {})
@@ -3624,15 +3624,3 @@ func subscriptionCurrentCSVGetter(crclient versioned.Interface, namespace, subNa
3624
3624
return subscription .Status .CurrentCSV
3625
3625
}
3626
3626
}
3627
-
3628
- func operatorGroupServiceAccountNameSetter (crclient versioned.Interface , namespace , name , saName string ) func () error {
3629
- return func () error {
3630
- toUpdate , err := crclient .OperatorsV1 ().OperatorGroups (namespace ).Get (context .Background (), name , metav1.GetOptions {})
3631
- if err != nil {
3632
- return err
3633
- }
3634
- toUpdate .Spec .ServiceAccountName = saName
3635
- _ , err = crclient .OperatorsV1 ().OperatorGroups (namespace ).Update (context .Background (), toUpdate , metav1.UpdateOptions {})
3636
- return err
3637
- }
3638
- }
0 commit comments