Documentation
¶
Overview ¶
pkg/resources/clusterrolebindings/clusterrolebinding.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 ResolvedClusterRoleBindingSpec
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 ResolvedClusterRoleBindingSpec) error
Create creates a ClusterRoleBinding if it does not already exist. Idempotent — skips if the ClusterRoleBinding already exists. ClusterRoleBindings 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 ResolvedClusterRoleBindingSpec) error
Delete deletes the ClusterRoleBinding if it exists.
func DeleteIfOwned ¶
func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, name string) error
DeleteIfOwned deletes the ClusterRoleBinding only if it is owned by the CR.
func Update ¶
func Update(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedClusterRoleBindingSpec) error
Update applies the desired subjects to an existing ClusterRoleBinding. RoleRef is immutable in Kubernetes — if it changed the binding is deleted and recreated. If it does not exist, creates it.
Types ¶
type ResolvedClusterRoleBindingSpec ¶
type ResolvedClusterRoleBindingSpec struct {
Name string
Labels map[string]string
RoleRef rbacv1.RoleRef
Subjects []rbacv1.Subject
Sleep string
}
ResolvedClusterRoleBindingSpec is the fully resolved ClusterRoleBinding specification.
func Resolve ¶
func Resolve(src orktypes.ClusterRoleBindingTemplateSource, ownerName string) ResolvedClusterRoleBindingSpec
Resolve builds a ResolvedClusterRoleBindingSpec from a ClusterRoleBindingTemplateSource. Template expressions must already be evaluated by template.Resolver before calling.