lameduck

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 17 Imported by: 18

Documentation

Overview

Package lameduck implements a lameducks provider. Lameduck provider fetches lameducks from the RTC (Runtime Configurator) service. This functionality allows an operator to do hitless VM upgrades. If a target is set to be in lameduck by the operator, it is taken out of the targets list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDefaultLister

func InitDefaultLister(opts *configpb.Options, globalRDSAddr string, lister Lister, l *logger.Logger) error

InitDefaultLister initializes the package using the given arguments. If a lister is given in the arguments, global.lister is set to that, otherwise a new lameduck service is created using the config options, and global.lister is set to that service. Initiating the package from a given lister is useful for testing pacakges that depend on this package.

Types

type Lameducker

type Lameducker interface {
	Lameduck(name string) error
	Unlameduck(name string) error
}

Lameducker provides an interface to Lameduck/Unlameduck an instance.

Cloudprober doesn't currently (as of July, 2018) use this interface by itself. It's provided here so that other software (e.g. probing deployment management software) can lameduck/unlameduck instances in a way that Cloudprober understands.

func NewLameducker

func NewLameducker(opts *configpb.Options, hc *http.Client, l *logger.Logger) (Lameducker, error)

NewLameducker creates a new lameducker using the provided config and an oauth2 enabled *http.Client; if the client is set to nil, an oauth enabled client is created automatically using GCP default credentials.

type Lister

type Lister interface {
	List() []string
}

Lister is an interface for getting current lameducks.

func GetDefaultLister

func GetDefaultLister() (Lister, error)

GetDefaultLister returns the global Lister. If global lister is uninitialized, it returns an error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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