aboutsummaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-05 13:02:27 +0000
committerGitHub <noreply@github.com>2022-07-05 13:02:27 +0000
commit13479d457d34496b43027bc1d71cdb0891a8b738 (patch)
tree4dbc91dbf6b56882e8a864da88f28a108528d2c0 /pkg/specgen
parentd1e1400747fd3266bfc14d62b4174cd601107003 (diff)
parent33a474286b7e64429f73d9faf4f7e35e4b815bef (diff)
downloadpodman-13479d457d34496b43027bc1d71cdb0891a8b738.tar.gz
podman-13479d457d34496b43027bc1d71cdb0891a8b738.tar.bz2
podman-13479d457d34496b43027bc1d71cdb0891a8b738.zip
Merge pull request #14823 from Luap99/debian-unit-tests
envVarValueResourceFieldRef: use int64 for value
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/generate/kube/kube.go4
-rw-r--r--pkg/specgen/generate/kube/play_test.go4
2 files changed, 3 insertions, 5 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
}
diff --git a/pkg/specgen/generate/kube/play_test.go b/pkg/specgen/generate/kube/play_test.go
index e01d62b08..466dab610 100644
--- a/pkg/specgen/generate/kube/play_test.go
+++ b/pkg/specgen/generate/kube/play_test.go
@@ -2,7 +2,6 @@ package kube
import (
"encoding/json"
- "fmt"
"math"
"runtime"
"strconv"
@@ -777,8 +776,7 @@ func TestEnvVarValue(t *testing.T) {
if test.expected == nilString {
assert.Nil(t, result)
} else {
- fmt.Println(*result, test.expected)
- assert.Equal(t, &(test.expected), result)
+ assert.Equal(t, test.expected, *result)
}
})
}