Narrow interface consumed by scale client

Kubernetes-commit: d8b69a0a65ad40523f621f11ac296624b4d976b5
This commit is contained in:
Jordan Liggitt
2018-04-03 14:34:04 -04:00
committed by Kubernetes Publisher
parent e7bf2d1742
commit 8048d500b5
2 changed files with 13 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ import (
"strings"
"sync"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
@@ -34,6 +35,15 @@ import (
scaleext "k8s.io/client-go/scale/scheme/extensionsv1beta1"
)
// PreferredResourceMapper determines the preferred version of a resource to scale
type PreferredResourceMapper interface {
// ResourceFor takes a partial resource and returns the preferred resource.
ResourceFor(resource schema.GroupVersionResource) (preferredResource schema.GroupVersionResource, err error)
}
// Ensure a RESTMapper satisfies the PreferredResourceMapper interface
var _ PreferredResourceMapper = meta.RESTMapper(nil)
// ScaleKindResolver knows about the relationship between
// resources and the GroupVersionKind of their scale subresources.
type ScaleKindResolver interface {