diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-07-04 17:24:24 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-07-04 17:24:24 +0200 |
commit | 3fbe93371258704e56dc741218b4faa399395f8a (patch) | |
tree | ad7570ee796e2d54fee0c635f3fc1fd039bd6833 /pkg/specgen | |
parent | a406b950e4f8cf64bdd2c1e03a8480d4b5f97226 (diff) | |
download | podman-3fbe93371258704e56dc741218b4faa399395f8a.tar.gz podman-3fbe93371258704e56dc741218b4faa399395f8a.tar.bz2 podman-3fbe93371258704e56dc741218b4faa399395f8a.zip |
envVarValueResourceFieldRef: use int64 for value
int can be 32 or 64 bit depending on the architecture.
The total memory is int64 so we have to use int64 for the value as
well otherwise we get an overflow on 32 bit systems.
Fixes #14819
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/specgen')
-rw-r--r-- | pkg/specgen/generate/kube/kube.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go index 689c740f0..39e15f950 100644 --- a/pkg/specgen/generate/kube/kube.go +++ b/pkg/specgen/generate/kube/kube.go @@ -810,8 +810,8 @@ func envVarValueResourceFieldRef(env v1.EnvVar, opts *CtrSpecGenOptions) (*strin } // k8s rounds up the result to the nearest integer - intValue := int(math.Ceil(value.AsApproximateFloat64() / divisor.AsApproximateFloat64())) - stringValue := strconv.Itoa(intValue) + intValue := int64(math.Ceil(value.AsApproximateFloat64() / divisor.AsApproximateFloat64())) + stringValue := strconv.FormatInt(intValue, 10) return &stringValue, nil } |