component

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 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")
	ErrWorkloadNotFound         = errors.New("workload not found")
	ErrTraitNotFound            = errors.New("trait not found")
	ErrValidation               = errors.New("validation error")
	ErrComponentTypeNotFound    = errors.New("component type not found")
)

Functions

This section is empty.

Types

type GenerateReleaseRequest

type GenerateReleaseRequest struct {
	ReleaseName string
}

GenerateReleaseRequest contains the parameters for generating a component release.

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
	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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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