Output TYPE for getting service

Now service already supported 4 ServiceTypes, ServiceTypes is
friendly to distinguish services, so outputing service type better
when running 'kubectl get service'.
This commit is contained in:
FengyunPan
2017-06-18 12:19:57 +08:00
parent a57c33bd28
commit f01f9a9035
3 changed files with 14 additions and 12 deletions

View File

@@ -594,6 +594,7 @@ func Example_printServiceWithNamespacesAndLabels() {
"s": "magic",
},
ClusterIP: "10.1.1.1",
Type: api.ServiceTypeClusterIP,
},
Status: api.ServiceStatus{},
},
@@ -615,6 +616,7 @@ func Example_printServiceWithNamespacesAndLabels() {
"s": "kazam",
},
ClusterIP: "10.1.1.2",
Type: api.ServiceTypeClusterIP,
},
Status: api.ServiceStatus{},
}},
@@ -627,9 +629,9 @@ func Example_printServiceWithNamespacesAndLabels() {
fmt.Printf("Unexpected error: %v", err)
}
// Output:
// |NAMESPACE NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE L1|
// |ns1 svc1 10.1.1.1 <unknown> 53/UDP,53/TCP 10y value|
// |ns2 svc2 10.1.1.2 <unknown> 80/TCP,8080/TCP 10y dolla-bill-yall|
// |NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE L1|
// |ns1 svc1 ClusterIP 10.1.1.1 <none> 53/UDP,53/TCP 10y value|
// |ns2 svc2 ClusterIP 10.1.1.2 <none> 80/TCP,8080/TCP 10y dolla-bill-yall|
// ||
}