@@ -38,6 +38,7 @@ type Manifest2822Entry struct {
38
38
GitFetch string
39
39
GitCommit string
40
40
Directory string
41
+ File string
41
42
42
43
// architecture-specific versions of the above fields
43
44
ArchValues map [string ]string
56
57
57
58
GitFetch : "refs/heads/master" ,
58
59
Directory : "." ,
60
+ File : "Dockerfile" ,
59
61
}
60
62
)
61
63
@@ -81,7 +83,7 @@ func (entry Manifest2822Entry) Clone() Manifest2822Entry {
81
83
82
84
func (entry * Manifest2822Entry ) SeedArchValues () {
83
85
for field , val := range entry .Paragraph .Values {
84
- if strings .HasSuffix (field , "-GitRepo" ) || strings .HasSuffix (field , "-GitFetch" ) || strings .HasSuffix (field , "-GitCommit" ) || strings .HasSuffix (field , "-Directory" ) {
86
+ if strings .HasSuffix (field , "-GitRepo" ) || strings .HasSuffix (field , "-GitFetch" ) || strings .HasSuffix (field , "-GitCommit" ) || strings .HasSuffix (field , "-Directory" ) || strings . HasSuffix ( field , "-File" ) {
85
87
entry .ArchValues [field ] = val
86
88
}
87
89
}
@@ -118,7 +120,7 @@ func (a Manifest2822Entry) SameBuildArtifacts(b Manifest2822Entry) bool {
118
120
}
119
121
}
120
122
121
- return a .ArchitecturesString () == b .ArchitecturesString () && a .GitRepo == b .GitRepo && a .GitFetch == b .GitFetch && a .GitCommit == b .GitCommit && a .Directory == b .Directory && a .ConstraintsString () == b .ConstraintsString ()
123
+ return a .ArchitecturesString () == b .ArchitecturesString () && a .GitRepo == b .GitRepo && a .GitFetch == b .GitFetch && a .GitCommit == b .GitCommit && a .Directory == b .Directory && a .File == b . File && a . ConstraintsString () == b .ConstraintsString ()
122
124
}
123
125
124
126
// returns a list of architecture-specific fields in an Entry
@@ -160,6 +162,9 @@ func (entry Manifest2822Entry) ClearDefaults(defaults Manifest2822Entry) Manifes
160
162
if entry .Directory == defaults .Directory {
161
163
entry .Directory = ""
162
164
}
165
+ if entry .File == defaults .File {
166
+ entry .File = ""
167
+ }
163
168
for _ , key := range defaults .archFields () {
164
169
if defaults .ArchValues [key ] == entry .ArchValues [key ] {
165
170
delete (entry .ArchValues , key )
@@ -197,6 +202,9 @@ func (entry Manifest2822Entry) String() string {
197
202
if str := entry .Directory ; str != "" {
198
203
ret = append (ret , "Directory: " + str )
199
204
}
205
+ if str := entry .File ; str != "" {
206
+ ret = append (ret , "File: " + str )
207
+ }
200
208
for _ , key := range entry .archFields () {
201
209
ret = append (ret , key + ": " + entry .ArchValues [key ])
202
210
}
@@ -263,6 +271,13 @@ func (entry Manifest2822Entry) ArchDirectory(arch string) string {
263
271
return entry .Directory
264
272
}
265
273
274
+ func (entry Manifest2822Entry ) ArchFile (arch string ) string {
275
+ if val , ok := entry .ArchValues [arch + "-File" ]; ok && val != "" {
276
+ return val
277
+ }
278
+ return entry .File
279
+ }
280
+
266
281
func (entry Manifest2822Entry ) HasTag (tag string ) bool {
267
282
for _ , existingTag := range entry .Tags {
268
283
if tag == existingTag {
0 commit comments