mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 13:55:20 +00:00
Use latest container image when version is empty (#1439)
When using `velero install`, the image used should be a reasonable default, even if buildinfo.Version is missing (such as when using `go build` directly). Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
This commit is contained in:
committed by
KubeKween
parent
26d86f514c
commit
884e512f93
1
changelogs/unreleased/1439-nrb
Normal file
1
changelogs/unreleased/1439-nrb
Normal file
@@ -0,0 +1 @@
|
||||
Use `latest` image tag if no version information is provided at build time
|
||||
@@ -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 {
|
||||
|
||||
@@ -28,8 +28,16 @@ import (
|
||||
"github.com/heptio/velero/pkg/buildinfo"
|
||||
)
|
||||
|
||||
// Use "latest" if the build process didn't supply 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{
|
||||
|
||||
Reference in New Issue
Block a user