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

[Fix] Validate when multiple providers are defined #450

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

kuritka
Copy link
Collaborator

@kuritka kuritka commented Apr 16, 2021

resolves #448

  • controller_test.go was missing NS1EnabledKey in the cleanup() and configureEnvVar(), added

  • rewrite depresolver.getEdgeDNSType(), the function now coud return one more DNSType: DNSTypeError.
    DNSTypeError indicates depresolver found more than one provider. DNSTypeError generates validation error on k8gb startup.

  • DNSTypeNoEdgeDNS is returned when no provider is not recognised. This state passes validation; @ytsarev, is that expected behavior ?

  • functionality covered by depresolver tests.

Signed-off-by: kuritka kuritka@gmail.com

@ytsarev
Copy link
Member

ytsarev commented Apr 16, 2021

@kuritka k8gb can operate without edgeDNS provider, e.g. in local scenario or in some edge case environments where zone delegation is configured outside of k8gb. So that's expected.

controllers/depresolver/depresolver_config.go Outdated Show resolved Hide resolved
controllers/depresolver/depresolver_config.go Outdated Show resolved Hide resolved
controllers/depresolver/depresolver_config.go Outdated Show resolved Hide resolved
Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

test naming comment/suggestion

controllers/depresolver/depresolver_test.go Outdated Show resolved Hide resolved
@kuritka kuritka force-pushed the 448-fix-fail-on-multiple-providers branch 2 times, most recently from beee1de to 3586b31 Compare April 19, 2021 11:44
@kuritka kuritka requested review from somaritane and ytsarev April 19, 2021 11:55
k0da
k0da previously approved these changes Apr 19, 2021
Copy link
Collaborator

@k0da k0da left a comment

Choose a reason for hiding this comment

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

LGTM

@kuritka kuritka force-pushed the 448-fix-fail-on-multiple-providers branch from 3586b31 to 3d517e6 Compare April 19, 2021 15:33
@kuritka
Copy link
Collaborator Author

kuritka commented Apr 19, 2021

@somaritane, resolved, thanks

@kuritka kuritka requested a review from somaritane April 19, 2021 15:34
resolves #448

 - `controller_test.go` was missing NS1EnabledKey in the cleanup() and configureEnvVar()
 - rewrite depresolver.getEdgeDNSType(), the function now return one more DNSType: `DNSTypeError`
 indicating, more than one providers were resolved. Depresolver generates error if finds that state.
 `DNSTypeNoEdgeDNS` is returned when no provider is recognised and is valid state.
 - cover functionality by depresolver tests.

Signed-off-by: kuritka <kuritka@gmail.com>
@kuritka kuritka force-pushed the 448-fix-fail-on-multiple-providers branch from 3d517e6 to c3c879f Compare April 19, 2021 15:36
Copy link
Contributor

@somaritane somaritane left a comment

Choose a reason for hiding this comment

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

@kuritka, looks good, just few suggestions

@kuritka kuritka requested a review from somaritane April 19, 2021 15:59
Copy link
Contributor

@somaritane somaritane left a comment

Choose a reason for hiding this comment

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

@kuritka LGTM

@kuritka kuritka merged commit 8150998 into master Apr 20, 2021
@kuritka kuritka deleted the 448-fix-fail-on-multiple-providers branch April 20, 2021 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

k8gb allows to load multiple providers
4 participants