workload

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SecretEnvParser = NewSecretEnvParser()
	RawEnvParser    = NewRawEnvParser()
)
View Source
var (
	ErrEmptySelectors        = errors.New("selectors must not be empty")
	ErrInvalidPort           = errors.New("port must be between 1 and 65535")
	ErrInvalidTargetPort     = errors.New("targetPort must be between 1 and 65535 if exist")
	ErrInvalidProtocol       = errors.New("protocol must be TCP or UDP")
	ErrDuplicatePortProtocol = errors.New("port-protocol pair must not be duplicate")
)

Functions

func MagicEnvVar

func MagicEnvVar(k, v string) *corev1.EnvVar

MagicEnvVar generates a specialized EnvVar based on the key and value of environment.

Examples:

MagicEnvVar("secret_key", "secret://my_secret/my_key")
MagicEnvVar("key", "value")

func NewJobGenerator

func NewJobGenerator(generator *Generator) (modules.Generator, error)

func NewJobGeneratorFunc

func NewJobGeneratorFunc(generator *Generator) modules.NewGeneratorFunc

func NewWorkloadGeneratorFunc

func NewWorkloadGeneratorFunc(g *Generator) modules.NewGeneratorFunc

func NewWorkloadServiceGenerator

func NewWorkloadServiceGenerator(request *Generator) (modules.Generator, error)

NewWorkloadServiceGenerator returns a new ServiceGenerator instance.

func NewWorkloadServiceGeneratorFunc

func NewWorkloadServiceGeneratorFunc(workloadGenerator *Generator) modules.NewGeneratorFunc

NewWorkloadServiceGeneratorFunc returns a new NewGeneratorFunc that returns a ServiceGenerator instance.

Types

type Generator added in v0.11.0

type Generator struct {
	// Project represents the Project name
	Project string
	// Stack represents the Stack name
	Stack string
	// App represents the application name
	App string
	// Namespace represents the K8s Namespace
	Namespace string
	// Workload represents the Workload configuration
	Workload *workload.Workload
	// PlatformConfigs represents the module platform configurations
	PlatformConfigs map[string]apiv1.GenericConfig
	// SecretStoreSpec contains configuration to describe target secret store.
	SecretStoreSpec *apiv1.SecretStoreSpec
}

func (*Generator) Generate added in v0.11.0

func (g *Generator) Generate(spec *apiv1.Intent) error

type MagicEnvParser

type MagicEnvParser interface {
	Match(k, v string) (matched bool)
	Gen(k, v string) *corev1.EnvVar
}

MagicEnvParser is an interface for environment variable parsers.

func NewRawEnvParser

func NewRawEnvParser() MagicEnvParser

NewRawEnvParser creates a new instance of RawEnvParser.

func NewSecretEnvParser

func NewSecretEnvParser() MagicEnvParser

NewSecretEnvParser creates a new instance of SecretEnvParser.

type ServiceGenerator added in v0.11.0

type ServiceGenerator struct {
	Project   string
	Stack     string
	App       string
	Namespace string
	Service   *workload.Service
	Config    apiv1.GenericConfig
}

ServiceGenerator is a struct for generating Service Workload resources.

func (*ServiceGenerator) Generate added in v0.11.0

func (g *ServiceGenerator) Generate(spec *apiv1.Intent) error

Generate generates a Service Workload resource to the given spec.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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