Documentation
¶
Index ¶
- Constants
- func CWSAStatusNeedsUpdate(current, desired *agentoctopuscomv1beta1.ClusterWorkloadServiceAccountStatus) bool
- func ConditionsEqual(a, b []metav1.Condition) bool
- func ExternalChangePredicate() predicate.Predicate
- func ExternalDeletePredicate(tracker GCTrackerInterface) predicate.Predicate
- func GenerationOrDeletePredicate() predicate.Predicate
- func IsManagedServiceAccount(obj interface{}) bool
- func ManagedResourcePredicate() predicate.Predicate
- func ManagedServiceAccountPredicate() predicate.Predicate
- func MapServiceAccountToResources[T client.Object, L client.ObjectList](ctx context.Context, obj client.Object, c client.Client, listObj L, ...) []reconcile.Request
- func SuppressOwnedResourceDeletes() predicate.Predicate
- func WSAStatusNeedsUpdate(current, desired *agentoctopuscomv1beta1.WorkloadServiceAccountStatus) bool
- type ClusterWorkloadServiceAccountReconciler
- type GCTracker
- type GCTrackerInterface
- type WSAResource
- type WorkloadServiceAccountReconciler
Constants ¶
const ( ServiceAccountCleanupFinalizer = "octopus.com/serviceaccount-cleanup" ManagedByLabel = "octopus.com/managed-by" ManagedByValue = "permissions-controller" ReasonReconcileSuccess = "ReconcileSuccess" ReasonReconcileFailed = "ReconcileFailed" )
Variables ¶
This section is empty.
Functions ¶
func CWSAStatusNeedsUpdate ¶ added in v1.0.0
func CWSAStatusNeedsUpdate(current, desired *agentoctopuscomv1beta1.ClusterWorkloadServiceAccountStatus) bool
CWSAStatusNeedsUpdate determines if a ClusterWorkloadServiceAccount status update is needed. It returns true if the conditions have meaningfully changed.
func ConditionsEqual ¶ added in v1.0.0
ConditionsEqual compares two condition slices for equality in an order-insensitive manner. It returns true if both slices contain the same conditions with matching Type, Status, and Reason. Message and LastTransitionTime are intentionally not compared to avoid spurious updates.
func ExternalChangePredicate ¶ added in v1.0.0
ExternalChangePredicate filters out Create/Update events caused by this controller's Server-Side Apply operations by checking the ManagedFields metadata.
func ExternalDeletePredicate ¶ added in v1.0.0
func ExternalDeletePredicate(tracker GCTrackerInterface) predicate.Predicate
ExternalDeletePredicate filters out Delete events for resources being actively garbage collected by this controller.
func GenerationOrDeletePredicate ¶ added in v1.0.0
func IsManagedServiceAccount ¶
func IsManagedServiceAccount(obj interface{}) bool
func ManagedResourcePredicate ¶ added in v1.0.0
func ManagedServiceAccountPredicate ¶ added in v1.0.0
func WSAStatusNeedsUpdate ¶ added in v1.0.0
func WSAStatusNeedsUpdate(current, desired *agentoctopuscomv1beta1.WorkloadServiceAccountStatus) bool
WSAStatusNeedsUpdate determines if a WorkloadServiceAccount status update is needed. It returns true if the conditions have meaningfully changed.
Types ¶
type ClusterWorkloadServiceAccountReconciler ¶
type ClusterWorkloadServiceAccountReconciler struct {
client.Client
Scheme *runtime.Scheme
Engine *rules.InMemoryEngine
EventCollector *staging.EventCollector
Recorder record.EventRecorder
}
func (*ClusterWorkloadServiceAccountReconciler) SetupWithManager ¶
func (r *ClusterWorkloadServiceAccountReconciler) SetupWithManager(mgr ctrl.Manager, gcTracker *GCTracker) error
type GCTracker ¶ added in v1.0.0
type GCTracker struct {
// contains filtered or unexported fields
}
GCTracker tracks resources being actively garbage collected by the controller. It uses an expirable LRU cache to automatically clean up entries after a TTL.
func NewGCTracker ¶ added in v1.0.0
NewGCTracker creates a new GCTracker with the specified TTL for entries. The TTL should be long enough to cover the delay between the delete call and the watch event being processed by the predicate.
func (*GCTracker) IsBeingDeleted ¶ added in v1.0.0
IsBeingDeleted returns true if the resource with the given UID is being actively deleted by the controller (was recently marked for deletion and hasn't expired).
func (*GCTracker) MarkForDeletion ¶ added in v1.0.0
MarkForDeletion records that a resource with the given UID is being deleted by the controller. This should be called immediately before the delete operation.
type GCTrackerInterface ¶ added in v1.0.0
type GCTrackerInterface interface {
MarkForDeletion(uid types.UID)
IsBeingDeleted(uid types.UID) bool
}
GCTrackerInterface defines the interface for tracking resources being garbage collected. This allows predicates to filter out delete events for resources the controller is actively removing.
type WSAResource ¶
type WSAResource interface {
client.Object
*agentoctopuscomv1beta1.WorkloadServiceAccount | *agentoctopuscomv1beta1.ClusterWorkloadServiceAccount
}
type WorkloadServiceAccountReconciler ¶
type WorkloadServiceAccountReconciler struct {
client.Client
Scheme *runtime.Scheme
Engine *rules.InMemoryEngine
EventCollector *staging.EventCollector
Recorder record.EventRecorder
}
func (*WorkloadServiceAccountReconciler) SetupWithManager ¶
func (r *WorkloadServiceAccountReconciler) SetupWithManager(mgr ctrl.Manager, gcTracker *GCTracker) error