Merge pull request #18101 from brendandburns/kubectl6

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot
2015-12-29 12:43:42 -08:00
14 changed files with 69 additions and 23 deletions

View File

@@ -69,6 +69,8 @@ type Builder struct {
singleResourceType bool
continueOnError bool
export bool
schema validation.Schema
}
@@ -235,6 +237,12 @@ func (b *Builder) Selector(selector labels.Selector) *Builder {
return b
}
// ExportParam accepts the export boolean for these resources
func (b *Builder) ExportParam(export bool) *Builder {
b.export = export
return b
}
// NamespaceParam accepts the namespace that these resources should be
// considered under from - used by DefaultNamespace() and RequireNamespace()
func (b *Builder) NamespaceParam(namespace string) *Builder {
@@ -513,7 +521,7 @@ func (b *Builder) visitorResult() *Result {
if mapping.Scope.Name() != meta.RESTScopeNameNamespace {
selectorNamespace = ""
}
visitors = append(visitors, NewSelector(client, mapping, selectorNamespace, b.selector))
visitors = append(visitors, NewSelector(client, mapping, selectorNamespace, b.selector, b.export))
}
if b.continueOnError {
return &Result{visitor: EagerVisitorList(visitors), sources: visitors}
@@ -571,7 +579,7 @@ func (b *Builder) visitorResult() *Result {
}
}
info := NewInfo(client, mapping, selectorNamespace, tuple.Name)
info := NewInfo(client, mapping, selectorNamespace, tuple.Name, b.export)
items = append(items, info)
}
@@ -620,7 +628,7 @@ func (b *Builder) visitorResult() *Result {
visitors := []Visitor{}
for _, name := range b.names {
info := NewInfo(client, mapping, selectorNamespace, name)
info := NewInfo(client, mapping, selectorNamespace, name, b.export)
visitors = append(visitors, info)
}
return &Result{singular: isSingular, visitor: VisitorList(visitors), sources: visitors}