Documentation
¶
Overview ¶
Package projectconfig handles declarative cloud project configuration manifests (volcano-config.yaml) that describe storage buckets, storage policies, and function visibility for a project.
Index ¶
Constants ¶
const (
// ManifestVersion is the only currently supported manifest schema version.
ManifestVersion = 1
)
Variables ¶
This section is empty.
Functions ¶
func ResolveManifestPath ¶
ResolveManifestPath returns the manifest path that `config deploy` should load. An explicit path is used as-is (after existence check); otherwise the CLI looks for volcano/volcano-config.yaml then volcano-config.yaml in the working directory.
Types ¶
type BucketManifest ¶
type BucketManifest struct {
Name string `yaml:"name"`
FileSizeLimit *int64 `yaml:"file_size_limit,omitempty"`
AllowedMimeTypes *[]string `yaml:"allowed_mime_types,omitempty"`
Policies []PolicyManifest `yaml:"policies,omitempty"`
}
BucketManifest declares one storage bucket and its desired policies.
type FunctionManifest ¶
FunctionManifest declares the desired visibility for one deployed function.
type FunctionReconciler ¶
type FunctionReconciler interface {
ListPage(ctx context.Context, page, limit int) (*apiclient.PaginatedFunctions, error)
UpdateVisibility(ctx context.Context, identifier string, isPublic bool) (*apiclient.Function, error)
}
FunctionReconciler is the subset of internal/function.Service used to update function visibility from a manifest.
type Manifest ¶
type Manifest struct {
Version int `yaml:"version"`
Buckets []BucketManifest `yaml:"buckets,omitempty"`
Functions []FunctionManifest `yaml:"functions,omitempty"`
}
Manifest is the on-disk shape of volcano-config.yaml.
type PolicyManifest ¶
type PolicyManifest struct {
Name string `yaml:"name"`
Operation string `yaml:"operation"`
Definition string `yaml:"definition"`
}
PolicyManifest declares one storage policy attached to a bucket.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service deploys declarative project configuration to the Volcano API.
func NewService ¶
func NewService(deps cliruntime.Deps) Service
NewService wires the projectconfig Service against the storage and function services.
func NewServiceWithReconcilers ¶
func NewServiceWithReconcilers(storage StorageReconciler, functions FunctionReconciler) Service
NewServiceWithReconcilers returns a Service that uses the supplied reconcilers. Intended for tests.
type StorageReconciler ¶
type StorageReconciler interface {
GetBucket(ctx context.Context, name string) (*apiclient.StorageBucket, error)
CreateBucket(ctx context.Context, input api.StorageBucketCreateInput) (*apiclient.StorageBucket, error)
UpdateBucket(ctx context.Context, name string, input api.StorageBucketUpdateInput) (*apiclient.StorageBucket, error)
ListPolicies(ctx context.Context, bucketName string) ([]apiclient.StoragePolicy, error)
CreatePolicy(ctx context.Context, bucketName string, input api.StoragePolicyCreateInput) (*apiclient.StoragePolicy, error)
DeletePolicy(ctx context.Context, bucketName, identifier string) (*apiclient.StoragePolicy, error)
}
StorageReconciler is the subset of internal/storage.Service that Deploy drives. It is defined here so tests can substitute a fake implementation without standing up an authenticated session.
type Summary ¶
type Summary struct {
BucketsCreated int
BucketsUpdated int
BucketsUnchanged int
PoliciesCreated int
PoliciesUpdated int
PoliciesDeleted int
PoliciesUnchanged int
FunctionsUpdated int
FunctionsUnchanged int
}
Summary describes what changed in one Deploy run. All counters are non-decreasing across reconciliation steps so callers can render a single "buckets: X created, Y updated, Z unchanged" line per resource type.