Documentation
¶
Overview ¶
pkg/resources/limitranges/limitrange.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 ResolvedLimitRangeSpec
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 ResolvedLimitRangeSpec, toNamespaces []string, ) error
CopyToNamespaces copies a LimitRange to multiple target namespaces. Reads the source once and creates copies in each namespace. Idempotent — skips namespaces where the LimitRange already exists.
func Create ¶
func Create(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedLimitRangeSpec) error
Create creates a LimitRange 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 ResolvedLimitRangeSpec) error
Delete deletes the LimitRange if it exists.
func DeleteIfOwned ¶
func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, name, namespace string) error
DeleteIfOwned deletes the LimitRange only if it is owned by the CR.
func Update ¶
func Update(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedLimitRangeSpec) error
Update reconciles an existing LimitRange to match the resolved spec. If it does not exist, creates it.
Types ¶
type ResolvedLimitRangeSpec ¶
type ResolvedLimitRangeSpec struct {
Name string
Namespace string
Limits []orktypes.LimitRangeItem
FromLimitRange string
FromNamespace string
Labels map[string]string
Sleep string
}
ResolvedLimitRangeSpec is the fully resolved LimitRange specification.
func Resolve ¶
func Resolve(src orktypes.LimitRangeTemplateSource, ownerName string, reg orktypes.ProfileRegistry) ResolvedLimitRangeSpec
Resolve builds a ResolvedLimitRangeSpec from a LimitRangeTemplateSource. Template expressions must already be evaluated by template.Resolver before calling.