Commit 243de3a4 authored by Jeff Lowdermilk's avatar Jeff Lowdermilk

Fix kubectl log for single-container pods

parent e4fc45c2
......@@ -100,6 +100,10 @@ func RunLog(f *Factory, out io.Writer, cmd *cobra.Command, args []string) error
var container string
if len(args) == 1 {
if len(pod.Spec.Containers) != 1 {
return fmt.Errorf("POD %s has more than one container; please specify the container to print logs for", pod.ObjectMeta.Name)
}
container = pod.Spec.Containers[0].Name
} else {
container = args[1]
}
......
......@@ -49,7 +49,7 @@ func CheckErr(err error) {
if client.IsUnexpectedStatusError(err) {
glog.FatalDepth(1, fmt.Sprintf("Unexpected status received from server: %s", err.Error()))
}
glog.FatalDepth(1, fmt.Sprintf("Error: %s", err.Error()))
glog.FatalDepth(1, fmt.Sprintf("Client error: %s", err.Error()))
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment