Skip to content

Commit

Permalink
Use latest container image when version is empty
Browse files Browse the repository at this point in the history
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
  • Loading branch information
nrb committed May 3, 2019
1 parent 6ebedf6 commit 134740b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/install/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func WithRestoreOnly() podTemplateOption {
func Deployment(namespace string, opts ...podTemplateOption) *appsv1beta1.Deployment {
// TODO: Add support for server args
c := &podTemplateConfig{
image: "gcr.io/heptio-images/velero:latest",
image: DefaultImage,
}

for _, opt := range opts {
Expand Down
10 changes: 9 additions & 1 deletion pkg/install/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ import (
"github.com/heptio/velero/pkg/buildinfo"
)

// Use "latest" if the build process didn't support a version
func imageVersion() string {
if buildinfo.Version == "" {
return "latest"
}
return buildinfo.Version
}

// DefaultImage is the default image to use for the Velero deployment and restic daemonset containers.
var DefaultImage = "gcr.io/heptio-images/velero:" + buildinfo.Version
var DefaultImage = "gcr.io/heptio-images/velero:" + imageVersion()

func labels() map[string]string {
return map[string]string{
Expand Down

0 comments on commit 134740b

Please sign in to comment.