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 ¶
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
Click to show internal directories.
Click to hide internal directories.