-
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
Reconciling the server default BSL with the user configured default BSL #3173
Comments
If we want to cover both user-configured and server-configured at the same time, the only way I could though now is to have a new field in BSL CRD like Once the Velero pod restart, it compare the |
But this would not translate into covering both at the same time. This would mean giving precedence to the server config over the user config. In this proposed way, it would also break the principle of "do the least surprising thing", since the user would probably be surprised something they intentionally set was changed to something else they might not even be aware of (the server config, which will always have a default value of "default"). |
Let me recap the scenario I've thought, for example, we have 2 BSLs, one is 1a. During the fresh install, the velero CLI configures a BSL named "default" as the default BSL. ( |
Can I add one more case here? I think the majority of installations only have 1 BSL configured, so if that's the case can we use it irregardless of whether it's marked as default or not? |
The PR above marks the BSL to be created as the default, since at this time there's only 1. Another point where to handle this is when looping over the controller (BSL or Sync, doesn't matter), if there's only 1 BSL then mark it as default. Either this way or by just using the BSL if there's no other (it'd be odd for the backup to be doing this check but let's roll with it), the question of what if the server configuration specifies a different default? |
I just realized we have a user (cli) and a global (server)l level config for the ttl. Let me look at how the precedence is handled with that one. |
I wanted to surface this and get a sanity check if this has been addressed best we can, or if there's still a use case we need to cover. This is in regards to PR #3092. More specifically, this is in regards to how we pick the default BSL to use when the Velero server starts up with its configured default BSL when at the same time there is a BSL marked as default (in the CRD).
For context/recall:
Currently, this is how we pick the default BSL to use:
Did the user specify the default at backup creation time? If so, use that.
Is there a BSL marked as default (in the CRD)? Either the user did that manually or the BSL is from a new installation that automatically configured that first BSL as default. If so, use that (refs:
velero/pkg/controller/backup_storage_location_controller.go
Line 72 in 844cc16
If none of the above cases are true, use the server configuration to set a BSL as the default, IF AND ONLY IF there exists a BSL with the same name. If no BSL with that name exists, nothing can be done, except warn. Refs:
velero/pkg/controller/backup_storage_location_controller.go
Line 84 in 844cc16
If none of the above cases are possible, either there is no existing BSL, or none of the existing BSL is marked as "default". Likely these are legacy BSLs. In this case, the BSL controller will continue to throw the warning (see right above), and the failed backup will contain the error message explaining why and how to fix it. Ref: see pending PR for better error message: https://github.com/vmware-tanzu/velero/pull/3172/files#diff-f0334755c17add3306aecd57a34bc24dfa20a66f617dbaf541042dfd8e0887deR380.
❓ This is the question to answer:
Do we want the user configured default BSL to take precedence over the server configured default?
If so, this is handled. This is my preference, especially since the server config will be deprecated.
If not, we need to invert the existing logic to give preference to the server configuration.
Let me know if I missed anything.
c/c @nrb and @jenting
The text was updated successfully, but these errors were encountered: