containerd

package
v0.0.0-...-1d6cbaf Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

* Copyright 1999-2020 Alibaba Group Holding Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 1999-2020 Alibaba Group Holding Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const (
	DefaultStateDir = "/run/containerd"
	// DefaultAddress is the default unix socket address
	DefaultUinxAddress = DefaultStateDir + "/containerd.sock"
	DefaultRuntime     = "io.containerd.runc.v2"
	DefaultSnapshotter = "overlayfs"

	DefaultContainerdNS = "k8s.io"

	NetworkNsType = "network"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Ctx    context.Context
	Cancel context.CancelFunc
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint, namespace string) (*Client, error)

func (*Client) CopyToContainer

func (c *Client) CopyToContainer(ctx context.Context, containerId, srcFile, dstPath, extractDirName string, override bool) error

func (*Client) ExecContainer

func (c *Client) ExecContainer(ctx context.Context, containerId, command string) (output string, err error)

func (*Client) ExecuteAndRemove

func (c *Client) ExecuteAndRemove(ctx context.Context, config *containertype.Config, hostConfig *containertype.HostConfig,
	networkConfig *network.NetworkingConfig, containerName string, removed bool, timeout time.Duration,
	command string, containerInfo container.ContainerInfo) (containerId string, output string, err error, code int32)

ExecuteAndRemove: create and start a container for executing a command, and remove the container

func (*Client) GetContainerById

func (c *Client) GetContainerById(ctx context.Context, containerId string) (container.ContainerInfo, error, int32)

func (*Client) GetContainerByLabelSelector

func (c *Client) GetContainerByLabelSelector(labels map[string]string) (container.ContainerInfo, error, int32)

func (*Client) GetContainerByName

func (c *Client) GetContainerByName(ctx context.Context, containerName string) (container.ContainerInfo, error, int32)

func (*Client) GetPidById

func (c *Client) GetPidById(ctx context.Context, containerId string) (int32, error, int32)

func (*Client) NewTask

func (c *Client) NewTask(imageRef string, cntr containerd.Container) (containerd.Task, error)

func (*Client) RemoveContainer

func (c *Client) RemoveContainer(ctx context.Context, containerId string, force bool) error

func (*Client) Spec

func (c *Client) Spec(ci container.ContainerInfo) (*oci.Spec, error)

Jump to

Keyboard shortcuts

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