docker

package
v3.10.0-0.16.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const CmdDownRecommendedName = "down"
View Source
const CmdStatusRecommendedName = "status"

CmdStatusRecommendedName is the recommended command name

View Source
const (
	// CmdUpRecommendedName is the recommended command name
	CmdUpRecommendedName = "up"
)
View Source
const NonLinuxHostVolumeDirPrefix = "/var/lib/origin/volumes"

This is a special case for Docker for Mac where we need to have a directory inside the VM that we can re-mount with --make-shared flag. We can't use the host directories mounts as they are handled by the Docker for Mac directly (via fuse.osxfs). TODO: Figure out how to remove this snowflake

Variables

This section is empty.

Functions

func GetDetailedOut

func GetDetailedOut(out io.Writer) io.Writer

func GetDockerClient

func GetDockerClient() (dockerhelper.Interface, error)

GetDockerClient obtains a new Docker client from the environment or from a Docker machine, starting it if necessary and permitted

func NewCmdDown

func NewCmdDown(name, fullName string, out io.Writer) *cobra.Command

NewCmdDown creates a command that stops OpenShift

func NewCmdStatus

func NewCmdStatus(name, fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdStatus implements the OpenShift cluster status command.

func NewCmdUp

func NewCmdUp(name, fullName string, out, errout io.Writer, clusterAdd *cobra.Command) *cobra.Command

NewCmdUp creates a command that starts OpenShift on Docker with reasonable defaults

func PrintError

func PrintError(err error, out io.Writer)

Types

type ClientStatusConfig

type ClientStatusConfig struct {
}

ClientStatusConfig is the configuration for the client status command

func (*ClientStatusConfig) Status

func (c *ClientStatusConfig) Status(f *clientcmd.Factory, out io.Writer) error

Status prints the OpenShift cluster status

type ClientStopConfig

type ClientStopConfig struct {
}

func (*ClientStopConfig) Stop

func (c *ClientStopConfig) Stop() error

Stop stops the currently running origin container and any containers started by the node.

type ClusterUpConfig

type ClusterUpConfig struct {
	Image             string
	ImageTag          string
	ImageStreams      string
	DockerMachine     string
	SkipRegistryCheck bool
	PortForwarding    bool
	ClusterAdd        *cobra.Command

	Out io.Writer

	// BaseTempDir is the directory to use as the root for temp directories
	// This allows us to bundle all of the cluster-up directories in one spot for easier cleanup and ensures we aren't
	// doing crazy thing like dirtying /var on the host (that does weird stuff)
	BaseDir           string
	SpecifiedBaseDir  bool
	HostName          string
	UseExistingConfig bool
	Environment       []string
	ServerLogLevel    int
	AddComponents     []string

	HostVolumesDir           string
	HostConfigDir            string
	WriteConfig              bool
	HostDataDir              string
	UsePorts                 []int
	DNSPort                  int
	ServerIP                 string
	AdditionalIPs            []string
	UseNsenterMount          bool
	PublicHostname           string
	RoutingSuffix            string
	HostPersistentVolumesDir string
	HTTPProxy                string
	HTTPSProxy               string
	NoProxy                  []string
	CACert                   string
	PVCount                  int
	// contains filtered or unexported fields
}

func (*ClusterUpConfig) Bind

func (c *ClusterUpConfig) Bind(flags *pflag.FlagSet)

func (*ClusterUpConfig) BuildConfig

func (c *ClusterUpConfig) BuildConfig() (*configDirs, error)

func (*ClusterUpConfig) Check

func (c *ClusterUpConfig) Check(out io.Writer) error

Check is a spot to do NON-MUTATING, preflight checks. Over time, we should try to move our non-mutating checks out of Complete and into Check.

func (*ClusterUpConfig) ClusterAdminKubeConfigBytes

func (c *ClusterUpConfig) ClusterAdminKubeConfigBytes() ([]byte, error)

func (*ClusterUpConfig) Complete

func (c *ClusterUpConfig) Complete(cmd *cobra.Command, out io.Writer) error

func (*ClusterUpConfig) CreateProject

func (c *ClusterUpConfig) CreateProject(out io.Writer) error

CreateProject creates a new project for the current user

func (*ClusterUpConfig) DockerHelper

func (c *ClusterUpConfig) DockerHelper() *dockerhelper.Helper

DockerHelper returns a helper object to work with the Docker client

func (*ClusterUpConfig) GetDockerClient

func (c *ClusterUpConfig) GetDockerClient() dockerhelper.Interface

GetDockerClient obtains a new Docker client from the environment or from a Docker machine, starting it if necessary

func (*ClusterUpConfig) GetKubeAPIServerConfigDir

func (c *ClusterUpConfig) GetKubeAPIServerConfigDir() string

func (*ClusterUpConfig) GetLogDir

func (c *ClusterUpConfig) GetLogDir() string

func (*ClusterUpConfig) GetPublicHostName

func (c *ClusterUpConfig) GetPublicHostName() string

func (*ClusterUpConfig) HostHelper

func (c *ClusterUpConfig) HostHelper() *host.HostHelper

HostHelper returns a helper object to check Host configuration

func (*ClusterUpConfig) ImportInitialObjectsComponents

func (c *ClusterUpConfig) ImportInitialObjectsComponents(out io.Writer) []componentinstall.Component

TODO this should become a separate thing we can install, like registry

func (*ClusterUpConfig) Login

func (c *ClusterUpConfig) Login(out io.Writer) error

Login logs into the new server and sets up a default user and project

func (*ClusterUpConfig) OpenShiftHelper

func (c *ClusterUpConfig) OpenShiftHelper() *openshift.Helper

OpenShiftHelper returns a helper object to work with OpenShift on the server

func (*ClusterUpConfig) PostClusterStartupMutations

func (c *ClusterUpConfig) PostClusterStartupMutations(out io.Writer) error

func (*ClusterUpConfig) RESTConfig

func (c *ClusterUpConfig) RESTConfig() (*rest.Config, error)

func (*ClusterUpConfig) RegisterTemplateServiceBroker

func (c *ClusterUpConfig) RegisterTemplateServiceBroker(out io.Writer) error

RegisterTemplateServiceBroker will register the tsb with the service catalog

func (*ClusterUpConfig) ServerInfo

func (c *ClusterUpConfig) ServerInfo(out io.Writer)

ServerInfo displays server information after a successful start

func (*ClusterUpConfig) ShouldCreateUser

func (c *ClusterUpConfig) ShouldCreateUser() bool

ShouldCreateUser determines whether a user and project should be created. If the user provider has been modified in the config, then it should not attempt to create a user. Also, even if the user provider has not been modified, but data has been initialized, then we should also not create user.

func (*ClusterUpConfig) ShouldInitializeData

func (c *ClusterUpConfig) ShouldInitializeData() bool

ShouldInitializeData tries to determine whether we're dealing with an existing OpenShift data and config. It determines that data exists by checking for the existence of a docker-registry service.

func (*ClusterUpConfig) Start

func (c *ClusterUpConfig) Start(out io.Writer) error

Start runs the start tasks ensuring that they are executed in sequence

func (*ClusterUpConfig) StartSelfHosted

func (c *ClusterUpConfig) StartSelfHosted(out io.Writer) error

func (*ClusterUpConfig) Validate

func (c *ClusterUpConfig) Validate(errout io.Writer) error

Validate validates that required fields in StartConfig have been populated

type TaskPrinter

type TaskPrinter struct {
	// contains filtered or unexported fields
}

TaskPrinter is a helper for start task output

func NewTaskPrinter

func NewTaskPrinter(out io.Writer) *TaskPrinter

NewTaskPrinter creates a new TaskPrinter

func (*TaskPrinter) Failure

func (p *TaskPrinter) Failure(err error)

Failure writes out a failure marker for a task and outputs the error that caused the failure

func (*TaskPrinter) StartTask

func (p *TaskPrinter) StartTask(name string)

StartTask writes out the header for a task

func (*TaskPrinter) Success

func (p *TaskPrinter) Success()

Success writes out a success marker for a task

func (*TaskPrinter) TaskWriter

func (p *TaskPrinter) TaskWriter() io.Writer

TaskWriter is a writer that can be used to write task output

func (*TaskPrinter) ToError

func (p *TaskPrinter) ToError(err error) error

ToError provides a way to return the pretty error output from a task without special casing the code to only work in a narrow case while running the command.

Directories

Path Synopsis
Package exec contains a utility to Docker exec into a running a container
Package exec contains a utility to Docker exec into a running a container
Package host contains a utility to run commands on the Docker host by using an image in privileged mode.
Package host contains a utility to run commands on the Docker host by using an image in privileged mode.
Package runner contains a utility to run Docker containers
Package runner contains a utility to run Docker containers

Jump to

Keyboard shortcuts

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