operators

package
v0.0.0-...-f0e17bc Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DockerTarFile = "/tmp/docker.tar"
	OCITarFile    = "/tmp/oci.tar"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildOptions

type BuildOptions struct {
	Compress     bool
	MaxPullProcs int
	Pull         string
	SaveImage    bool
}

type DisplayImage

type DisplayImage struct {
	ID           string   `json:"id"`
	Names        []string `json:"names"`
	Digest       string   `json:"digest"`
	Createdat    string   `json:"createdat"`
	Size         string   `json:"size"`
	Created      int      `json:"created"`
	Createdatraw string   `json:"createdatraw"`
	Readonly     bool     `json:"readonly"`
}

type FakeCRIInterface

type FakeCRIInterface interface {
	Pull(name string) error
	ImageList() (*ImageStruct, error)
	HasImage(name string) error
}

type FakeCertInterface

type FakeCertInterface interface {
	AddDomain(domain string) error
}

type FakeClient

type FakeClient struct {
	Image        FakeImageInterface
	CRI          FakeCRIInterface
	Cluster      FakeClusterInterface
	Cert         FakeCertInterface
	Inspect      FakeInspectInterface
	CmdInterface cmd.Interface
}

func NewFakeClient

func NewFakeClient(clusterName string) *FakeClient

type FakeClusterInterface

type FakeClusterInterface interface {
	Run(images ...string) error
	Apply(file string) error
	Reset() error
}

type FakeImageInterface

type FakeImageInterface interface {
	ListImages(display bool) ([]DisplayImage, error)
	PullImage(images ...string) error
	BuildImage(image, context string, opts BuildOptions) error
	RemoveImage(images ...string) error
	DockerArchiveImage(name string) error
	OCIArchiveImage(name string) error
	SaveImage(name, file string) error
	SaveMultiImage(file string, name ...string) error
	TagImage(name, newName string) error
	LoadImage(file string) error
	Create(name string, short bool) ([]byte, error)
	Merge(newImage string, images []string) error
	FetchImageID(name string) (string, error)
}

func NewFakeImage

func NewFakeImage(sealosCmd *cmd.SealosCmd) FakeImageInterface

type FakeInspectInterface

type FakeInspectInterface interface {
	LocalImage(name string) error
	RemoteImage(name string) error
	DockerArchiveImage(name string) error
	OCIArchiveImage(name string) error
	ImageID(id string) error
}

type ImageStruct

type ImageStruct struct {
	//	var image ImageStruct
	//	err = json.Unmarshal(data, &image)
	//	if err != nil {
	//	return nil, err
	//}
	//	return &image, nil
	Images []struct {
		ID          string      `json:"id"`
		RepoTags    []string    `json:"repoTags"`
		RepoDigests []string    `json:"repoDigests"`
		Size        string      `json:"size"`
		UID         interface{} `json:"uid"`
		Username    string      `json:"username"`
		Spec        interface{} `json:"spec"`
		Pinned      bool        `json:"pinned"`
	} `json:"images"`
}

type PodStruct

type PodStruct struct {
	//var pod PodStruct
	//err = json.Unmarshal(data, &pod)
	//if err != nil {
	//	return nil, err
	//}
	//return &pod, nil
	Items []struct {
		ID       string `json:"id"`
		Metadata struct {
			Name      string `json:"name"`
			UID       string `json:"uid"`
			Namespace string `json:"namespace"`
			Attempt   int    `json:"attempt"`
		} `json:"metadata"`
		Labels         map[string]string `json:"labels,omitempty"`
		Annotations    map[string]string `json:"annotations,omitempty"`
		State          string            `json:"state"`
		CreatedAt      string            `json:"createdAt"`
		RuntimeHandler string            `json:"runtimeHandler"`
	} `json:"items"`
}

type ProcessStruct

type ProcessStruct struct {
	//var process ProcessStruct
	//	err = json.Unmarshal(data, &process)
	//	if err != nil {
	//		return nil, err
	//	}
	//	return &process, nil
	Containers []struct {
		ID           string `json:"id"`
		PodSandboxID string `json:"podSandboxId"`
		Metadata     struct {
			Name    string `json:"name"`
			Attempt int    `json:"attempt"`
		} `json:"metadata"`
		Image struct {
			Image       string            `json:"image"`
			Annotations map[string]string `json:"annotations"`
		} `json:"image"`
		ImageRef    string            `json:"imageRef"`
		State       string            `json:"state"`
		CreatedAt   string            `json:"createdAt"`
		Labels      map[string]string `json:"labels"`
		Annotations map[string]string `json:"annotations"`
	} `json:"containers"`
}

Jump to

Keyboard shortcuts

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