weeder

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(filename string) (*wapi.Config, error)

LoadConfig reads the weeder configuration from a file, unmarshalls it, fills in the default values and validates the unmarshalled configuration. If all validations pass it will return papi.Config else it will return an error.

Types

type Manager

type Manager interface {
	// Register registers a weeder with the manager. If a weeder with a key identified by `createKey`
	// exists then it will close it and replace it with the new weeder.
	Register(weeder Weeder) bool
	// Unregister checks if there is an existing weeder with the key. If it is found then it will close the weeder
	// and remove it from the manager.
	Unregister(key string) bool
	// UnregisterAll unregisters all weeders from the manager.
	UnregisterAll()
	// GetWeederRegistration returns a weederRegistration which will give access to the context and the cancelFn to the caller.
	GetWeederRegistration(key string) (Registration, bool)
}

Manager provides a single point for registering and unregistering weeders

func NewManager

func NewManager() Manager

NewManager creates a new manager for weeders.

type Registration

type Registration interface {
	// IsClosed return true if a weeder is closed else returns false.
	IsClosed() bool
	// Close closes the weeder.
	Close()
}

Registration provides a handle to check if a weeder has been closed and to also close the weeder.

type Weeder

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

Weeder represents an actor which will be responsible for watching dependent pods and weeding them out if they are in CrashLoopBackOff.

func NewWeeder

func NewWeeder(parentCtx context.Context, namespace string, config *wapi.Config, ctrlClient client.Client, seedClient kubernetes.Interface, ep *v1.Endpoints, logger logr.Logger) *Weeder

NewWeeder creates a new Weeder for a service/endpoint.

func (*Weeder) Run

func (w *Weeder) Run()

Run runs the Weeder which will intern create one go-routine for dependents identified by respective PodSelector.

Jump to

Keyboard shortcuts

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