From 8aa7e674e57a217864119adb22c2d1ea33cc49f1 Mon Sep 17 00:00:00 2001 From: Danny Krainas Date: Thu, 10 Nov 2016 00:00:18 -0500 Subject: [PATCH] set envs when converting to v2 spec --- info/v2/conversion.go | 1 + info/v2/conversion_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/info/v2/conversion.go b/info/v2/conversion.go index c099b90469..963d26e02c 100644 --- a/info/v2/conversion.go +++ b/info/v2/conversion.go @@ -259,6 +259,7 @@ func ContainerSpecFromV1(specV1 *v1.ContainerSpec, aliases []string, namespace s HasCustomMetrics: specV1.HasCustomMetrics, Image: specV1.Image, Labels: specV1.Labels, + Envs: specV1.Envs, } if specV1.HasCpu { specV2.Cpu.Limit = specV1.Cpu.Limit diff --git a/info/v2/conversion_test.go b/info/v2/conversion_test.go index be9cc92c42..445fcb0983 100644 --- a/info/v2/conversion_test.go +++ b/info/v2/conversion_test.go @@ -26,12 +26,14 @@ import ( var ( timestamp = time.Date(1987, time.August, 10, 0, 0, 0, 0, time.UTC) labels = map[string]string{"foo": "bar"} + envs = map[string]string{"foo": "bar"} ) func TestContanierSpecFromV1(t *testing.T) { v1Spec := v1.ContainerSpec{ CreationTime: timestamp, Labels: labels, + Envs: envs, HasCpu: true, Cpu: v1.CpuSpec{ Limit: 2048, @@ -63,6 +65,7 @@ func TestContanierSpecFromV1(t *testing.T) { expectedV2Spec := ContainerSpec{ CreationTime: timestamp, Labels: labels, + Envs: envs, HasCpu: true, Cpu: CpuSpec{ Limit: 2048,