openshift / openshift-velero-plugin

General Velero plugin for backup and restore of openshift workloads.
Apache License 2.0
49 stars 38 forks source link

OADP-4692: Skip Restore of ConfigMaps and Build pods relating to build #277

Closed kaovilai closed 3 months ago

kaovilai commented 3 months ago
docker buildx build --platform=linux/amd64,linux/arm64 --push -t $(ghcr_tag) .
❯ ghcr_tag 
ghcr.io/kaovilai/openshift-velero-plugin:buildconfig
Recreate

```yaml apiVersion: image.openshift.io/v1 kind: ImageStream metadata: name: django-psql-persistent namespace: django ``` ```yaml apiVersion: build.openshift.io/v1 kind: BuildConfig metadata: annotations: description: Defines how to build the application openshift.io/generated-by: OpenShiftNewApp template.alpha.openshift.io/wait-for-ready: "true" labels: app: django-psql-persistent template: django-psql-persistent name: django-psql-persistent namespace: django spec: failedBuildsHistoryLimit: 5 nodeSelector: null output: to: kind: ImageStreamTag name: django-psql-persistent:latest postCommit: script: ./manage.py test resources: {} runPolicy: Serial source: git: uri: https://github.com/sclorg/django-ex.git type: Git strategy: sourceStrategy: env: - name: PIP_INDEX_URL from: kind: DockerImage name: quay.io/oadp-qe/python:3.6 type: Source successfulBuildsHistoryLimit: 5 triggers: - type: ConfigChange ``` ``` velero create backup test --include-namespaces django ``` we need to delete namespace ``` oc delete ns django --wait && velero create restore test-restore --from-backup=test ``` check after restore that configmaps do not contain velero restore label, which mean they were regenerated.

Backup

``` time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-ca" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 22 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-global-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-global-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-global-ca" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 23 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-sys-config namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-sys-config namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-sys-config" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 24 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=kube-root-ca.crt namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=kube-root-ca.crt namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=kube-root-ca.crt namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/kube-root-ca.crt" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Leaving ConfigMap backup plugin, not a buildconfig-build's configmap name" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:37" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 25 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=kube-root-ca.crt namespace=django progress= resource=configmaps ```

Restore

``` time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-ca, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-ca because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 12 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-ca namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-global-ca, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-global-ca because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 13 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-sys-config, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-sys-config because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 14 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Getting client for /v1, Kind=ConfigMap" logSource="pkg/restore/restore.go:1021" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Attempting to restore ConfigMap: kube-root-ca.crt" logSource="pkg/restore/restore.go:1487" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 15 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=kube-root-ca.crt namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Attempting to restore ConfigMap: openshift-service-ca.crt" logSource="pkg/restore/restore.go:1487" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 16 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=openshift-service-ca.crt namespace=django progress= resource=configmaps restore=openshift-adp/test-restore ```

Signed-off-by: Tiger Kaovilai tkaovila@redhat.com

openshift-ci-robot commented 3 months ago

@kaovilai: This pull request references OADP-4692 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.18.0" version, but no target version was set.

