docker

package
v0.0.0-...-601a7b6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Copyright © 2021 Rasa Technologies GmbH

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.

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

This section is empty.

Variables

This section is empty.

Functions

func SkipVersionConstrainsCheck

func SkipVersionConstrainsCheck() bool

SkipVersionConstrainsCheck skips Docker version check if the `RASACTL_SKIP_DOCKER_VERSION_CHECK` environment variable is set to `true`.

func VersionConstrains

func VersionConstrains(dockerVersion string) error

DockerVersionConstrains checks if the Docker CLI version is within constrains boundaries.

Types

type Docker

type Docker struct {
	Client      *client.Client
	Ctx         context.Context
	Namespace   string
	Log         logr.Logger
	Spinner     *status.SpinnerMessage
	ProjectPath string

	Kind  KindSpec
	Flags *rtypes.RasaCtlFlags
	// contains filtered or unexported fields
}

Docker represents a Docker client.

func (*Docker) CreateKindNode

func (d *Docker) CreateKindNode(hostname string) (container.ContainerCreateCreatedBody, error)

CreateKindNode creates a new container that is used as a kind node.

func (*Docker) DeleteKindNode

func (d *Docker) DeleteKindNode(hostname string) error

DeleteKindNode deletes a kind node.

func (*Docker) GetKind

func (d *Docker) GetKind() KindSpec

GetKind return the Docker.Kind field.

func (*Docker) GetKindNetworkGatewayAddress

func (d *Docker) GetKindNetworkGatewayAddress() (string, error)

GetKindNetworkGatewayAddress returns a gateway address of the KinD network.

func (*Docker) GetServerVersion

func (d *Docker) GetServerVersion() (string, error)

func (*Docker) SetKind

func (d *Docker) SetKind(kind KindSpec)

SetKind sets the Docker.Kind field.

func (*Docker) SetNamespace

func (d *Docker) SetNamespace(name string)

SetNamespace sets the Docker.Namespace field.

func (*Docker) SetProjectPath

func (d *Docker) SetProjectPath(path string)

SetProjectPath sets the Docker.ProjectPath field.

func (*Docker) StartKindNode

func (d *Docker) StartKindNode(hostname string) error

StartKindNode starts a kind node that was previously stopped.

func (*Docker) StopKindNode

func (d *Docker) StopKindNode(hostname string) error

StopKindNode stops a container that is used as a kind node. In case the container fails to stop gracefully within a minute, it is forcefully terminated (killed).

type Interface

type Interface interface {
	CreateKindNode(hostname string) (container.ContainerCreateCreatedBody, error)
	StopKindNode(hostname string) error
	StartKindNode(hostname string) error
	DeleteKindNode(hostname string) error
	SetNamespace(name string)
	GetKind() KindSpec
	SetKind(kind KindSpec)
	SetProjectPath(path string)
	GetKindNetworkGatewayAddress() (string, error)
	GetServerVersion() (string, error)
}

func New

func New(c *Docker) (Interface, error)

New initializes Docker client.

type KindSpec

type KindSpec struct {
	ControlPlaneHost string
	Version          string
}

KindSpec represents the kind specification that stores information relented to kind.

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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