pkg

package
v0.0.0-...-5544660 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowedGVK = []v1.GroupVersionKind{
	{
		Group:   "apps",
		Version: "v1",
		Kind:    "deployments",
	},
	{
		Group:   "apps",
		Version: "v1",
		Kind:    "statefulsets",
	},
	{
		Group:   "batch",
		Version: "v1beta1",
		Kind:    "cronjobs",
	},
	{
		Group:   "batch",
		Version: "v1",
		Kind:    "cronjobs",
	},
}

AllowedGVK represents the allowed Group Version Kind

Functions

This section is empty.

Types

type KidleClient

type KidleClient struct {
	client.Client
	DiscoveryClient *discovery.DiscoveryClient
	Namespace       string
}

KidleClient defines the client

func NewKidleClient

func NewKidleClient(namespace string) (*KidleClient, error)

NewKidleClient creates a kubernetes client for kidle. It can connect inside a k8s cluster from a pod into its current namespace or outside as a remote client on a specified namespace. If namespace == "", the namespace from the current context is used.

func (*KidleClient) ApplyDesiredIdleState

func (k *KidleClient) ApplyDesiredIdleState(idle bool, req *client.ObjectKey) (bool, error)

ApplyDesiredIdleState make sure that the referenced object has the proper idling state

func (*KidleClient) CreateIdlingResource

func (k *KidleClient) CreateIdlingResource(idle bool, ref string, req *client.ObjectKey) (bool, error)

CreateIdlingResource creates an IdlingResource with the given values

func (*KidleClient) GetAllowedResources

func (k *KidleClient) GetAllowedResources() (map[string]bool, error)

GetAllowedResources gives the possible resources to create by calling the k8s discovery client

Jump to

Keyboard shortcuts

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