kubernetes

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubernetesBackend

type KubernetesBackend struct {
	// contains filtered or unexported fields
}

func NewKubernetesBackend

func NewKubernetesBackend(cfg KubernetesConfig) (*KubernetesBackend, error)

func NewKubernetesBackendWithFakeClient

func NewKubernetesBackendWithFakeClient(namespace string) (*KubernetesBackend, *fake.Clientset)

Create a test client with a fake kubernetes clientset

func (*KubernetesBackend) Close

func (k *KubernetesBackend) Close() error

Calls all necessary finalization if necessary

func (*KubernetesBackend) GetLocks

func (k *KubernetesBackend) GetLocks(group string) (int, error)

Returns the current number of locks for the given group

func (*KubernetesBackend) GetStaleLocks

func (k *KubernetesBackend) GetStaleLocks(ts time.Duration) ([]types.Lock, error)

Return all locks older than x

func (*KubernetesBackend) HasLock

func (k *KubernetesBackend) HasLock(group string, id string) (bool, error)

Check if a given id already has a lock for this group

func (*KubernetesBackend) Release

func (k *KubernetesBackend) Release(group string, id string) error

Release the lock currently held by the id. Does not fail when no lock is held.

func (*KubernetesBackend) Reserve

func (k *KubernetesBackend) Reserve(group string, id string) error

Reserve a lock for the given group. Returns true if the lock is successfully reserved, even if the lock is already held by the specific id

type KubernetesConfig

type KubernetesConfig struct {
	Kubeconfig string `yaml:"-"`
	Namespace  string `yaml:"namespace,omitempty"`
}

Jump to

Keyboard shortcuts

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