diff --git a/app/controller/server/controller.go b/app/controller/server/controller.go index 866431a..15fe361 100644 --- a/app/controller/server/controller.go +++ b/app/controller/server/controller.go @@ -76,7 +76,7 @@ func (c *Controller) Init(ctx context.Context) (*types.Server, error) { MaxConcurrentBuilds: 3, MaxCPUPerBuild: 1, MaxMemoryPerBuild: 2, - VolumeMinSize: 1, + VolumeMinSize: 1024, } manager, err := c.resolveServerManager(server) diff --git a/app/controller/volume/create.go b/app/controller/volume/create.go index 3c11c17..c6270df 100644 --- a/app/controller/volume/create.go +++ b/app/controller/volume/create.go @@ -58,10 +58,10 @@ func (c *Controller) sanitizeCreateInput(in *types.VolumeCreateInput) error { func (c *Controller) validateRestrictions(in *types.VolumeCreateInput, restrictions *types.VolumeRestriction) error { err := check.NewValidationErrors() if in.Size < restrictions.MinVolumeSize { - err.AddValidationError("size", check.NewValidationErrorf("Volume is below min allowed limit of %dGB", restrictions.MinVolumeSize)) + err.AddValidationError("size", check.NewValidationErrorf("Volume is below min allowed limit of %dMiB", restrictions.MinVolumeSize)) } if in.Size > restrictions.MaxVolumeSize { - err.AddValidationError("size", check.NewValidationErrorf("Volume is above max allowed limit of %dGB", restrictions.MaxVolumeSize)) + err.AddValidationError("size", check.NewValidationErrorf("Volume is above max allowed limit of %dMiB", restrictions.MaxVolumeSize)) } if err.HasError() { diff --git a/app/pipeline/convert/deploy_step.go b/app/pipeline/convert/deploy_step.go index 11a5ba3..f7311fb 100644 --- a/app/pipeline/convert/deploy_step.go +++ b/app/pipeline/convert/deploy_step.go @@ -157,7 +157,7 @@ func getTemplateInput(image string, input *pipeline.RunnerContextInput, spec *ty for _, v := range input.Volumes { in.Volumes = append(in.Volumes, &templates.Volume{ VolumeName: v.GetIdentifierStr(), - Storage: fmt.Sprintf("%dGi", v.Size), + Storage: fmt.Sprintf("%dMi", v.Size), MountPath: v.MountPath, }) } diff --git a/app/services/config/volume.go b/app/services/config/volume.go index cc42ea5..acd204c 100644 --- a/app/services/config/volume.go +++ b/app/services/config/volume.go @@ -8,7 +8,7 @@ import ( func (s *Service) GetVolumeRestrictions(server *types.Server, tenant *types.Tenant) *types.VolumeRestriction { return &types.VolumeRestriction{ MaxVolumes: tenant.MaxVolumes, - MinVolumeSize: helpers.Max(tenant.MinVolumeSize, server.VolumeMinSize), + MinVolumeSize: helpers.Min(tenant.MinVolumeSize, server.VolumeMinSize), MaxVolumeSize: tenant.MaxVolumeSize, } } diff --git a/app/services/spec/input_mapper.go b/app/services/spec/input_mapper.go index 0093213..4c10920 100644 --- a/app/services/spec/input_mapper.go +++ b/app/services/spec/input_mapper.go @@ -22,7 +22,7 @@ const ( defaultTCPPort = 8000 defaultMountName = "Storage" defaultMountPath = "/data" - defaultMountSize = 1 + defaultMountSize = 1024 defaultReplicas = 1 defaultMemory = 0.5 defaultCPU = 1 diff --git a/app/web/views/components/vserver/limits.templ b/app/web/views/components/vserver/limits.templ index b13cea7..7e1d350 100644 --- a/app/web/views/components/vserver/limits.templ +++ b/app/web/views/components/vserver/limits.templ @@ -36,8 +36,9 @@ templ limits(server *types.Server) { @shared.Input(&shared.InputProps{ Name: "min_volume_size", Label: "Min Volume Size", - Tooltip: `Minimum size of the volume in GB, this is to handle the limitations of the underlying cloud + Tooltip: `Minimum size of the volume in MiB, this is to handle the limitations of the underlying cloud providers if any. E.g. linode cannot have volumes less than 10GB.`, + Description: "Volume size is in MiB", Type: "number", Placeholder: "1", Required: true, diff --git a/app/web/views/components/vtenant/limits.templ b/app/web/views/components/vtenant/limits.templ index 766ab1d..ed2de3e 100644 --- a/app/web/views/components/vtenant/limits.templ +++ b/app/web/views/components/vtenant/limits.templ @@ -106,11 +106,12 @@ templ Limits(tenant *types.Tenant, restrictions *types.TenantRestrictions, canEd
{ volume.Name }
{ volume.MountPath }
-{ fmt.Sprintf("%d",volume.Size) } GB
+{ fmt.Sprintf("%d",volume.Size) } MiB