-
Notifications
You must be signed in to change notification settings - Fork 351
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
Prioritize location provider over global provider #97
Conversation
@@ -89,7 +89,7 @@ Create the backup storage location provider | |||
*/}} | |||
{{- define "velero.backupStorageLocation.provider" -}} | |||
{{- with .Values.configuration -}} | |||
{{ default .backupStorageLocation.provider .provider }} | |||
{{ default .provider .backupStorageLocation.provider }} |
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.
In the line below, if there's a value for provider
, it will make that the default value for the backupStorageLocation.provider
anyway. Unless I'm reading this wrong. If it's right, would this be necessary?
https://github.com/vmware-tanzu/helm-charts/blob/master/charts/velero/templates/_helpers.tpl#L92
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, if configuration.provider
is set (and it has to be to enable deployment) it overrides configuration.backupStorageLocation.provider
. Why? Because the first value is actually the default and the second one if given: doc. Not really intuitive, but it is how it is.
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.
I appreciate the explanation! My understanding was the exact opposite, so, glad to have this corrected. Thanks for the link to the relevant docs, I'll revisit that too.
I just submitted this same thing as a PR and closed it b/c this is here #98 @carlisia helm documentation is This threw me through a loop too but if this PR is merged the chart will default to This PR is huge as it lets us define separate providers for both the |
Ok, makes sense. @yurinnick let's bump the chart version and get it merged. |
Signed-off-by: Nikolai Iurin <yurinnick93@gmail.com>
Signed-off-by: Nikolai Iurin <yurinnick93@gmail.com>
fbdd16c
to
b1f3cc0
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.
Thank you for this! 👍
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.
thanks for this @yurinnick, this change makes sense to me.
It'd be great if you could also update the comments in values.yaml
to describe the new precedence here.
@@ -89,7 +89,7 @@ Create the backup storage location provider | |||
*/}} | |||
{{- define "velero.backupStorageLocation.provider" -}} | |||
{{- with .Values.configuration -}} | |||
{{ default .backupStorageLocation.provider .provider }} | |||
{{ default .provider .backupStorageLocation.provider }} |
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.
should this be {{ default .provider .backupStorageLocation.name }}
? .backupStorageLocation.name
is what I see documented in values.yaml
and the docs. However, I also see on L90 that we're using {{- define "velero.backupStorageLocation.provider" -}}
, and in the backupstoragelocation template we reference backupStorageLocation.provider
(https://github.com/vmware-tanzu/helm-charts/blob/master/charts/velero/templates/backupstoragelocation.yaml#L12).
Not entirely sure but it seems like there's an inconsistency somewhere.
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.
hey @skriss I see name and provider being a bit decoupled - name is used for the name of a resource while the provider is used by the plugin for config.
To use name you actually introduce complexity - for example when using digital ocean you would set your provider as digitalocean.com/velero
which is not a valid kubernetes resource name because of the /
Another use case would be more than one AWS providers with different names
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.
I totally agree they should be separate things. I'm just trying to ensure that (a) we're not making a backwards-incompatible change if we were previously using the "name" value to fill in the provider and now we're no longer doing so; and (b) that the docs are accurate.
I can't really tell at a glance if we're making a backwards-incompatible change here, but it seems like probably not?
If not, then let's please just document that there is now a backupStorageLocation.provider
that is separate from backupStorageLocation.name
.
@@ -107,6 +107,6 @@ Create the volume snapshot location provider | |||
*/}} | |||
{{- define "velero.volumeSnapshotLocation.provider" -}} | |||
{{- with .Values.configuration -}} | |||
{{ default .volumeSnapshotLocation.provider .provider }} | |||
{{ default .provider .volumeSnapshotLocation.provider }} |
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.
same question here
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.
see above
Documentation in the `values.yaml` to make clear having seperate providers for `volumeSnapshotLocation`, `backupStorageLocation`, and the `deployment.yaml` This fixes vmware-tanzu#97 (review) Signed-off-by: Austin Vance <austin@focusedlabs.io>
Documentation in the `values.yaml` to make clear having separate providers for `volumeSnapshotLocation`, `backupStorageLocation`, and the `deployment.yaml` This fixes vmware-tanzu#97 (review) Signed-off-by: Austin Vance <austin@focusedlabs.io>
Documentation in the `values.yaml` to make clear having separate providers for `volumeSnapshotLocation`, `backupStorageLocation`, and the `deployment.yaml` This fixes vmware-tanzu#97 (review) Signed-off-by: Austin Vance <austin@focusedlabs.io>
Documentation in the `values.yaml` to make clear having separate providers for `volumeSnapshotLocation`, `backupStorageLocation`, and the `deployment.yaml` This fixes vmware-tanzu#97 (review) Signed-off-by: Austin Vance <austin@focusedlabs.io>
Documentation in the `values.yaml` to make clear having separate providers for `volumeSnapshotLocation`, `backupStorageLocation`, and the `deployment.yaml` This fixes vmware-tanzu/helm-charts#97 (review) Signed-off-by: Austin Vance <austin@focusedlabs.io>
Closes #95.
Prioritize
configuration.(backupStorageLocation|volumeSnapshotLocation).config
overconfiguration.provider
Signed-off-by: Nikolai Iurin yurinnick93@gmail.com