Skip to content

Commit

Permalink
Use @ as a separator between image name and tag to not collide with…
Browse files Browse the repository at this point in the history
… `sha256:...` tags (#245)
  • Loading branch information
outofforest authored Jul 5, 2023
1 parent 650da2a commit 73d9747
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ require (
github.com/google/uuid v1.3.0
github.com/outofforest/go-zfs/v3 v3.1.14
github.com/outofforest/ioc/v2 v2.5.2
github.com/outofforest/isolator v0.8.0
github.com/outofforest/isolator v0.8.2
github.com/outofforest/logger v0.4.0
github.com/outofforest/parallel v0.2.3
github.com/outofforest/run v0.6.0
github.com/pkg/errors v0.9.1
github.com/ridge/must v0.6.0
github.com/spf13/cobra v1.7.0
github.com/vishvananda/netlink v1.1.0
golang.org/x/sys v0.9.0
golang.org/x/sys v0.10.0
libvirt.org/go/libvirtxml v1.9004.0
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ github.com/outofforest/go-zfs/v3 v3.1.14 h1:F0MosonFuGwiIotlMVKoMsvAmISnOWOAncev
github.com/outofforest/go-zfs/v3 v3.1.14/go.mod h1:H8SgVKbvhso4bQGQMn6P21mFEd3oDOIaBH2w0Bcsu3c=
github.com/outofforest/ioc/v2 v2.5.2 h1:4mNzLuzoZTXL/cO0qf1TrSYvejMgbZz5OUhdLzAUbek=
github.com/outofforest/ioc/v2 v2.5.2/go.mod h1:yI+FHuHchC/t6nVo3WJ96qEgCXdHQKFI/4wW2/75YcU=
github.com/outofforest/isolator v0.8.0 h1:fBiM2pX2hlinEVpKWOt6+mdbXUooUHyUtyscnzpiQtU=
github.com/outofforest/isolator v0.8.0/go.mod h1:oybGTl8quQf7ra2cq0FwjX6LbgBwZybOErS5oeh2DJc=
github.com/outofforest/isolator v0.8.2 h1:QbNe1kD+ktdgN2Haps6Mx3r1vB0aJFHDLSm8C/WDZI0=
github.com/outofforest/isolator v0.8.2/go.mod h1:CWQkLwr3qXyXxouqvS1QDC1nfUQ2FCdcUJSMrZVikJc=
github.com/outofforest/libexec v0.3.9 h1:KvVLuKDHqpydwNoKm+j36hi9DVPU61X4oHonlZ5cw88=
github.com/outofforest/libexec v0.3.9/go.mod h1:J2rUB/m0ER8UNOHd3/UQM55bvh1cbMwhb8gibeF/zyo=
github.com/outofforest/logger v0.3.3/go.mod h1:+M5sO17Va9V33t28Qs9VqRQ8bFV501Uhq2PtQY+R3Ms=
Expand Down Expand Up @@ -111,8 +111,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
6 changes: 3 additions & 3 deletions infra/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (bid BuildID) IsValidType(buildType BuildType) bool {
return bid.Type() == buildType
}

var validRegExp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9\-_.]*$`)
var validRegExp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9\-_.:]*$`)

// Tag is the tag of build
type Tag string
Expand Down Expand Up @@ -203,7 +203,7 @@ func ParseBuildKey(strBuildKey string) (BuildKey, error) {
if strBuildKey == "" {
return BuildKey{}, errors.New("empty build key received")
}
parts := strings.SplitN(strBuildKey, ":", 2)
parts := strings.SplitN(strBuildKey, "@", 2)
name := parts[0]
if name != "" && !IsNameValid(name) {
return BuildKey{}, errors.Errorf("name '%s' is invalid", name)
Expand Down Expand Up @@ -231,7 +231,7 @@ type BuildKey struct {

// String returns string representation of build key
func (bk BuildKey) String() string {
return fmt.Sprintf("%s:%s", bk.Name, bk.Tag)
return fmt.Sprintf("%s@%s", bk.Name, bk.Tag)
}

// IsValid returns true if build key is valid
Expand Down

0 comments on commit 73d9747

Please sign in to comment.