Skip to content

Namespace during restore lack label during create call from backup namespace preventing create via validating webhooks #9012

@birsanv

Description

@birsanv

What steps did you take and what happened:

Using Velero 1.14
We have an issue where a customer sets some labels on a namespace and uses validating webhooks to force the label being set when a namespace is created, manually or through a restore operation.

If you backup any resources created in this namespace, the actual namespace resource is not backed up. So when the restore is executed and the namespace doesn't exist, the restore operation creates a namespace using the resource metadata.namespace name. But since the namespace was not backed up , any other information is missing from the new ns resource and the validating webhooks fails the ns creation because is missing the required label.

We request that the namespace resource is also backed up with the resource so that it can be fully recreated on restore, if it doesn't exist.

Steps to reproduce:

Steps to Reproduce:

  1. Create a namespace and set a label label1: value; define a validating webhooks that fails a ns creation if the ns doesn't have the label1

  2. Create a resource under that ns

  3. Back up the resource using a Velero backup

  4. Delete the ns

  5. Run the Restore operation to recreate the resource.

  6. The ns is created by restore but with no label. And since the validating webhooks doesn't allow for the ns to be created, the restore fails

What did you expect to happen:
Step 6 should successfully recreate the backed up resource

The following information will help us better understand what's going on:

If you are using velero v1.7.0+:
Please use velero debug --backup <backupname> --restore <restorename> to generate the support bundle, and attach to this issue, more options please refer to velero debug --help

If you are using earlier versions:
Please provide the output of the following commands (Pasting long output into a GitHub gist or other pastebin is fine.)

  • kubectl logs deployment/velero -n velero
  • velero backup describe <backupname> or kubectl get backup/<backupname> -n velero -o yaml
  • velero backup logs <backupname>
  • velero restore describe <restorename> or kubectl get restore/<restorename> -n velero -o yaml
  • velero restore logs <restorename>

Anything else you would like to add:

Environment:

  • Velero version (use velero version):
  • Velero features (use velero client config get features):
  • Kubernetes version (use kubectl version):
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

  • 👍 for "I would like to see this bug fixed as soon as possible"
  • 👎 for "There are more important bugs to focus on right now"

https://issues.redhat.com/browse/OADP-6252

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions