container

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FatalErr

func FatalErr(msg interface{})

FatalErr exits the test in case a fatal error has occurred.

Types

type AuthInfo

type AuthInfo struct {
	Authorization string `json:"authorization"`
}

AuthInfo returns the error info

type DockerCLI

type DockerCLI struct {
	CLI *client.Client

	ExecCommandPath string
	// contains filtered or unexported fields
}

DockerCLI provides function to run the docker command

func NewDockerCLI

func NewDockerCLI() *DockerCLI

NewDockerCLI initialize the docker cli framework

func (*DockerCLI) Args

func (c *DockerCLI) Args(args ...string) *DockerCLI

Args sets the additional arguments for the docker exutil.CLI command

func (*DockerCLI) CheckImageExist

func (c *DockerCLI) CheckImageExist(imageIndex string) (bool, error)

CheckImageExist check the image exist

func (*DockerCLI) ContainerCreate

func (c *DockerCLI) ContainerCreate(imageName string, containerName string, entrypoint string, openStdin bool) (string, error)

func (*DockerCLI) ContainerRemove

func (c *DockerCLI) ContainerRemove(id string) error

func (*DockerCLI) ContainerStart

func (c *DockerCLI) ContainerStart(id string) error

func (*DockerCLI) ContainerStop

func (c *DockerCLI) ContainerStop(id string) error

func (*DockerCLI) Exec

func (c *DockerCLI) Exec(id string, cmd []string) (int, string, string, error)

func (*DockerCLI) GetImageID

func (c *DockerCLI) GetImageID(imageTag string) (string, error)

GetImageID is to get the image ID by image tag

func (*DockerCLI) GetImageList

func (c *DockerCLI) GetImageList() ([]string, error)

GetImageList is to get the image list

func (*DockerCLI) ImageRemove

func (c *DockerCLI) ImageRemove(imageID string) error

ImageRemove is to remove the image

func (*DockerCLI) Output

func (c *DockerCLI) Output() (string, error)

Output executes the command and returns stdout/stderr combined into one string

func (*DockerCLI) Run

func (c *DockerCLI) Run(commands ...string) *DockerCLI

Run executes given docker command

type ExitError

type ExitError struct {
	Cmd    string
	StdErr string
	*exec.ExitError
}

ExitError returns the error info

type PodmanCLI

type PodmanCLI struct {
	ExecCommandPath string

	UnsetProxy bool
	// contains filtered or unexported fields
}

PodmanCLI provides function to run the docker command

func NewPodmanCLI

func NewPodmanCLI() *PodmanCLI

NewPodmanCLI initialize the docker cli framework

func (*PodmanCLI) Args

func (c *PodmanCLI) Args(args ...string) *PodmanCLI

Args sets the additional arguments for the podman exutil.CLI command

func (*PodmanCLI) CheckImageExist

func (c *PodmanCLI) CheckImageExist(imageIndex string) (bool, error)

CheckImageExist is to check the image is exist

func (*PodmanCLI) ContainerCreate

func (c *PodmanCLI) ContainerCreate(imageName string, containerName string, entrypoint string, openStdin bool) (string, error)

func (*PodmanCLI) ContainerRemove

func (c *PodmanCLI) ContainerRemove(id string) error

func (*PodmanCLI) ContainerStart

func (c *PodmanCLI) ContainerStart(id string) error

func (*PodmanCLI) ContainerStop

func (c *PodmanCLI) ContainerStop(id string) error

func (*PodmanCLI) CopyFile

func (c *PodmanCLI) CopyFile(id string, src string, target string) error

func (*PodmanCLI) Exec

func (c *PodmanCLI) Exec(id string, commands []string) (string, error)

func (*PodmanCLI) ExecBackgroud

func (c *PodmanCLI) ExecBackgroud(id string, commands []string) (string, error)

func (*PodmanCLI) GetImageID

func (c *PodmanCLI) GetImageID(imageTag string) (string, error)

GetImageID is to get the image ID by image tag

func (*PodmanCLI) GetImageList

func (c *PodmanCLI) GetImageList() ([]string, error)

GetImageList to get the image list

func (*PodmanCLI) GetImages

func (c *PodmanCLI) GetImages() ([]PodmanImage, error)

func (*PodmanCLI) GetImagesByJSON

func (c *PodmanCLI) GetImagesByJSON(jsonStr string) ([]PodmanImage, error)

func (*PodmanCLI) Output

func (c *PodmanCLI) Output() (string, error)

Output executes the command and returns stdout/stderr combined into one string

func (*PodmanCLI) RemoveImage

func (c *PodmanCLI) RemoveImage(imageIndex string) (bool, error)

RemoveImage is to remove image

func (*PodmanCLI) Run

func (c *PodmanCLI) Run(commands ...string) *PodmanCLI

Run executes given Podman command

type PodmanImage

type PodmanImage struct {
	ID         string            `json:"Id"`
	Size       int64             `json:"Size"`
	Labels     map[string]string `json:"Labels"`
	Names      []string          `json:"Names"`
	Digest     string            `json:"Digest"`
	Digests    []string          `json:"Digests"`
	Dangling   bool              `json:"Dangling"`
	History    []string          `json:"History"`
	Containers int64             `json:"Containers"`
}

PodmanImage podman image

type QuayCLI

type QuayCLI struct {
	EndPointPre   string
	Authorization string
}

QuayCLI provides function to run the quay command

func NewQuayCLI

func NewQuayCLI() *QuayCLI

NewQuayCLI initialize the quay api

func (*QuayCLI) ChangeTag

func (c *QuayCLI) ChangeTag(imageTag, manifestDigest string) (bool, error)

ChangeTag will change the image tag

func (*QuayCLI) CheckTagNotExist

func (c *QuayCLI) CheckTagNotExist(imageIndex string) (bool, error)

CheckTagNotExist check the image exist

func (*QuayCLI) DeleteTag

func (c *QuayCLI) DeleteTag(imageIndex string) (bool, error)

DeleteTag will delete the image

func (*QuayCLI) GetImageDigest

func (c *QuayCLI) GetImageDigest(imageIndex string) (string, error)

GetImageDigest gets the ID of the specified image

func (*QuayCLI) GetTagNameList

func (c *QuayCLI) GetTagNameList(imageIndex string) ([]string, error)

GetTagNameList get the tag name list in quay

func (*QuayCLI) GetTags

func (c *QuayCLI) GetTags(imageIndex string) ([]TagInfo, error)

GetTags list the specificTag in repository

func (*QuayCLI) TryChangeTag

func (c *QuayCLI) TryChangeTag(imageTag, manifestDigest string) (bool, error)

func (*QuayCLI) TryDeleteTag

func (c *QuayCLI) TryDeleteTag(imageIndex string) (bool, error)

TryDeleteTag will delete the image

type TagInfo

type TagInfo struct {
	Name           string `json:"name"`
	Reversion      bool   `json:"reversion"`
	StartTs        int64  `json:"start_ts"`
	EndTs          int64  `json:"end_ts"`
	ManifestDigest string `json:"manifest_digest"`
	ImageID        string `json:"image_id"`
	LastModified   string `json:"last_modified"`
	Expiration     string `json:"expiration"`
	DockerImageID  string `json:"docker_image_id"`
	IsManifestList bool   `json:"is_manifest_list"`
	Size           int64  `json:"size"`
}

TagInfo returns the images tag info

type TagsResult

type TagsResult struct {
	HasAdditional bool      `json:"has_additional"`
	Page          int       `json:"page"`
	Tags          []TagInfo `json:"tags"`
}

TagsResult returns the images tag info

Jump to

Keyboard shortcuts

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