From 6972cd5524177571994685993089129363a0a2e1 Mon Sep 17 00:00:00 2001 From: Aleksandar Date: Tue, 24 May 2022 15:53:44 +0000 Subject: [PATCH] Fix objectStorage.Resources.Requests required even when empty --- install/installer/pkg/components/minio/helm.go | 2 +- install/installer/pkg/config/v1/config.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/install/installer/pkg/components/minio/helm.go b/install/installer/pkg/components/minio/helm.go index 1ce11f8cde2e87..7cdfe980bc7ffd 100644 --- a/install/installer/pkg/components/minio/helm.go +++ b/install/installer/pkg/components/minio/helm.go @@ -26,7 +26,7 @@ var Helm = common.CompositeHelmFunc( helm.KeyValue("minio.volumePermissions.image.repository", cfg.RepoName(common.ThirdPartyContainerRepo(cfg.Config.Repository, common.DockerRegistryURL), "bitnami/bitnami-shell")), } - if cfg.Config.ObjectStorage.Resources.Requests.Memory() != nil { + if cfg.Config.ObjectStorage.Resources != nil && cfg.Config.ObjectStorage.Resources.Requests.Memory() != nil { memoryRequests := resource.MustParse(cfg.Config.ObjectStorage.Resources.Requests.Memory().String()) commonHelmValues = append(commonHelmValues, helm.KeyValue("minio.resources.requests.memory", memoryRequests.String())) } diff --git a/install/installer/pkg/config/v1/config.go b/install/installer/pkg/config/v1/config.go index e4a7620acfd3ff..20c35b0850d8c9 100644 --- a/install/installer/pkg/config/v1/config.go +++ b/install/installer/pkg/config/v1/config.go @@ -49,8 +49,10 @@ func (v version) Defaults(in interface{}) error { cfg.Metadata.Region = "local" cfg.Metadata.InstallationShortname = "default" // TODO(gpl): we're tied to "default" here because that's what we put into static bridges in the past cfg.ObjectStorage.InCluster = pointer.Bool(true) - cfg.ObjectStorage.Resources.Requests = corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("2Gi"), + cfg.ObjectStorage.Resources = &Resources{ + Requests: corev1.ResourceList{ + corev1.ResourceMemory: resource.MustParse("2Gi"), + }, } cfg.ContainerRegistry.InCluster = pointer.Bool(true) cfg.Workspace.Resources.Requests = corev1.ResourceList{ @@ -155,7 +157,7 @@ type ObjectStorage struct { Azure *ObjectStorageAzure `json:"azure,omitempty"` MaximumBackupCount *int `json:"maximumBackupCount,omitempty"` BlobQuota *int64 `json:"blobQuota,omitempty"` - Resources Resources `json:"resources,omitempty"` + Resources *Resources `json:"resources,omitempty"` } type ObjectStorageS3 struct {