workload

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWorkloadNotFound      = errors.New("workload not found")
	ErrWorkloadAlreadyExists = errors.New("workload already exists")
	ErrComponentNotFound     = errors.New("component not found")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	CreateWorkload(ctx context.Context, namespaceName string, w *openchoreov1alpha1.Workload) (*openchoreov1alpha1.Workload, error)
	UpdateWorkload(ctx context.Context, namespaceName string, w *openchoreov1alpha1.Workload) (*openchoreov1alpha1.Workload, error)
	ListWorkloads(ctx context.Context, namespaceName, componentName string, opts services.ListOptions) (*services.ListResult[openchoreov1alpha1.Workload], error)
	GetWorkload(ctx context.Context, namespaceName, workloadName string) (*openchoreov1alpha1.Workload, error)
	DeleteWorkload(ctx context.Context, namespaceName, workloadName string) error
	GetWorkloadSchema(ctx context.Context) (*extv1.JSONSchemaProps, error)
}

Service defines the workload 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 workload service without authorization.

func NewServiceWithAuthz

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

NewServiceWithAuthz creates a workload 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