Skip to content

Commit

Permalink
fix: secret-init oom killed
Browse files Browse the repository at this point in the history
Signed-off-by: Bence Csati <[email protected]>
  • Loading branch information
csatib02 committed Dec 15, 2024
1 parent a2b3d1b commit 39315ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pkg/common/secret_init_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,25 @@ func LoadSecretInitConfig(annotations map[string]string) SecretInitConfig {
if val, err := resource.ParseQuantity(viper.GetString(SecretInitCPURequestEnvVar)); err == nil {
secretInitConfig.CPURequest = val
} else {
secretInitConfig.CPURequest = resource.MustParse("50m")
secretInitConfig.CPURequest = resource.MustParse("100m")
}

if val, err := resource.ParseQuantity(viper.GetString(SecretInitMemoryRequestEnvVar)); err == nil {
secretInitConfig.MemoryRequest = val
} else {
secretInitConfig.MemoryRequest = resource.MustParse("64Mi")
secretInitConfig.MemoryRequest = resource.MustParse("128Mi")
}

if val, err := resource.ParseQuantity(viper.GetString(SecretInitCPULimitEnvVar)); err == nil {
secretInitConfig.CPULimit = val
} else {
secretInitConfig.CPULimit = resource.MustParse("250m")
secretInitConfig.CPULimit = resource.MustParse("500m")
}

if val, err := resource.ParseQuantity(viper.GetString(SecretInitMemoryLimitEnvVar)); err == nil {
secretInitConfig.MemoryLimit = val
} else {
secretInitConfig.MemoryLimit = resource.MustParse("64Mi")
secretInitConfig.MemoryLimit = resource.MustParse("256Mi")
}

return secretInitConfig
Expand Down
8 changes: 4 additions & 4 deletions pkg/common/secret_init_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func TestLoadSecretInitConfig(t *testing.T) {
Image: "vault:latest",
ImagePullPolicy: "Always",
LogLevel: "info",
CPURequest: resource.MustParse("50m"),
MemoryRequest: resource.MustParse("64Mi"),
CPULimit: resource.MustParse("250m"),
MemoryLimit: resource.MustParse("64Mi"),
CPURequest: resource.MustParse("100m"),
MemoryRequest: resource.MustParse("128Mi"),
CPULimit: resource.MustParse("500m"),
MemoryLimit: resource.MustParse("256Mi"),
},
},
{
Expand Down

0 comments on commit 39315ac

Please sign in to comment.