@@ -3081,7 +3081,6 @@ func subscriptionHasCondition(condType operatorsv1alpha1.SubscriptionConditionTy
3081
3081
3082
3082
func fetchSubscription (crc versioned.Interface , namespace , name string , checker subscriptionStateChecker ) (* operatorsv1alpha1.Subscription , error ) {
3083
3083
var fetchedSubscription * operatorsv1alpha1.Subscription
3084
- var err error
3085
3084
3086
3085
log := func (s string ) {
3087
3086
ctx .Ctx ().Logf ("%s: %s" , time .Now ().Format ("15:04:05.9999" ), s )
@@ -3091,10 +3090,12 @@ func fetchSubscription(crc versioned.Interface, namespace, name string, checker
3091
3090
var lastCSV string
3092
3091
var lastInstallPlanRef * corev1.ObjectReference
3093
3092
3094
- err = wait .Poll (pollInterval , pollDuration , func () (bool , error ) {
3093
+ err := wait .Poll (pollInterval , pollDuration , func () (bool , error ) {
3094
+ var err error
3095
3095
fetchedSubscription , err = crc .OperatorsV1alpha1 ().Subscriptions (namespace ).Get (context .Background (), name , metav1.GetOptions {})
3096
3096
if err != nil || fetchedSubscription == nil {
3097
- return false , err
3097
+ log (fmt .Sprintf ("error getting subscription %s/%s: %v" , namespace , name , err ))
3098
+ return false , nil
3098
3099
}
3099
3100
thisState , thisCSV , thisInstallPlanRef := fetchedSubscription .Status .State , fetchedSubscription .Status .CurrentCSV , fetchedSubscription .Status .InstallPlanRef
3100
3101
if thisState != lastState || thisCSV != lastCSV || ! equality .Semantic .DeepEqual (thisInstallPlanRef , lastInstallPlanRef ) {
@@ -3104,10 +3105,11 @@ func fetchSubscription(crc versioned.Interface, namespace, name string, checker
3104
3105
return checker (fetchedSubscription ), nil
3105
3106
})
3106
3107
if err != nil {
3107
- log (fmt .Sprintf ("never got correct status: %#v" , fetchedSubscription .Status ))
3108
- log (fmt .Sprintf ("subscription spec: %#v" , fetchedSubscription .Spec ))
3108
+ log (fmt .Sprintf ("subscription %s/%s never got correct status: %#v" , namespace , name , fetchedSubscription .Status ))
3109
+ log (fmt .Sprintf ("subscription %s/%s spec: %#v" , namespace , name , fetchedSubscription .Spec ))
3110
+ return nil , err
3109
3111
}
3110
- return fetchedSubscription , err
3112
+ return fetchedSubscription , nil
3111
3113
}
3112
3114
3113
3115
func buildSubscriptionCleanupFunc (crc versioned.Interface , subscription * operatorsv1alpha1.Subscription ) cleanupFunc {
0 commit comments