refactor builder in kubectl factory
This commit is contained in:
@@ -26,7 +26,6 @@ import (
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
@@ -170,17 +169,6 @@ func (b *Builder) Local(mapperFunc ClientMapperFunc) *Builder {
|
||||
return b
|
||||
}
|
||||
|
||||
// Unstructured updates the builder's ClientMapper, RESTMapper,
|
||||
// ObjectTyper, and codec for working with unstructured api objects
|
||||
func (b *Builder) Unstructured(mapperFunc ClientMapperFunc, mapper meta.RESTMapper, typer runtime.ObjectTyper) *Builder {
|
||||
b.mapper.RESTMapper = mapper
|
||||
b.mapper.ObjectTyper = typer
|
||||
b.mapper.Decoder = unstructured.UnstructuredJSONScheme
|
||||
b.mapper.ClientMapper = ClientMapperFunc(mapperFunc)
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
// URL accepts a number of URLs directly.
|
||||
func (b *Builder) URL(httpAttemptCount int, urls ...*url.URL) *Builder {
|
||||
for _, u := range urls {
|
||||
|
Reference in New Issue
Block a user