mirror of https://github.com/docker/docs.git
Repositories and tags can't have ':' in their name (to allow parsing the REPO:TAG notation)
This commit is contained in:
parent
379d449c44
commit
49a78929c6
8
tags.go
8
tags.go
|
@ -2,9 +2,11 @@ package docker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TagStore struct {
|
type TagStore struct {
|
||||||
|
@ -60,6 +62,12 @@ func (store *TagStore) Reload() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (store *TagStore) Set(repoName, tag, revision string) error {
|
func (store *TagStore) Set(repoName, tag, revision string) error {
|
||||||
|
if strings.Contains(repoName, ":") {
|
||||||
|
return fmt.Errorf("Illegal repository name: %s", repoName)
|
||||||
|
}
|
||||||
|
if strings.Contains(repoName, ":") {
|
||||||
|
return fmt.Errorf("Illegal tag name: %s", tag)
|
||||||
|
}
|
||||||
if err := store.Reload(); err != nil {
|
if err := store.Reload(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue