ocmcontainer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 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 added in v1.0.0

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 added in v1.0.0

func (o *Runtime) Attach() error

func (*Runtime) BackgroundExec added in v1.0.0

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

func (*Runtime) BackgroundExecWithChan added in v1.0.0

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

func (*Runtime) Copy added in v1.0.0

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 added in v1.0.0

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

func (*Runtime) CreateContainer added in v1.0.0

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

This is just a wrapper around Create for readability

func (*Runtime) Exec added in v1.0.0

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

func (*Runtime) ExecPostRunBlockingCmds added in v1.0.0

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 added in v1.0.0

func (o *Runtime) ExecPostRunBlockingHooks() error

func (*Runtime) ExecPostRunNonBlockingCmds added in v1.0.0

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 added in v1.0.0

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

func (*Runtime) RegisterBlockingPostStartCmd added in v1.0.0

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

func (*Runtime) RegisterPostExecCleanupFunc added in v1.0.0

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

func (*Runtime) RegisterPreExecCleanupFunc added in v1.0.0

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

func (*Runtime) Run added in v1.0.0

func (o *Runtime) Run() error

func (*Runtime) Running added in v1.0.0

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 added in v1.0.0

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

func (*Runtime) StartAndAttach added in v1.0.0

func (o *Runtime) StartAndAttach() error

func (*Runtime) Stop added in v1.0.0

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

func (*Runtime) Trap added in v1.0.0

func (o *Runtime) Trap()

Jump to

Keyboard shortcuts

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