summaryrefslogtreecommitdiff
path: root/libpod/kube.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-08 18:00:11 +0200
committerGitHub <noreply@github.com>2019-07-08 18:00:11 +0200
commited3acaecbfeead3b0fef5928e47ecc9f34cd8d5b (patch)
tree2ef0f0a0c9f3c2cd8798dee04de8c3d5ab292c36 /libpod/kube.go
parent1055b22e9b900e5f4d41f39b506de4f2d1aa2f8e (diff)
parent1d36501f961889f554daf3c696fe95443ef211b6 (diff)
downloadpodman-ed3acaecbfeead3b0fef5928e47ecc9f34cd8d5b.tar.gz
podman-ed3acaecbfeead3b0fef5928e47ecc9f34cd8d5b.tar.bz2
podman-ed3acaecbfeead3b0fef5928e47ecc9f34cd8d5b.zip
Merge pull request #3496 from baude/golandcodeinspect
code cleanup
Diffstat (limited to 'libpod/kube.go')
-rw-r--r--libpod/kube.go23
1 files changed, 2 insertions, 21 deletions
diff --git a/libpod/kube.go b/libpod/kube.go
index 08ab7a4a4..409937010 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -17,7 +17,6 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"k8s.io/api/core/v1"
- "k8s.io/apimachinery/pkg/api/resource"
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@@ -324,22 +323,6 @@ func libpodEnvVarsToKubeEnvVars(envs []string) ([]v1.EnvVar, error) {
return envVars, nil
}
-// Is this worth it?
-func libpodMaxAndMinToResourceList(c *Container) (v1.ResourceList, v1.ResourceList) { //nolint
- // It does not appear we can properly calculate CPU resources from the information
- // we know in libpod. Libpod knows CPUs by time, shares, etc.
-
- // We also only know about a memory limit; no memory minimum
- maxResources := make(map[v1.ResourceName]resource.Quantity)
- minResources := make(map[v1.ResourceName]resource.Quantity)
- config := c.Config()
- maxMem := config.Spec.Linux.Resources.Memory.Limit
-
- _ = maxMem
-
- return maxResources, minResources
-}
-
// libpodMountsToKubeVolumeMounts converts the containers mounts to a struct kube understands
func libpodMountsToKubeVolumeMounts(c *Container) ([]v1.VolumeMount, []v1.Volume, error) {
var vms []v1.VolumeMount
@@ -427,16 +410,14 @@ func determineCapAddDropFromCapabilities(defaultCaps, containerCaps []string) *v
// those indicate a dropped cap
for _, capability := range defaultCaps {
if !util.StringInSlice(capability, containerCaps) {
- cap := v1.Capability(capability)
- drop = append(drop, cap)
+ drop = append(drop, v1.Capability(capability))
}
}
// Find caps in the container but not in the defaults; those indicate
// an added cap
for _, capability := range containerCaps {
if !util.StringInSlice(capability, defaultCaps) {
- cap := v1.Capability(capability)
- add = append(add, cap)
+ add = append(add, v1.Capability(capability))
}
}