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

Initialize Mirroring spec to avoid nil pointer exception #241

Conversation

GowthamShanmugam
Copy link
Contributor

@GowthamShanmugam
Copy link
Contributor Author

/hold need to test

@GowthamShanmugam
Copy link
Contributor Author

/hold cancel

@GowthamShanmugam GowthamShanmugam force-pushed the fix_enable_mirroring branch 2 times, most recently from ff766cc to 4937b1c Compare November 26, 2024 11:18
addons/agent_mirrorpeer_controller.go Outdated Show resolved Hide resolved
Comment on lines +200 to +202
if sc.Spec.Mirroring == nil {
sc.Spec.Mirroring = &ocsv1.MirroringSpec{}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This place is different from above, the immediate if condition is raising nil pointer exception
if !utils.ContainsString(sc.Spec.Mirroring.PeerSecretNames, secretName)

so it has to be initialized before this line.

@umangachapagain
Copy link
Contributor

/cc @rewantsoni

@GowthamShanmugam
Copy link
Contributor Author

/cherry-pick release-4.18

@openshift-cherrypick-robot

@GowthamShanmugam: once the present PR merges, I will cherry-pick it on top of release-4.18 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.18

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-sigs/prow repository.

@rewantsoni
Copy link
Member

/lgtm

@rewantsoni
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Nov 28, 2024
Copy link
Contributor

openshift-ci bot commented Nov 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GowthamShanmugam, umangachapagain

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-merge-bot openshift-merge-bot bot merged commit 4305a16 into red-hat-storage:main Nov 28, 2024
11 checks passed
@openshift-cherrypick-robot

@GowthamShanmugam: new pull request created: #242

In response to this:

/cherry-pick release-4.18

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants