0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-26 05:30:39 +00:00

reverse the orderin

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2017-11-09 10:55:44 +08:00
parent 0927e34a03
commit ff05dfd6dc
3 changed files with 3 additions and 3 deletions

View File

@ -248,8 +248,8 @@ func run(c *cli.Context) error {
if c.Bool("tags.auto") {
plugin.Build.Tags = docker.DefaultTagSuffix(
c.String("commit.ref"),
c.String("tags.suffix"),
c.String("repo.branch"),
c.String("tags.suffix"),
)
}

View File

@ -9,7 +9,7 @@ import (
// DefaultTagSuffix returns a set of default suggested tags
// based on the commit ref with an attached suffix.
func DefaultTagSuffix(ref, suffix, defaultBranch string) []string {
func DefaultTagSuffix(ref, defaultBranch, suffix string) []string {
tags := DefaultTags(ref, defaultBranch)
if len(suffix) == 0 {
return tags

View File

@ -109,7 +109,7 @@ func TestDefaultTagSuffix(t *testing.T) {
}
for _, test := range tests {
got, want := DefaultTagSuffix(test.Before, test.Suffix, test.DefaultBranch), test.After
got, want := DefaultTagSuffix(test.Before, test.DefaultBranch, test.Suffix), test.After
if !reflect.DeepEqual(got, want) {
t.Errorf("Got tag %v, want %v", got, want)
}