Make a change to visitor to allow it to accept an error, like Go's path walker

This commit is contained in:
feihujiang
2015-06-15 10:48:56 +08:00
parent b5a4a548df
commit 29dc7f6ec2
12 changed files with 128 additions and 101 deletions

View File

@@ -68,7 +68,10 @@ func RunClusterInfo(factory *cmdutil.Factory, out io.Writer, cmd *cobra.Command)
SelectorParam("kubernetes.io/cluster-service=true").
ResourceTypeOrNameArgs(false, []string{"services"}...).
Latest()
b.Do().Visit(func(r *resource.Info) error {
b.Do().Visit(func(r *resource.Info, err error) error {
if err != nil {
return err
}
services := r.Object.(*api.ServiceList).Items
for _, service := range services {
var link string