-
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
Backup is backing up all namespaces when includedNamespaces are omitted and using only labelSelector #7105
Comments
I think this is a bit of an edge case, but we may want a fix for it. In the non-label-selector use case, if a namespace is included in the backup, then we include it even if empty. Since label selectors are applied to the resources within namespaces, and we need the namespace any time we're backing something up in the namespace, we need to include the namespaces with resources. So one possible fix here is to exclude the namespace resource for the backup if all of the following are true:
|
In this case
was not the intention nor was it explicitly specified as "all namespaces backup", as they expected velero to only include namespace the label selector resources are in.
So is the current behavior such that if at least one namespace have a label, other namespaces are excluded? |
@kaovilai but it is an "all namespaces" backup -- i.e. selector and namespaces are both applied, result is the intersection of the two. It's "all resources with this label in all namespaces". You can also do a "some namespaces" backup with selectors -- i.e. only include namespaces "foo,bar" but also within those only with a certain label. "So is the current behavior such that if at least one namespace have a label, other namespaces are excluded?" |
|
@kaovilai that could work -- and it would be applicable to both label and non-label backups -- no logic change around obscure edge cases, just a new flag on the backup. |
It's reasonable to enhance, but I think there is no need to introduce a new parameter for this. |
That would be "breaking change" then. But I agree that most people would not want an empty NS backup. |
It would appear that this is a change in behavior from prior versions. From what another OADP user is seeing, this didn't happen in Velero 1.11, so this is possibly a regression. |
@kaovilai if we're reverting to prior behavior, though, it's less a breaking change than it is a fix for a regression. |
The namespaces should be gathered after the item collection to resolve this problem. The method Concurrently, item collectors can benefit from a few potential enhancements:
|
This is a valid issue. |
I created a backup:
Without includedNamespaces, but only with labelSelector.
The backup included all namespaces in the cluster, unrelated to the label selector.
I expected all resources being backed up to be related only to the label selector.
Environment:
velero version
): v1.12.1kubectl version
):/etc/os-release
): Red Hat Enterprise Linux CoreOSThe text was updated successfully, but these errors were encountered: