Merge pull request #46507 from bboreham/dont-print-local-message

Automatic merge from submit-queue

Don't print message at the top of `set selector` or `set subject`

**What this PR does / why we need it**:

Stop printing "running in local/dry-run mode..." at the top of `set selector` or `set subject`, because the user may be trying to pipe the output of this command as the input to another. 

**Which issue this PR fixes**: 
fixes #46505

**Special notes for your reviewer**:
This PR makes `set subject` and `set resources` consistent with similar commands in the same directory.

**Release note**:

```release-note
`set selector` and `set subject` no longer print "running in local/dry-run mode..." at the top, so their output can be piped as valid yaml or json
```
This commit is contained in:
Kubernetes Submit Queue 2017-05-26 09:11:09 -07:00 committed by GitHub
commit 46dfb3abc7
2 changed files with 0 additions and 2 deletions

View File

@ -172,7 +172,6 @@ func (o *SelectorOptions) RunSelector() error {
return patch.Err
}
if o.local || o.dryrun {
fmt.Fprintln(o.out, "running in local/dry-run mode...")
o.PrintObject(info.Object)
return nil
}

View File

@ -224,7 +224,6 @@ func (o *SubjectOptions) Run(f cmdutil.Factory, fn updateSubjects) error {
}
if o.Local || o.DryRun {
fmt.Fprintln(o.Out, "running in local/dry-run mode...")
return o.PrintObject(o.Mapper, info.Object, o.Out)
}