update kubectl subcommand with -k changes

This commit is contained in:
Jingfang Liu
2019-02-25 16:30:50 -08:00
parent 0c026bfac1
commit b38cf738d6
18 changed files with 47 additions and 22 deletions

View File

@@ -115,6 +115,9 @@ var (
# List a pod identified by type and name specified in "pod.yaml" in JSON output format.
kubectl get -f pod.yaml -o json
# List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml.
kubectl get -k dir/
# Return only the phase value of the specified pod.
kubectl get -o template pod/web-pod-13je7 --template={{.status.phase}}
@@ -257,7 +260,7 @@ func (o *GetOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []stri
switch {
case o.Watch || o.WatchOnly:
default:
if len(args) == 0 && cmdutil.IsFilenameSliceEmpty(o.Filenames) {
if len(args) == 0 && cmdutil.IsFilenameSliceEmpty(o.Filenames, o.Kustomize) {
fmt.Fprintf(o.ErrOut, "You must specify the type of resource to get. %s\n\n", cmdutil.SuggestAPIResources(o.CmdParent))
fullCmdName := cmd.Parent().CommandPath()
usageString := "Required resource not specified."