component

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrComponentNotFound        = errors.New("component not found")
	ErrComponentAlreadyExists   = errors.New("component already exists")
	ErrComponentReleaseNotFound = errors.New("component release not found")
	ErrReleaseBindingNotFound   = errors.New("release binding not found")
	ErrPipelineNotFound         = errors.New("deployment pipeline not found")
	ErrPipelineNotConfigured    = errors.New("project has no deployment pipeline configured")
	ErrNoLowestEnvironment      = errors.New("no lowest environment found in deployment pipeline")
	ErrInvalidPromotionPath     = errors.New("invalid promotion path")
	ErrWorkloadNotFound         = errors.New("workload not found")
	ErrTraitNameCollision       = errors.New("trait name collision across kinds")
	ErrValidation               = errors.New("validation error")
	ErrComponentTypeNotFound    = errors.New("component type not found")
)

Functions

This section is empty.

Types

type DeployReleaseRequest

type DeployReleaseRequest struct {
	ReleaseName string
}

DeployReleaseRequest contains the parameters for deploying a release.

type GenerateReleaseRequest

type GenerateReleaseRequest struct {
	ReleaseName string
}

GenerateReleaseRequest contains the parameters for generating a component release.

type PromoteComponentRequest

type PromoteComponentRequest struct {
	SourceEnvironment string
	TargetEnvironment string
}

PromoteComponentRequest contains the parameters for promoting a component.

type Service

type Service interface {
	CreateComponent(ctx context.Context, namespaceName string, component *openchoreov1alpha1.Component) (*openchoreov1alpha1.Component, error)
	UpdateComponent(ctx context.Context, namespaceName string, component *openchoreov1alpha1.Component) (*openchoreov1alpha1.Component, error)
	ListComponents(ctx context.Context, namespaceName, projectName string, opts services.ListOptions) (*services.ListResult[openchoreov1alpha1.Component], error)
	GetComponent(ctx context.Context, namespaceName, componentName string) (*openchoreov1alpha1.Component, error)
	DeleteComponent(ctx context.Context, namespaceName, componentName string) error
	DeployRelease(ctx context.Context, namespaceName, componentName string, req *DeployReleaseRequest) (*openchoreov1alpha1.ReleaseBinding, error)
	PromoteComponent(ctx context.Context, namespaceName, componentName string, req *PromoteComponentRequest) (*openchoreov1alpha1.ReleaseBinding, error)
	GenerateRelease(ctx context.Context, namespaceName, componentName string, req *GenerateReleaseRequest) (*openchoreov1alpha1.ComponentRelease, error)
	GetComponentSchema(ctx context.Context, namespaceName, componentName string) (*extv1.JSONSchemaProps, error)
	GetComponentReleaseSchema(ctx context.Context, namespaceName, releaseName, componentName string) (*extv1.JSONSchemaProps, error)
}

Service defines the component service interface. Both the core service (no authz) and the authz-wrapped service implement this. Methods accept and return Kubernetes CRD types directly for alignment with the K8s-native API design (discussion #1716).

func NewService

func NewService(k8sClient client.Client, logger *slog.Logger) Service

NewService creates a new component service without authorization. It internally creates an unwrapped project service for project validation, avoiding double authz when used within the authz-wrapped component service.

func NewServiceWithAuthz

func NewServiceWithAuthz(k8sClient client.Client, authzPDP authz.PDP, logger *slog.Logger) Service

NewServiceWithAuthz creates a component service with authorization checks.

Jump to

Keyboard shortcuts

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