variablecontext

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubstitutePodSpecForTask

func SubstitutePodSpecForTask(rj *execution.Job, template *tasks.TaskTemplate) v1.PodSpec

SubstitutePodSpecForTask returns a PodSpec from a TaskTemplate after substituting context variables for the task context.

func SubstitutePodTemplateSpecForJob

func SubstitutePodTemplateSpecForJob(rj *execution.Job) v1.PodTemplateSpec

SubstitutePodTemplateSpecForJob returns a PodTemplateSpec for a given Job after substituting context variables for the job context. Uses the Job's substitutions field to specify overrides for the job context.

Types

type Provider

type Provider interface {
	// GetAllPrefixes returns a list of prefixes that the provider would inject.
	GetAllPrefixes() []string

	// MakeVariablesFromJobConfig returns context variables for the "jobconfig"
	// context, which contains information about the parent JobConfig of a Job.
	MakeVariablesFromJobConfig(rjc *execution.JobConfig) map[string]string

	// MakeVariablesFromJob returns context variables for the "job" context, which
	// contains information about the Job.
	MakeVariablesFromJob(rj *execution.Job) map[string]string

	// MakeVariablesFromTask returns context variables for the "task" context, which
	// contains information about the Task.
	MakeVariablesFromTask(rj *execution.Job, task *tasks.TaskTemplate) map[string]string
}

Provider supplies context variables given an object. The intention is that variables can only be provided in different "contexts" in a Job's lifecycle.

var (
	// ContextProvider is the global Provider that can supply context variables.
	ContextProvider Provider = &defaultProvider{}
)

Jump to

Keyboard shortcuts

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