@@ -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
@@ -3627,12 +3633,6 @@ func updateInternalCatalog(t GinkgoTInterface, c operatorclient.ClientInterface,
3627
3633
require .NoError (t , err )
3628
3634
}
3629
3635
3630
- func updateCatSrcPriority (crClient versioned.Interface , namespace string , catsrc * operatorsv1alpha1.CatalogSource , priority int ) {
3631
- catsrc .Spec .Priority = priority
3632
- _ , err := crClient .OperatorsV1alpha1 ().CatalogSources (namespace ).Update (context .Background (), catsrc , metav1.UpdateOptions {})
3633
- Expect (err ).Should (BeNil ())
3634
- }
3635
-
3636
3636
func subscriptionCurrentCSVGetter (crclient versioned.Interface , namespace , subName string ) func () string {
3637
3637
return func () string {
3638
3638
subscription , err := crclient .OperatorsV1alpha1 ().Subscriptions (namespace ).Get (context .Background (), subName , metav1.GetOptions {})
@@ -3642,15 +3642,3 @@ func subscriptionCurrentCSVGetter(crclient versioned.Interface, namespace, subNa
3642
3642
return subscription .Status .CurrentCSV
3643
3643
}
3644
3644
}
3645
-
3646
- func operatorGroupServiceAccountNameSetter (crclient versioned.Interface , namespace , name , saName string ) func () error {
3647
- return func () error {
3648
- toUpdate , err := crclient .OperatorsV1 ().OperatorGroups (namespace ).Get (context .Background (), name , metav1.GetOptions {})
3649
- if err != nil {
3650
- return err
3651
- }
3652
- toUpdate .Spec .ServiceAccountName = saName
3653
- _ , err = crclient .OperatorsV1 ().OperatorGroups (namespace ).Update (context .Background (), toUpdate , metav1.UpdateOptions {})
3654
- return err
3655
- }
3656
- }
0 commit comments