Skip to content
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

OADP-1057: CloudStorageLocation Prefix/CACert support #1126

Merged

Conversation

kaovilai
Copy link
Member

@kaovilai kaovilai commented Aug 11, 2023

Related to openshift/openshift-velero-plugin#199

In order to avoid conflict with velero expected folders, new validations has been added.

Change Summary

  • bl.CloudStorage now support Prefix/CACert fields
  • New validation errors when Prefix is not specified and backupImages is not false.
    BackupLocation must have velero prefix when backupImages is not set to false
    
    BackupLocation must have cloud storage prefix when backupImages is not set to false
    
  • Convert BSL/VSL validation reconciler into a function called from ValidateDataProtectionCR function

Testing instructions

Prerequisites:

Substitute operator install steps in prerequiste for the following operator-sdk run command.

To try this patch, get operator-sdk and run

export OADP_TEST_NS=openshift-adp
(oc create namespace $OADP_TEST_NS || true) && \
operator-sdk run bundle ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle --namespace $OADP_TEST_NS

cleanup

operator-sdk cleanup oadp-operator --namespace $OADP_TEST_NS

After cleanup, you will have to create dpa again.

Example DPA

cat << EOF | oc create -f -
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
  name: ${CLUSTER_NAME}-dpa
  namespace: openshift-adp
spec:
  features:
    dataMover:
      enable: false
  backupLocations:
  - bucket:
      cloudStorageRef:
        name: ${CLUSTER_NAME}-oadp
      credential:
        key: credentials
        name: cloud-credentials
      default: true
      prefix: velero # added capability in oadp-operator#1126 PR
      config:
        region: ${REGION}
  configuration:
    velero:
      defaultPlugins:
      - openshift
      - aws
      - csi
    restic:
      enable: false
  unsupportedOverrides:
    openshiftPluginImageFqin: ghcr.io/kaovilai/openshift-velero-plugin:sts
EOF

dev notes

bundle build command

IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-support-operator BUNDLE_IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle make docker-build docker-push bundle bundle-build bundle-push

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 11, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 11, 2023

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

In response to this:

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 kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 11, 2023
@openshift-ci
Copy link

openshift-ci bot commented Aug 11, 2023

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 11, 2023
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai kaovilai force-pushed the OADP-1057-cloudstorage-prefix branch from ed96ab4 to 99b86dd Compare August 11, 2023 01:36
@kaovilai kaovilai marked this pull request as ready for review August 11, 2023 02:14
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 11, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 11, 2023

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

In response to this:

Related to openshift/openshift-velero-plugin#199

Testing instructions

Prerequisites:

Substitute operator install steps in prerequiste for the following operator-sdk run command.

To try this patch, get operator-sdk and run

export OADP_TEST_NS=openshift-adp
(oc create namespace $OADP_TEST_NS || true) && \
operator-sdk run bundle ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle --namespace $OADP_TEST_NS

cleanup

operator-sdk cleanup oadp-operator --namespace $OADP_TEST_NS

After cleanup, you will have to create dpa again.

Example DPA

cat << EOF | oc create -f -
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
 name: ${CLUSTER_NAME}-dpa
 namespace: openshift-adp
spec:
 features:
   dataMover:
     enable: false
 backupLocations:
 - bucket:
     cloudStorageRef:
       name: ${CLUSTER_NAME}-oadp
     credential:
       key: credentials
       name: cloud-credentials
     default: true
     config:
       region: ${REGION}
 configuration:
   velero:
     defaultPlugins:
     - openshift
     - aws
     - csi
   restic:
     enable: false
 unsupportedOverrides:
   openshiftPluginImageFqin: ghcr.io/kaovilai/openshift-velero-plugin:sts
EOF

dev notes

bundle build command

IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-support-operator BUNDLE_IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle make docker-build docker-push bundle bundle-build bundle-push

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 kubernetes/test-infra repository.

@kaovilai
Copy link
Member Author

kaovilai commented Aug 11, 2023

validated working :D
backup/restore of imagestreamtags restored the image shas

@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 11, 2023

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

In response to this:

Related to openshift/openshift-velero-plugin#199

Testing instructions

Prerequisites:

Substitute operator install steps in prerequiste for the following operator-sdk run command.

To try this patch, get operator-sdk and run

export OADP_TEST_NS=openshift-adp
(oc create namespace $OADP_TEST_NS || true) && \
operator-sdk run bundle ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle --namespace $OADP_TEST_NS

cleanup

operator-sdk cleanup oadp-operator --namespace $OADP_TEST_NS

After cleanup, you will have to create dpa again.

Example DPA

cat << EOF | oc create -f -
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
 name: ${CLUSTER_NAME}-dpa
 namespace: openshift-adp
spec:
 features:
   dataMover:
     enable: false
 backupLocations:
 - bucket:
     cloudStorageRef:
       name: ${CLUSTER_NAME}-oadp
     credential:
       key: credentials
       name: cloud-credentials
     default: true
     prefix: velero # added capability in oadp-operator#1126 PR
     config:
       region: ${REGION}
 configuration:
   velero:
     defaultPlugins:
     - openshift
     - aws
     - csi
   restic:
     enable: false
 unsupportedOverrides:
   openshiftPluginImageFqin: ghcr.io/kaovilai/openshift-velero-plugin:sts
EOF

dev notes

bundle build command

IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-support-operator BUNDLE_IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle make docker-build docker-push bundle bundle-build bundle-push

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 kubernetes/test-infra repository.

@kaovilai kaovilai force-pushed the OADP-1057-cloudstorage-prefix branch from 3a0ebef to 38c3be6 Compare August 11, 2023 02:54
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai kaovilai force-pushed the OADP-1057-cloudstorage-prefix branch from 38c3be6 to 5cc5750 Compare August 11, 2023 06:26
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai
Copy link
Member Author

/retest

2 similar comments
@kaovilai
Copy link
Member Author

/retest

@kaovilai
Copy link
Member Author

/retest

@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 11, 2023

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

In response to this:

Related to openshift/openshift-velero-plugin#199

In order to avoid conflict with velero expected folders, a new validation has been added.

BackupLocation must have velero prefix when backupImages is set to true

Testing instructions

Prerequisites:

Substitute operator install steps in prerequiste for the following operator-sdk run command.

To try this patch, get operator-sdk and run

export OADP_TEST_NS=openshift-adp
(oc create namespace $OADP_TEST_NS || true) && \
operator-sdk run bundle ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle --namespace $OADP_TEST_NS

cleanup

operator-sdk cleanup oadp-operator --namespace $OADP_TEST_NS

After cleanup, you will have to create dpa again.

Example DPA

cat << EOF | oc create -f -
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
 name: ${CLUSTER_NAME}-dpa
 namespace: openshift-adp
spec:
 features:
   dataMover:
     enable: false
 backupLocations:
 - bucket:
     cloudStorageRef:
       name: ${CLUSTER_NAME}-oadp
     credential:
       key: credentials
       name: cloud-credentials
     default: true
     prefix: velero # added capability in oadp-operator#1126 PR
     config:
       region: ${REGION}
 configuration:
   velero:
     defaultPlugins:
     - openshift
     - aws
     - csi
   restic:
     enable: false
 unsupportedOverrides:
   openshiftPluginImageFqin: ghcr.io/kaovilai/openshift-velero-plugin:sts
EOF

dev notes

bundle build command

IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-support-operator BUNDLE_IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle make docker-build docker-push bundle bundle-build bundle-push

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 kubernetes/test-infra repository.

@kaovilai
Copy link
Member Author

/retest

1 similar comment
@kaovilai
Copy link
Member Author

/retest

@kaovilai kaovilai force-pushed the OADP-1057-cloudstorage-prefix branch from 8bf081a to efd0d68 Compare August 12, 2023 06:34
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai kaovilai force-pushed the OADP-1057-cloudstorage-prefix branch from efd0d68 to 9451f3f Compare August 12, 2023 06:35
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 16, 2023

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

In response to this:

Related to openshift/openshift-velero-plugin#199

In order to avoid conflict with velero expected folders, new validations has been added.

Change Summary

  • bl.CloudStorage now support Prefix/CACert fields
  • New validation errors when Prefix is not specified and backupImages is not false.
