mirror of
https://github.com/stakater/Reloader.git
synced 2026-05-17 14:16:39 +00:00
fix: empty slices instead of nil return
This commit is contained in:
@@ -100,8 +100,9 @@ var _ = Describe("Pause Period Tests", func() {
|
||||
Expect(paused).To(BeFalse(), "Deployment should NOT have paused-at annotation without pause-period")
|
||||
})
|
||||
|
||||
// TODO: Reloader currently only reads pause-period from deployment metadata, not pod template.
|
||||
// This test documents the expected behavior but needs Reloader code changes to pass.
|
||||
// FUTURE: Reloader currently only reads pause-period from deployment metadata, not pod template.
|
||||
// This test is pending (skipped) and documents the expected future behavior.
|
||||
// Requires Reloader code changes to support reading pause-period from pod template annotations.
|
||||
PIt("should pause Deployment when pause-period annotation is on pod template", func() {
|
||||
By("Creating a ConfigMap")
|
||||
_, err := utils.CreateConfigMap(ctx, kubeClient, testNamespace, configMapName,
|
||||
|
||||
@@ -23,6 +23,9 @@ const (
|
||||
// ErrWatchTimeout is returned when a watch times out waiting for condition.
|
||||
var ErrWatchTimeout = errors.New("watch timeout waiting for condition")
|
||||
|
||||
// ErrWatchError is returned when the watch receives an error event from the API server.
|
||||
var ErrWatchError = errors.New("watch received error event from API server")
|
||||
|
||||
// ErrUnsupportedOperation is returned when an operation is not supported for a workload type.
|
||||
var ErrUnsupportedOperation = errors.New("operation not supported for this workload type")
|
||||
|
||||
@@ -109,7 +112,7 @@ func watchOnce[T runtime.Object](
|
||||
case watch.Deleted:
|
||||
continue
|
||||
case watch.Error:
|
||||
return zero, false, nil
|
||||
return zero, false, ErrWatchError
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,7 +175,7 @@ func watchDeleteOnce(
|
||||
return true, nil
|
||||
}
|
||||
if event.Type == watch.Error {
|
||||
return false, nil
|
||||
return false, ErrWatchError
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user