Skip to content

Commit 1e5226b

Browse files
sseagoamastbau
authored andcommitted
Summary of Changes:
Move PVC Request Size Patch to Backup CSI Action Shifted the logic that patches the PVC request size (to match the corresponding VolumeSnapshot size) from the CSI Restore action to the CSI Backup action. ✅ This enables restoring a PVC independently using label selectors, without requiring the VolumeSnapshot to be restored first. Include VolumeSnapshot in CSI Additional Items for PVC Added VolumeSnapshot as an additional item in the PVC CSI backup logic to ensure necessary metadata is available during restore. Include VolumeSnapshotContent in CSI Restore Additional Items Added VolumeSnapshotContent to the additional items in the CSI restore action to support a more complete restore workflow. ✅ This to make sure those resources are restored even if filters out by label from the resources list to restore Signed-off-by: Amos Mastbaum <[email protected]>
1 parent 2108256 commit 1e5226b

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Dockerfile.ubi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ COPY . /go/src/github.com/vmware-tanzu/velero
1010
WORKDIR /go/src/github.com/vmware-tanzu/velero
1111

1212
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero
13-
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-restore-helper github.com/vmware-tanzu/velero/cmd/velero-restore-helper
1413
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper
1514

1615
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS restic-builder
@@ -31,7 +30,6 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=
3130
FROM registry.access.redhat.com/ubi9-minimal
3231
RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf -y reinstall tzdata && microdnf clean all
3332
COPY --from=builder /go/src/velero velero
34-
COPY --from=builder /go/src/velero-restore-helper velero-restore-helper
3533
COPY --from=builder /go/src/velero-helper velero-helper
3634
COPY --from=restic-builder /opt/app-root/src/restic /usr/bin/restic
3735

@@ -41,4 +39,4 @@ RUN chmod -R 777 /home/velero
4139
USER 65534:65534
4240
ENV HOME=/home/velero
4341

44-
ENTRYPOINT ["/velero"]
42+
ENTRYPOINT ["/velero"]

pkg/restore/actions/csi/pvc_action.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ func (p *pvcRestoreItemAction) Execute(
114114
pvc.Spec.DataSource = nil
115115
pvc.Spec.DataSourceRef = nil
116116
} else {
117-
118117
backup := new(velerov1api.Backup)
119118
err := p.crClient.Get(
120119
context.TODO(),
@@ -131,7 +130,6 @@ func (p *pvcRestoreItemAction) Execute(
131130
}
132131

133132
if boolptr.IsSetToTrue(backup.Spec.SnapshotMoveData) {
134-
135133
logger.Info("Start DataMover restore.")
136134

137135
// If PVC doesn't have a DataUploadNameLabel, which should be created

0 commit comments

Comments
 (0)