@@ -31,7 +31,7 @@ func main() {
return
}
- ref := req.Source.Repository + ":" + req.Source.Tag
+ ref := req.Source.Repository + ":" + req.Source.Tag()
n, err := name.ParseReference(ref, name.WeakValidation)
if err != nil {
@@ -1,12 +1,22 @@
package resource
+const DefaultTag = "latest"
+
type Source struct {
Repository string `json:"repository"`
- Tag string `json:"tag"`
+ RawTag string `json:"tag"`
Debug bool `json:"debug"`
+func (s Source) Tag() string {
+ if s.RawTag == "" {
+ return DefaultTag
+ }
+ return s.RawTag
+}
type Version struct {
Digest string `json:"digest"`