Skip to content

Commit

Permalink
Fix quantity parsing in configmgr service (#1327)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aimichelle authored May 11, 2023
1 parent 912711d commit 1ca2b25
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cloud/config_manager/controllers/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ func AddDefaultTableStoreSize(pemMemoryRequest string, customPEMFlags map[string
if pemMemoryRequest == "" {
defaultTableStoreSizeMB = defaultUncappedTableStoreSizeMB
} else {
pemMemorySizeBytes := resource.MustParse(pemMemoryRequest)
pemMemorySizeBytes, err := resource.ParseQuantity(pemMemoryRequest)
if err != nil {
log.Errorf("Failed to parse quantity %s", pemMemoryRequest)
return
}
defaultTableStoreSizeBytes := defaultTableStorePercentage * float64(pemMemorySizeBytes.Value())
defaultTableStoreSizeMB = int(math.Floor(defaultTableStoreSizeBytes / bytesPerMiB))
if defaultTableStoreSizeMB == 0 {
Expand Down

0 comments on commit 1ca2b25

Please sign in to comment.