8000 Backup: the operator runs backups and restores itself through SQL on clickhouse-backup sidecars, multi-period schedules by Slach · Pull Request #2148 · Altinity/clickhouse-operator · GitHub
[go: up one dir, main page]

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1a29fa0
Backup: the operator runs backups and restores itself through SQL on …
Slach Nov 24, 2026
7faf17c
Backup: typed run plan, operation and step instead of strings
Slach Nov 27, 2026
f1195c8
Backup: keep the run plan schema open in the CRD
Slach Nov 27, 2026
3036d3f
Backup: clear names for the orchestrator state
Slach Nov 27, 2026
3b86629
Backup: drop the own-storage name check of a restore from another ins…
Slach Nov 27, 2026
42648b2
Backup: one schedule time, review cleanups
Slach Nov 27, 2026
2bf98e6
Local build and e2e fixes, also proposed separately
Slach Nov 27, 2026
da288a8
e2e: wait 30s for the FIPS binary HTTP port, docker run is in the wait
Slach Nov 27, 2026
73c7941
e2e: run the FIPS binary container as the current user
Slach Nov 27, 2026
4bcdf41
CRD: plain descriptions of the schedule lastScheduleTime fields
Slach Nov 28, 2026
f835d2e
Backup: say scheduled time instead of due time and slot
Slach Nov 28, 2026
95d533b
e2e: test_010088 schedules run once a month
Slach Nov 28, 2026
ac3af17
Backup: split pkg/model/chbackup/builder.go into naming.go and recove…
Slach Nov 28, 2026
ddfe706
small code simplified
Slach Nov 28, 2026
ac74dd9
Backup: drop the failf, logf and warnf wrappers of the orchestrator
Slach Nov 28, 2026
fb6f8fb
Backup: rename target.go to backup_target.go, type target to backupTa…
Slach Nov 28, 2026
11dfc61
Backup: the orchestrator runs its SQL itself, linear backup and restore
Slach Nov 28, 2026
615df8a
Backup: check the storage path error before its result, split dropSou…
Slach Nov 28, 2026
0dd2c2b
Backup tests: the fake is fakeClickHouse in ch, as the orchestrator f…
Slach Nov 28, 2026
6d6de3d
Backup: restoreHosts after restore, runAll signature on its own lines
Slach Nov 28, 2026
b7afd01
Backup: typed ClickHouse time and numbers, kill next to the other com…
Slach Nov 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.git
dev/bin/
dev/log/
docs/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:

echo "${DOCKER_PASS}" | docker login -u $DOCKER_USER --password-stdin docker.io
echo "Building operator image with SBOM + provenance + metadata capture"
docker buildx build --progress plain --platform=linux/amd64,linux/arm64 -f dockerfile/operator/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GOFIPS140=${GOFIPS140} --build-arg GODEBUG_FIPS140=${GODEBUG_FIPS140} -t docker.io/${DOCKER_ORG}/clickhouse-operator:${CHO_RELEASE} --sbom=true --provenance=mode=max --metadata-file operator-build-metadata.json --pull --push .
docker buildx build --progress plain --platform=linux/amd64,linux/arm64 -f dockerfile/operator/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_SHA=$(git rev-parse --short HEAD) --build-arg GOFIPS140=${GOFIPS140} --build-arg GODEBUG_FIPS140=${GODEBUG_FIPS140} -t docker.io/${DOCKER_ORG}/clickhouse-operator:${CHO_RELEASE} --sbom=true --provenance=mode=max --metadata-file operator-build-metadata.json --pull --push .
echo "Building metrics-exporter image with SBOM + provenance + metadata capture"
docker buildx build --progress plain --platform=linux/amd64,linux/arm64 -f dockerfile/metrics-exporter/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GOFIPS140=${GOFIPS140} --build-arg GODEBUG_FIPS140=${GODEBUG_FIPS140} -t docker.io/${DOCKER_ORG}/metrics-exporter:${CHO_RELEASE} --sbom=true --provenance=mode=max --metadata-file metrics-exporter-build-metadata.json --pull --push .
docker buildx build --progress plain --platform=linux/amd64,linux/arm64 -f dockerfile/metrics-exporter/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_SHA=$(git rev-parse --short HEAD) --build-arg GOFIPS140=${GOFIPS140} --build-arg GODEBUG_FIPS140=${GODEBUG_FIPS140} -t docker.io/${DOCKER_ORG}/metrics-exporter:${CHO_RELEASE} --sbom=true --provenance=mode=max --metadata-file metrics-exporter-build-metadata.json --pull --push .
- name: Install syft (SBOM tool) if missing
run: |
set -euo pipefail
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ jobs:

