Harbor cant be updated from 1.1.0 due to modification of immutable fields

⢎⡠ Kustomization/harbor - HealthCheckFailed - health check failed after 41.958352ms: failed early due to stalled resources: [HelmRelease/sylva-system/harbor status: 'Failed']                              
 ✗ Command timeout exceeded                                                                                                                                                                                 
Timed-out waiting for the following resources to be ready:                                                                                                                                                  
IDENTIFIER                         STATUS     REASON            MESSAGE                                                                                                                                     
Kustomization/sylva-system/harbor  InProgress                   Kustomization generation is 2, but latest observed generation is 1                                                                          
╰┄╴HelmRelease/sylva-system/harbor Failed                       Failed to upgrade after 4 attempt(s)                                                                                                        
   ├┄╴┬┄┄[Conditions]                                                                                                                                                                                       
   ┆  ├┄╴Stalled                   True       RetriesExceeded   Failed to upgrade after 4 attempt(s)                                                                                                        
   ┆  ├┄╴Ready                     False      RollbackSucceeded Helm rollback to previous release harbor/harbor.v7 with chart harbor@1.14.0 succeeded                                                       
   ┆  ├┄╴Released                  False      UpgradeFailed     Helm upgrade failed for release harbor/harbor with chart harbor@1.14.2: cannot patch "harbor-registry" with kind PersistentVolumeClaim: Pers
istentVolumeClaim "harbor-registry" is invalid: spec: Forbidden: spec is immutable after creation except resources.requests for bound claims                                                                
   ┆  ┆    core.PersistentVolumeClaimSpec{                                                                                                                                                                  
   ┆  ┆  -                       AccessModes: []core.PersistentVolumeAccessMode{"ReadWriteOnce"},                                                                                                           
   ┆  ┆  +                       AccessModes: []core.PersistentVolumeAccessMode{"ReadWriteMany"},                                                                                                           
   ┆  ┆                          Selector:    nil,                                                                                                                                                          
   ┆  ┆                          Resources:   {Requests: {s"storage": {i: {...}, s: "5Gi", Format: "BinarySI"}}},                                                                                           
   ┆  ┆                          ... // 5 identical fields                                                                                                                                                  
   ┆  ┆    }                                                                                                                                                                                                
   ┆  ╰┄╴Remediated              True RollbackSucceeded Helm rollback to previous release harbor/harbor.v7 with chart harbor@1.14.0 succeeded                                                               
   ╰┄╴┬┄┄[Events]                                                                                                                                                                                           
      ├┄╴harbor.17e138b262652f8f      UpgradeFailed     Helm upgrade failed for release harbor/harbor with chart harbor@1.14.2: cannot patch "harbor-registry" with kind PersistentVolumeClaim: PersistentVo
lumeClaim "harbor-registry" is invalid: spec: Forbidden: spec is immutable after creation except resources.requests for bound claims                                                                        
      ┆    core.PersistentVolumeClaimSpec{                                                                                                                                                                  
      ┆  -  AccessModes: []core.PersistentVolumeAccessMode{"ReadWriteOnce"},                                                                                                                                
      ┆  +  AccessModes: []core.PersistentVolumeAccessMode{"ReadWriteMany"},                                                                                                                                
      ┆     Selector:    nil,                                                                                                                                                                               
      ┆     Resources:   {Requests: {s"storage": {i: {...}, s: "5Gi", Format: "BinarySI"}}},                                                                                                                
      ┆     ... // 5 identical fields                                                                                                                                                                       
      ┆    }                                                                                                                                                                                                
      ┆                                                                                                                                                                                                     
      ┆  Last Helm logs:                                                                                                                                                                                    
      ┆                                          
     ┆                                                                                                                                                                                                     
      ┆  2024-07-11T17:27:48.906781491Z: Looks like there are no changes for Service "harbor-portal"                                                                                                        
      ┆  2024-07-11T17:27:48.913704993Z: Looks like there are no changes for Service "harbor-redis"                                                                                                         
      ┆  2024-07-11T17:27:48.920603158Z: Looks like there are no changes for Service "harbor-registry"                                                                                                      
      ┆  2024-07-11T17:27:48.932470832Z: Patch Deployment "harbor-core" in namespace harbor                                                                                                                 
      ┆  2024-07-11T17:27:49.119192996Z: Patch Deployment "harbor-jobservice" in namespace harbor                                                                                                           
      ┆  2024-07-11T17:27:49.259686718Z: Patch Deployment "harbor-portal" in namespace harbor                                                                                                               
      ┆  2024-07-11T17:27:50.487266025Z: Patch Deployment "harbor-registry" in namespace harbor                                                                                                             
      ┆  2024-07-11T17:27:50.649140552Z: Patch StatefulSet "harbor-redis" in namespace harbor                                                                                                               
      ┆  2024-07-11T17:27:50.728006497Z: Looks like there are no changes for Ingress "harbor-ingress"                                                                                                       
      ┆  2024-07-11T17:27:51.097798634Z: warning: Upgrade "harbor" failed: cannot patch "harbor-registry" with kind PersistentVolumeClaim: PersistentVolumeClaim "harbor-registry" is invalid: spec: Forbidd
en: spec is immutable after creation except resources.requests for bound claims
      ┆    core.PersistentVolumeClaimSpec{                                                            
      ┆  -                       AccessModes: []core.PersistentVolumeAccessMode{"ReadWriteOnce"},                                                                                                           
      ┆  +                       AccessModes: []core.PersistentVolumeAccessMode{"ReadWriteMany"},                                                                                                           
      ┆                          Selector:    nil,                                                    
      ┆                          Resources:   {Requests: {s"storage": {i: {...}, s: "5Gi", Format: "BinarySI"}}},                                                                                           
      ┆                          ... // 5 identical fields                                            
      ┆    }

The problem was seen during a manual upgrade from version 1.1.0 to main on a baremetal deployment.
We changed the accessMode of the Harbor pvc in the following MR !2377 (merged), which causes the problem as these fields are immutable.

Assignee Loading
Time tracking Loading