internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindMount

func BindMount(srcMountPoint string, dstMountPoint string) error

func ConvertOptionsToString

func ConvertOptionsToString(options []string) string

Convert options []string to comma separated string

func ExecuteMountpointProcess

func ExecuteMountpointProcess(env []string, mountpointConfig MountpointConfig, hookConfig Config) error

func ReadOciConfigJson

func ReadOciConfigJson(configJsonPath string) (specs.Spec, error)

func SetLogger

func SetLogger(logger *logrus.Logger)

Set the logger

func WriteOciConfigJson

func WriteOciConfigJson(configJsonPath string, containerConfig specs.Spec) error

Write the config.json file

Types

type Config

type Config struct {

	// If the ActivationFlag is not present in containerConfig.Process.Env, then the hook will not be activated
	// If the ActivationFlag is present in containerConfig.Process.Env, then the hook will be activated
	ActivationFlag string `json:"activation_flag,omitempty"`

	// Mountpoint program path
	ProgramPath string `json:"program_path"`

	// Host mountpoint
	HostMountPoint string `json:"host_mountpoint"`

	// Container mountpoint
	ContainerMountPoint string `json:"container_mountpoint"`
}

struct to hold the hook configuration

func ReadConfig

func ReadConfig(configFile string) (Config, error)

method to read the configuration file

type MountpointConfig

type MountpointConfig struct {

	// Activation flag. Omit if not present
	ActivationFlag string `json:"activation_flag,omitempty"`

	// Container mountpoint. Omit if not present
	ContainerMountPoint string `json:"container_mountpoint,omitempty"`

	// S3 bucket name. Must be present
	S3BucketName string `json:"s3_bucket_name"`

	// S3 endpoint url. Omit if not present
	S3EndpointUrl string `json:"s3_endpoint_url,omitempty"`

	// S3 prefix. Omit if not present
	S3Prefix string `json:"s3_prefix,omitempty"`
}

Struct to hold the mountpoint configuration passed via container environment variables

func ProcessEnv

func ProcessEnv(env []string, hookConfig Config) (mountpointConfig MountpointConfig)

Jump to

Keyboard shortcuts

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