mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-03-26 19:45:06 +00:00
Compare commits
6 Commits
dependabot
...
v1.16.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f31599fe4 | ||
|
|
f8ae1495ac | ||
|
|
b469d9f427 | ||
|
|
87084ce3c7 | ||
|
|
3df026ffdb | ||
|
|
406a730c2a |
2
.github/workflows/nightly-trivy-scan.yml
vendored
2
.github/workflows/nightly-trivy-scan.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
# maintain the versions of Velero those need security scan
|
||||
versions: [main]
|
||||
# list of images that need scan
|
||||
images: [velero, velero-plugin-for-aws, velero-plugin-for-gcp, velero-plugin-for-microsoft-azure]
|
||||
images: [velero, velero-restore-helper]
|
||||
permissions:
|
||||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
||||
|
||||
|
||||
2
.github/workflows/prow-action.yml
vendored
2
.github/workflows/prow-action.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
execute:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: jpmcb/prow-github-actions@v2.0.0
|
||||
- uses: jpmcb/prow-github-actions@v1.1.3
|
||||
with:
|
||||
# TODO: before allowing the /lgtm command, see if we can block merging if changelog labels are missing.
|
||||
prow-commands: |
|
||||
|
||||
@@ -26,23 +26,18 @@ builds:
|
||||
- arm
|
||||
- arm64
|
||||
- ppc64le
|
||||
- s390x
|
||||
ignore:
|
||||
# don't build arm for darwin and arm/arm64 for windows
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
- goos: darwin
|
||||
goarch: ppc64le
|
||||
- goos: darwin
|
||||
goarch: s390x
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
- goos: windows
|
||||
goarch: ppc64le
|
||||
- goos: windows
|
||||
goarch: s390x
|
||||
ldflags:
|
||||
- -X "github.com/vmware-tanzu/velero/pkg/buildinfo.Version={{ .Tag }}" -X "github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA={{ .FullCommit }}" -X "github.com/vmware-tanzu/velero/pkg/buildinfo.GitTreeState={{ .Env.GIT_TREE_STATE }}" -X "github.com/vmware-tanzu/velero/pkg/buildinfo.ImageRegistry={{ .Env.REGISTRY }}"
|
||||
archives:
|
||||
@@ -65,4 +60,4 @@ git:
|
||||
# tags if there are more than one tag in the same commit.
|
||||
#
|
||||
# Default: `-version:refname`
|
||||
tag_sort: -version:creatordate
|
||||
tag_sort: -version:creatordate
|
||||
@@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
# Velero binary build section
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23-bookworm AS velero-builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23.7-bookworm AS velero-builder
|
||||
|
||||
ARG GOPROXY
|
||||
ARG BIN
|
||||
@@ -49,7 +49,7 @@ RUN mkdir -p /output/usr/bin && \
|
||||
go clean -modcache -cache
|
||||
|
||||
# Restic binary build section
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23-bookworm AS restic-builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23.7-bookworm AS restic-builder
|
||||
|
||||
ARG GOPROXY
|
||||
ARG BIN
|
||||
@@ -73,7 +73,7 @@ RUN mkdir -p /output/usr/bin && \
|
||||
go clean -modcache -cache
|
||||
|
||||
# Velero image packing section
|
||||
FROM paketobuildpacks/run-jammy-tiny:latest
|
||||
FROM paketobuildpacks/run-jammy-tiny:0.2.57
|
||||
|
||||
LABEL maintainer="Xun Jiang <jxun@vmware.com>"
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
ARG OS_VERSION=1809
|
||||
|
||||
# Velero binary build section
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23-bookworm AS velero-builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23.7-bookworm AS velero-builder
|
||||
|
||||
ARG GOPROXY
|
||||
ARG BIN
|
||||
|
||||
4
Makefile
4
Makefile
@@ -112,7 +112,7 @@ comma=,
|
||||
# The version of restic binary to be downloaded
|
||||
RESTIC_VERSION ?= 0.15.0
|
||||
|
||||
CLI_PLATFORMS ?= linux-amd64 linux-arm linux-arm64 darwin-amd64 darwin-arm64 windows-amd64 linux-ppc64le linux-s390x
|
||||
CLI_PLATFORMS ?= linux-amd64 linux-arm linux-arm64 darwin-amd64 darwin-arm64 windows-amd64 linux-ppc64le
|
||||
BUILD_OUTPUT_TYPE ?= docker
|
||||
BUILD_OS ?= linux
|
||||
BUILD_ARCH ?= amd64
|
||||
@@ -495,4 +495,4 @@ new-changelog:
|
||||
fi
|
||||
@mkdir -p ./changelogs/unreleased/ && \
|
||||
echo $(CHANGELOG_BODY) > ./changelogs/unreleased/$(GH_PR_NUMBER)-$(GH_LOGIN) && \
|
||||
echo \"$(CHANGELOG_BODY)\" added to "./changelogs/unreleased/$(GH_PR_NUMBER)-$(GH_LOGIN)"
|
||||
echo \"$(CHANGELOG_BODY)\" added to "./changelogs/unreleased/$(GH_PR_NUMBER)-$(GH_LOGIN)"
|
||||
|
||||
2
Tiltfile
2
Tiltfile
@@ -52,7 +52,7 @@ git_sha = str(local("git rev-parse HEAD", quiet = True, echo_off = True)).strip(
|
||||
|
||||
tilt_helper_dockerfile_header = """
|
||||
# Tilt image
|
||||
FROM golang:1.23 as tilt-helper
|
||||
FROM golang:1.23.7 as tilt-helper
|
||||
|
||||
# Support live reloading with Tilt
|
||||
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/restart.sh && \
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
This PR aims to add s390x support to Velero binary.
|
||||
@@ -1 +0,0 @@
|
||||
Inherit k8s default volumeSnapshotClass.
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM --platform=$TARGETPLATFORM golang:1.23-bookworm
|
||||
FROM --platform=$TARGETPLATFORM golang:1.23.7-bookworm
|
||||
|
||||
ARG GOPROXY
|
||||
|
||||
|
||||
@@ -127,9 +127,6 @@ const (
|
||||
VolumeSnapshotClassDriverBackupAnnotationPrefix = "velero.io/csi-volumesnapshot-class"
|
||||
VolumeSnapshotClassDriverPVCAnnotation = "velero.io/csi-volumesnapshot-class"
|
||||
|
||||
// https://kubernetes.io/zh-cn/docs/concepts/storage/volume-snapshot-classes/
|
||||
VolumeSnapshotClassKubernetesAnnotation = "snapshot.storage.kubernetes.io/is-default-class"
|
||||
|
||||
// There is no release w/ these constants exported. Using the strings for now.
|
||||
// CSI Annotation volumesnapshotclass
|
||||
// https://github.com/kubernetes-csi/external-snapshotter/blob/master/pkg/utils/util.go#L59-L60
|
||||
|
||||
@@ -432,23 +432,13 @@ func GetVolumeSnapshotClassForStorageClass(
|
||||
}
|
||||
}
|
||||
}
|
||||
// not found by label, pick by annotation
|
||||
for _, sc := range snapshotClasses.Items {
|
||||
_, hasDefaultAnnotation := sc.Annotations[velerov1api.VolumeSnapshotClassKubernetesAnnotation]
|
||||
if sc.Driver == provisioner {
|
||||
vsClass = sc
|
||||
if hasDefaultAnnotation {
|
||||
return &sc, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
// If there's only one volumesnapshotclass for the driver, return it.
|
||||
if n == 1 {
|
||||
return &vsClass, nil
|
||||
}
|
||||
return nil, fmt.Errorf(
|
||||
"failed to get VolumeSnapshotClass for provisioner %s, ensure that the desired VolumeSnapshot class has the %s label or %s annotation",
|
||||
provisioner, velerov1api.VolumeSnapshotClassSelectorLabel, velerov1api.VolumeSnapshotClassKubernetesAnnotation)
|
||||
"failed to get VolumeSnapshotClass for provisioner %s, ensure that the desired VolumeSnapshot class has the %s label",
|
||||
provisioner, velerov1api.VolumeSnapshotClassSelectorLabel)
|
||||
}
|
||||
|
||||
// IsVolumeSnapshotClassHasListerSecret returns whether a volumesnapshotclass has a snapshotlister secret
|
||||
|
||||
@@ -45,26 +45,13 @@ This section documents some of the choices made during implementing the CSI snap
|
||||
1. VolumeSnapshots created by the Velero CSI plugins are retained only for the lifetime of the backup even if the `DeletionPolicy` on the VolumeSnapshotClass is set to `Retain`. To accomplish this, during deletion of the backup the prior to deleting the VolumeSnapshot, VolumeSnapshotContent object is patched to set its `DeletionPolicy` to `Delete`. Deleting the VolumeSnapshot object will result in cascade delete of the VolumeSnapshotContent and the snapshot in the storage provider.
|
||||
2. VolumeSnapshotContent objects created during a `velero backup` that are dangling, unbound to a VolumeSnapshot object, will be discovered, using labels, and deleted on backup deletion.
|
||||
3. The Velero CSI plugins, to backup CSI backed PVCs, will choose the VolumeSnapshotClass in the cluster based on the following logic:
|
||||
1. **Default Behavior Based On Annotation:**
|
||||
You can specify a default VolumeSnapshotClass for VolumeSnapshots that don't request any particular class to bind to by adding the snapshot.storage.kubernetes.io/is-default-class: "true" annotation.
|
||||
For example, if you want to create a VolumeSnapshotClass for the CSI driver `disk.csi.cloud.com` for taking snapshots of disks created with `disk.csi.cloud.com` based storage classes, you can create a VolumeSnapshotClass like this:
|
||||
```yaml
|
||||
apiVersion: snapshot.storage.k8s.io/v1
|
||||
kind: VolumeSnapshotClass
|
||||
metadata:
|
||||
name: test-snapclass-by-annotation
|
||||
annotations:
|
||||
snapshot.storage.kubernetes.io/is-default-class: "true"
|
||||
driver: disk.csi.cloud.com
|
||||
```
|
||||
Note: If multiple CSI drivers exist, a default VolumeSnapshotClass can be specified for each of them.
|
||||
2. **Default Behavior Based On Label:**
|
||||
1. **Default Behavior:**
|
||||
You can simply create a VolumeSnapshotClass for a particular driver and put a label on it to indicate that it is the default VolumeSnapshotClass for that driver. For example, if you want to create a VolumeSnapshotClass for the CSI driver `disk.csi.cloud.com` for taking snapshots of disks created with `disk.csi.cloud.com` based storage classes, you can create a VolumeSnapshotClass like this:
|
||||
```yaml
|
||||
apiVersion: snapshot.storage.k8s.io/v1
|
||||
kind: VolumeSnapshotClass
|
||||
metadata:
|
||||
name: test-snapclass-by-label
|
||||
name: test-snapclass
|
||||
labels:
|
||||
velero.io/csi-volumesnapshot-class: "true"
|
||||
driver: disk.csi.cloud.com
|
||||
|
||||
@@ -14,11 +14,13 @@ Run `make update` to regenerate files if you make the following changes:
|
||||
|
||||
The following files are automatically generated from the source code:
|
||||
|
||||
* CRDs
|
||||
* The clientset
|
||||
* Listers
|
||||
* Shared informers
|
||||
* Documentation
|
||||
* Protobuf/gRPC types
|
||||
|
||||
You can run `make verify` to ensure that all generated files (CRDs, docs) are up to date.
|
||||
You can run `make verify` to ensure that all generated files (clientset, listers, shared informers, docs) are up to date.
|
||||
|
||||
## Linting
|
||||
|
||||
|
||||
@@ -116,8 +116,6 @@ FEATURES ?=
|
||||
DEBUG_VELERO_POD_RESTART ?= false
|
||||
VELERO_SERVER_DEBUG_MODE ?= false
|
||||
|
||||
ITEM_BLOCK_WORKER_COUNT ?= 1
|
||||
|
||||
# Parameters to run migration tests along with all other E2E tests, and both of them should
|
||||
# be provided or left them all empty to skip migration tests with no influence to other
|
||||
# E2E tests.
|
||||
@@ -169,8 +167,7 @@ COMMON_ARGS := --velerocli=$(VELERO_CLI) \
|
||||
--uploader-type=$(UPLOADER_TYPE) \
|
||||
--debug-velero-pod-restart=$(DEBUG_VELERO_POD_RESTART) \
|
||||
--fail-fast=$(FAIL_FAST) \
|
||||
--has-vsphere-plugin=$(HAS_VSPHERE_PLUGIN) \
|
||||
--item-block-worker-count=$(ITEM_BLOCK_WORKER_COUNT)
|
||||
--has-vsphere-plugin=$(HAS_VSPHERE_PLUGIN)
|
||||
|
||||
# Make sure ginkgo is in $GOBIN
|
||||
.PHONY:ginkgo
|
||||
|
||||
@@ -343,12 +343,6 @@ func init() {
|
||||
false,
|
||||
"a switch for installing vSphere plugin.",
|
||||
)
|
||||
flag.IntVar(
|
||||
&test.VeleroCfg.ItemBlockWorkerCount,
|
||||
"item-block-worker-count",
|
||||
1,
|
||||
"Velero backup's item block worker count.",
|
||||
)
|
||||
}
|
||||
|
||||
// Add label [SkipVanillaZfs]:
|
||||
|
||||
@@ -367,10 +367,6 @@ func installVeleroServer(ctx context.Context, cli, cloudProvider string, options
|
||||
args = append(args, fmt.Sprintf("--uploader-type=%v", options.UploaderType))
|
||||
}
|
||||
|
||||
if options.ItemBlockWorkerCount > 1 {
|
||||
args = append(args, fmt.Sprintf("--item-block-worker-count=%d", options.ItemBlockWorkerCount))
|
||||
}
|
||||
|
||||
if err := createVeleroResources(ctx, cli, namespace, args, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -280,7 +280,6 @@ func getProviderVeleroInstallOptions(veleroCfg *VeleroConfig,
|
||||
io.VeleroPodMemLimit = veleroCfg.VeleroPodMemLimit
|
||||
io.VeleroPodMemRequest = veleroCfg.VeleroPodMemRequest
|
||||
io.DisableInformerCache = veleroCfg.DisableInformerCache
|
||||
io.ItemBlockWorkerCount = veleroCfg.ItemBlockWorkerCount
|
||||
|
||||
return io, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user