ocmcontainer

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Runtime

type Runtime struct {

	// PostStartExecHooks are functions that are defined by features in order
	// to allow features to self-initialize things _after_ the container has
	// started.
	PostStartExecHooks [](func(features.ContainerRuntime) error)

	// BlockingPostStartExecCommands are typically populated by the functions
	// defined in the PostStartExecHooks list above. This is a string slice that
	// is run inside the container after it is started but before an interactive
	// session is attached. If this fails, ocm-container will exit before attaching.
	BlockingPostStartExecCmds [][]string

	// NonBlockingPostStartExecCmds are similar to the BlockingPostStartExecCmds
	// defined above, however if these commands are unsuccessful on the container
	// ocm-container will not exit and will continue to boot.
	NonBlockingPostStartExecCmds [][]string
	// contains filtered or unexported fields
}

func New

func New(cmd *cobra.Command, args []string) (*Runtime, error)

func (*Runtime) Attach

func (o *Runtime) Attach() error

func (*Runtime) BackgroundExec

func (o *Runtime) BackgroundExec(args []string)

func (*Runtime) BackgroundExecWithChan

func (o *Runtime) BackgroundExecWithChan(args []string, stdout chan string)

func (*Runtime) Copy

func (o *Runtime) Copy(source, destination string) (string, error)

Copy takes a source and destination (optionally with a [container]: prefixed) and executes a container engine "cp" command with those as arguments

func (*Runtime) Create

func (o *Runtime) Create(c engine.ContainerRef) error

func (*Runtime) CreateContainer

func (o *Runtime) CreateContainer(c engine.ContainerRef) error

This is just a wrapper around Create for readability

func (*Runtime) Exec

func (o *Runtime) Exec(args []string) (string, error)

func (*Runtime) ExecPostRunBlockingCmds

func (o *Runtime) ExecPostRunBlockingCmds() error

ExecPostRunBlockingCmds starts the blocking exec commands stored in the *Runtime config Blocking commands are those that must succeed to ensure a working ocm-container

func (*Runtime) ExecPostRunBlockingHooks

func (o *Runtime) ExecPostRunBlockingHooks() error

func (*Runtime) ExecPostRunNonBlockingCmds

func (o *Runtime) ExecPostRunNonBlockingCmds()

ExecPostRunNonBlockingCmds starts the non-blocking exec commands stored in the *Runtime config Non-blocking commands are those that may or may not succeed, but are not critical to the operation of the container

func (*Runtime) Inspect

func (o *Runtime) Inspect(query string) (string, error)

func (*Runtime) RegisterBlockingPostStartCmd

func (o *Runtime) RegisterBlockingPostStartCmd(cmd []string)

func (*Runtime) RegisterPostExecCleanupFunc

func (o *Runtime) RegisterPostExecCleanupFunc(f func())

func (*Runtime) RegisterPreExecCleanupFunc

func (o *Runtime) RegisterPreExecCleanupFunc(f func())

func (*Runtime) Run

func (o *Runtime) Run() error

func (*Runtime) Running

func (o *Runtime) Running() (bool, error)

Running returns a boolean indicating if the container is running in that Point In Time Keep in mind the state could change at any time

func (*Runtime) Start

func (o *Runtime) Start(attach bool) error

func (*Runtime) StartAndAttach

func (o *Runtime) StartAndAttach() error

func (*Runtime) Stop

func (o *Runtime) Stop(timeout int) error

func (*Runtime) Trap

func (o *Runtime) Trap()

Jump to

Keyboard shortcuts

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