grim/convey

Parents 6ae333e6277f
Children 888f18bb2021
replace the on existing use of util/ShortID with the code from that function
  • +2 -2
    docker/run.go
  • +0 -30
    util/id.go
  • --- a/docker/run.go Sat Oct 26 14:39:26 2019 -0500
    +++ b/docker/run.go Sat Oct 26 14:42:35 2019 -0500
    @@ -26,6 +26,7 @@
    "time"
    "github.com/kballard/go-shellquote"
    + "github.com/satori/go.uuid"
    log "github.com/sirupsen/logrus"
    "bitbucket.org/rw_grim/convey/environment"
    @@ -33,7 +34,6 @@
    "bitbucket.org/rw_grim/convey/normalize"
    "bitbucket.org/rw_grim/convey/runtime"
    "bitbucket.org/rw_grim/convey/tasks"
    - "bitbucket.org/rw_grim/convey/util"
    "bitbucket.org/rw_grim/convey/yaml"
    )
    @@ -212,7 +212,7 @@
    fullEnv := env.Copy().MergeSlice(r.Environment).Merge(rt.Environment)
    // create an id for this container
    - runID := util.ShortID()
    + runID := uuid.NewV4().String()[0:6]
    // Map the image name so we can use it elsewhere
    image := fullEnv.Map(r.Image)
    --- a/util/id.go Sat Oct 26 14:39:26 2019 -0500
    +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
    @@ -1,30 +0,0 @@
    -// Convey
    -// Copyright 2016-2018 Gary Kramlich <grim@reaperworld.com>
    -//
    -// This program is free software: you can redistribute it and/or modify
    -// it under the terms of the GNU General Public License as published by
    -// the Free Software Foundation, either version 3 of the License, or
    -// (at your option) any later version.
    -//
    -// This program is distributed in the hope that it will be useful,
    -// but WITHOUT ANY WARRANTY; without even the implied warranty of
    -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    -// GNU General Public License for more details.
    -//
    -// You should have received a copy of the GNU General Public License
    -// along with this program. If not, see <http://www.gnu.org/licenses/>.
    -
    -// Package util contains utility functions.
    -package util
    -
    -import "github.com/satori/go.uuid"
    -
    -// ShortID create short, unique identifier.
    -func ShortID() string {
    - return ID()[0:6]
    -}
    -
    -// ID returns a uuid4
    -func ID() string {
    - return uuid.NewV4().String()
    -}