Skip to content

Commit

Permalink
removed func ensurePodDisruptionBudgets
Browse files Browse the repository at this point in the history
  • Loading branch information
triceras committed Jan 21, 2025
1 parent 85710ff commit eb71c9c
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions controllers/humiocluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2542,29 +2542,3 @@ func (r *HumioClusterReconciler) cleanupOrphanedPDBs(ctx context.Context, hc *hu

return nil
}

// ensurePodDisruptionBudgets is the main entry point for PDB reconciliation
func (r *HumioClusterReconciler) ensurePodDisruptionBudgets(ctx context.Context, hc *humiov1alpha1.HumioCluster, nodeSpec *humiov1alpha1.HumioNodeSpec) error {
// Only proceed if PDB should be created for this cluster
if !shouldCreatePDBForNodePool(nodeSpec) {
return nil
}

// Construct the desired PDB
desiredPDB, err := r.constructPDB(hc, nodeSpec)
if err != nil {
return fmt.Errorf("failed to construct PDB: %w", err)
}

// Create or update the PDB
if err := r.createOrUpdatePDB(ctx, hc, nodeSpec, desiredPDB); err != nil {
return fmt.Errorf("failed to create or update PDB: %w", err)
}

// Clean up any orphaned PDBs
if err := r.cleanupOrphanedPDBs(ctx, hc, nodeSpec); err != nil {
return fmt.Errorf("failed to cleanup orphaned PDBs: %w", err)
}

return nil
}

0 comments on commit eb71c9c

Please sign in to comment.