workload

package
v0.11.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 21 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 *internalv1.Workload
	// PlatformConfigs represents the module platform configurations
	PlatformConfigs map[string]v1.GenericConfig
	// SecretStoreSpec contains configuration to describe target secret store.
	SecretStoreSpec *v1.SecretStoreSpec
}

func (*Generator) Generate added in v0.11.0

func (g *Generator) Generate(spec *v1.Spec) 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   *internalv1.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.Spec) 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