rancher / backup-restore-operator

Apache License 2.0
100 stars 69 forks source link

[v2.9] BRO not backing up namespaces created for FleetWorkspaces #589

Closed github-actions[bot] closed 1 month ago

github-actions[bot] commented 2 months ago

This is a forwardport issue for #482, automatically created via GitHub Actions workflow initiated by @mallardduck

Original issue body:

Rancher Server Setup

SURE-8919

Describe the bug When using FleetWorkspaces in Rancher this will create a new namespace for said workspace. Due to this if a user attempts to restore on a new cluster the restore process will fail as it will not create said namespace.

To Reproduce Steps to reproduce the behavior:

  1. Create a fresh cluster
  2. Create FleetWorkspaces (See additional context below)
  3. Install backup operator and take a backup
  4. Delete cluster
  5. Restore Rancher on totally new cluster
  6. Observe restore failure

Expected behavior I would expect one of two things to happen:

  1. Rancher restore should create the namespace as needed to allow the FleetWorkspace to be repopulated
  2. Rancher restore will skip creating FleetWorkspaces as to not prevent the restore from completing Option one is preferable but two will at leas prevent end users from getting stuck.

Screenshots Not needed

Additional context Sample Fleet config

---
apiVersion: management.cattle.io/v3
kind: FleetWorkspace
metadata:
  name: enterprise

---
apiVersion: management.cattle.io/v3
kind: FleetWorkspace
metadata:
  name: edge

---
apiVersion: fleet.cattle.io/v1alpha1
kind: ClusterGroup
metadata:
  name: infra
  namespace: enterprise
spec:
  selector:
    matchExpressions: []
    matchLabels:
      infra: "true"
---
apiVersion: fleet.cattle.io/v1alpha1
kind: ClusterGroup
metadata:
  name: apps
  namespace: edge
spec:
  selector:
    matchExpressions: []
    matchLabels:
      apps: "true"
mallardduck commented 2 months ago

The primary PR for this is merged into main: https://github.com/rancher/backup-restore-operator/pull/577 This issue is for tracking the PR to merge into 5.0/2.9: https://github.com/rancher/backup-restore-operator/pull/578


For QA use - this issue with track this PR: https://github.com/rancher/backup-restore-operator/pull/578 This release will have Charts usable for QA: https://github.com/rancher/backup-restore-operator/releases/tag/v5.0.2-rc.1

nickwsuse commented 1 month ago

Verified on v2.9-head ID: 7f4c4ec && Rancher Backups v104.0.2+up5.0.2-rc.2

No errors were recorded in the restore logs for any of the following tests, and the workspaces were successfully restored.

Fresh Install

  1. Rancher Backups resourceSet shows updated regex for fleet workspaces ✅
  2. In-Place restore after creating Fleet workspaces and deleting a cluster ✅
  3. RKE1 local with RKE1 downstream cluster ✅
  4. RKE1 local with RKE2 downstream cluster ✅
  5. RKE1 local with RKE1 downstream cluster migrated to RKE2 local ✅
  6. RKE1 local with RKE2 downstream cluster migrated to RKE2 local ✅
  7. RKE2 local with RKE1 downstream cluster migrated to RKE2 local ✅
  8. RKE2 local with RKE2 downstream cluster migrated to RKE2 local ✅

Upgrade

  1. Rancher Backups resourceSet shows updated regex for fleet workspaces ✅
  2. In-Place restore after creating Fleet workspaces and deleting a cluster ✅
  3. RKE1 local with RKE1 downstream cluster ✅
  4. RKE1 local with RKE2 downstream cluster ✅
  5. RKE1 local with RKE1 downstream cluster migrated to RKE2 local ✅
  6. RKE1 local with RKE2 downstream cluster migrated to RKE2 local ✅
  7. RKE2 local with RKE1 downstream cluster migrated to RKE2 local ✅
  8. RKE2 local with RKE2 downstream cluster migrated to RKE2 local ✅