kubernetes

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DevPodCreatedLabel      = "devpod.sh/created"
	DevPodWorkspaceLabel    = "devpod.sh/workspace"
	DevPodWorkspaceUIDLabel = "devpod.sh/workspace-uid"

	DevPodInfoAnnotation        = "devpod.sh/info"
	DevPodLastAppliedAnnotation = "devpod.sh/last-applied-configuration"
)
View Source
const DevContainerName = "devpod"
View Source
const OfficialDockerRegistry = "https://index.docker.io/v1/"

Variables

View Source
var ExtraDevPodLabels = map[string]string{
	DevPodCreatedLabel: "true",
}

Functions

func DecodeAuthTokenFromPullSecret added in v0.1.1

func DecodeAuthTokenFromPullSecret(secret k8sv1.Secret, host string) (string, error)

func GetRegistryFromImageName added in v0.1.1

func GetRegistryFromImageName(imageName string) (string, error)

GetRegistryFromImageName retrieves the registry name from an imageName

func IsCritical added in v0.1.1

func IsCritical(status *corev1.ContainerStatus) bool

func IsReady added in v0.1.1

func IsReady(status *corev1.ContainerStatus) bool

func IsRunning added in v0.1.1

func IsRunning(status *corev1.ContainerStatus) bool

func IsTerminated added in v0.1.1

func IsTerminated(status *corev1.ContainerStatus) bool

func IsWaiting added in v0.1.1

func IsWaiting(status *corev1.ContainerStatus) bool

func NewKubernetesDriver

func NewKubernetesDriver(options *options.Options, log log.Logger) driver.Driver

func PreparePullSecretData added in v0.1.1

func PreparePullSecretData(registryURL, authToken, email string) (string, error)

func Succeeded added in v0.1.1

func Succeeded(status *corev1.ContainerStatus) bool

Types

type DevContainerInfo

type DevContainerInfo struct {
	WorkspaceID string
	Options     *driver.RunOptions
}

type DockerConfig added in v0.1.1

type DockerConfig map[string]DockerConfigEntry

DockerConfig represents the config file used by the docker CLI. This config that represents the credentials that should be used when pulling images from specific image repositories.

type DockerConfigEntry added in v0.1.1

type DockerConfigEntry struct {
	Auth  string `json:"auth"`
	Email string `json:"email"`
}

DockerConfigEntry holds the user information that grant the access to docker registry

type DockerConfigJSON added in v0.1.1

type DockerConfigJSON struct {
	Auths DockerConfig `json:"auths"`
}

DockerConfigJSON represents a local docker auth config file for pulling images.

type KubernetesDriver added in v0.1.1

type KubernetesDriver struct {
	Log log.Logger
	// contains filtered or unexported fields
}

func (*KubernetesDriver) CommandDevContainer added in v0.1.1

func (k *KubernetesDriver) CommandDevContainer(ctx context.Context, workspaceId, user, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

func (*KubernetesDriver) DeleteDevContainer added in v0.1.1

func (k *KubernetesDriver) DeleteDevContainer(ctx context.Context, workspaceId string) error

func (*KubernetesDriver) DeletePullSecret added in v0.1.1

func (k *KubernetesDriver) DeletePullSecret(
	ctx context.Context,
	pullSecretName string) error

func (*KubernetesDriver) EnsurePullSecret added in v0.1.1

func (k *KubernetesDriver) EnsurePullSecret(
	ctx context.Context,
	pullSecretName string,
	dockerImage string,
) (bool, error)

func (*KubernetesDriver) FindDevContainer added in v0.1.1

func (k *KubernetesDriver) FindDevContainer(ctx context.Context, workspaceId string) (*config.ContainerDetails, error)

func (*KubernetesDriver) GetDevContainerLogs added in v0.1.8

func (k *KubernetesDriver) GetDevContainerLogs(ctx context.Context, workspaceID string, stdout io.Writer, stderr io.Writer) error

func (*KubernetesDriver) ReadSecretContents added in v0.1.1

func (k *KubernetesDriver) ReadSecretContents(
	ctx context.Context,
	pullSecretName string,
	host string,
) (string, error)

func (*KubernetesDriver) RunDevContainer added in v0.1.1

func (k *KubernetesDriver) RunDevContainer(
	ctx context.Context,
	workspaceId string,
	options *driver.RunOptions,
) error

func (*KubernetesDriver) StartDevContainer added in v0.1.1

func (k *KubernetesDriver) StartDevContainer(ctx context.Context, workspaceId string) error

func (*KubernetesDriver) StopDevContainer added in v0.1.1

func (k *KubernetesDriver) StopDevContainer(ctx context.Context, workspaceId string) error

func (*KubernetesDriver) TargetArchitecture added in v0.1.1

func (k *KubernetesDriver) TargetArchitecture(ctx context.Context, workspaceId string) (string, error)

Jump to

Keyboard shortcuts

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