Skip to content

Commit

Permalink
Backup application namespace manifestwork
Browse files Browse the repository at this point in the history
In order to prevent workload eviction (see issue: https://issues.redhat.com/browse/ACM-5795)
we now backup the application namespace ManifestWork resource used to create the namespace
on the managed cluster.

Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
(cherry picked from commit dbb1fe0)
  • Loading branch information
Benamar Mekhissi authored and agarwal-mudit committed Jun 9, 2023
1 parent f27648a commit 1c0adc9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions controllers/util/mw_util.go
Expand Up @@ -197,13 +197,19 @@ func (mwu *MWUtil) CreateOrUpdateNamespaceManifest(
return err
}

labels := map[string]string{}
manifests := []ocmworkv1.Manifest{
*manifest,
}

mwName := fmt.Sprintf(ManifestWorkNameFormat, name, namespaceName, MWTypeNS)
manifestWork := mwu.newManifestWork(mwName, managedClusterNamespace, labels, manifests, annotations)
manifestWork := mwu.newManifestWork(
mwName,
managedClusterNamespace,
map[string]string{
OCMBackupLabelKey: OCMBackupLabelValue,
},
manifests,
annotations)

return mwu.createOrUpdateManifestWork(manifestWork, managedClusterNamespace)
}
Expand Down

0 comments on commit 1c0adc9

Please sign in to comment.