mirror of https://github.com/rancher/wrangler.git
19 lines
405 B
Go
19 lines
405 B
Go
package apply
|
|
|
|
import (
|
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
|
"k8s.io/client-go/dynamic"
|
|
"k8s.io/client-go/rest"
|
|
)
|
|
|
|
func NewClientFactory(config *rest.Config) ClientFactory {
|
|
return func(gvr schema.GroupVersionResource) (dynamic.NamespaceableResourceInterface, error) {
|
|
client, err := dynamic.NewForConfig(config)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return client.Resource(gvr), nil
|
|
}
|
|
}
|