common

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterPrivateVolumeMountPath = "/srv/ha/internal"
	ClusterPrivateVolumeAgentName = "fs_cluster_private"
)

Variables

This section is empty.

Functions

func AnyResourcesInUse

func AnyResourcesInUse(resources []client.ResourceWithVolumes) bool

func AssertResourceInUseStable added in v1.5.0

func AssertResourceInUseStable(ctx context.Context, cli *client.Client, name string) error

AssertResourceInUseStable records the node that a resource is running on, and then monitors the resource to check that it remains on the same node for a few seconds. This is useful for sanity-checking that a resource has started up and is healthy.

func CheckIPCollision added in v1.2.0

func CheckIPCollision(config reactor.PromoterConfig, checkIP net.IP) error

func ClusterPrivateVolumeAgent

func ClusterPrivateVolumeAgent(deployedVol client.Volume, resource string) *reactor.ResourceAgent

func DevicePath

func DevicePath(vol client.Volume) string

func NoResourcesInUse

func NoResourcesInUse(resources []client.ResourceWithVolumes) bool

func WaitUntilResourceCondition

func WaitUntilResourceCondition(ctx context.Context, cli *client.Client, name string, condition func([]client.ResourceWithVolumes) bool) error

Types

type IpCidr

type IpCidr struct {
	net.IPNet
}

func ServiceIPFromParts

func ServiceIPFromParts(ip net.IP, prefix int) IpCidr

func ServiceIPFromString

func ServiceIPFromString(s string) (IpCidr, error)

func (*IpCidr) IP

func (s *IpCidr) IP() net.IP

func (IpCidr) MarshalJSON

func (s IpCidr) MarshalJSON() ([]byte, error)

func (*IpCidr) Prefix

func (s *IpCidr) Prefix() int

func (*IpCidr) Set

func (s *IpCidr) Set(raw string) error

func (*IpCidr) Type

func (s *IpCidr) Type() string

func (*IpCidr) UnmarshalJSON

func (s *IpCidr) UnmarshalJSON(b []byte) error

type ResourceState

type ResourceState int
const (
	Unknown ResourceState = iota
	ResourceStateOK
	ResourceStateDegraded
	ResourceStateBad
)

func (ResourceState) MarshalJSON

func (l ResourceState) MarshalJSON() ([]byte, error)

func (ResourceState) String

func (l ResourceState) String() string

func (*ResourceState) UnmarshalJSON

func (l *ResourceState) UnmarshalJSON(text []byte) error

type ResourceStatus

type ResourceStatus struct {
	State   ResourceState `json:"state"`
	Service ServiceState  `json:"service"`
	Primary string        `json:"primary"`
	Nodes   []string      `json:"nodes"`
	Volumes []VolumeState `json:"volumes"`
}

type ServiceState

type ServiceState int
const (
	ServiceStateStopped ServiceState = iota
	ServiceStateStarted
)

func (ServiceState) MarshalJSON

func (s ServiceState) MarshalJSON() ([]byte, error)

func (ServiceState) String

func (s ServiceState) String() string

func (*ServiceState) UnmarshalJSON

func (s *ServiceState) UnmarshalJSON(text []byte) error

type UidGid

type UidGid struct {
	Uid int
	Gid int
}

func (*UidGid) String

func (u *UidGid) String() string

type ValidationError

type ValidationError string

func (ValidationError) Error

func (v ValidationError) Error() string

type Volume

type Volume struct {
	Volume VolumeConfig `json:"volume"`
	Status VolumeState  `json:"status"`
}

type VolumeConfig

type VolumeConfig struct {
	Number              int    `json:"number"`
	SizeKiB             uint64 `json:"size_kib"`
	FileSystem          string `json:"file_system,omitempty"`
	FileSystemRootOwner UidGid `json:"file_system_root_owner,omitempty"`
}

func ClusterPrivateVolume

func ClusterPrivateVolume() VolumeConfig

type VolumeState

type VolumeState struct {
	Number int           `json:"number"`
	State  ResourceState `json:"state"`
}

Jump to

Keyboard shortcuts

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