use apimachinery packages instead of client-go packages

This commit is contained in:
deads2k
2017-01-12 10:17:12 -05:00
parent 5d4795e14e
commit 633e9d98fc
30 changed files with 1288 additions and 1349 deletions

View File

@@ -21,18 +21,15 @@ import (
"fmt"
"time"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/pkg/api"
apierrors "k8s.io/client-go/pkg/api/errors"
"k8s.io/client-go/pkg/runtime"
clientschema "k8s.io/client-go/pkg/runtime/schema"
runtimeserializer "k8s.io/client-go/pkg/runtime/serializer"
"k8s.io/client-go/pkg/util/wait"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
kapi "k8s.io/kubernetes/pkg/api"
_ "k8s.io/client-go/pkg/apis/authorization/install"
)
@@ -42,9 +39,9 @@ type GenericWebhook struct {
}
// NewGenericWebhook creates a new GenericWebhook from the provided kubeconfig file.
func NewGenericWebhook(kubeConfigFile string, groupVersions []clientschema.GroupVersion, initialBackoff time.Duration) (*GenericWebhook, error) {
func NewGenericWebhook(kubeConfigFile string, groupVersions []schema.GroupVersion, initialBackoff time.Duration) (*GenericWebhook, error) {
for _, groupVersion := range groupVersions {
if !kapi.Registry.IsEnabledVersion(schema.GroupVersion{Group: groupVersion.Group, Version: groupVersion.Version}) {
if !api.Registry.IsEnabledVersion(groupVersion) {
return nil, fmt.Errorf("webhook plugin requires enabling extension resource: %s", groupVersion)
}
}