In response to [this](https://github.com/openshift/openshift-velero-plugin/pull/277): >Signed-off-by: Tiger Kaovilai > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fopenshift-velero-plugin). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 3 months ago

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

openshift-ci-robot commented 3 months ago

@kaovilai: This pull request references OADP-4692 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.18.0" version, but no target version was set.

In response to [this](https://github.com/openshift/openshift-velero-plugin/pull/277): >```sh >docker buildx build --platform=linux/amd64,linux/arm64 --push -t $(ghcr_tag) . >``` >```sh >❯ ghcr_tag >ghcr.io/kaovilai/openshift-velero-plugin:buildconfig >``` > >Signed-off-by: Tiger Kaovilai > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Fopenshift-velero-plugin). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
kaovilai commented 3 months ago

/cc @sseago

kaovilai commented 3 months ago

whoopsies dismissed 3 approvals in a row that's a new achievement

kaovilai commented 3 months ago

test image ghcr.io/kaovilai/openshift-velero-plugin:buildconfig rebuilt

kaovilai commented 3 months ago

/hold Sachin said still see issue

kaovilai commented 3 months ago

/unhold

kaovilai commented 3 months ago

dev test is satisfactory. After simulating disaster, ConfigMap at restored namespace do not contain restore label meaning ConfigMap was a regenerated one, not from backup.

kaovilai commented 3 months ago
Backup

``` time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-ca" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 22 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-global-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-global-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-global-ca" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 23 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-sys-config namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-sys-config namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-sys-config" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 24 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=kube-root-ca.crt namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=kube-root-ca.crt namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=kube-root-ca.crt namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/kube-root-ca.crt" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Leaving ConfigMap backup plugin, not a buildconfig-build's configmap name" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:37" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 25 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=kube-root-ca.crt namespace=django progress= resource=configmaps ```

Restore

``` time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-ca, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-ca because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 12 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-ca namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-global-ca, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-global-ca because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 13 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-sys-config, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-sys-config because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 14 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Getting client for /v1, Kind=ConfigMap" logSource="pkg/restore/restore.go:1021" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Attempting to restore ConfigMap: kube-root-ca.crt" logSource="pkg/restore/restore.go:1487" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 15 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=kube-root-ca.crt namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Attempting to restore ConfigMap: openshift-service-ca.crt" logSource="pkg/restore/restore.go:1487" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 16 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=openshift-service-ca.crt namespace=django progress= resource=configmaps restore=openshift-adp/test-restore ```

openshift-ci-robot commented 3 months ago

@kaovilai: This pull request references OADP-4692 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.18.0" version, but no target version was set.

In response to [this](https://github.com/openshift/openshift-velero-plugin/pull/277): >```sh >docker buildx build --platform=linux/amd64,linux/arm64 --push -t $(ghcr_tag) . >``` >```sh >❯ ghcr_tag >ghcr.io/kaovilai/openshift-velero-plugin:buildconfig >``` > >
Recreate >

>``` >apiVersion: image.openshift.io/v1 >kind: ImageStream >metadata: > name: django-psql-persistent > namespace: django >``` >``` >apiVersion: build.openshift.io/v1 >kind: BuildConfig >metadata: > annotations: > description: Defines how to build the application > openshift.io/generated-by: OpenShiftNewApp > template.alpha.openshift.io/wait-for-ready: "true" > labels: > app: django-psql-persistent > template: django-psql-persistent > name: django-psql-persistent > namespace: django >spec: > failedBuildsHistoryLimit: 5 > nodeSelector: null > output: > to: > kind: ImageStreamTag > name: django-psql-persistent:latest > postCommit: > script: ./manage.py test > resources: {} > runPolicy: Serial > source: > git: > uri: https://github.com/sclorg/django-ex.git > type: Git > strategy: > sourceStrategy: > env: > - name: PIP_INDEX_URL > from: > kind: DockerImage > name: quay.io/oadp-qe/python:3.6 > type: Source > successfulBuildsHistoryLimit: 5 > triggers: > - type: ConfigChange >``` > >``` >velero create backup test --include-namespaces django >``` > >we need to delete namespace >``` >oc delete ns django --wait && velero create restore test-restore --from-backup=test >``` > >check after restore that configmaps do not contain velero restore label, which mean they were regenerated. >

>
Backup

``` time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-ca" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 22 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-global-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-global-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-global-ca" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 23 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-sys-config namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-sys-config namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-sys-config" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 24 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=kube-root-ca.crt namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=kube-root-ca.crt namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=kube-root-ca.crt namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/kube-root-ca.crt" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Leaving ConfigMap backup plugin, not a buildconfig-build's configmap name" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:37" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 25 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=kube-root-ca.crt namespace=django progress= resource=configmaps ```

Restore

``` time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-ca, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-ca because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 12 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-ca namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-global-ca, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-global-ca because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 13 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-sys-config, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-sys-config because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 14 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Getting client for /v1, Kind=ConfigMap" logSource="pkg/restore/restore.go:1021" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Attempting to restore ConfigMap: kube-root-ca.crt" logSource="pkg/restore/restore.go:1487" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 15 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=kube-root-ca.crt namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Attempting to restore ConfigMap: openshift-service-ca.crt" logSource="pkg/restore/restore.go:1487" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 16 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=openshift-service-ca.crt namespace=django progress= resource=configmaps restore=openshift-adp/test-restore ```

Signed-off-by: Tiger Kaovilai tkaovila@redhat.com

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

openshift-ci-robot commented 3 months ago

@kaovilai: This pull request references OADP-4692 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.18.0" version, but no target version was set.

In response to [this](https://github.com/openshift/openshift-velero-plugin/pull/277): >```sh >docker buildx build --platform=linux/amd64,linux/arm64 --push -t $(ghcr_tag) . >``` >```sh >❯ ghcr_tag >ghcr.io/kaovilai/openshift-velero-plugin:buildconfig >``` > >
Recreate >

> >```yaml >apiVersion: image.openshift.io/v1 >kind: ImageStream >metadata: > name: django-psql-persistent > namespace: django >``` > >```yaml >apiVersion: build.openshift.io/v1 >kind: BuildConfig >metadata: > annotations: > description: Defines how to build the application > openshift.io/generated-by: OpenShiftNewApp > template.alpha.openshift.io/wait-for-ready: "true" > labels: > app: django-psql-persistent > template: django-psql-persistent > name: django-psql-persistent > namespace: django >spec: > failedBuildsHistoryLimit: 5 > nodeSelector: null > output: > to: > kind: ImageStreamTag > name: django-psql-persistent:latest > postCommit: > script: ./manage.py test > resources: {} > runPolicy: Serial > source: > git: > uri: https://github.com/sclorg/django-ex.git > type: Git > strategy: > sourceStrategy: > env: > - name: PIP_INDEX_URL > from: > kind: DockerImage > name: quay.io/oadp-qe/python:3.6 > type: Source > successfulBuildsHistoryLimit: 5 > triggers: > - type: ConfigChange >``` > >``` >velero create backup test --include-namespaces django >``` > >we need to delete namespace >``` >oc delete ns django --wait && velero create restore test-restore --from-backup=test >``` > >check after restore that configmaps do not contain velero restore label, which mean they were regenerated. >

>
Backup

``` time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-ca" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 22 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-global-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-global-ca namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-global-ca" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 23 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=django-psql-persistent-1-sys-config namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=django-psql-persistent-1-sys-config namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/django-psql-persistent-1-sys-config" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] buildconfig-build's configmap has pod's ownerRef, adding skip annotation" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:68" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 24 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Processing item" backup=openshift-adp/test logSource="pkg/backup/backup.go:412" name=kube-root-ca.crt namespace=django progress= resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Backing up item" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:175" name=kube-root-ca.crt namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="Executing custom action" backup=openshift-adp/test logSource="pkg/backup/item_backupper.go:362" name=kube-root-ca.crt namespace=django resource=configmaps time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Entering ConfigMap backup plugin" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:30" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] ConfigMap: django/kube-root-ca.crt" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:34" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="[cm-backup] Leaving ConfigMap backup plugin, not a buildconfig-build's configmap name" backup=openshift-adp/test cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/backup.go:37" pluginName=velero-plugins time="2024-08-27T21:32:14Z" level=info msg="Backed up 25 items out of an estimated total of 39 (estimate will change throughout the backup)" backup=openshift-adp/test logSource="pkg/backup/backup.go:452" name=kube-root-ca.crt namespace=django progress= resource=configmaps ```

Restore

``` time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-ca, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-ca because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 12 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-ca namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-global-ca, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-global-ca because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 13 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-global-ca namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Skipping restore of ConfigMap django-psql-persistent-1-sys-config, belongs to build pod, will regenerate as needed" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:40" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Skipping restore of ConfigMap: django-psql-persistent-1-sys-config because a registered plugin discarded it" logSource="pkg/restore/restore.go:1354" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 14 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=django-psql-persistent-1-sys-config namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Getting client for /v1, Kind=ConfigMap" logSource="pkg/restore/restore.go:1021" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Attempting to restore ConfigMap: kube-root-ca.crt" logSource="pkg/restore/restore.go:1487" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 15 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=kube-root-ca.crt namespace=django progress= resource=configmaps restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="restore status includes excludes: " logSource="pkg/restore/restore.go:1304" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Executing item action for configmaps" logSource="pkg/restore/restore.go:1318" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="[cm-restore] Entering ConfigMap restore plugin" cmd=/plugins/velero-plugins logSource="/opt/app-root/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/configmap/restore.go:27" pluginName=velero-plugins restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Attempting to restore ConfigMap: openshift-service-ca.crt" logSource="pkg/restore/restore.go:1487" restore=openshift-adp/test-restore time="2024-08-27T21:34:07Z" level=info msg="Restored 16 items out of an estimated total of 27 (estimate will change throughout the restore)" logSource="pkg/restore/restore.go:778" name=openshift-service-ca.crt namespace=django progress= resource=configmaps restore=openshift-adp/test-restore ```

Signed-off-by: Tiger Kaovilai tkaovila@redhat.com

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

openshift-ci[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kaovilai, sseago

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/openshift-velero-plugin/blob/master/OWNERS)~~ [kaovilai,sseago] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
sseago commented 3 months ago

/lgtm

openshift-ci[bot] commented 3 months ago

@kaovilai: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
kaovilai commented 3 months ago

/cherry-pick oadp-1.4

openshift-cherrypick-robot commented 3 months ago

@kaovilai: new pull request created: #278

In response to [this](https://github.com/openshift/openshift-velero-plugin/pull/277#issuecomment-2313878564): >/cherry-pick oadp-1.4 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.