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 kudo init --verify on cluster without KUDO #1757

Merged
merged 1 commit into from
Jan 23, 2021
Merged

Conversation

ANeumann82
Copy link
Member

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

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() {
Copy link
Contributor

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...

Copy link
Member Author

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...

Copy link
Contributor

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...

Copy link
Contributor

@alenkacz alenkacz left a 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() {
Copy link
Contributor

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...

@alenkacz alenkacz merged commit 7be10eb into main Jan 23, 2021
@alenkacz alenkacz deleted the an/fix-init-verify branch January 23, 2021 19:09
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.

kudo init --verify throws an error when KUDO is not installed
2 participants