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: simplify ClientSet and add comments #700

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justinsb
Copy link
Contributor

No description provided.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 29, 2025
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 29, 2025
@justinsb
Copy link
Contributor Author

/assign @cheftako

return ok
}

// HasID returns true if the ClientSet has a client to the specified serverID.
func (cs *ClientSet) HasID(serverID string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

HasID looks unused, can be trimmed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So because it is exported, I wasn't sure that it was safe to remove - it could be used from another project maybe? But maybe it's only konnectivity-client that we consider part of our "API contract"?

Do we run an e2e where we just check that e.g. kube-apiserver still builds - I think that's probably our primary client, and I think I'd be very comfortable removing exported functions as long as apiserver still compiles.

On the other hand, I do agree, it's probably safe to remove, but maybe lots of small safe cleanups are better than one big (and potentially risky) cleanup?

Copy link
Contributor

Choose a reason for hiding this comment

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

So because it is exported, I wasn't sure that it was safe to remove - it could be used from another project maybe? But maybe it's only konnectivity-client that we consider part of our "API contract"?

Your point is right, but historically pkg/agent has always been specific to konnectivity-agent binary.

Do we run an e2e where we just check that e.g. kube-apiserver still builds - I think that's probably our primary client, and I think I'd be very comfortable removing exported functions as long as apiserver still compiles.

apiserver doesn't depend on pkg/agent. This repo has .github/workflows/e2e.yaml checking apiserver for k8s versions against locally-built konnectivity-server and konnectivity-agent, but mistakes made in konnectivity-client aren't fully detected until attempts to release to k/k.

On the other hand, I do agree, it's probably safe to remove, but maybe lots of small safe cleanups are better than one big (and potentially risky) cleanup?

I would still include it, but no objections to keeping as-is, this PR is strictly improvement.

@jkh52
Copy link
Contributor

jkh52 commented Feb 4, 2025

/lgtm
/approve

/hold

HOLD only for the optional nit and allow @cheftako to look.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 4, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 4, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkh52, justinsb

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 4, 2025
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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants