Skip to content

Commit

Permalink
set envs when converting to v2 spec
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkrainas committed Apr 11, 2017
1 parent 359ef5b commit 8aa7e67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions info/v2/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions info/v2/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -63,6 +65,7 @@ func TestContanierSpecFromV1(t *testing.T) {
expectedV2Spec := ContainerSpec{
CreationTime: timestamp,
Labels: labels,
Envs: envs,
HasCpu: true,
Cpu: CpuSpec{
Limit: 2048,
Expand Down

0 comments on commit 8aa7e67

Please sign in to comment.