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 check for empty DNS value in ca init #815

Merged
merged 3 commits into from
Jan 11, 2023
Merged

Conversation

hslatman
Copy link
Member

No description provided.

@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Dec 13, 2022
command/ca/init.go Outdated Show resolved Hide resolved
dopey
dopey previously approved these changes Dec 14, 2022
@hslatman
Copy link
Member Author

I've taken your suggestion, @dopey. It's simpler 🙂

By the way, there was another PR that addressed the issue at hand: #812. It didn't accept all things we do now, so we can't merge it. But I think the additional validations for the DNS hostname may be a nice addition to the CLI validators. WDYT?

// all are empty (length 0).
func allEmpty(parts []string) bool {
for _, p := range parts {
if len(p) > 0 {
Copy link
Contributor

@dopey dopey Dec 15, 2022

Choose a reason for hiding this comment

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

Is there a reason we're specifically checking for len here? With strings in golang I thought it was more idiomatic to check if it's equivalent to "".

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 3dca2ff. You're right; it's more idiomatic that way.

@hslatman hslatman force-pushed the herman/fix-empty-dns-init branch from d003588 to 3dca2ff Compare December 15, 2022 10:48
@hslatman hslatman enabled auto-merge December 16, 2022 10:41
@hslatman hslatman requested a review from dopey December 16, 2022 10:41
@hslatman hslatman added this to the v0.24.0 milestone Jan 11, 2023
@hslatman hslatman merged commit 37ace5e into master Jan 11, 2023
@hslatman hslatman deleted the herman/fix-empty-dns-init branch January 11, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants