Documentation
¶
Overview ¶
pkg/resources/clusterroles/clusterrole.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 ResolvedClusterRoleSpec
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 ResolvedClusterRoleSpec) error
Create creates a ClusterRole if it does not already exist. Idempotent — skips if the ClusterRole already exists. ClusterRoles are cluster-scoped; ownership is tracked via the orkestra.io/owner label.
func Delete ¶
func Delete(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedClusterRoleSpec) error
Delete deletes the ClusterRole if it exists.
func DeleteIfOwned ¶
func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, name string) error
DeleteIfOwned deletes the ClusterRole only if it is owned by the CR.
func Update ¶
func Update(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedClusterRoleSpec) error
Update applies the desired rules to an existing ClusterRole. If it does not exist, creates it.
Types ¶
type ResolvedClusterRoleSpec ¶
type ResolvedClusterRoleSpec struct {
Name string
Labels map[string]string
Rules []rbacv1.PolicyRule
Sleep string
}
ResolvedClusterRoleSpec is the fully resolved ClusterRole specification.
func Resolve ¶
func Resolve(src orktypes.ClusterRoleTemplateSource, ownerName string) ResolvedClusterRoleSpec
Resolve builds a ResolvedClusterRoleSpec from a ClusterRoleTemplateSource. Template expressions must already be evaluated by template.Resolver before calling.