echo "${DOCKER_PASS}" | docker login -u $DOCKER_USER --password-stdin docker.io
echo "Building operator image with SBOM + provenance + metadata capture"
docker buildx build --progress plain --platform=linux/amd64,linux/arm64 -f dockerfile/operator/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GOFIPS140=${GOFIPS140} --build-arg GODEBUG_FIPS140=${GODEBUG_FIPS140} -t docker.io/${DOCKER_ORG}/clickhouse-operator:${CHO_RELEASE} --sbom=true --provenance=mode=max --metadata-file operator-build-metadata.json --pull --push .
docker buildx build --progress plain --platform=linux/amd64,linux/arm64 -f dockerfile/operator/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_SHA=$(git rev-parse --short HEAD) --build-arg GOFIPS140=${GOFIPS140} --build-arg GODEBUG_FIPS140=${GODEBUG_FIPS140} -t docker.io/${DOCKER_ORG}/clickhouse-operator:${CHO_RELEASE} --sbom=true --provenance=mode=max --metadata-file operator-build-metadata.json --pull --push .
echo "Building metrics-exporter image with SBOM + provenance + metadata capture"
docker buildx build --progress plain --platform=linux/amd64,linux/arm64 -f dockerfile/metrics-exporter/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GOFIPS140=${GOFIPS140} --build-arg GODEBUG_FIPS140=${GODEBUG_FIPS140} -t docker.io/${DOCKER_ORG}/metrics-exporter:${CHO_RELEASE} --sbom=true --provenance=mode=max --metadata-file metrics-exporter-build-metadata.json --pull --push .
docker buildx build --progress plain --platform=linux/amd64,linux/arm64 -f dockerfile/metrics-exporter/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_SHA=$(git rev-parse --short HEAD) --build-arg GOFIPS140=${GOFIPS140} --build-arg GODEBUG_FIPS140=${GODEBUG_FIPS140} -t docker.io/${DOCKER_ORG}/metrics-exporter:${CHO_RELEASE} --sbom=true --provenance=mode=max --metadata-file metrics-exporter-build-metadata.json --pull --push .
- name: Install syft (SBOM tool) if missing
run: |
set -euo pipefail
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check_helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
export GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
export GOFIPS140=v1.0.0

docker build -f dockerfile/operator/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GOFIPS140=${GOFIPS140} -t altinity/clickhouse-operator:${CHO_RELEASE} --pull .
docker build -f dockerfile/metrics-exporter/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GOFIPS140=${GOFIPS140} -t altinity/metrics-exporter:${CHO_RELEASE} --pull .
docker build -f dockerfile/operator/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_SHA=$(git rev-parse --short HEAD) --build-arg GOFIPS140=${GOFIPS140} -t altinity/clickhouse-operator:${CHO_RELEASE} --pull .
docker build -f dockerfile/metrics-exporter/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_SHA=$(git rev-parse --short HEAD) --build-arg GOFIPS140=${GOFIPS140} -t altinity/metrics-exporter:${CHO_RELEASE} --pull .

docker image save altinity/clickhouse-operator:${CHO_RELEASE} -o operator.tar
docker image save altinity/metrics-exporter:${CHO_RELEASE} -o metrics-exporter.tar
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
test "$(docker info -f '{{.DockerRootDir}}')" = "/mnt/docker"
df -h /mnt /

- uses: actions/setup-python@v5
- uses: actions/setup-python@v7
id: setup-python
with:
python-version: '3.12'
Expand Down Expand Up @@ -129,8 +129,8 @@ jobs:
echo "current release=$CHO_RELEASE"
echo "current go version=$GO_VERSION"

docker build -f dockerfile/operator/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GOFIPS140=${GOFIPS140} -t altinity/clickhouse-operator:${CHO_RELEASE} --pull .
docker build -f dockerfile/metrics-exporter/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GOFIPS140=${GOFIPS140} -t altinity/metrics-exporter:${CHO_RELEASE} --pull .
docker build -f dockerfile/operator/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_SHA=$(git rev-parse --short HEAD) --build-arg GOFIPS140=${GOFIPS140} -t altinity/clickhouse-operator:${CHO_RELEASE} --pull .
docker build -f dockerfile/metrics-exporter/Dockerfile --build-arg GO_VERSION=${GO_VERSION} --build-arg GIT_SHA=$(git rev-parse --short HEAD) --build-arg GOFIPS140=${GOFIPS140} -t altinity/metrics-exporter:${CHO_RELEASE} --pull .

docker image save altinity/clickhouse-operator:${CHO_RELEASE} -o operator.tar
docker image save altinity/metrics-exporter:${CHO_RELEASE} -o metrics-exporter.tar
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* **EXPERIMENTAL: Operator-managed backup and restore.** Added `ClickHouseBackup`, `ClickHouseBackupSchedule`, and `ClickHouseRestore` resources using `clickhouse-backup`. Supports per-cluster backups and restores, scheduled backups, retention, configurable storage paths, and cross-installation restores. Enable with `spec.backup.enabled: "yes"` and configure storage using `backup.configSecretRef`, referencing a Kubernetes Secret containing `config.yml`. Storage configuration changes can be applied without restarting backup sidecars. See [backup documentation](docs/backup.md). by [@discostur](https://github.com/discostur), [@sunsingerus](https://github.com/sunsingerus), and [@Slach](https://github.com/Slach) in [#2015](https://github.com/Altinity/clickhouse-operator/pull/2015) and [#2118](https://github.com/Altinity/clickhouse-operator/pull/2118). Related [#1795](https://github.com/Altinity/clickhouse-operator/issues/1795), [#862](https://github.com/Altinity/clickhouse-operator/issues/862)
* **EXPERIMENTAL: Operator-managed backup and restore.** Added `ClickHouseBackup`, `ClickHouseBackupSchedule`, and `ClickHouseRestore` resources using `clickhouse-backup`. Supports per-cluster backups and restores, scheduled backups, retention, configurable storage paths, and cross-installation restores. Enable with `spec.backup.enabled: "yes"` and set `backup.storageConfig.valueFrom.secretKeyRef` to the key of a Kubernetes Secret with the `clickhouse-backup` configuration. Storage configuration changes can be applied without restarting backup sidecars. See [backup documentation](docs/backup.md). by [@discostur](https://github.com/discostur), [@sunsingerus](https://github.com/sunsingerus), and [@Slach](https://github.com/Slach) in [#2015](https://github.com/Altinity/clickhouse-operator/pull/2015) and [#2118](https://github.com/Altinity/clickhouse-operator/pull/2118). Related [#1795](https://github.com/Altinity/clickhouse-operator/issues/1795), [#862](https://github.com/Altinity/clickhouse-operator/issues/862)

* **Hot-reload ClickHouse user passwords from Kubernetes Secrets.** Set `valueFrom.hotReload: true` on `password`, `password_sha256_hex`, or `password_double_sha1_hex` to rotate credentials without restarting Pods. Enabling requires a one-time rollout; automatic Secret-change detection applies to references declared directly in the CHI. See [documentation](docs/security_hardening.md#rotating-user-passwords-without-pod-restarts).

Expand Down
9 changes: 6 additions & 3 deletions cmd/operator/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ func launchBackup(ctx context.Context, wg *sync.WaitGroup) {
go func() {
defer wg.Done()

if err := initWithRetry(ctx, backupComponent, newBackupInitializer()); err != nil {
initializer := newBackupInitializer()
if err := initWithRetry(ctx, backupComponent, initializer); err != nil {
if util.IsContextDone(ctx) {
log.Warning("Starting backup ABORTED - shutting down, err: %v", err)
return
Expand All @@ -179,8 +180,10 @@ func launchBackup(ctx context.Context, wg *sync.WaitGroup) {
}

log.Info("Starting backup")
if err := runBackup(ctx); err != nil {
log.Warning("Starting backup FAILED with err: %v", err)
// A manager that loses the Lease is built again and rejoins the election
if err := runBackup(ctx, initializer); err != nil {
log.Warning("Starting backup FAILED - backup reconciliation is DISABLED for the lifetime of this process, "+
"err: %v", err)
}
}()
}
Expand Down
109 changes: 82 additions & 27 deletions cmd/operator/app/thread_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (

"github.com/go-logr/logr"

batch "k8s.io/api/batch/v1"
apiErrors "k8s.io/apimachinery/pkg/api/errors"
apiMachineryRuntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/discovery"
clientGoScheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
Expand All @@ -35,14 +35,15 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
ctrlManager "sigs.k8s.io/controller-runtime/pkg/manager"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/source"

log "github.com/altinity/clickhouse-operator/pkg/announcer"
api "github.com/altinity/clickhouse-operator/pkg/apis/clickhouse.altinity.com/v1"
"github.com/altinity/clickhouse-operator/pkg/apis/deployment"
"github.com/altinity/clickhouse-operator/pkg/chop"
controller "github.com/altinity/clickhouse-operator/pkg/controller/chbackup"
chiKube "github.com/altinity/clickhouse-operator/pkg/controller/chi/kube"
"github.com/altinity/clickhouse-operator/pkg/interfaces"
"github.com/altinity/clickhouse-operator/pkg/model/chbackup"
"github.com/altinity/clickhouse-operator/pkg/util"
)

Expand Down Expand Up @@ -117,32 +118,42 @@ func missingBackupKinds(discovery discovery.DiscoveryInterface) ([]string, error
return missing, nil
}

// newBackupCacheOptions builds the backup manager cache config. Jobs and CronJobs are narrowed to
// the ones the backup controllers build; without that, the cache would hold every Job and CronJob
// in the watched namespaces. The custom resources and installations stay unfiltered: they are
// user-authored and carry no operator label. Installations are trimmed instead, to the metadata
// and status the watches need.
// Custom resources and installations are not filtered by label, because users create them without operator labels.
//
// log is a parameter rather than the package-level logger because a logr zero value discards Info
// silently, so reading that var would let this line vanish if the sole call site ever moved.
func newBackupCacheOptions(log logr.Logger, cacheNamespaces []string) cache.Options {
selector := chbackup.JobSelector()
byObject := map[client.Object]cache.ByObject{
&batch.Job{}: {Label: selector},
&batch.CronJob{}: {Label: selector},
&api.ClickHouseInstallation{}: {Transform: controller.TrimInstallation},
}

// A wrong selector fails silently - the cache just stays empty - so the effective one goes in
// the boot log.
log.Info("init backup - cache label selector", "selector", selector.String(), "types", len(byObject))
log.Info("init backup - cache", "types", len(byObject))

return cache.Options{
DefaultNamespaces: newCacheNamespaces(cacheNamespaces),
ByObject: byObject,
}
}

const backupLeaderElectionID = "clickhouse-operator-backup"

// Leader election keeps two operators from running the same backup. Outside a pod there is no namespace, so no election.
func newBackupManagerOptions(log logr.Logger) ctrlRuntime.Options {
options := ctrlRuntime.Options{
Scheme: backupScheme,
Cache: newBackupCacheOptions(log, chop.Config().GetCacheNamespaces()),
// pkg/metrics/operator serves the operator metrics, so the controller-runtime listener is off
Metrics: metricsserver.Options{BindAddress: "0"},
}
if namespace, ok := chop.GetRuntimeParam(deployment.OPERATOR_POD_NAMESPACE); ok && (namespace != "") {
options.LeaderElection = true
options.LeaderElectionID = backupLeaderElectionID
options.LeaderElectionNamespace = namespace
options.LeaderElectionReleaseOnCancel = true
}
log.Info("init backup - leader election", "enabled", options.LeaderElection, "namespace", options.LeaderElectionNamespace)
return options
}

// newBackupInitializer resolves the clients that must be built exactly once, then returns the
// step that is safe to retry: it waits for the backup CRDs to be served and builds the manager.
//
Expand Down Expand Up @@ -186,13 +197,7 @@ func initBackup(ctx context.Context, cr interfaces.IKubeCR) error {
return err
}

backupManager, err = ctrlRuntime.NewManager(restConfig, ctrlRuntime.Options{
Scheme: backupScheme,
Cache: newBackupCacheOptions(backupLogger, chop.Config().GetCacheNamespaces()),
// Disable controller-runtime's built-in metrics listener: operator metrics, backup
// metrics included, are served by pkg/metrics/operator on the operator's own endpoint.
Metrics: metricsserver.Options{BindAddress: "0"},
})
backupManager, err = ctrlRuntime.NewManager(restConfig, newBackupManagerOptions(backupLogger))
if err != nil {
// Not terminal: building the manager depends on the API server.
backupLogger.Error(err, "init backup - unable to ctrlRuntime.NewManager")
Expand All @@ -206,6 +211,11 @@ func initBackup(ctx context.Context, cr interfaces.IKubeCR) error {
return fmt.Errorf("%w: %w", errInitTerminal, err)
}

// Backup runs stop when the manager loses leadership
if err = backupManager.Add(controller.Runs()); err != nil {
return fmt.Errorf("%w: %w", errInitTerminal, err)
}

// Logged by the manager itself once it runs its controllers, rather than after Start returns,
// which happens only at shutdown.
if err = backupManager.Add(ctrlManager.RunnableFunc(func(context.Context) error {
Expand All @@ -224,10 +234,13 @@ func initBackup(ctx context.Context, cr interfaces.IKubeCR) error {
func setupBackupControllers(manager ctrlRuntime.Manager, cr interfaces.IKubeCR) error {
c, apiReader, scheme := manager.GetClient(), manager.GetAPIReader(), manager.GetScheme()

runs := func(kind string) source.Source {
return source.Channel(controller.Runs().Notifications(kind), &handler.EnqueueRequestForObject{})
}
if err := ctrlRuntime.
NewControllerManagedBy(manager).
For(&api.ClickHouseBackup{}).
Owns(&batch.Job{}).
WatchesRawSource(runs(api.ClickHouseBackupCRDResourceKind)).
WithEventFilter(controller.WatchedNamespacePredicate()).
Complete(controller.NewBackupController(c, apiReader, scheme, cr)); err != nil {
return err
Expand All @@ -237,14 +250,17 @@ func setupBackupControllers(manager ctrlRuntime.Manager, cr interfaces.IKubeCR)
if err := ctrlRuntime.
NewControllerManagedBy(manager).
For(&api.ClickHouseBackupSchedule{}).
Owns(&batch.CronJob{}).
WatchesRawSource(runs(api.ClickHouseBackupScheduleCRDResourceKind)).
Watches(
&api.ClickHouseInstallation{},
handler.EnqueueRequestsFromMapFunc(schedule.SchedulesForCHI),
builder.WithPredicates(controller.CHITopologyPredicate()),
).
Watches(&api.ClickHouseRestore{}, handler.EnqueueRequestsFromMapFunc(schedule.SchedulesForRestore)).
Watches(&batch.Job{}, handler.EnqueueRequestsFromMapFunc(schedule.SchedulesForJob)).
Watches(
&api.ClickHouseRestore{},
handler.EnqueueRequestsFromMapFunc(schedule.SchedulesForRestore),
builder.WithPredicates(controller.RestoreHoldPredicate()),
).
WithEventFilter(controller.WatchedNamespacePredicate()).
Complete(schedule); err != nil {
return err
Expand All @@ -253,7 +269,7 @@ func setupBackupControllers(manager ctrlRuntime.Manager, cr interfaces.IKubeCR)
if err := ctrlRuntime.
NewControllerManagedBy(manager).
For(&api.ClickHouseRestore{}).
Owns(&batch.Job{}).
WatchesRawSource(runs(api.ClickHouseRestoreCRDResourceKind)).
WithEventFilter(controller.WatchedNamespacePredicate()).
Complete(controller.NewRestoreController(c, apiReader, scheme, cr)); err != nil {
return err
Expand All @@ -270,11 +286,50 @@ func setupBackupControllers(manager ctrlRuntime.Manager, cr interfaces.IKubeCR)
Complete(controller.NewRecoveryController(c, apiReader, scheme, cr))
}

func runBackup(ctx context.Context) error {
var backupRestartBackoff = wait.Backoff{
Duration: time.Second,
Factor: 2.0,
Jitter: 0.1,
Cap: time.Minute,
// Steps only limits the doubling, as in initRetryBackoff
Steps: 7,
}

// A manager cannot start twice, so after a lost Lease runBackup builds a new one. The next leader resumes runs from status.
func runBackup(ctx context.Context, rebuild func(context.Context) error) error {
return serveBackup(ctx, startBackupManager, rebuild, backupRestartBackoff)
}

func startBackupManager(ctx context.Context) error {
if err := backupManager.Start(ctx); err != nil {
backupLogger.Error(err, "run backup - unable to backupManager.Start")
return err
}
// Run successful
return nil
}

// A manager that ran longer than the backoff cap resets the backoff.
func serveBackup(ctx context.Context, start, rebuild func(context.Context) error, backoff wait.Backoff) error {
for {
started := time.Now()
err := start(ctx)
if util.IsContextDone(ctx) {
return nil
}
log.Warning("backup controllers stopped, the leader election is entered again, err: %v", err)

if time.Since(started) > backoff.Cap {
backoff.Steps, backoff.Duration = backupRestartBackoff.Steps, backupRestartBackoff.Duration
}
if util.WaitContextDoneOrTimeout(ctx, backoff.Step()) {
return nil
}
if err := initWithRetry(ctx, backupComponent, rebuild); err != nil {
if util.IsContextDone(ctx) {
return nil
}
return err
}
}
}
Loading
0