-
Notifications
You must be signed in to change notification settings - Fork 303
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
Initial Refactor of TargetProxy to Translator Package #1168
Initial Refactor of TargetProxy to Translator Package #1168
Conversation
Hi @spencerhance. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @rramkumar1 |
@rramkumar1 I added another commit to handle sslPolicy. It gets a bit tricky since we the proxy only holds a string, but we use a pointer to hold all three states. We currently don't update the policy if the user deletes the FC or sets the policy to nil. I'm not sure if there's a better way to handle this, or if the original commit makes more sense for now until we have a general solution for backendconfig/frontendconfig. Ideally in the future we should delete the policy if the FC is deleted. |
/ok-to-test |
@@ -37,6 +39,8 @@ import ( | |||
type Env struct { | |||
// Ing is the Ingress we are translating. | |||
Ing *v1beta1.Ingress | |||
// FrontendConfig is the frontendconfig associated with the Ingress | |||
FrontendConfig *frontendconfigv1beta1.FrontendConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add TODO that this should eventually be a map of FrontendConfigs (similar to Secret)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/translator/translator.go
Outdated
// 1) policy is nil -> this returns nil | ||
// 2) policy is an empty string -> this returns an empty string | ||
// 3) policy is non-empty -> this constructs the resource path and returns it | ||
func getSslPolicyLink(env *Env) (*string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove get
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/translator/translator_test.go
Outdated
} | ||
|
||
for _, tc := range testCases { | ||
env := &Env{FrontendConfig: tc.fc} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use t.Run and pass the description there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
6398ab1
to
e97e46a
Compare
pkg/translator/translator_test.go
Outdated
} | ||
|
||
if !reflect.DeepEqual(result, tc.want) { | ||
t.Errorf("desc: %q, l7.getSslPolicyLink() = %v, want %+v", tc.desc, result, tc.want) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need this anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops. Fixed that and the rest of the error
e97e46a
to
67f5cc7
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rramkumar1, spencerhance 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 |
Refactors TargetHttp/Https Proxy to Translator package, including SSL Policy.