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

Implement SslPolicies for TargetHttpsProxy #1019

Merged

Conversation

spencerhance
Copy link
Contributor

This is the main feature PR for SslPolicies

This relies on a few other PRs, but can be reviewed in parallel

@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 4, 2020
@spencerhance
Copy link
Contributor Author

/assign @rramkumar1

@rramkumar1
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 6, 2020
pkg/loadbalancers/target_proxies.go Show resolved Hide resolved
pkg/loadbalancers/target_proxies.go Outdated Show resolved Hide resolved
pkg/loadbalancers/target_proxies.go Outdated Show resolved Hide resolved
@spencerhance spencerhance force-pushed the implement-feature-ssl-policy branch 2 times, most recently from b6d2046 to 561d69b Compare February 6, 2020 19:17
@spencerhance spencerhance force-pushed the implement-feature-ssl-policy branch 4 times, most recently from 351064e to c5703b8 Compare February 12, 2020 01:33
@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 Feb 12, 2020
@spencerhance
Copy link
Contributor Author

spencerhance commented Feb 12, 2020

@rramkumar1 Added a bunch of unit tests, can you take another look?

I also refactored the syncing logic so that we sync on target proxy creation and later syncs

@@ -97,6 +99,18 @@ func newTestJig(t *testing.T) *testJig {
tp.SslCertificates = request.SslCertificates
return nil
}
mockGCE.MockTargetHttpsProxies.SetSslPolicyHook = func(ctx context.Context, key *meta.Key, ref *compute.SslPolicyReference, proxies *cloud.MockTargetHttpsProxies) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this hook special? Can it be added to k8s_cloud_provider mock.go instead?

If its too much work to re-vendor then I suppose we can have this here but would be good to upstream

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I do this in a follow up and add a TODO here? Re-vendoring always takes like a couple days to get all the approvals.

@@ -439,3 +439,8 @@ func IsLegacyL4ILBService(svc *api_v1.Service) bool {
}
return false
}

// NewString returns a pointer to the provider string literal
Copy link
Contributor

Choose a reason for hiding this comment

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

provided

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -439,3 +439,8 @@ func IsLegacyL4ILBService(svc *api_v1.Service) bool {
}
return false
}

// NewString returns a pointer to the provider string literal
func NewString(s string) *string {
Copy link
Contributor

Choose a reason for hiding this comment

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

NewStringPointer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

desc string
fc *frontendconfigv1beta1.FrontendConfig
want *string
}{
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need a case for frontend config with empty string ssl policy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

want: "global/sslPolicies/test-policy",
},
{
desc: "proxy with different ssl policy",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a duplicate of the test case below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

want: "",
},
}

Copy link
Contributor

Choose a reason for hiding this comment

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

You need a case where a proxy has a policy and then the frontend config policy string is nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@rramkumar1
Copy link
Contributor

Be sure to send a PR for the k8s_cloud_provider change

/lgtm

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

[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 /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 17, 2020
@k8s-ci-robot k8s-ci-robot merged commit 05d9c8d into kubernetes:master Feb 17, 2020
@rnaveiras rnaveiras mentioned this pull request Feb 24, 2020
@spencerhance spencerhance deleted the implement-feature-ssl-policy branch June 29, 2020 22:17
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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