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") } diff --git a/image/api_selector_test.go b/image/api_selector_test.go index 371c64352..cffacc7bc 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"}, @@ -135,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"},