Documentation
¶
Overview ¶
pkg/resources/roles/role.go
Index ¶
- 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 ResolvedRoleSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedRoleSpec) error
Create creates a Role if it does not already exist. Idempotent — skips if the Role already exists. Owner reference ensures cleanup when the CR is deleted.
func Delete ¶
func Delete(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedRoleSpec) error
Delete deletes the Role if it exists.
func DeleteIfOwned ¶
func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, name, namespace string) error
DeleteIfOwned deletes the Role only if it is owned by the CR.
func Update ¶
func Update(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedRoleSpec) error
Update applies the desired rules to an existing Role.
Types ¶
type ResolvedRoleSpec ¶
type ResolvedRoleSpec struct {
Name string
Namespace string
Labels map[string]string
Rules []rbacv1.PolicyRule
// Sleep injects an artificial delay into the reconcile of this resource.
// Useful for autoscale testing, latency simulation, and chaos engineering.
// Accepts extended duration units (s, m, h, d, w, mo, y).
Sleep string
}
ResolvedRoleSpec is the fully resolved Role specification.
func Resolve ¶
func Resolve(src orktypes.RoleTemplateSource, ownerName string) ResolvedRoleSpec
Resolve builds a ResolvedRoleSpec from a RoleTemplateSource. Template expressions must already be evaluated by template.Resolver before calling.
Click to show internal directories.
Click to hide internal directories.