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

fix(networking): cleanup service/endpoint if needed #3078

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

Vicente-Cheng
Copy link
Contributor

@Vicente-Cheng Vicente-Cheng commented Aug 21, 2024

Which issue(s) this PR fixes:

Issue longhorn/longhorn#9272

What this PR does / why we need it:

We meet a corner case that the service/endpoint would not be cleanup. That will cause the service keep the ClusterIP None. With this config, the endpoint of sharemanager would not be correct, so the CSI driver cannot perform the mountpoint well.

We would like to have a checking mechanism to know if the service/endpoint did not cleanup. Then we will cleanup the service/endpoint to ensure the correct endpoint.

Special notes for your reviewer:

Additional documentation or context

@Vicente-Cheng Vicente-Cheng changed the title sharemanager controller: cleanup service/endpoint if needed fix(networking): cleanup service/endpoint if needed Aug 21, 2024
@Vicente-Cheng Vicente-Cheng force-pushed the cleanup-service-endpoint branch 2 times, most recently from b8e8bae to 2411a2e Compare August 22, 2024 08:38
@Vicente-Cheng
Copy link
Contributor Author

codeFactor checking failure is not related to this PR.

@Vicente-Cheng Vicente-Cheng marked this pull request as ready for review August 22, 2024 08:42
james-munson
james-munson previously approved these changes Aug 22, 2024
Copy link
Contributor

@james-munson james-munson left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me.

controller/share_manager_controller.go Outdated Show resolved Hide resolved
controller/share_manager_controller.go Outdated Show resolved Hide resolved
controller/share_manager_controller.go Outdated Show resolved Hide resolved
controller/share_manager_controller.go Outdated Show resolved Hide resolved
controller/share_manager_controller.go Outdated Show resolved Hide resolved
controller/share_manager_controller.go Show resolved Hide resolved
controller/share_manager_controller.go Outdated Show resolved Hide resolved
@Vicente-Cheng Vicente-Cheng force-pushed the cleanup-service-endpoint branch 2 times, most recently from 552adef to 072656f Compare August 23, 2024 02:11
controller/share_manager_controller.go Outdated Show resolved Hide resolved
@Vicente-Cheng Vicente-Cheng force-pushed the cleanup-service-endpoint branch 2 times, most recently from ed2d224 to c3c1673 Compare August 23, 2024 05:38
derekbit
derekbit previously approved these changes Aug 23, 2024
Copy link
Member

@derekbit derekbit left a comment

Choose a reason for hiding this comment

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

LGTM.

@derekbit
Copy link
Member

Need @c3y1huang's final check and approval. Thank you.

controller/share_manager_controller.go Outdated Show resolved Hide resolved
controller/share_manager_controller.go Outdated Show resolved Hide resolved
derekbit
derekbit previously approved these changes Aug 23, 2024
Copy link
Member

@derekbit derekbit left a comment

Choose a reason for hiding this comment

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

LGTM

controller/share_manager_controller.go Outdated Show resolved Hide resolved
    We meet a corner case that the service/endpoint would not be
    cleanup. That will cause the service keep the ClusterIP `None`.
    With this config, the endpoint of sharemanager would not correct.
    So the CSI driver cannot perform the mountpoint well.

    We would like to have a checking mechanism to know if the service/
    endpoint did not cleanup. Then we will cleanup the service/endpoint
    to ensure the correct endpoint.

    Remove the cleanup function in the setting controller, we could do
    the cleanup on the sm controller

Signed-off-by: Vicente Cheng <vicente.cheng@suse.com>
Co-authored-by: Chin-Ya Huang <chin-ya.huang@suse.com>
Co-authored-by: Derek Su <derek.su@suse.com>
Copy link
Contributor

@c3y1huang c3y1huang left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the fix.

@c3y1huang c3y1huang merged commit abb2235 into longhorn:master Aug 23, 2024
7 of 8 checks passed
@c3y1huang
Copy link
Contributor

@mergify backport v1.7.x

Copy link

mergify bot commented Aug 23, 2024

backport v1.7.x

✅ Backports have been created

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