-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable Kopia Maintenance Interval #8581
base: main
Are you sure you want to change the base?
Conversation
6e3d09f
to
569c2ef
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8581 +/- ##
==========================================
+ Coverage 59.18% 59.37% +0.18%
==========================================
Files 370 370
Lines 39595 40004 +409
==========================================
+ Hits 23434 23752 +318
- Misses 14679 14756 +77
- Partials 1482 1496 +14 ☔ View full report in Codecov by Sentry. |
569c2ef
to
bcc6e39
Compare
014d288
to
40af53f
Compare
40af53f
to
14200ad
Compare
cc27593
to
334ac16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found https://velero.io/docs/main/backup-repository-configuration/ so will add info there and link from maintenance config page.
334ac16
to
b4247c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently double checking the flow of backup-repository-configmap from specifying a configmap to reading to storing into a repoOption.StorageOptions[key]
velero/pkg/controller/backup_repository_controller.go
Lines 404 to 405 in b4247c9
func getBackupRepositoryConfig(ctx context.Context, ctrlClient client.Client, configName, namespace, repoName, repoType string, log logrus.FieldLogger) (map[string]string, error) { | |
if configName == "" { |
config, err := getBackupRepositoryConfig(ctx, r, r.backupRepoConfig, r.namespace, req.Name, req.Spec.RepositoryType, log) |
which defines
config := map[string]string
with all the values set by user.This map of string is then set to
backupRepository.spec.RepositoryConfig
and patched to cluster CR in followingfunc (r *BackupRepoReconciler) initializeRepo(ctx context.Context, req *velerov1api.BackupRepository, log logrus.FieldLogger) error { |
This function is only called when backupRepo is in newly created as part of a backuprepo Reconcile()
This is used by
func (urp *unifiedRepoProvider) GetStoreOptions(param interface{}) (map[string]string, error) { |
via
storeVar, err := funcTable.getStorageVariables(repoParam.BackupLocation, urp.repoBackend, repoParam.BackupRepo.Spec.VolumeNamespace, repoParam.BackupRepo.Spec.RepositoryConfig) |
However, getStorageVariables() do not pass all the options from backupRepoConfig back.
velero/pkg/repository/provider/unified_repo.go
Lines 571 to 575 in b4247c9
if backupRepoConfig != nil { | |
if v, found := backupRepoConfig[udmrepo.StoreOptionCacheLimit]; found { | |
result[udmrepo.StoreOptionCacheLimit] = v | |
} | |
} |
So either make getStorageVariables() pass everything, or make it add the maintenance interval to one of the things it adds.
@blackpiglet @Lyndon-Li any opinions on making getStorageVariables return everything from backupRepoConfig? |
d96729e
to
3186280
Compare
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> comment update Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> comment Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
…ons. Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
3186280
to
7d9b489
Compare
Signed-off-by: Tiger Kaovilai tkaovila@redhat.com
Thank you for contributing to Velero!
Please add a summary of your change
Configurable Kopia Maintenance Interval. repo-maintenance-job-configmap adds an option for
fullMaintenanceInterval
where fastGC (12 hours), and eagerGC (6 hours).This configmap is loaded in assembleRepoParam that returns RepoParam which now contains the maintenance interval referenced by several repository functions.
The manager functions then call provider functions which read repoParam.FullMaintenanceInterval and add it to repoOption.
Repooption is then passed to repoService, in this case kopiaRepoService.Init
kopiaRepoService.Init calls writeInitParameters which finally set kopia p.FullCycle.Interval
Does your change fix a particular issue?
Fixes #8364
Please indicate you've done the following:
make new-changelog
) or comment/kind changelog-not-required
on this PR.site/content/docs/main
.