Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Only set VolumeSize as default if nothing is set on Volumes map
Browse files Browse the repository at this point in the history
Signed-off-by: tylerslaton <[email protected]>
  • Loading branch information
tylerslaton committed Nov 2, 2023
1 parent cb3ec26 commit c23d6fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controller/defaults/volumeclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ func addVolumeClassDefaults(ctx context.Context, c kclient.Client, app *v1.AppIn
// This is a bit of a hack as we're migrating away from the VolumeSize field. Essentially,
// we want to ensure that app.Status.Volumes[name] always has a size set. If the VolumeSize
// field has been set in the past, we want to mirgrate that over to be set on app.Status.Volumes[name].
if app.Status.Defaults.VolumeSize != nil {
// There is another edge case where the Size field was set by a VolumeClass's default size. In this
// case we want to leave the Size field alone.
if app.Status.Defaults.VolumeSize != nil && volDefaults.Size == "" {
volDefaults.Size = v1.Quantity(app.Status.Defaults.VolumeSize.String())
}

Expand Down

0 comments on commit c23d6fa

Please sign in to comment.