@@ -25,7 +25,7 @@ type PVCExpansionResult struct {
2525 NeedsExpansion bool
2626 NeedsStatefulSetRecreation bool
2727 RequiresDetachment bool
28- OnlyPVCSizeChanged bool // True if only PVC sizes changed, no other StatefulSet changes
28+ OnlyPVCSizeChanged bool // True if only PVC sizes changed, no other StatefulSet changes
2929 PVCsToExpand []PVCExpansionInfo
3030 ValidationErrors []string
3131}
@@ -40,11 +40,11 @@ type PVCExpansionInfo struct {
4040}
4141
4242// DetectPVCExpansion analyzes if PVC expansion is needed for a StatefulSet
43- func DetectPVCExpansion (ctx context.Context , k8sClient client.Client ,
43+ func DetectPVCExpansion (ctx context.Context , k8sClient client.Client ,
4444 namespace , statefulSetName string , newStorageVolumes []v1.StorageVolume ) (* PVCExpansionResult , error ) {
45-
45+
4646 logger := log .FromContext (ctx ).WithName ("pvc-expansion" )
47-
47+
4848 result := & PVCExpansionResult {
4949 PVCsToExpand : []PVCExpansionInfo {},
5050 ValidationErrors : []string {},
@@ -75,7 +75,7 @@ func DetectPVCExpansion(ctx context.Context, k8sClient client.Client,
7575 if isSpecialStorageClass (sv ) || strings .HasPrefix (sv .StorageSize , "0" ) {
7676 continue
7777 }
78-
78+
7979 pvc := corev1.PersistentVolumeClaim {
8080 ObjectMeta : metav1.ObjectMeta {Name : sv .Name },
8181 Spec : corev1.PersistentVolumeClaimSpec {
@@ -173,7 +173,7 @@ func DetectPVCExpansion(ctx context.Context, k8sClient client.Client,
173173// ExpandPVCs performs the actual PVC expansion
174174func ExpandPVCs (ctx context.Context , k8sClient client.Client , expansionInfos []PVCExpansionInfo ) error {
175175 logger := log .FromContext (ctx ).WithName ("pvc-expansion" )
176-
176+
177177 for _ , info := range expansionInfos {
178178 logger .Info ("Expanding PVC" , "pvc" , info .PVCName , "namespace" , info .Namespace ,
179179 "currentSize" , info .CurrentSize .String (), "newSize" , info .NewSize .String ())
@@ -189,7 +189,7 @@ func ExpandPVCs(ctx context.Context, k8sClient client.Client, expansionInfos []P
189189
190190 // Update the PVC size
191191 pvc .Spec .Resources .Requests [corev1 .ResourceStorage ] = info .NewSize
192-
192+
193193 err = k8sClient .Update (ctx , & pvc )
194194 if err != nil {
195195 return fmt .Errorf ("failed to update PVC %s: %w" , info .PVCName , err )
@@ -278,9 +278,9 @@ func ExpandPVCsWithDetachment(ctx context.Context, k8sClient client.Client, expe
278278}
279279
280280// getStatefulSetPVCs returns all PVCs for a specific volume in a StatefulSet
281- func getStatefulSetPVCs (ctx context.Context , k8sClient client.Client ,
281+ func getStatefulSetPVCs (ctx context.Context , k8sClient client.Client ,
282282 namespace , statefulSetName , volumeName string ) ([]corev1.PersistentVolumeClaim , error ) {
283-
283+
284284 var pvcList corev1.PersistentVolumeClaimList
285285 err := k8sClient .List (ctx , & pvcList , client .InNamespace (namespace ))
286286 if err != nil {
@@ -514,11 +514,11 @@ func requiresDetachmentForExpansion(sc *storagev1.StorageClass) bool {
514514 // Known provisioners that support online expansion (safe to expand without detachment)
515515 onlineExpansionSupportedProvisioners := map [string ]bool {
516516 // Google Cloud Persistent Disk
517- "kubernetes.io/gce-pd" : true ,
517+ "kubernetes.io/gce-pd" : true ,
518518 "pd.csi.storage.gke.io" : true ,
519519 // AWS EBS
520520 "kubernetes.io/aws-ebs" : true ,
521- "ebs.csi.aws.com" : true ,
521+ "ebs.csi.aws.com" : true ,
522522 // DigitalOcean Block Storage
523523 "dobs.csi.digitalocean.com" : true ,
524524 // Linode Block Storage
0 commit comments