add --all-namespaces flag to request across all namespaces

This commit is contained in:
Masahiro Sano
2015-05-12 20:14:31 +09:00
parent d9d12fd3f7
commit 8ce64ec69e
11 changed files with 50 additions and 30 deletions

View File

@@ -23,6 +23,7 @@ import (
"os"
"strings"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/meta"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
@@ -220,6 +221,15 @@ func (b *Builder) DefaultNamespace() *Builder {
return b
}
// AllNamespaces instructs the builder to use NamespaceAll as a namespace to request resources
// acroll all namespace. This overrides the namespace set by NamespaceParam().
func (b *Builder) AllNamespaces(allNamespace bool) *Builder {
if allNamespace {
b.namespace = api.NamespaceAll
}
return b
}
// RequireNamespace instructs the builder to set the namespace value for any object found
// to NamespaceParam() if empty, and if the value on the resource does not match
// NamespaceParam() an error will be returned.