Merge pull request #2501 from weaveworks/2497-log-k8s-deployments-error

Log specific error when deployments are not supported
This commit is contained in:
Alfonso Acosta
2017-05-05 16:00:16 +02:00
committed by GitHub

View File

@@ -150,7 +150,7 @@ func NewClient(config ClientConfig) (Client, error) {
// We would use NegotiateVersion, but Kubernetes 1.1 "supports"
// extensions/v1beta1, but not deployments or replicasets.
if _, err := ec.Deployments(api.NamespaceAll).List(api.ListOptions{}); err != nil {
log.Infof("Deployments and ReplicaSets are not supported by this Kubernetes version")
log.Infof("Deployments and ReplicaSets are not supported by this Kubernetes version: %v", err)
} else {
result.deploymentStore = &cache.StoreToDeploymentLister{Store: result.setupStore(ec, "deployments", &extensions.Deployment{})}
result.replicaSetStore = &cache.StoreToReplicaSetLister{Store: result.setupStore(ec, "replicasets", &extensions.ReplicaSet{})}