From c7d7300ddb8b1316faec365838cd25f6ecff89bc Mon Sep 17 00:00:00 2001 From: Damian Szymanski Date: Tue, 30 Apr 2019 15:23:34 +0200 Subject: [PATCH 1/3] Query for image based on dist --- image/api_selector.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/image/api_selector.go b/image/api_selector.go index 65b664f48..53910a750 100644 --- a/image/api_selector.go +++ b/image/api_selector.go @@ -237,6 +237,10 @@ func (as *APISelector) buildCandidateTags(params *Params) ([]*tagSet, error) { addTags("os:"+params.OS, "language_"+params.Language+":true") } + if hasDist { + addTags("dist:" + params.Dist) + } + if hasLang { addDefaultTag("language_" + params.Language + ":true") } From 0c55a3c8c084a2d2b4bc07e612038a9802e1bddb Mon Sep 17 00:00:00 2001 From: Damian Szymanski Date: Tue, 30 Apr 2019 16:04:14 +0200 Subject: [PATCH 2/3] Update api_selector test --- image/api_selector_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/image/api_selector_test.go b/image/api_selector_test.go index 371c64352..1c15e58d3 100644 --- a/image/api_selector_test.go +++ b/image/api_selector_test.go @@ -107,6 +107,7 @@ var ( &tagSet{[]string{"dist:precise", "language_ruby:true"}, false, uint64(4), "corp/frob"}, &tagSet{[]string{"group_edge:true", "language_ruby:true"}, false, uint64(4), "corp/frob"}, &tagSet{[]string{"language_ruby:true", "os:linux"}, false, uint64(4), "corp/frob"}, + &tagSet{[]string{"dist:precise"}, false, uint64(4), "corp/frob"}, &tagSet{[]string{"language_ruby:true"}, true, uint64(4), "corp/frob"}, &tagSet{[]string{"dist:precise"}, true, uint64(4), "corp/frob"}, &tagSet{[]string{"group_edge:true"}, true, uint64(4), "corp/frob"}, From e0a3534f4c3ff54c7c85f2888ade31c5fb6bdf87 Mon Sep 17 00:00:00 2001 From: Damian Szymanski Date: Tue, 30 Apr 2019 20:36:28 +0200 Subject: [PATCH 3/3] Update api_selector test --- image/api_selector_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/image/api_selector_test.go b/image/api_selector_test.go index 1c15e58d3..cffacc7bc 100644 --- a/image/api_selector_test.go +++ b/image/api_selector_test.go @@ -136,6 +136,7 @@ var ( &tagSet{[]string{"dist:yosammity", "language_node_js:true"}, false, uint64(4), "corp/frob"}, &tagSet{[]string{"group_fancy:true", "language_node_js:true"}, false, uint64(4), "corp/frob"}, &tagSet{[]string{"language_node_js:true", "os:osx"}, false, uint64(4), "corp/frob"}, + &tagSet{[]string{"dist:yosammity"}, false, uint64(4), "corp/frob"}, &tagSet{[]string{"language_node_js:true"}, true, uint64(4), "corp/frob"}, &tagSet{[]string{"osx_image:xcode6.1"}, true, uint64(4), "corp/frob"}, &tagSet{[]string{"dist:yosammity"}, true, uint64(4), "corp/frob"},