Documentation
¶
Overview ¶
pkg/resources/resourcequotas/resourcequota.go
Index ¶
- func CopyToNamespaces(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, ...) error
- func Create(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, ...) error
- func Delete(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, ...) error
- func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, ...) error
- func Update(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, ...) error
- type ResolvedResourceQuotaSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyToNamespaces ¶
func CopyToNamespaces( ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedResourceQuotaSpec, toNamespaces []string, ) error
CopyToNamespaces copies a ResourceQuota to multiple target namespaces. Reads the source quota once and creates copies in each namespace. Idempotent — skips namespaces where the quota already exists.
func Create ¶
func Create(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedResourceQuotaSpec) error
Create creates a ResourceQuota if it does not already exist. Idempotent — skips if it already exists. Owner reference set for cascade deletion.
func Delete ¶
func Delete(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedResourceQuotaSpec) error
Delete deletes the ResourceQuota if it exists.
func DeleteIfOwned ¶
func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, name, namespace string) error
DeleteIfOwned deletes the ResourceQuota only if it is owned by the CR.
func Update ¶
func Update(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedResourceQuotaSpec) error
Update reconciles an existing ResourceQuota to match the resolved spec. If it does not exist, creates it.
Types ¶
type ResolvedResourceQuotaSpec ¶
type ResolvedResourceQuotaSpec struct {
Name string
Namespace string
Hard map[string]string
FromResourceQuota string
FromNamespace string
Labels map[string]string
Sleep string
}
ResolvedResourceQuotaSpec is the fully resolved ResourceQuota specification.
func Resolve ¶
func Resolve(src orktypes.ResourceQuotaTemplateSource, ownerName string, reg orktypes.ProfileRegistry) ResolvedResourceQuotaSpec
Resolve builds a ResolvedResourceQuotaSpec from a ResourceQuotaTemplateSource. Template expressions must already be evaluated by template.Resolver before calling.