Skip to content

Commit 8ced187

Browse files
committed
test only changes
1 parent 0365165 commit 8ced187

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

pkg/cvo/internal/operatorstatus.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,18 @@ func waitForOperatorStatusToBeDone(ctx context.Context, interval time.Duration,
206206
case resourcebuilder.InitializingMode:
207207
// during initialization we allow degraded as long as the component goes available
208208
if available && (!progressing || len(expected.Status.Versions) > 0) {
209-
return true, nil
209+
if expected.Name != "machine-config" && expected.Name != "openshift-apiserver" {
210+
return true, nil
211+
}
210212
}
211213
default:
212214
// if we're at the correct version, and available, and not degraded, we are done
213215
// if we're available, not degraded, and not progressing, we're also done
214216
// TODO: remove progressing once all cluster operators report expected versions
215217
if available && (!progressing || len(expected.Status.Versions) > 0) && !degraded {
216-
return true, nil
218+
if expected.Name != "machine-config" && expected.Name != "openshift-apiserver" {
219+
return true, nil
220+
}
217221
}
218222
}
219223

@@ -235,12 +239,16 @@ func waitForOperatorStatusToBeDone(ctx context.Context, interval time.Duration,
235239
Message: message,
236240
Name: actual.Name,
237241
}
238-
return false, nil
242+
if expected.Name != "machine-config" && expected.Name != "openshift-apiserver" {
243+
return false, nil
244+
}
239245
}
240246
}
241247

242248
updateEffect := payload.UpdateEffectFail
243-
if available {
249+
if available && expected.Name == "openshift-apiserver" {
250+
updateEffect = payload.UpdateEffectFailAfterInterval
251+
} else if available && expected.Name != "machine-config" {
244252
updateEffect = payload.UpdateEffectFailAfterInterval
245253
}
246254
lastErr = &payload.UpdateError{

pkg/cvo/status.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ func (optr *Operator) syncStatus(ctx context.Context, original, config *configv1
273273
Message: fmt.Sprintf("Error while reconciling %s: %s", version, msg),
274274
LastTransitionTime: now,
275275
})
276+
klog.Infof("!!!! %s", fmt.Sprintf("Error while reconciling %s: %s", version, msg))
276277
} else {
277278
resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{
278279
Type: configv1.OperatorProgressing,
@@ -281,6 +282,7 @@ func (optr *Operator) syncStatus(ctx context.Context, original, config *configv1
281282
Message: fmt.Sprintf("Unable to apply %s: %s", version, msg),
282283
LastTransitionTime: now,
283284
})
285+
klog.Infof("!!!! %s", fmt.Sprintf("Unable to apply %s: %s", version, msg))
284286
}
285287

286288
} else {
@@ -331,6 +333,7 @@ func (optr *Operator) syncStatus(ctx context.Context, original, config *configv1
331333
Message: message,
332334
LastTransitionTime: now,
333335
})
336+
klog.Infof("!!!! %s", message)
334337
}
335338
}
336339

@@ -357,33 +360,44 @@ func (optr *Operator) syncStatus(ctx context.Context, original, config *configv1
357360
// its last update to go ready, or an hour has elapsed since the update began, before the condition is ignored.
358361
func convertErrorToProgressing(history []configv1.UpdateHistory, now time.Time, status *SyncWorkerStatus) (reason string, message string, ok bool) {
359362
if len(history) == 0 || status.Failure == nil || status.Reconciling {
363+
klog.Infof("!!!! 1")
360364
return "", "", false
361365
}
362366
uErr, ok := status.Failure.(*payload.UpdateError)
363367
if !ok {
368+
klog.Infof("!!!! 2")
364369
return "", "", false
365370
}
366371
if uErr.Reason == "ClusterOperatorNotAvailable" || uErr.Reason == "ClusterOperatorsNotAvailable" {
367372
switch uErr.UpdateEffect {
368373
case payload.UpdateEffectNone:
374+
klog.Infof("!!!! 3")
369375
return uErr.Reason, fmt.Sprintf("waiting on %s", uErr.Name), true
370376
case payload.UpdateEffectFail:
377+
klog.Infof("!!!! 4")
371378
return "", "", false
372379
case payload.UpdateEffectFailAfterInterval:
373380
var exceeded []string
374-
threshold := now.Add(-(40 * time.Minute))
381+
//threshold := now.Add(-(40 * time.Minute))
382+
threshold := now.Add(-(20 * time.Minute))
375383
for _, name := range strings.Split(uErr.Name, ", ") {
376384
if payload.COUpdateStartTimesGet(name).Before(threshold) {
385+
klog.Infof("!!!! exceeded=%s", name)
377386
exceeded = append(exceeded, name)
378387
}
379388
}
380389
if len(exceeded) > 0 {
381-
return uErr.Reason, fmt.Sprintf("wait has exceeded 40 minutes for these operators: %s", strings.Join(exceeded, ", ")), false
390+
klog.Infof("!!!! 5")
391+
//return uErr.Reason, fmt.Sprintf("wait has exceeded 40 minutes for these operators: %s", strings.Join(exceeded, ", ")), false
392+
return uErr.Reason, fmt.Sprintf("wait has exceeded 20 minutes for these operators: %s", strings.Join(exceeded, ", ")), false
382393
} else {
383-
return uErr.Reason, fmt.Sprintf("waiting up to 40 minutes on %s", uErr.Name), true
394+
klog.Infof("!!!! 6")
395+
//return uErr.Reason, fmt.Sprintf("waiting up to 40 minutes on %s", uErr.Name), true
396+
return uErr.Reason, fmt.Sprintf("waiting up to 20 minutes on %s", uErr.Name), true
384397
}
385398
}
386399
}
400+
klog.Infof("!!!! 7")
387401
return "", "", false
388402
}
389403

0 commit comments

Comments
 (0)