Skip to content

Commit 663a091

Browse files
committed
Add a few missing bits
1 parent 08c08a3 commit 663a091

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

manifest/rfc2822.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ func (manifest Manifest2822) String() string {
203203
}
204204

205205
func (entry *Manifest2822Entry) SetGitRepo(arch string, repo string) {
206+
if entry.Paragraph.Values == nil {
207+
entry.Paragraph.Values = map[string]string{}
208+
}
206209
entry.Paragraph.Values[arch+"-GitRepo"] = repo
207210
}
208211

@@ -221,6 +224,9 @@ func (entry Manifest2822Entry) ArchGitFetch(arch string) string {
221224
}
222225

223226
func (entry *Manifest2822Entry) SetGitCommit(arch string, commit string) {
227+
if entry.Paragraph.Values == nil {
228+
entry.Paragraph.Values = map[string]string{}
229+
}
224230
entry.Paragraph.Values[arch+"-GitCommit"] = commit
225231
}
226232

@@ -257,6 +263,16 @@ func (entry Manifest2822Entry) HasSharedTag(tag string) bool {
257263
return false
258264
}
259265

266+
// HasArchitecture returns true if the given architecture exists in entry.Architectures
267+
func (entry Manifest2822Entry) HasArchitecture(arch string) bool {
268+
for _, existingArch := range entry.Architectures {
269+
if arch == existingArch {
270+
return true
271+
}
272+
}
273+
return false
274+
}
275+
260276
func (manifest Manifest2822) GetTag(tag string) *Manifest2822Entry {
261277
for _, entry := range manifest.Entries {
262278
if entry.HasTag(tag) {

0 commit comments

Comments
 (0)