driver

package
v0.1.6 Latest Latest
Warning

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

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

Documentation

Overview

Portions Copyright (C) 2020 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Portions Copyright (C) 2020 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Portions Copyright (C) 2020 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConnecting = errors.Errorf("driver not connecting")
View Source
var ErrNotRunning = errors.Errorf("driver not running")

Functions

func GetFactories

func GetFactories() map[string]Factory

func RandSleep added in v0.1.4

func RandSleep(maxMS int64)

RandSleep sleeps a random amount of time between zero and maxMS milliseconds

func Register

func Register(f Factory)

Types

type Builder

type Builder struct {
	Name   string
	Driver string
	Nodes  []Node
}

type BuilderClients added in v0.1.4

type BuilderClients struct {
	// The builder on the chosen node/pod
	ChosenNode NodeClient

	// If multiple builders present, clients to the other builders (excluding the chosen pod)
	OtherNodes []NodeClient
}

func Boot

type BuildkitConfig

type BuildkitConfig struct {
}

type Driver

type Driver interface {
	Factory() Factory
	Bootstrap(context.Context, progress.Logger) error
	Info(context.Context) (*Info, error)
	Stop(ctx context.Context, force bool) error
	Rm(ctx context.Context, force bool) error
	Clients(ctx context.Context) (*BuilderClients, error)
	Features() map[Feature]bool
	List(ctx context.Context) ([]Builder, error)
	RuntimeSockProxy(ctx context.Context, name string) (net.Conn, error)
	GetVersion(ctx context.Context) (string, error)

	// TODO - do we really need both?  Seems like some cleanup needed here...
	GetAuthWrapper(string) imagetools.Auth
	GetAuthProvider(secretName string, stderr io.Writer) session.Attachable
	GetAuthHintMessage() string
}

func GetDriver

func GetDriver(ctx context.Context, name string, f Factory, kubeClientConfig clientcmd.ClientConfig, flags []string, config string, do map[string]string, contextPathHash string) (Driver, error)

type Factory

type Factory interface {
	Name() string
	Usage() string
	Priority(context.Context) int
	New(ctx context.Context, cfg InitConfig) (Driver, error)
	AllowsInstances() bool
}

func GetDefaultFactory

func GetDefaultFactory(ctx context.Context, instanceRequired bool) (Factory, error)

func GetFactory

func GetFactory(name string, instanceRequired bool) Factory

type Feature

type Feature string
const CacheExport Feature = "cache export"
const ContainerdExporter Feature = "Containerd exporter"
const DockerExporter Feature = "Docker exporter"
const MultiPlatform Feature = "multiple platforms"
const OCIExporter Feature = "OCI exporter"

type Info

type Info struct {
	Status Status
	// DynamicNodes must be empty if the actual nodes are statically listed in the store
	DynamicNodes []store.Node
}

type InitConfig

type InitConfig struct {
	// This object needs updates to be generic for different drivers
	Name string
	//DockerAPI        dockerclient.APIClient
	KubeClientConfig clientcmd.ClientConfig
	BuildkitFlags    []string
	ConfigFile       string
	DriverOpts       map[string]string
	// ContextPathHash can be used for determining pods in the driver instance
	ContextPathHash string
}

type Node

type Node struct {
	Name      string
	Status    string
	Platforms []specs.Platform
}

type NodeClient added in v0.1.4

type NodeClient struct {
	NodeName       string
	ClusterAddr    string
	BuildKitClient *client.Client
}

type Status

type Status int
const (
	Inactive Status = iota
	Starting
	Running
	Stopping
	Stopped
)

func (Status) String

func (s Status) String() string

Directories

Path Synopsis
execconn
Portions Copyright (C) 2020 VMware, Inc.
Portions Copyright (C) 2020 VMware, Inc.
manifest
Portions Copyright (C) 2020 VMware, Inc.
Portions Copyright (C) 2020 VMware, Inc.
podchooser
Portions Copyright (C) 2020 VMware, Inc.
Portions Copyright (C) 2020 VMware, Inc.

Jump to

Keyboard shortcuts

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