Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDockerInstalled ¶
func CheckDockerInstalled() bool
func CheckDockerInstalledHostAware ¶ added in v0.13.0
func CheckDockerInstalledHostAware() bool
CheckDockerInstalledHostAware reports whether docker is installed on the node. When gpud runs inside a container with the host root filesystem mounted (the gpud DaemonSet's gpud.mountHostRoot, default on), a docker CLI bundled in the container image itself must not count: the node only "has docker" if the HOST has the binary. (LEP-6440, verified on containerd BYOK nodes: the host has no docker at all -- no /host/usr/bin/docker, no /var/run/docker.sock, containerd is the runtime -- yet the PATH-only check matched /usr/bin/docker bundled in the gpud image and reported "docker installed but docker is not running" on all nodes.) Without the host-root mount (bare-metal/systemd installs) it falls back to the PATH lookup, preserving the previous behavior.
func CheckDockerRunning ¶
CheckDockerRunning checks if the docker daemon is running. If not run, fails with: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
func IsErrDockerClientVersionNewerThanDaemon ¶
IsErrDockerClientVersionNewerThanDaemon returns true if the docker client version is newer than the daemon version. e.g., "Error response from daemon: client version 1.44 is too new. Maximum supported API version is 1.43"
Types ¶
type DockerContainer ¶
type DockerContainer struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Image string `json:"image,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
State string `json:"state,omitempty"`
PodName string `json:"pod_name,omitempty"`
PodNamespace string `json:"pod_namespace,omitempty"`
}
func ListContainers ¶
func ListContainers(ctx context.Context) ([]DockerContainer, error)
ListContainers lists all containers from the docker daemon. If docker daemon is not running, fails with: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"