Skip to content

Commit

Permalink
Fix objectStorage.Resources.Requests required even when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
vulkoingim authored and roboquat committed May 24, 2022
1 parent 0899f4d commit 6972cd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion install/installer/pkg/components/minio/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
Expand Down
8 changes: 5 additions & 3 deletions install/installer/pkg/config/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6972cd5

Please sign in to comment.