-
Notifications
You must be signed in to change notification settings - Fork 101
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 kudo init --verify on cluster without KUDO #1757
Conversation
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
@@ -111,6 +111,10 @@ func (k *KudoWebHook) verifyWithCertManager(client *kube.Client, result *verifie | |||
if err := k.validateCertManagerInstallation(client, result); err != nil { | |||
return err | |||
} | |||
if !result.IsValid() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait so verifier returns errors but you still have to check the result? 🤔 that's kind of error-prone...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it is... It's about different things:
- The return value determines if there was an error in the validation process
- The result contains errors that the validation detected
In hindsight it would be better to have just the result and handle the validation exceptions there as well...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that sounds like better design probably...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
@@ -111,6 +111,10 @@ func (k *KudoWebHook) verifyWithCertManager(client *kube.Client, result *verifie | |||
if err := k.validateCertManagerInstallation(client, result); err != nil { | |||
return err | |||
} | |||
if !result.IsValid() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that sounds like better design probably...
Signed-off-by: Andreas Neumann aneumann@mesosphere.com
What this PR does / why we need it:
Don't throw exception when running kudo init --verify against a cluster without KUDO
Fixes #1753