@@ -23,15 +23,15 @@ import (
23
23
"github.com/google/go-cmp/cmp/cmpopts"
24
24
25
25
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/config"
26
- latestV1 "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest/v1 "
26
+ latestV2 "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest/v2 "
27
27
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/version"
28
28
"github.com/GoogleContainerTools/skaffold/testutil"
29
29
)
30
30
31
31
func TestBuildOptions (t * testing.T ) {
32
32
tests := []struct {
33
33
description string
34
- artifact latestV1 .Artifact
34
+ artifact latestV2 .Artifact
35
35
runMode config.RunMode
36
36
wantDisableOptimizations bool
37
37
wantLabels []string
@@ -41,17 +41,17 @@ func TestBuildOptions(t *testing.T) {
41
41
}{
42
42
{
43
43
description : "all zero value" ,
44
- artifact : latestV1 .Artifact {
45
- ArtifactType : latestV1 .ArtifactType {
46
- KoArtifact : & latestV1 .KoArtifact {},
44
+ artifact : latestV2 .Artifact {
45
+ ArtifactType : latestV2 .ArtifactType {
46
+ KoArtifact : & latestV2 .KoArtifact {},
47
47
},
48
48
},
49
49
},
50
50
{
51
51
description : "base image" ,
52
- artifact : latestV1 .Artifact {
53
- ArtifactType : latestV1 .ArtifactType {
54
- KoArtifact : & latestV1 .KoArtifact {
52
+ artifact : latestV2 .Artifact {
53
+ ArtifactType : latestV2 .ArtifactType {
54
+ KoArtifact : & latestV2 .KoArtifact {
55
55
BaseImage : "gcr.io/distroless/base:nonroot" ,
56
56
},
57
57
},
@@ -60,9 +60,9 @@ func TestBuildOptions(t *testing.T) {
60
60
},
61
61
{
62
62
description : "empty platforms" ,
63
- artifact : latestV1 .Artifact {
64
- ArtifactType : latestV1 .ArtifactType {
65
- KoArtifact : & latestV1 .KoArtifact {
63
+ artifact : latestV2 .Artifact {
64
+ ArtifactType : latestV2 .ArtifactType {
65
+ KoArtifact : & latestV2 .KoArtifact {
66
66
Platforms : []string {},
67
67
},
68
68
},
@@ -71,9 +71,9 @@ func TestBuildOptions(t *testing.T) {
71
71
},
72
72
{
73
73
description : "multiple platforms" ,
74
- artifact : latestV1 .Artifact {
75
- ArtifactType : latestV1 .ArtifactType {
76
- KoArtifact : & latestV1 .KoArtifact {
74
+ artifact : latestV2 .Artifact {
75
+ ArtifactType : latestV2 .ArtifactType {
76
+ KoArtifact : & latestV2 .KoArtifact {
77
77
Platforms : []string {"linux/amd64" , "linux/arm64" },
78
78
},
79
79
},
@@ -83,9 +83,9 @@ func TestBuildOptions(t *testing.T) {
83
83
},
84
84
{
85
85
description : "workspace" ,
86
- artifact : latestV1 .Artifact {
87
- ArtifactType : latestV1 .ArtifactType {
88
- KoArtifact : & latestV1 .KoArtifact {},
86
+ artifact : latestV2 .Artifact {
87
+ ArtifactType : latestV2 .ArtifactType {
88
+ KoArtifact : & latestV2 .KoArtifact {},
89
89
},
90
90
ImageName : "ko://example.com/foo" ,
91
91
Workspace : "my-app-subdirectory" ,
@@ -94,9 +94,9 @@ func TestBuildOptions(t *testing.T) {
94
94
},
95
95
{
96
96
description : "source dir" ,
97
- artifact : latestV1 .Artifact {
98
- ArtifactType : latestV1 .ArtifactType {
99
- KoArtifact : & latestV1 .KoArtifact {
97
+ artifact : latestV2 .Artifact {
98
+ ArtifactType : latestV2 .ArtifactType {
99
+ KoArtifact : & latestV2 .KoArtifact {
100
100
Dir : "my-go-mod-is-here" ,
101
101
},
102
102
},
@@ -107,9 +107,9 @@ func TestBuildOptions(t *testing.T) {
107
107
},
108
108
{
109
109
description : "workspace and source dir" ,
110
- artifact : latestV1 .Artifact {
111
- ArtifactType : latestV1 .ArtifactType {
112
- KoArtifact : & latestV1 .KoArtifact {
110
+ artifact : latestV2 .Artifact {
111
+ ArtifactType : latestV2 .ArtifactType {
112
+ KoArtifact : & latestV2 .KoArtifact {
113
113
Dir : "my-go-mod-is-here" ,
114
114
},
115
115
},
@@ -121,9 +121,9 @@ func TestBuildOptions(t *testing.T) {
121
121
},
122
122
{
123
123
description : "disable compiler optimizations for debug" ,
124
- artifact : latestV1 .Artifact {
125
- ArtifactType : latestV1 .ArtifactType {
126
- KoArtifact : & latestV1 .KoArtifact {},
124
+ artifact : latestV2 .Artifact {
125
+ ArtifactType : latestV2 .ArtifactType {
126
+ KoArtifact : & latestV2 .KoArtifact {},
127
127
},
128
128
ImageName : "ko://example.com/foo" ,
129
129
},
@@ -132,9 +132,9 @@ func TestBuildOptions(t *testing.T) {
132
132
},
133
133
{
134
134
description : "labels" ,
135
- artifact : latestV1 .Artifact {
136
- ArtifactType : latestV1 .ArtifactType {
137
- KoArtifact : & latestV1 .KoArtifact {
135
+ artifact : latestV2 .Artifact {
136
+ ArtifactType : latestV2 .ArtifactType {
137
+ KoArtifact : & latestV2 .KoArtifact {
138
138
Labels : map [string ]string {
139
139
"foo" : "bar" ,
140
140
"frob" : "baz" ,
0 commit comments