Compare commits

..

6 Commits

Author SHA1 Message Date
lyndon-li
8f31599fe4 Merge pull request #8849 from Lyndon-Li/release-1.16
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m40s
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 38s
[1.16] Issue 8847: inherit pod info from node-agent-windows
2025-04-08 13:38:04 +08:00
lyndon-li
f8ae1495ac Merge branch 'release-1.16' into release-1.16 2025-04-08 12:57:26 +08:00
Xun Jiang/Bruce Jiang
b469d9f427 Bump base image to 0.2.57 to fix CVEs. (#8853)
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m58s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 37s
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
2025-04-07 23:27:46 -04:00
Lyndon-Li
87084ce3c7 issue 8847: inherit pod info from node-agent-windows
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-04-07 19:41:14 +08:00
lyndon-li
3df026ffdb Merge pull request #8834 from Lyndon-Li/release-1.16
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m12s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 37s
Pin velero image for 1.16.0
2025-03-31 15:15:43 +08:00
Lyndon-Li
406a730c2a pin velero image
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2025-03-31 13:39:27 +08:00
18 changed files with 20 additions and 65 deletions

View File

@@ -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

View File

@@ -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: |

View File

@@ -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

View File

@@ -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>"

View File

@@ -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

View File

@@ -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)"

View File

@@ -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 && \

View File

@@ -1 +0,0 @@
This PR aims to add s390x support to Velero binary.

View File

@@ -1 +0,0 @@
Inherit k8s default volumeSnapshotClass.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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]:

View File

@@ -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
}

View File

@@ -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
}