Skip to content

Refactor/PR comments for auto-cert matching + documentation #864

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

Merged
merged 7 commits into from
Feb 21, 2019

Conversation

khyew
Copy link

@khyew khyew commented Feb 20, 2019

  • Addressed PR comments from previously-approved (and merged) PR Auto-add certs from ACM by hostname if none are specified via annotation #851

  • Use DeepEquals instead of a loop to match wildcard hostnames

  • Use k8s sets package instead of string-boolean maps as sets for removing duplicate hosts

  • Made inferCertArns a member function of the defaultController struct to avoid having to pass singletons around

  • Added documentation and examples for auto-cert matching

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 20, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @khyew. Thanks for your PR.

I'm waiting for a kubernetes-sigs or 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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 20, 2019
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 20, 2019
@khyew
Copy link
Author

khyew commented Feb 20, 2019

/assign @M00nF1sh

@M00nF1sh
Copy link
Collaborator

awesome!
/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 20, 2019
@M00nF1sh
Copy link
Collaborator

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: khyew, M00nF1sh

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 21, 2019
@khyew
Copy link
Author

khyew commented Feb 21, 2019

I... don't understand. The unit test passes locally.

@khyew khyew force-pushed the fix-lookup-cert-arns branch from fea14c0 to d1bc9a9 Compare February 21, 2019 01:32
@khyew
Copy link
Author

khyew commented Feb 21, 2019

Force-pushing after a rebase onto master to see if things are out of sync from my local repo...

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2019
@khyew
Copy link
Author

khyew commented Feb 21, 2019

@M00nF1sh looks like the unit tests pass now (with no changes other than a rebase and forced re-push). Can you approve again when you get a chance?

@M00nF1sh
Copy link
Collaborator

umm..that should indicate some flakes happend..wait me double check your test cases

@M00nF1sh
Copy link
Collaborator

Hi,
It's because you are returning sets.String.unsortedList() from inferCertCRN & uniqueHosts.(the order of these returned [] is pure random), and in the test comparsion, order matters when compare [].

Fix:

  1. return sets.String instead of []string, and change the expectations in test cases to sets.String{} too.
  2. return sets.String.List() (i'm ok with this since this have little performance drawbacks)

@khyew
Copy link
Author

khyew commented Feb 21, 2019

oh wow yeah, that totally slipped my mind

@khyew
Copy link
Author

khyew commented Feb 21, 2019

I actually would have been in favour of changing the tests to not expect the results to come in a specific order, because the function itself makes no guarantee of specific ordering and this couples the tests a bit too tightly with the current implementation. But in this case since the fix takes literally 5 seconds, I'm just going to convert the calls from UnsortedList() to List().

@M00nF1sh
Copy link
Collaborator

/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 21, 2019
@k8s-ci-robot k8s-ci-robot merged commit 1f16379 into kubernetes-sigs:master Feb 21, 2019
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