Skip to content

Commit

Permalink
Merge pull request kubernetes#29382 from ncdc/automated-cherry-pick-o…
Browse files Browse the repository at this point in the history
…f-#28294-upstream-release-1.3

Automatic merge from submit-queue

Automated cherry pick of kubernetes#28294

Cherry pick of kubernetes#28294 on release-1.3.
  • Loading branch information
k8s-merge-robot authored Jul 21, 2016
2 parents fe4251f + 91c93a4 commit 527483f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hack/test-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,20 @@ __EOF__
# Post-condition: POD abc should error since it doesn't exist
kube::test::if_has_string "${output_message}" 'pods "abc" not found'

### Test retrieval of non-existing POD with json output flag specified
# Pre-condition: no POD exists
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
# Command
output_message=$(! kubectl get pods abc 2>&1 "${kube_flags[@]}" -o json)
# Post-condition: POD abc should error since it doesn't exist
kube::test::if_has_string "${output_message}" 'pods "abc" not found'
# Post-condition: make sure we don't display an empty List
if kube::test::if_has_string "${output_message}" 'List'; then
echo 'Unexpected List output'
echo "${LINENO} $(basename $0)"
exit 1
fi

#####################################
# Third Party Resources #
#####################################
Expand Down
3 changes: 3 additions & 0 deletions pkg/kubectl/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ func RunGet(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string
singular := false
infos, err := r.IntoSingular(&singular).Infos()
if err != nil {
if singular {
return err
}
allErrs = append(allErrs, err)
}

Expand Down

0 comments on commit 527483f

Please sign in to comment.