environment

package
v0.0.0-...-8680cc4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PouchBinary is default binary
	PouchBinary = "/usr/local/bin/pouch"

	// PouchdAddress is default pouchd address
	PouchdAddress = "unix:///var/run/pouchd.sock"

	// PouchdUnixDomainSock is the default unix domain socket file used by pouchd.
	PouchdUnixDomainSock = "/var/run/pouchd.sock"

	// TLSConfig is default tls config
	TLSConfig = client.TLSConfig{}

	// BusyboxRepo the repository of busybox image
	BusyboxRepo = "registry.hub.docker.com/library/busybox"

	// BusyboxTag the default tag used for busybox image
	BusyboxTag = "1.28"

	// BusyboxDigest the digest used for busybox image
	BusyboxDigest = "sha256:141c253bc4c3fd0a201d32dc1f493bcf3fff003b6df416dea4f41046e0f37d47"

	// BusyboxID the default ID for busybox image
	BusyboxID = "sha256:8c811b4aec35f259572d0f79207bc0678df4c736eeec50bc9fec37ed936a472a"

	// Busybox125Tag the 1.25 tag used for 1.25 busybox image
	Busybox125Tag = "1.25"

	// Busybox125Digest the digests used for 1.25 busybox image
	Busybox125Digest = "sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912"

	// Busybox125ID the ID used for 1.25 busybox image
	Busybox125ID = "sha256:e02e811dd08fd49e7f6032625495118e63f597eb150403d02e3238af1df240ba"

	// HelloworldRepo the repository of hello-world image
	HelloworldRepo = "registry.hub.docker.com/library/hello-world"

	// HelloworldTag the tag used for hello-world image
	HelloworldTag = "linux"

	// HttpdRepo the repo for httpd image
	HttpdRepo = "registry.hub.docker.com/library/httpd"

	// HttpdTag the tag for httpd image
	HttpdTag = "2"

	// CniRepo the repo for cni image
	CniRepo = "calico/cni"

	// CniTag the tag for cni image
	CniTag = "v3.1.3"

	// GateWay default gateway for test
	GateWay = "192.168.1.1"

	// Subnet default subnet for test
	Subnet = "192.168.1.0/24"
)
View Source
var (

	// IsMemorySupport checks if memory cgroup is avaible
	IsMemorySupport = func() bool {
		return cgroupInfo.Memory.MemoryLimit
	}

	// IsMemoryReservationSupport checks if memory reservation cgroup is available
	IsMemoryReservationSupport = func() bool {
		return cgroupInfo.Memory.MemoryReservation
	}

	// IsMemorySwapSupport checks if memory swap cgroup is avaible
	IsMemorySwapSupport = func() bool {
		return cgroupInfo.Memory.MemorySwap
	}

	// IsMemorySwappinessSupport checks if memory swappiness cgroup is avaible
	IsMemorySwappinessSupport = func() bool {
		return cgroupInfo.Memory.MemorySwappiness
	}
)

the following check funtions provide cgroup file avaible check

Functions

func FindDisk

func FindDisk() (string, bool)

FindDisk finds a available disk, not partion

func GetBusybox

func GetBusybox()

GetBusybox gets image info from test environment variable.

func GetOtherImage

func GetOtherImage()

GetOtherImage gets other image info from test environment variable.

func GetTestNetwork

func GetTestNetwork()

GetTestNetwork get gateway and subnet from test environment variable.

func IsAliKernel

func IsAliKernel() bool

IsAliKernel checks if the kernel of test environment is AliKernel.

func IsCRIUExist

func IsCRIUExist() bool

IsCRIUExist checks if criu exist on machine.

func IsDiskQuota

func IsDiskQuota() bool

IsDiskQuota checks if it can use disk quota for container.

func IsDumbInitExist

func IsDumbInitExist() bool

IsDumbInitExist checks if the dumb-init binary exists on host.

func IsGrpquota

func IsGrpquota() bool

IsGrpquota checks if there is grpquota set on test machine

func IsHubConnected

func IsHubConnected() bool

IsHubConnected checks if hub address can be connected.

func IsLinux

func IsLinux() bool

IsLinux checks if the OS of test environment is Linux.

func IsLxcfsEnabled

func IsLxcfsEnabled() bool

IsLxcfsEnabled checks if the lxcfs is installed and service is enabled.

func IsPrjquota

func IsPrjquota() bool

IsPrjquota checks if there is prjquota set on test machine

func IsRuncVersionSupportRichContianer

func IsRuncVersionSupportRichContianer() bool

IsRuncVersionSupportRichContianer checks if the version of runc supports rich container.

func PruneAllContainers

func PruneAllContainers(apiClient client.ContainerAPIClient) error

PruneAllContainers deletes all containers from pouchd.

func PruneAllImages

func PruneAllImages(apiClient client.ImageAPIClient) error

PruneAllImages deletes all images from pouchd.

func PruneAllVolumes

func PruneAllVolumes(apiClient client.VolumeAPIClient) error

PruneAllVolumes deletes all volumes from pouchd

func SupportSystemdCgroupDriver

func SupportSystemdCgroupDriver() bool

SupportSystemdCgroupDriver checks if systemd cgroup driver is available on machine.

Types

This section is empty.

Jump to

Keyboard shortcuts

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