Merge pull request #47719 from xilabao/fix-set-selector-1

Automatic merge from submit-queue (batch tested with PRs 48196, 42783, 48507, 47719, 46138)

fix parse resource in setting selector

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2017-07-11 23:09:13 -07:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@@ -116,6 +116,10 @@ func (o *SelectorOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args [
mapper, _ := f.Object()
o.mapper = mapper
o.encoder = f.JSONEncoder()
o.resources, o.selector, err = getResourcesAndSelector(args)
if err != nil {
return err
}
o.builder = f.NewBuilder(!o.local).
ContinueOnError().
@@ -135,8 +139,6 @@ func (o *SelectorOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args [
o.ClientForMapping = func(mapping *meta.RESTMapping) (resource.RESTClient, error) {
return f.ClientForMapping(mapping)
}
o.resources, o.selector, err = getResourcesAndSelector(args)
return err
}