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

storageClusterPeer: add logic for storageclusterpeer controller #2678

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

rewantsoni
Copy link
Member

@rewantsoni rewantsoni commented Jul 1, 2024

Copy link
Contributor

openshift-ci bot commented Jul 1, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rewantsoni
Once this PR has been reviewed and has the lgtm label, please assign iamniting for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rewantsoni
Copy link
Member Author

/retest-required

config/rbac/role.yaml Outdated Show resolved Hide resolved
controllers/util/k8sutil.go Outdated Show resolved Hide resolved
@@ -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"
Copy link
Contributor

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?

Copy link
Member Author

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"

api/v1/storageclusterpeer_types.go Outdated Show resolved Hide resolved
Comment on lines 80 to 84
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
},
Copy link
Contributor

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.")
Copy link
Contributor

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.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 24, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2024
@rewantsoni rewantsoni force-pushed the scp-controller branch 6 times, most recently from c31ebbe to cd4371e Compare July 31, 2024 10:56
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 10, 2024
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>
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 10, 2024
Signed-off-by: Rewant Soni <resoni@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants