scale

package
v0.0.0-...-b0bff92 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PatchReplicasToScale

func PatchReplicasToScale(
	ctx context.Context,
	name string,
	scale int32,
	patcher ScalePatcher) error

PatchReplicasToScale patches the provided object name with the expected scale. If the operation fails an error is returned

Types

type ScalePatcher

type ScalePatcher interface {
	// Patch patches the supplied object name with a supplied patch operation.
	// The returned scale is provided if the operation completes successfully.
	Patch(context.Context, string, types.PatchType, []byte, meta.PatchOptions, ...string) (int32, error)
}

ScalePatcher provides a generic interface for patching replicas count on common Kubernetes objects. The Kubernetes objects must support patching of spec.replicas to work with this interface

func DeploymentScalePatcher

func DeploymentScalePatcher(deploy apps.DeploymentInterface) ScalePatcher

DeploymentScalePatcher returns a ScalePatcher suitable for use with Deployments

func StatefulSetScalePatcher

func StatefulSetScalePatcher(stateSet apps.StatefulSetInterface) ScalePatcher

StatefulSetScalePatcher returns a ScalePatcher suitable for use with Statefulsets.

type ScalePatcherFunc

type ScalePatcherFunc func(context.Context, string, types.PatchType, []byte, meta.PatchOptions, ...string) (int32, error)

ScalePatcherFunc is a convenience func to implement the ScalePatcher interface

func (ScalePatcherFunc) Patch

func (p ScalePatcherFunc) Patch(
	ctx context.Context,
	name string,
	patchType types.PatchType,
	data []byte,
	opts meta.PatchOptions,
	subresources ...string,
) (int32, error)

Patch see ScalePatcher.Patch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL