-
Notifications
You must be signed in to change notification settings - Fork 184
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
storageClusterPeer: add logic for storageclusterpeer controller #2678
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rewantsoni The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest-required |
controllers/util/k8sutil.go
Outdated
@@ -42,6 +42,9 @@ const ( | |||
|
|||
// This is the name for the OwnerUID FieldIndex | |||
OwnerUIDIndexName = "ownerUID" | |||
|
|||
// CephBlockPoolBlackListAnnotation is used to disable cephBlockPool mirroring for RDR | |||
CephBlockPoolBlackListAnnotation = "ocs.openshift.io/disable-mirroring" |
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.
Possible to use allow/reject
synonyms?
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.
Updated it to use CephBlockPoolForbidMirroringLabel = "ocs.openshift.io/forbid-mirroring"
CreateFunc: func(createEvent event.CreateEvent) bool { | ||
// Check if the annotation is not present | ||
if createEvent.Object.GetAnnotations() == nil { | ||
return false | ||
} | ||
if _, exists := createEvent.Object.GetAnnotations()[util.CephBlockPoolBlackListAnnotation]; !exists { | ||
return false | ||
} | ||
return true | ||
}, |
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.
why not use a value for annotation and change predicates to
CreateFunc: func(e event.CreateEvent) bool {
return e.Object.GetAnnotations()[annotation] != ""
}
func (r *StorageClusterPeerReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error) { | ||
var err error | ||
r.ctx = ctrllog.IntoContext(ctx, r.Log) | ||
r.Log.Info("Reconciling StorageClusterPeer.") |
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.
in the logs, could you pls check in this line, how many times the context is being logged? I wasn't able to find the offending line and probably think supplied param ctx
already has object and again ctrllog.IntoContext
duplicates it.
controllers/storageclusterpeer/storageclusterpeer_controller.go
Outdated
Show resolved
Hide resolved
1ea99b9
to
274a469
Compare
c31ebbe
to
cd4371e
Compare
controllers/storageclusterpeer/storageclusterpeer_controller.go
Outdated
Show resolved
Hide resolved
controllers/storageclusterpeer/storageclusterpeer_controller.go
Outdated
Show resolved
Hide resolved
controllers/storageclusterpeer/storageclusterpeer_controller.go
Outdated
Show resolved
Hide resolved
controllers/storageclusterpeer/storageclusterpeer_controller.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Rewant Soni <resoni@redhat.com>
ran make gen-protobuf to generate the code Signed-off-by: Rewant Soni <resoni@redhat.com>
Signed-off-by: Rewant Soni <resoni@redhat.com>
Signed-off-by: Rewant Soni <resoni@redhat.com>
Signed-off-by: Rewant Soni <resoni@redhat.com>
Signed-off-by: Rewant Soni <resoni@redhat.com>
cd4371e
to
47ad908
Compare
Signed-off-by: Rewant Soni <resoni@redhat.com>
47ad908
to
4b3c038
Compare
add logic for storage cluster peer controller
Depends on:
Part of RHSTOR-4886
(review only the last two commits)