client-go: Index | Files | Directories

package scale

import ""

Package scale provides a polymorphic scale client capable of fetching and updating Scale for any resource which implements the `scale` subresource, as long as that subresource operates on a version of scale convertable to autoscaling.Scale.


Package Files

client.go doc.go interfaces.go util.go

type PreferredResourceMapper Uses

type PreferredResourceMapper interface {
    // ResourceFor takes a partial resource and returns the preferred resource.
    ResourceFor(resource schema.GroupVersionResource) (preferredResource schema.GroupVersionResource, err error)

PreferredResourceMapper determines the preferred version of a resource to scale

type ScaleConverter Uses

type ScaleConverter struct {
    // contains filtered or unexported fields

ScaleConverter knows how to convert between external scale versions.

func NewScaleConverter Uses

func NewScaleConverter() *ScaleConverter

NewScaleConverter creates a new ScaleConverter for converting between Scales in autoscaling/v1 and extensions/v1beta1.

func (*ScaleConverter) Codecs Uses

func (c *ScaleConverter) Codecs() serializer.CodecFactory

func (*ScaleConverter) ConvertToVersion Uses

func (c *ScaleConverter) ConvertToVersion(in runtime.Object, outVersion schema.GroupVersion) (runtime.Object, error)

ConvertToVersion converts the given *external* input object to the given output *external* output group-version.

func (*ScaleConverter) ScaleVersions Uses

func (c *ScaleConverter) ScaleVersions() []schema.GroupVersion

func (*ScaleConverter) Scheme Uses

func (c *ScaleConverter) Scheme() *runtime.Scheme

Scheme returns the scheme used by this scale converter.

type ScaleInterface Uses

type ScaleInterface interface {
    // Get fetches the scale of the given scalable resource.
    Get(ctx context.Context, resource schema.GroupResource, name string, opts metav1.GetOptions) (*autoscalingapi.Scale, error)

    // Update updates the scale of the given scalable resource.
    Update(ctx context.Context, resource schema.GroupResource, scale *autoscalingapi.Scale, opts metav1.UpdateOptions) (*autoscalingapi.Scale, error)

    // Patch patches the scale of the given scalable resource.
    Patch(ctx context.Context, gvr schema.GroupVersionResource, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions) (*autoscalingapi.Scale, error)

ScaleInterface can fetch and update scales for resources in a particular namespace which implement the scale subresource.

type ScaleKindResolver Uses

type ScaleKindResolver interface {
    // ScaleForResource returns the GroupVersionKind of the
    // scale subresource for the given GroupVersionResource.
    ScaleForResource(resource schema.GroupVersionResource) (scaleVersion schema.GroupVersionKind, err error)

ScaleKindResolver knows about the relationship between resources and the GroupVersionKind of their scale subresources.

func NewDiscoveryScaleKindResolver Uses

func NewDiscoveryScaleKindResolver(client discovery.ServerResourcesInterface) ScaleKindResolver

NewDiscoveryScaleKindResolver creates a new ScaleKindResolver which uses information from the given disovery client to resolve the correct Scale GroupVersionKind for different resources.

type ScalesGetter Uses

type ScalesGetter interface {
    // Scales produces a ScaleInterface for a particular namespace.
    // Set namespace to the empty string for non-namespaced resources.
    Scales(namespace string) ScaleInterface

ScalesGetter can produce a ScaleInterface

func New Uses

func New(baseClient restclient.Interface, mapper PreferredResourceMapper, resolver dynamic.APIPathResolverFunc, scaleKindResolver ScaleKindResolver) ScalesGetter

New creates a new ScalesGetter using the given client to make requests. The GroupVersion on the client is ignored.

func NewForConfig Uses

func NewForConfig(cfg *restclient.Config, mapper PreferredResourceMapper, resolver dynamic.APIPathResolverFunc, scaleKindResolver ScaleKindResolver) (ScalesGetter, error)

NewForConfig creates a new ScalesGetter which resolves kinds to resources using the given RESTMapper, and API paths using the given dynamic.APIPathResolverFunc.


fakePackage fake provides a fake client interface to arbitrary Kubernetes APIs that exposes common high level operations and exposes common metadata.
schemePackage scheme contains a runtime.Scheme to be used for serializing and deserializing different versions of Scale, and for converting in between them.
scheme/appsintPackage appsint contains the necessary scaffolding of the internal version of extensions as required by conversion logic.
scheme/extensionsintPackage extensionsint contains the necessary scaffolding of the internal version of extensions as required by conversion logic.

Package scale imports 22 packages (graph) and is imported by 337 packages. Updated 2020-07-14. Refresh now. Tools for package owners.