File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -65,4 +65,7 @@ func SanitizeBuildSpec(b *buildv1alpha1.BuildSpec) {
65
65
if b .Timeout != nil && b .Timeout .Duration == 0 {
66
66
b .Timeout = nil
67
67
}
68
+ if b .Dockerfile != nil && * b .Dockerfile == "" {
69
+ b .Dockerfile = nil
70
+ }
68
71
}
Original file line number Diff line number Diff line change @@ -127,6 +127,8 @@ func TestSanitizeBuildSpec(t *testing.T) {
127
127
},
128
128
}
129
129
130
+ emptyString := ""
131
+
130
132
testCases := []struct {
131
133
name string
132
134
in buildv1alpha1.BuildSpec
@@ -161,6 +163,10 @@ func TestSanitizeBuildSpec(t *testing.T) {
161
163
Duration : time .Duration (0 ),
162
164
}},
163
165
out : buildv1alpha1.BuildSpec {Timeout : nil },
166
+ }, {
167
+ name : "should clean-up an empty Dockerfile" ,
168
+ in : buildv1alpha1.BuildSpec {Dockerfile : & emptyString },
169
+ out : buildv1alpha1.BuildSpec {Dockerfile : nil },
164
170
}}
165
171
166
172
for _ , tt := range testCases {
You can’t perform that action at this time.
0 commit comments