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

Refactor healthchecksl4, change functions order, rename functions #1808

Merged

Conversation

panslava
Copy link
Contributor

@panslava panslava commented Sep 13, 2022

  1. Moved functions to be defined in order of execution
  2. Renamed EnsureHealthCheck -> EnsureHealthCheckWithFirewall, DeleteHealthCheck -> DeleteHealthCheckWithFirewall

No functional changes, just small refactoring

This is needed for Dual-Stack #1782, but doing this in separate PR

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 13, 2022
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 13, 2022
@panslava panslava force-pushed the small-refactor-l4healthchecks branch from a46af84 to 6e7e0f1 Compare September 13, 2022 15:16
@panslava
Copy link
Contributor Author

/assign kl52752

@panslava panslava force-pushed the small-refactor-l4healthchecks branch 4 times, most recently from d078f0c to a06994c Compare September 13, 2022 15:52
@panslava panslava changed the title Small refactor healthchecksl4, change functions order, rename function Small refactor healthchecksl4, change functions order, rename functions Sep 13, 2022
@panslava panslava marked this pull request as draft September 13, 2022 15:57
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 13, 2022
@panslava panslava force-pushed the small-refactor-l4healthchecks branch 2 times, most recently from 6488a06 to b0cc6ff Compare September 13, 2022 16:03
@panslava panslava marked this pull request as ready for review September 13, 2022 16:03
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 13, 2022
pkg/healthchecksl4/healthchecksl4.go Outdated Show resolved Hide resolved
err := l4hc.hcProvider.Delete(hcName, scope)
if err != nil {
// Ignore deletion error due to health check in use by another resource.
if !utils.IsInUsedByError(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should check the value of sharedHC to see if this error is really related to shared health check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, that can be useful, but I don't want to change a lot of "logic" in this PR

Also, what if user decided to use our non-shared "healthcheck" for his own resources (which is weird case, but possible), so I am not sure, how we should act in this situation

pkg/healthchecksl4/interfaces.go Outdated Show resolved Hide resolved
pkg/healthchecksl4/interfaces.go Outdated Show resolved Hide resolved
@panslava panslava force-pushed the small-refactor-l4healthchecks branch from b0cc6ff to 004c214 Compare September 13, 2022 17:13
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 13, 2022
@panslava panslava force-pushed the small-refactor-l4healthchecks branch from 004c214 to 804528d Compare September 13, 2022 17:17
@panslava panslava changed the title Small refactor healthchecksl4, change functions order, rename functions Refactor healthchecksl4, change functions order, rename functions Sep 13, 2022
- change functions order
- extracted deleting health check to deleteHealthCheck function
- rename EnsureHealthCheck -> EnsureHealthCheckWithFirewall,
  DeleteHealthCheck -> DeleteHealthCheckWithFirewall
- removed unused return value from ensureHealthCheck
@panslava panslava force-pushed the small-refactor-l4healthchecks branch from 804528d to 8b55dcc Compare September 13, 2022 17:38
@kl52752
Copy link
Contributor

kl52752 commented Sep 13, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 13, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kl52752, panslava

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

@k8s-ci-robot k8s-ci-robot merged commit 4a6258b into kubernetes:master Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants