-
Notifications
You must be signed in to change notification settings - Fork 72
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
CloudStorage: Only delete and remove finalizer if there exists an annotation. #574
Conversation
ea16689
to
84c6b92
Compare
84c6b92
to
d6959bf
Compare
Annotation ("oadp.openshift.io/cloudstorage-delete": "true") to activate bucket deletion in cloud providers, finalizer will be removed for you. To remove CR without deleting bucket in cloud storage, user just have to remove finalizer. |
…, create if not exist & no err
2f6432c
to
01335c7
Compare
Codecov Report
@@ Coverage Diff @@
## master #574 +/- ##
==========================================
- Coverage 37.60% 37.30% -0.31%
==========================================
Files 14 14
Lines 2917 2941 +24
==========================================
Hits 1097 1097
- Misses 1737 1761 +24
Partials 83 83
Continue to review full report at Codecov.
|
/test 4.7-operator-unit-test |
controllers/bucket_controller.go
Outdated
deleted, err := clnt.Delete() | ||
if err != nil { | ||
log.Error(err, "unable to delete bucket") | ||
b.EventRecorder.Event(&bucket, corev1.EventTypeWarning, "unable to delete bucket", fmt.Sprintf("unable to delete bucket: %v", bucket.Spec.Name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the event needs to look different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after updating the event names
58c3844
to
b402ffa
Compare
/retest |
@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. |
New:
oadp.openshift.io/cloudstorage-delete: "true"
is now required to trigger bucket deletionFix:
Example annotation
If user wants to remove the CloudStorage custom resource from the cluster without deleting bucket from cloud provider, they can do so by
oadp.openshift.io/cloudstorage-delete: "true"
annotationoc delete cloudstorage/<name>