Documentation
¶
Overview ¶
Package grants resolves per-project cluster resource grants (multitenancy-manager AvailableClusterResource) so that Application package settings fields tagged with x-deckhouse-grantable-resource can be defaulted and validated against what a project may use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
// Default is the per-project default granted name. May be empty.
Default string
// Available is the set of granted names available to the project.
Available []string
// Found reports whether an AvailableClusterResource was actually located.
// When false, the feature is treated as inactive (no defaulting, no
// validation) for this resource.
Found bool
}
Catalog is the resolved per-project catalog for one grantable resource.
func (Catalog) IsAvailable ¶
IsAvailable reports whether name is in the available set.
type NoopResolver ¶
type NoopResolver struct{}
NoopResolver is a Resolver that always reports the feature as inactive. Useful for tests and contexts where grant resolution is not wired.
type Resolver ¶
type Resolver interface {
// Resolve returns the per-project catalog for the AvailableClusterResource
// named resource in namespace. A missing CRD (multitenancy disabled) or a
// missing object yields Catalog{Found: false} with a nil error; only
// unexpected API errors are returned.
Resolve(ctx context.Context, namespace, resource string) (Catalog, error)
}
Resolver resolves a grantable resource catalog for a namespace.
func NewResolver ¶
NewResolver returns a Resolver backed by the given client.