Browse code

Fix bug in error output

Clayton Coleman authored on 2015/04/10 03:39:23
Showing 2 changed files
... ...
@@ -138,7 +138,7 @@ export OPENSHIFT_PROFILE="${CLI_PROFILE-}"
138 138
 #
139 139
 
140 140
 # test client not configured
141
-[ "$(osc get services 2>&1 | grep 'no server found')" ]
141
+[ "$(osc get services 2>&1 | grep 'Error in configuration')" ]
142 142
 
143 143
 # Set KUBERNETES_MASTER for osc from now on
144 144
 export KUBERNETES_MASTER="${API_SCHEME}://${API_HOST}:${API_PORT}"
... ...
@@ -4,6 +4,7 @@ import (
4 4
 	"strings"
5 5
 
6 6
 	kerrors "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
7
+	"github.com/GoogleCloudPlatform/kubernetes/pkg/client/clientcmd"
7 8
 )
8 9
 
9 10
 const (
... ...
@@ -53,8 +54,7 @@ func detectReason(err error) int {
53 53
 		switch {
54 54
 		case strings.Contains(err.Error(), "certificate signed by unknown authority"):
55 55
 			return certificateAuthorityUnknownReason
56
-
57
-		case strings.Contains(err.Error(), "no server found for"):
56
+		case clientcmd.IsConfigurationInvalid(err), strings.Contains(err.Error(), "no server found for"):
58 57
 			return noServerFoundReason
59 58
 		}
60 59
 	}