minishift / minishift-addons

A repository for the community to exchange Minishift add-ons
Apache License 2.0
71 stars 86 forks source link

Comment out new-project in grafana addon #143

Closed cunningt closed 5 months ago

cunningt commented 6 years ago

Comment out new-project in grafana addon - grafana is often paired with Prometheus, but the new-project in the grafana addon hinders that. Once conditionals are added, probably should test for whether the project namespace exists or not.

centos-ci commented 6 years ago

Can one of the admins verify this patch?

cunningt commented 6 years ago

@budhram @praveenkumar The problem here is that oc new-project returns non zero when the project already exists ...

tcunning@tcunning-OSX:/tmp/prometheus-operator$ oc new-project myproject
Error from server (AlreadyExists): project.project.openshift.io "myproject" already exists
tcunning@tcunning-OSX:/tmp/prometheus-operator$ echo $?
1

so the script bombs out at that point if the project doesn't exist. You can easily do a oc new-project and create a project, but the inclusion of the oc new-project line here means you can't ever install grafana into a previously existing namespace - which means the addon is essentially useless because the main use case for grafana is going to be installing it into a namespace with other stuff. Grafana is a graphing engine and there has to be something pumping out data (prometheus, database, etc) for it to visualize.

It'd be great if oc new-project had a flag like --no-fail that returned 0 if the project exists.