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 stunnel client implementation #7

Merged
merged 2 commits into from
Dec 1, 2021

Conversation

alaypatel07
Copy link
Contributor

Describe what this PR does
This adds stunnel client implementation. Depends on #4 fixes #5

Is there anything that requires special attention?

Related issues:

@alaypatel07 alaypatel07 changed the title [WIP]: add stunnel client implementation add stunnel client implementation Nov 19, 2021
@openshift-ci openshift-ci bot added size/XL and removed size/XXL labels Nov 19, 2021
@alaypatel07 alaypatel07 force-pushed the stunnel-client branch 4 times, most recently from e6427c5 to a477b7b Compare November 20, 2021 02:48
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.

Just a couple little items.
But I am curious about your thoughts on the consistency of the Interface method names. (or maybe having too many days off just left me confused 😕)

transport/stunnel/client.go Outdated Show resolved Hide resolved

type client struct {
logger logr.Logger
ingressPort int32
Copy link
Member

Choose a reason for hiding this comment

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

I'm struggling a bit w/ the ingressPort name. It's ConnectPort in the Transport interface, but the NewClient params also refer to it as ingressPort. And Endpoint has IngressPort().
Did we make a mistake by having Transport.ConnectPort() and Endpoint.IngressPort()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's part of a bad refactor, it should be connectPort here in the transport package.

IMO, having ListenPort and ConnectPort at the transport level makes sense because out of the port one is used to accept connection other is used to connect.

In the case of endpoint interface both are used to accept connections, the difference is whether it is exposed external to the cluster or it is internal because of which BackendPort and IngressPort made much more sense, assuming Ingress is the terms used widely to accept traffic into the cluster. Most Kube resources use targetPort and port to mean the same thing respectively but that was turning out to be a little confusing when we were having conversations in the team about this. I would be open to renaming the endpoint interface methods if we want to be consistent with Kube resource fields

return "localhost"
}

func NewClient(ctx context.Context, c ctrlclient.Client, logger logr.Logger,
Copy link
Member

Choose a reason for hiding this comment

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

Please comment the params

Co-authored-by: John Strunk <[email protected]>
Signed-off-by: Alay Patel <[email protected]>
@alaypatel07
Copy link
Contributor Author

@JohnStrunk Thanks for the feedback, updated a couple of things and added clarification on the naming, PTAL. If we do want to revisit the endpoint interface naming, can we let this PR in and handle it in a separate issue? Thanks

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.

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 1, 2021

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@openshift-merge-robot openshift-merge-robot merged commit 02dbbbb into backube:main Dec 1, 2021
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.

Implement stunnel client
3 participants