googlearchive / k8s-service-catalog

[DEPRECATED] Commandline tool to manage Service Catalog lifecycle and GCP Service Broker atop Kubernetes Cluster
Apache License 2.0
69 stars 31 forks source link

Add cluster info into error messages #189

Open maqiuyujoyce opened 6 years ago

maqiuyujoyce commented 6 years ago

When I tried to run sc remove-gcp-broker, I got the following error message:

Failed to remove the Service Broker Error: error deleting broker resources: failed to delete resources output: exit status 1: Error from server (Forbidden): error when deleting "/tmp/service-catalog-gcp805626444/namespace.yaml": namespaces "google-oauth" is forbidden: User "" cannot delete namespaces in the namespace "google-oauth": Required "container.namespaces.delete" permission.

I assigned myself Kubernetes Engine Admin role (which covers the specific permission showed in the error message) but still got the same error.

Eventually I realized that the actual root cause is that I was connecting to the incorrect cluster.

So it might be good for us to also include the cluster name into the error message when the tool failed in kubectl commands.