BackupLocation must have velero prefix when backupImages is not set to false
BackupLocation must have cloud storage prefix when backupImages is not set to false
  • Convert BSL/VSL validation reconciler into a function called from ValidateDataProtectionCR function

Testing instructions

Prerequisites:

Substitute operator install steps in prerequiste for the following operator-sdk run command.

To try this patch, get operator-sdk and run

export OADP_TEST_NS=openshift-adp
(oc create namespace $OADP_TEST_NS || true) && \
operator-sdk run bundle ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle --namespace $OADP_TEST_NS

cleanup

operator-sdk cleanup oadp-operator --namespace $OADP_TEST_NS

After cleanup, you will have to create dpa again.

Example DPA

cat << EOF | oc create -f -
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
 name: ${CLUSTER_NAME}-dpa
 namespace: openshift-adp
spec:
 features:
   dataMover:
     enable: false
 backupLocations:
 - bucket:
     cloudStorageRef:
       name: ${CLUSTER_NAME}-oadp
     credential:
       key: credentials
       name: cloud-credentials
     default: true
     prefix: velero # added capability in oadp-operator#1126 PR
     config:
       region: ${REGION}
 configuration:
   velero:
     defaultPlugins:
     - openshift
     - aws
     - csi
   restic:
     enable: false
 unsupportedOverrides:
   openshiftPluginImageFqin: ghcr.io/kaovilai/openshift-velero-plugin:sts
EOF

dev notes

bundle build command

IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-support-operator BUNDLE_IMG=ghcr.io/kaovilai/oadp-operator:csl-prefix-bundle make docker-build docker-push bundle bundle-build bundle-push

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 kubernetes/test-infra repository.

@kaovilai
Copy link
Member Author

/retest

@kaovilai
Copy link
Member Author

/hold
for openshift/openshift-velero-plugin#199 to merge first

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 16, 2023
@openshift-ci
Copy link

openshift-ci bot commented Aug 16, 2023

@kaovilai: all tests passed!

Full PR test history. Your PR dashboard.

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 kubernetes/test-infra repository. I understand the commands that are listed here.

@sseago
Copy link
Contributor

sseago commented Aug 22, 2023

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 22, 2023
@sseago
Copy link
Contributor

sseago commented Aug 22, 2023

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Aug 22, 2023

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2023
@openshift-merge-robot openshift-merge-robot merged commit ad7151f into openshift:master Aug 22, 2023
13 checks passed
@kaovilai
Copy link
Member Author

/cherry-pick oadp-1.2

@openshift-cherrypick-robot
Copy link
Contributor

@kaovilai: #1126 failed to apply on top of branch "oadp-1.2":

Applying: validator and type updates
Applying: validator and type updates
Applying: CloudStorageLocation prefix is added to BSL
Applying: clarify backupImages error
Applying: validator refactor returns err from validating funcs
Applying: unit tests fix
Applying: simplify expression
Applying: Add ignorable restore error logs and unit test
Using index info to reconstruct a base tree...
M	tests/e2e/lib/velero_helpers.go
Falling back to patching base and 3-way merge...
Auto-merging tests/e2e/lib/velero_helpers.go
CONFLICT (content): Merge conflict in tests/e2e/lib/velero_helpers.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0008 Add ignorable restore error logs and unit test
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick oadp-1.2

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 kubernetes/test-infra repository.

kaovilai added a commit to kaovilai/oadp-operator that referenced this pull request Aug 28, 2023
* validator and type updates

* validator and type updates

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

* CloudStorageLocation prefix is added to BSL

* clarify backupImages error

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

* validator refactor returns err from validating funcs

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

* unit tests fix

* simplify expression

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

* Add ignorable restore error logs and unit test

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

* consistent error string across bl.velero and bl.cloudstorage

---------

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
kaovilai added a commit that referenced this pull request Aug 29, 2023
* validator and type updates

* validator and type updates



* CloudStorageLocation prefix is added to BSL

* clarify backupImages error



* validator refactor returns err from validating funcs



* unit tests fix

* simplify expression



* Add ignorable restore error logs and unit test



* consistent error string across bl.velero and bl.cloudstorage

---------

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants