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 validation to k8s version, improve error messages #26

Merged
merged 2 commits into from
Nov 23, 2017

Conversation

ngtuna
Copy link
Contributor

@ngtuna ngtuna commented Nov 9, 2017

This PR adds validation to k8s version before installing/uninstalling kubeapps and returns a warning message to let user aware of using k8s 1.7+ with RBAC enabled. This also contains several error messages which turns the tool to become more friendly.

@ngtuna
Copy link
Contributor Author

ngtuna commented Nov 9, 2017

Ref issue #23

@ngtuna ngtuna requested a review from arapulido November 9, 2017 02:49
cmd/down.go Outdated
}
if version.Major <= 1 && version.Minor < 7 {
fmt.Println("Warning: Kubernetes with RBAC enabled (v1.7+) is required to run Kubeapps")
os.Exit(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

the exit code should be different than 0 to return an error. Also, why exiting instead of returning the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it isn't an error. We just want to send a warning message and quit the installer gently.

Copy link
Contributor

Choose a reason for hiding this comment

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

but it should be an error, I mean if I want to deploy kubeapps and the command doesn't succeed the exit code shouldn't be 0

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @andresmgot , this should be considered an error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okie I turned to an error message in the follow-up commit. Please @arapulido @andresmgot take a look

cmd/root.go Outdated
Short: "Kubeapps Installer manages to install Kubeapps components to your cluster",
Use: "kubeapps",
Short: "Kubeapps Installer manages to install Kubeapps components to your cluster",
SilenceErrors: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

why silencing these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just a cobra's tactic for silencing errors down stream. Otherwise the error message will appear twice like this:

Error: the server could not find the requested resource
ERRO[0000] the server could not find the requested resource 

cmd/up.go Outdated
}

return c.Run(objs, wd)
fmt.Println("Successfully installed kubeapps.")
Copy link
Contributor

Choose a reason for hiding this comment

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

this gives the impression that kubeapps is now ready to be used (which is not true since it will be deploying for a while). I would set here a message that explains what to do next: monitor the deployment or wait for something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok so that probably should be directing user to run $ kubectl get po --all-namespaces -w for monitoring the deployment progress. WDYT ?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it is better to show the deployments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Working on a separate PR #52

@ngtuna
Copy link
Contributor Author

ngtuna commented Nov 20, 2017

This PR is pending a bit for this one vmware-archive/manifest#7 to be tackled

@ngtuna
Copy link
Contributor Author

ngtuna commented Nov 23, 2017

I would like to merge this PR as the last part of it is displaying output for kubeapps up is tackled on the separate PR #52. Ping @andresmgot

@ngtuna ngtuna merged commit 5c2069c into vmware-tanzu:master Nov 23, 2017
arapulido pushed a commit to arapulido/kubeapps that referenced this pull request Feb 13, 2018
prydonius pushed a commit that referenced this pull request Feb 23, 2018
add created-by=kubeapps label
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.

3 participants