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

Add endpoint package #1

Merged
merged 3 commits into from
Nov 5, 2021
Merged

Conversation

alaypatel07
Copy link
Contributor

Describe what this PR does
This PR adds an endpoint package with the interface methods and
two implementations. One is Route implementation and the other is LoadBalancer.

Is there anything that requires special attention?
This also attempts to solve two distinct requirements for reconcilers:

  1. Ability to watch resources that are reconciled in the packages
  2. Communicate the RBAC required via documenting annotations on the New methods

Related issues:
None

@alaypatel07 alaypatel07 force-pushed the endpoint branch 3 times, most recently from e7b3d66 to c14969f Compare November 4, 2021 21:22
Copy link
Member

@JohnStrunk JohnStrunk left a comment

Choose a reason for hiding this comment

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

  • What do you think of moving utils/ to internal/utils/? Do we want the utils package to be a part of the library's API?

  • I'm not going to hold up the PR for it, but we may want move to envtest instead of client/fake for the tests.

.github/workflows/tests.yml Outdated Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
endpoint/loadbalancer/loadbalancer.go Outdated Show resolved Hide resolved
// IsHealthy returns whether or not all Kube resources used by endpoint are healthy
IsHealthy(ctx context.Context, c client.Client) (bool, error)
// MarkForCleanup
MarkForCleanup(ctx context.Context, c client.Client, key, value string) error
Copy link
Member

Choose a reason for hiding this comment

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

I assume they will pass in and remember the k/v that gets applied to the underlying objects, but how will they do the actual cleanup? Are they expected to do the DeleteAllOf on the types that are returned by a call to APIsToWatch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored, thanks!

^ that was in response to a different comment.

But yes, I imagine APIsToWatch feeding the cleanup APIs as well. Open to renaming the function as appropriate.

Copy link

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

/LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 5, 2021

@shawn-hurley: changing LGTM is restricted to collaborators

In response to this:

/LGTM

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/test-infra repository.

alaypatel07 and others added 3 commits November 5, 2021 12:44
Signed-off-by: Alay Patel <alay1431@gmail.com>
Signed-off-by: Alay Patel <alay1431@gmail.com>
Co-authored-by: John Strunk <jstrunk@redhat.com>
Signed-off-by: Alay Patel <alay1431@gmail.com>
Copy link
Member

@JohnStrunk JohnStrunk left a comment

Choose a reason for hiding this comment

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

Thanks, Alay!

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 5, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alaypatel07, JohnStrunk, shawn-hurley

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:
  • OWNERS [JohnStrunk,alaypatel07]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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.

None yet

4 participants