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

common name annotation for services and ingresses #49

Merged
merged 1 commit into from
Nov 20, 2020

Conversation

MartinWeindel
Copy link
Member

What this PR does / why we need it:
Allow to specify the common name for certificates of services and ingresses explicitly by using an annotation cert.gardener.cloud/commonname.

Which issue(s) this PR fixes:
Fixes #48

Special notes for your reviewer:

Release note:

optional common name annotation for services and ingresses

@MartinWeindel MartinWeindel requested a review from a team as a code owner November 16, 2020 12:59
@gardener-robot gardener-robot added needs/review Needs review size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 16, 2020
@MartinWeindel MartinWeindel marked this pull request as draft November 16, 2020 12:59
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 16, 2020
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 17, 2020
@gardener-robot gardener-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 17, 2020
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 17, 2020
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 17, 2020
@MartinWeindel MartinWeindel marked this pull request as ready for review November 17, 2020 13:00
annotatedDomains := []string{}
if cn != "" {
annotatedDomains = append(annotatedDomains, cn)
}
for _, e := range strings.Split(a, ",") {
Copy link
Member

Choose a reason for hiding this comment

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

I think we already had a function like this to parse lists in strings in the CMLib.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, there is a function, but it produces a StringSet. The order should be kept here.

if e != "" && e != cn {
domains = append(domains, e)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

see above

}
result := []string{cn}
for _, host := range hosts {
if host != cn {
Copy link
Member

Choose a reason for hiding this comment

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

Is is required to exclude the cn from the hosts?

Copy link
Member Author

@MartinWeindel MartinWeindel Nov 18, 2020

Choose a reason for hiding this comment

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

It is excluded to avoid adding it twice.

@gardener-robot gardener-robot removed the needs/review Needs review label Nov 17, 2020
@MartinWeindel MartinWeindel merged commit f91e366 into master Nov 20, 2020
@MartinWeindel MartinWeindel deleted the commonname-annotation branch November 20, 2020 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

introduce annotation cert.gardener.cloud/commonname
5 participants