install

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathTOI         = "/toi"
	Inputs          = "inputs"
	Outputs         = "outputs"
	PathExec        = PathTOI + "/run"
	PathOutputs     = PathTOI + "/" + Outputs
	PathInputs      = PathTOI + "/" + Inputs
	InputParameters = "parameters"
	InputConfig     = "config"
	InputOCMConfig  = "ocmconfig"
	InputOCMRepo    = "ocmrepo"
)

Variables

This section is empty.

Functions

func CheckCredentialRequests

func CheckCredentialRequests(executor *toi.Executor, spec *toi.PackageSpecification, espec *toi.ExecutorSpecification) (map[string]CredentialsRequestSpec, map[string]string, error)

CheckCredentialRequests determine required credentials for executor.

func GetResource

func GetResource(res ocm.ResourceAccess, target interface{}) error

func NewFunctions

func NewFunctions(ctx ocm.Context, credvals CredentialValues) spiffing.Functions

func ProcessConfig

func ProcessConfig(name string, octx ocm.Context, cv ocm.ComponentVersionAccess, resolver ocm.ComponentVersionResolver, template []byte, config []byte, libraries []metav1.ResourceReference, schemedata []byte) ([]byte, error)

func ValidateByScheme

func ValidateByScheme(src []byte, schemedata []byte) error

Types

type CredentialSpec

type CredentialSpec = toi.CredentialSpec

type CredentialValues

type CredentialValues map[string]common.Properties

type Credentials

type Credentials = toi.Credentials

func ParseCredentialSpecification

func ParseCredentialSpecification(data []byte, desc string) (*Credentials, error)

type CredentialsRequest

type CredentialsRequest = toi.CredentialsRequest

func ParseCredentialRequest

func ParseCredentialRequest(data []byte) (*CredentialsRequest, error)

type CredentialsRequestSpec

type CredentialsRequestSpec = toi.CredentialsRequestSpec

type Driver

type Driver interface {
	SetConfig(props map[string]string) error
	Exec(op *Operation) (*OperationResult, error)
}

type ExecutorContext

type ExecutorContext struct {
	Spec  toi.ExecutorSpecification
	Image *toi.Image
	CV    ocm.ComponentVersionAccess
}

func DetermineExecutor

func DetermineExecutor(executor *toi.Executor, octx ocm.Context, cv ocm.ComponentVersionAccess, resolver ocm.ComponentVersionResolver) (*ExecutorContext, error)

type Operation

type Operation struct {
	// Action is the action to be performed. It is passed a srgument to the executable
	Action string
	// ComponentVersion is the name of the root component/version to install
	ComponentVersion string
	// Image is the image to invoke
	Image toi.Image
	// Environment contains environment variables that should be injected into the container execution
	Environment map[string]string
	// Files contains files that should be injected into the invocation image.
	Files map[string]blobaccess.BlobAccess
	// Outputs map of output (sub)paths (e.g. NAME) to the name of the output.
	// Indicates which outputs the driver should return the contents of in the OperationResult.
	Outputs map[string]string
	// Output stream for log messages from the driver
	Out io.Writer
	// Output stream for error messages from the driver
	Err io.Writer
}

Operation describes the data passed into the driver to run an operation.

func (*Operation) Close

func (op *Operation) Close() error

type OperationResult

type OperationResult struct {
	// Outputs maps from the name of the output to its content.
	Outputs map[string][]byte

	// Error is any errors from executing the operation.
	Error error
}

OperationResult is the output of the Driver running an Operation.

func ExecuteAction

ExecuteAction prepared the execution options and executes the action.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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