Skip to content

Commit 1ca2b25

Browse files
authored
Fix quantity parsing in configmgr service (#1327)
Summary: Passing a quantity which cannot be parsed will lead to a crashloopbackoff. Relevant Issues: N/A Type of change: /kind bug Test Plan: Deploy to staging Signed-off-by: Michelle Nguyen <michellenguyen@pixielabs.ai>
1 parent 912711d commit 1ca2b25

File tree

1 file changed

+5
-1
lines changed
  • src/cloud/config_manager/controllers

1 file changed

+5
-1
lines changed

src/cloud/config_manager/controllers/server.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ func AddDefaultTableStoreSize(pemMemoryRequest string, customPEMFlags map[string
118118
if pemMemoryRequest == "" {
119119
defaultTableStoreSizeMB = defaultUncappedTableStoreSizeMB
120120
} else {
121-
pemMemorySizeBytes := resource.MustParse(pemMemoryRequest)
121+
pemMemorySizeBytes, err := resource.ParseQuantity(pemMemoryRequest)
122+
if err != nil {
123+
log.Errorf("Failed to parse quantity %s", pemMemoryRequest)
124+
return
125+
}
122126
defaultTableStoreSizeBytes := defaultTableStorePercentage * float64(pemMemorySizeBytes.Value())
123127
defaultTableStoreSizeMB = int(math.Floor(defaultTableStoreSizeBytes / bytesPerMiB))
124128
if defaultTableStoreSizeMB == 0 {

0 commit comments

Comments
 (0)