lease

package
v1.69.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const ControllerName = "seed-lease"

ControllerName is the name of this controller.

Variables

View Source
var CheckSeedConnection = func(ctx context.Context, client rest.Interface) error {
	result := client.Get().AbsPath("/healthz").Do(ctx)
	if result.Error() != nil {
		return fmt.Errorf("failed to execute call to Kubernetes API Server: %v", result.Error())
	}

	var statusCode int
	result.StatusCode(&statusCode)
	if statusCode != http.StatusOK {
		return fmt.Errorf("API Server returned unexpected status code: %d", statusCode)
	}

	return nil
}

CheckSeedConnection is a function which checks the connection to the seed. Exposed for testing.

Functions

This section is empty.

Types

type Reconciler

type Reconciler struct {
	GardenClient   client.Client
	SeedRESTClient rest.Interface
	Config         config.SeedControllerConfiguration
	Clock          clock.Clock
	HealthManager  healthz.Manager
	LeaseNamespace string
	SeedName       string
}

Reconciler reconciles Seed resources and updates the heartbeat Lease object in the garden cluster when the connection to the seed cluster succeeds.

func (*Reconciler) AddToManager

func (r *Reconciler) AddToManager(mgr manager.Manager, gardenCluster cluster.Cluster) error

AddToManager adds Reconciler to the given manager.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile reconciles Seed resources and updates the heartbeat Lease object in the garden cluster when the connection to the seed cluster succeeds.

Jump to

Keyboard shortcuts

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