Documentation
¶
Index ¶
- func ConvertWorkloadCRToYAML(workload *openchoreov1alpha1.Workload) ([]byte, error)
- func ConvertWorkloadDescriptorToWorkloadCR(descriptorPath string, params api.CreateWorkloadParams) (*openchoreov1alpha1.Workload, error)
- func CreateBasicWorkload(params api.CreateWorkloadParams) (*openchoreov1alpha1.Workload, error)
- type ConversionParams
- type WorkloadDescriptor
- type WorkloadDescriptorConfiguration
- type WorkloadDescriptorConnection
- type WorkloadDescriptorConnectionEnvBindings
- type WorkloadDescriptorDependencies
- type WorkloadDescriptorEndpoint
- type WorkloadDescriptorEnvVar
- type WorkloadDescriptorEnvVarSource
- type WorkloadDescriptorFileVar
- type WorkloadDescriptorMetadata
- type WorkloadDescriptorSecretKeyRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertWorkloadCRToYAML ¶
func ConvertWorkloadCRToYAML(workload *openchoreov1alpha1.Workload) ([]byte, error)
ConvertWorkloadCRToYAML converts a Workload CR to clean YAML bytes with proper field ordering
func ConvertWorkloadDescriptorToWorkloadCR ¶
func ConvertWorkloadDescriptorToWorkloadCR(descriptorPath string, params api.CreateWorkloadParams) (*openchoreov1alpha1.Workload, error)
ConvertWorkloadDescriptorToWorkloadCR converts a workload.yaml descriptor to a Workload CR
func CreateBasicWorkload ¶
func CreateBasicWorkload(params api.CreateWorkloadParams) (*openchoreov1alpha1.Workload, error)
CreateBasicWorkload creates a basic Workload CR without reading from a descriptor file
Types ¶
type ConversionParams ¶
type ConversionParams struct {
NamespaceName string
ProjectName string
ComponentName string
ImageURL string
}
ConversionParams holds the parameters needed for workload conversion
type WorkloadDescriptor ¶
type WorkloadDescriptor struct {
APIVersion string `yaml:"apiVersion"`
Metadata WorkloadDescriptorMetadata `yaml:"metadata"`
Endpoints []WorkloadDescriptorEndpoint `yaml:"endpoints,omitempty"`
Dependencies *WorkloadDescriptorDependencies `yaml:"dependencies,omitempty"`
Configurations WorkloadDescriptorConfiguration `yaml:"configurations,omitempty"`
}
WorkloadDescriptor represents the structure of a workload.yaml file This is the developer-maintained descriptor alongside source code
type WorkloadDescriptorConfiguration ¶
type WorkloadDescriptorConfiguration struct {
Env []WorkloadDescriptorEnvVar `yaml:"env,omitempty"`
Files []WorkloadDescriptorFileVar `yaml:"files,omitempty"`
}
WorkloadDescriptorConfiguration represents the configurations section in workload.yaml
type WorkloadDescriptorConnection ¶
type WorkloadDescriptorConnection struct {
// Project is the target component's project name (optional, defaults to same project).
Project string `yaml:"project,omitempty"`
// Component is the target component name.
Component string `yaml:"component"`
// Name is the target endpoint name.
Name string `yaml:"name"`
// Visibility is the visibility level for the connection.
Visibility string `yaml:"visibility"`
// EnvBindings maps connection address components to env var names.
EnvBindings WorkloadDescriptorConnectionEnvBindings `yaml:"envBindings"`
}
type WorkloadDescriptorConnectionEnvBindings ¶ added in v0.17.0
type WorkloadDescriptorDependencies ¶ added in v1.0.0
type WorkloadDescriptorDependencies struct {
// Endpoints define how this workload consumes endpoints from other components.
Endpoints []WorkloadDescriptorConnection `yaml:"endpoints,omitempty"`
}
WorkloadDescriptorDependencies represents the dependencies section in workload.yaml
type WorkloadDescriptorEndpoint ¶
type WorkloadDescriptorEndpoint struct {
Name string `yaml:"name"`
DisplayName string `yaml:"displayName,omitempty"`
Port int32 `yaml:"port"`
TargetPort int32 `yaml:"targetPort,omitempty"`
Type string `yaml:"type"`
BasePath string `yaml:"basePath,omitempty"`
SchemaFile string `yaml:"schemaFile,omitempty"`
Context string `yaml:"context,omitempty"`
Visibility []string `yaml:"visibility,omitempty"`
}
type WorkloadDescriptorEnvVar ¶
type WorkloadDescriptorEnvVar struct {
Name string `yaml:"name"`
Value string `yaml:"value,omitempty"`
ValueFrom *WorkloadDescriptorEnvVarSource `yaml:"valueFrom,omitempty"`
}
WorkloadDescriptorEnvVar represents an environment variable in the descriptor
type WorkloadDescriptorEnvVarSource ¶
type WorkloadDescriptorEnvVarSource struct {
SecretKeyRef *WorkloadDescriptorSecretKeyRef `yaml:"secretKeyRef,omitempty"`
Path string `yaml:"path,omitempty"`
}
WorkloadDescriptorEnvVarSource represents the source for an environment variable value
type WorkloadDescriptorFileVar ¶
type WorkloadDescriptorFileVar struct {
Name string `yaml:"name"`
MountPath string `yaml:"mountPath"`
Value string `yaml:"value,omitempty"`
ValueFrom *WorkloadDescriptorEnvVarSource `yaml:"valueFrom,omitempty"`
}
WorkloadDescriptorFileVar represents a file configuration in the descriptor
type WorkloadDescriptorMetadata ¶
type WorkloadDescriptorMetadata struct {
Name string `yaml:"name"`
}
type WorkloadDescriptorSecretKeyRef ¶
WorkloadDescriptorSecretKeyRef represents a reference to a secret key