hamaster

package
v16.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAvalailabilityZonesNilError

func IsAvalailabilityZonesNilError(err error) bool

IsAvalailabilityZonesNilError asserts tooManyCRsError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

func IsTooManyCRsError

func IsTooManyCRsError(err error) bool

IsTooManyCRsError asserts tooManyCRsError.

Types

type Config

type Config struct {
	K8sClient k8sclient.Interface
}

type HAMaster

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

func New

func New(config Config) (*HAMaster, error)

func (*HAMaster) Enabled

func (h *HAMaster) Enabled(ctx context.Context, obj interface{}) (bool, error)

func (*HAMaster) Mapping

func (h *HAMaster) Mapping(ctx context.Context, obj interface{}) ([]Mapping, error)

func (*HAMaster) Replicas

func (h *HAMaster) Replicas(ctx context.Context, obj interface{}) (int, error)

type Interface

type Interface interface {
	// Enabled returns true in case HA Masters is enabled. Right now this means to
	// have 3 replicas configured for the master setup.
	Enabled(ctx context.Context, obj interface{}) (bool, error)
	// Mapping fetches the AWSCluster and AWSControlPlane CRs using the cluster ID
	// label obj must provide as meta object. See the godoc of Mapping for more
	// information on the returned list of mapped information.
	Mapping(ctx context.Context, obj interface{}) ([]Mapping, error)
	// Replicas fetches the G8sControlPlane CR and returns the number of replicas
	// configured for the master setup.
	Replicas(ctx context.Context, obj interface{}) (int, error)
}

type Mapping

type Mapping struct {
	// AZ is the master availability zones. Given 2 availability zones A and B in
	// a HA Masters setup of 3 masters, AZ will be A, B and A again in the list of
	// mappings computed by implementations of Interface.
	AZ string
	// ID can either be 0, 1, 2 or 3. Master ID 0 is omnipresent in a single
	// master setup. In a HA Masters setup ID will be 1, 2 and then 3 in the list
	// of mappings computed by implementations of Interface.
	ID int
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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