lameduck

package
v0.0.0-...-e1c190b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

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(optsProto *configpb.Options, 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 Lister

type Lister interface {
	List() ([]string, error)
}

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.

type Service

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

Service provides methods to do lameduck operations on VMs.

func NewService

func NewService(optsProto *configpb.Options, c *http.Client, l *logger.Logger) (*Service, error)

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

func (*Service) Lameduck

func (ldSvc *Service) Lameduck(name string) error

Lameduck puts the target in lameduck mode.

func (*Service) List

func (ldSvc *Service) List() ([]string, error)

List returns the targets that are in lameduck mode.

func (*Service) Unlameduck

func (ldSvc *Service) Unlameduck(name string) error

Unlameduck removes the target from lameduck mode.

Directories

Path Synopsis
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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