Merge pull request #3928 from zubron/customize-velero-image-at-build-time

Allow image registry to be configured at build time

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
This commit is contained in:
Bridget McErlean
2021-07-16 15:23:53 -04:00
parent 07060d7fea
commit 1d882c6509
16 changed files with 273 additions and 66 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
/*
Copyright 2018, 2019, 2020 the Velero contributors.
Copyright the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -23,11 +23,13 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/vmware-tanzu/velero/internal/velero"
)
func DaemonSet(namespace string, opts ...podTemplateOption) *appsv1.DaemonSet {
c := &podTemplateConfig{
image: DefaultImage,
image: velero.DefaultVeleroImage(),
}
for _, opt := range opts {
+3 -2
View File
@@ -1,5 +1,5 @@
/*
Copyright 2020 the Velero contributors.
Copyright the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/vmware-tanzu/velero/internal/velero"
"github.com/vmware-tanzu/velero/pkg/builder"
)
@@ -117,7 +118,7 @@ func WithDefaultVolumesToRestic() podTemplateOption {
func Deployment(namespace string, opts ...podTemplateOption) *appsv1.Deployment {
// TODO: Add support for server args
c := &podTemplateConfig{
image: DefaultImage,
image: velero.DefaultVeleroImage(),
}
for _, opt := range opts {
-11
View File
@@ -29,20 +29,9 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/vmware-tanzu/velero/config/crd/crds"
"github.com/vmware-tanzu/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 = "velero/velero:" + imageVersion()
DefaultVeleroPodCPURequest = "500m"
DefaultVeleroPodMemRequest = "128Mi"
DefaultVeleroPodCPULimit = "1000m"