Skip to content

Commit

Permalink
address linter
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Mar 30, 2023
1 parent 5f02e1c commit 2d3da31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,25 +239,30 @@ func createLicenseVolumeMount() corev1.VolumeMount {
}

func toEnvVar(kv map[string]string) []corev1.EnvVar {
var envVar []corev1.EnvVar
envVar := make([]corev1.EnvVar, 0, len(kv))

for k, v := range kv {
envVar = append(envVar, corev1.EnvVar{
Name: k,
Value: v,
})
}

return envVar
}

func toResourceRequirements(kv map[string]string) corev1.ResourceRequirements {
r := corev1.ResourceRequirements{
Requests: map[corev1.ResourceName]resource.Quantity{},
}

if v, ok := kv["cpu"]; ok {
r.Requests["cpu"] = resource.MustParse(v)
}

if v, ok := kv["memory"]; ok {
r.Requests["memory"] = resource.MustParse(v)
}

return r
}

0 comments on commit 2d3da31

Please sign in to comment.