Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oadp-1.1: OADP-1256 Use updated PVB/PVR for patching Failed Phase during startup #238

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a2207d1
Add UBI Dockerfiles for Konveyor 1.6.2
dymurray Jun 29, 2020
2422432
Add support for restic skip-unchanged
dymurray Jun 29, 2020
142a2dc
Add BZ + Publish automation to repo (#82)
rayfordj Jan 28, 2021
e3bf2b2
Version string and restic branch for konveyor-dev/main
sseago Aug 18, 2021
bcfcea2
Use temporary go 1.16 builder image for UBI
dymurray Sep 14, 2021
9eb8a67
Fix velero build on temporary image
jmontleon Sep 14, 2021
55a6fdb
Use numeric user for velero-restic-restore-helper
snorwin Oct 25, 2021
6066135
Enable multiarch builds (#135)
jmontleon Nov 8, 2021
80a0258
Use arm64-graviton2 for arm builds (#137)
jmontleon Nov 9, 2021
6f08b0e
Add required keys for arm builds (#139)
jmontleon Nov 10, 2021
5de4d4b
Update Travis build job to work w/o changes on new branches
jmontleon Nov 11, 2021
ee13338
Added support for restic --verify flag
sseago Mar 26, 2020
1a9f739
CVE-1869801 update aws-sdk-go to 1.34.11
sseago Mar 7, 2022
f085b3f
update Dockerfile builder images to golang 1.17
sseago Mar 8, 2022
ec5ce69
Use numeric non-root user for nonroot SCC compatibility
jmontleon May 6, 2022
6221dee
update restic branch for quay builds
sseago Jun 17, 2022
17c2b3e
Use a full VM for arm
dymurray Jun 17, 2022
7fd8b40
Update version string for 1.9.0 (#168)
sseago Jul 5, 2022
ebcb958
add vsb to restore priority (#172)
eemcmullan Jul 8, 2022
638544e
[konveyor-1.9] OADP-598: Improve datamover backup performance (#179)
openshift-cherrypick-robot Jul 29, 2022
c3b06d1
[konveyor-1.9] OADP-644: Make datamover timeout configurable (#183)
openshift-cherrypick-robot Aug 11, 2022
9df88ab
update release string to 1.9.1
sseago Aug 11, 2022
59861a6
log volumesnapshotbackup status if is not complete.
kaovilai Sep 1, 2022
23366e3
clean temp vsclass for dm restore (#197)
eemcmullan Sep 16, 2022
98de189
partially fail backup if vsb fails (#200)
eemcmullan Sep 19, 2022
d5da59a
Add nil check before execution of csi snapshot delete
shubham-pampattiwar Sep 26, 2022
50418e1
OADP-927: Remove VSClass name in Get error (#212)
eemcmullan Oct 24, 2022
157ec0b
OADP-1002: Ignore not found err for temp vsclass in cases of data mov…
eemcmullan Oct 28, 2022
a0f9283
Updating to reflect upstream csi changes for 1.9.5
sseago Jan 24, 2023
7c2f857
updating version string and restic version for 1.9.5
sseago Jan 24, 2023
668b21c
Use updated PVB/PVR for patching Failed Phase during startup
kaovilai Feb 3, 2023
70d24ca
move UpdatePVXStatusToFailed to controller pkg
kaovilai Feb 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/bz-pr-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is a basic workflow to help you get started with Actions

name: BZ PR Creation

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request_target:
branches:
- "*"
types:
- opened
- edited
- reopened
- synchronize

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
bz-on-pr-create:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: docker://quay.io/konveyor/pr-bz-github-action
name: update bugzilla with posted pr
with:
org_repo: ${{ github.repository }}
pr_number: ${{ github.event.pull_request.number }}
bz_product: "Migration Toolkit for Containers"
title: ${{ github.event.pull_request.title }}
github_token: ${{ secrets.GITHUB_TOKEN }}
bugzilla_token: ${{ secrets.BUGZILLA_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/pr-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This is a basic workflow to help you get started with Actions

name: BZ Merge

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request_target:
branches:
- "*"
types:
- closed


# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in pnamearallel
jobs:
# This workflow contains a single job called "build"
bz-on-pr-merge:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: docker://quay.io/konveyor/pr-merge-github-action
name: update bugzilla to modified
with:
bugzilla_token: ${{ secrets.BUGZILLA_TOKEN }}
org_repo: ${{ github.repository }}
pr_number: ${{ github.event.pull_request.number }}
bz_product: "Migration Toolkit for Containers"
title: ${{ github.event.pull_request.title }}
github_token: ${{ secrets.GITHUB_TOKEN }}
branch_to_release: "release-1.4.4:1.4.4,release-1.4.3:1.4.3,konveyor-1.5.2:1.4.0,release-1.4.5:1.4.5,release-1.5.0:1.5.0,konveyor-dev:1.5.z"
base_branch: ${{ github.base_ref }}
61 changes: 61 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish Images

on:
push:
branches:
- konveyor-dev
- 'release-*.*.*'
- 'sprint-*'
tags:
- 'release-*.*.*'
workflow_dispatch:

env:
REGISTRY: quay.io
IMAGE_NAME: konveyor/velero
HELPER_IMAGE_NAME: konveyor/velero-restic-restore-helper
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Build container image
run: docker build . --file Dockerfile.ubi --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }}

- name: Build helper image
run: docker build . --file Dockerfile-velero-restic-restore-helper.ubi --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }}

- name: Log into registry
run: echo "${{ secrets.QUAY_PUBLISH_TOKEN }}" | docker login quay.io -u ${{ secrets.QUAY_PUBLISH_ROBOT }} --password-stdin

- name: Push container image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }}

- name: Push helper image
run: docker push ${{ env.REGISTRY }}/${{ env.HELPER_IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }}

- name: Retag container image
run: docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
if: ${{ github.ref == 'refs/heads/konveyor-dev' }}

- name: Retag helper image
run: docker tag ${{ env.REGISTRY }}/${{ env.HELPER_IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }} ${{ env.REGISTRY }}/${{ env.HELPER_IMAGE_NAME }}:latest
if: ${{ github.ref == 'refs/heads/konveyor-dev' }}

- name: push retagged container image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
if: ${{ github.ref == 'refs/heads/konveyor-dev' }}

- name: push retagged helper image
run: docker push ${{ env.REGISTRY }}/${{ env.HELPER_IMAGE_NAME }}:latest
if: ${{ github.ref == 'refs/heads/konveyor-dev' }}
78 changes: 78 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
os: linux
services: docker
dist: focal
language: go
go: stable

env:
global:
- IMAGE1: quay.io/konveyor/velero
- IMAGE2: quay.io/konveyor/velero-restic-restore-helper
- DEFAULT_BRANCH: konveyor-dev
- DOCKERFILE1: Dockerfile.ubi
- DOCKERFILE2: Dockerfile-velero-restic-restore-helper.ubi
- DOCKER_CLI_EXPERIMENTAL: enabled
- GOPROXY: https://goproxy.io,direct

before_install:
- |
if [ "${TRAVIS_BRANCH}" == "${DEFAULT_BRANCH}" ]; then
export TAG=latest
else
export TAG="${TRAVIS_BRANCH}"
fi

# Builds routinely fail due to download failures inside alternate arch docker containers
# Here we are downloading outside the docker container and copying the deps in
# Also use -v for downloads/builds to stop no output failures from lxd env buffering.
before_script:
- go mod vendor -v
- git clone https://github.com/konveyor/restic -b konveyor-0.14.0
- pushd restic; go mod vendor -v; popd
- sed -i 's|-mod=mod|-mod=vendor|g' ${DOCKERFILE1}
- sed -i 's|-mod=mod|-mod=vendor|g' ${DOCKERFILE2}
- sed -i 's|go build|go build -v|g' ${DOCKERFILE1}
- sed -i 's|go build|go build -v|g' ${DOCKERFILE2}
- sed -i 's|^RUN mkdir -p \$APP_ROOT/src/github.com/restic \\$|COPY --chown=1001 restic/ $APP_ROOT/src/github.com/restic/restic|g' ${DOCKERFILE1}
- sed -i 's|&& cd \$APP_ROOT/src/github.com/restic \\$||g' ${DOCKERFILE1}
- sed -i 's|&& git clone https://github.com/konveyor/restic -b .*$||g' ${DOCKERFILE1}

script:
- docker build -t ${IMAGE1}:${TAG}-${TRAVIS_ARCH} -f ${DOCKERFILE1} .
- docker build -t ${IMAGE2}:${TAG}-${TRAVIS_ARCH} -f ${DOCKERFILE2} .
- if [ -n "${QUAY_ROBOT}" ]; then docker login quay.io -u "${QUAY_ROBOT}" -p ${QUAY_TOKEN}; fi
- if [ -n "${QUAY_ROBOT}" ]; then docker push ${IMAGE1}:${TAG}-${TRAVIS_ARCH}; fi
- if [ -n "${QUAY_ROBOT}" ]; then docker push ${IMAGE2}:${TAG}-${TRAVIS_ARCH}; fi

jobs:
include:
- stage: build images
arch: ppc64le
- arch: s390x
- arch: arm64-graviton2
virt: vm
group: edge
- arch: amd64
- stage: push manifest
language: shell
arch: amd64
before_script: []
script:
- |
if [ -n "${QUAY_ROBOT}" ]; then
docker login quay.io -u "${QUAY_ROBOT}" -p ${QUAY_TOKEN}
docker manifest create \
${IMAGE1}:${TAG} \
${IMAGE1}:${TAG}-amd64 \
${IMAGE1}:${TAG}-ppc64le \
${IMAGE1}:${TAG}-s390x \
${IMAGE1}:${TAG}-aarch64
docker manifest create \
${IMAGE2}:${TAG} \
${IMAGE2}:${TAG}-amd64 \
${IMAGE2}:${TAG}-ppc64le \
${IMAGE2}:${TAG}-s390x \
${IMAGE2}:${TAG}-aarch64
docker manifest push ${IMAGE1}:${TAG}
docker manifest push ${IMAGE2}:${TAG}
fi
14 changes: 14 additions & 0 deletions 1.6.0-konveyor-rebase.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
git checkout v1.6.0
git checkout -b 1.6.0-rebase
git cherry-pick b15d6bae5ab937f40efc3f5312c00cd1cf4e9e59 # Add UBI Dockerfiles for Konveyor
git cherry-pick 391f9a646b3a881091e63234fea9646475de0bb3 # Add support for restic skip-unchanged
git cherry-pick 53ef637b20362bc46abd6a70cd968d4c84b3034c # insecureSkipTLSVerify changes
git cherry-pick e38a31d951fa35793aaa6e6b57dfcde71f8f5f33 # Added support for restic --verify flag
# fix conflicts
# CONFLICT (content): Merge conflict in config/crd/crds/crds.go
# "make update" for CRDs
git cherry-pick e5c45325c7e32d4e5225680b74045360ce7b63aa # CVE-1869801 update aws-sdk-go to 1.34.11
git cherry-pick b8e95a3be397a82f2ea7a560c0bfd2444a1dc960 # Add BZ automation to repo (#82)

# new commit, Dockerfile.ubi "version bump for velero; update restic branch/build"
# rebase log, "mod=mod" for restic, update to topic branch, velero version bump
14 changes: 14 additions & 0 deletions Dockerfile-velero-restic-restore-helper.ubi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM quay.io/konveyor/builder:v1.17.2 AS builder
ENV GOPATH=$APP_ROOT
COPY . $APP_ROOT/src/github.com/vmware-tanzu/velero
WORKDIR $APP_ROOT/src/github.com/vmware-tanzu/velero
RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/velero-restic-restore-helper github.com/vmware-tanzu/velero/cmd/velero-restic-restore-helper

FROM registry.access.redhat.com/ubi8-minimal
RUN microdnf -y update && microdnf clean all

COPY --from=builder /opt/app-root/src/velero-restic-restore-helper velero-restic-restore-helper

USER 65534:65534

ENTRYPOINT [ "/velero-restic-restore-helper" ]
23 changes: 23 additions & 0 deletions Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# TODO! Find a real ubi8 image for golang 1.16
FROM quay.io/konveyor/builder:v1.17.2 AS builder
ENV GOPATH=$APP_ROOT
COPY . /go/src/github.com/vmware-tanzu/velero
WORKDIR /go/src/github.com/vmware-tanzu/velero
RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=v1.9.5-konveyor' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero

FROM quay.io/konveyor/builder:v1.17.2 AS restic-builder
ENV GOPATH=$APP_ROOT
RUN mkdir -p $APP_ROOT/src/github.com/restic \
&& cd $APP_ROOT/src/github.com/restic \
&& git clone https://github.com/konveyor/restic -b konveyor-0.14.0
WORKDIR $APP_ROOT/src/github.com/restic/restic
RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic

FROM registry.access.redhat.com/ubi8-minimal
RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf clean all
COPY --from=builder /go/src/velero velero
COPY --from=restic-builder /opt/app-root/src/restic /usr/bin/restic

USER 65534:65534

ENTRYPOINT ["/velero"]
1 change: 1 addition & 0 deletions changelogs/unreleased/5829-kaovilai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correct PVB/PVR Failed Phase patching during startup
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/Azure/go-autorest/autorest/azure/auth v0.5.8
github.com/Azure/go-autorest/autorest/to v0.3.0
github.com/apex/log v1.9.0
github.com/aws/aws-sdk-go v1.28.2
github.com/aws/aws-sdk-go v1.34.11
github.com/bombsimon/logrusr/v3 v3.0.0
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/fatih/color v1.13.0
Expand All @@ -23,6 +23,7 @@ require (
github.com/hashicorp/go-hclog v0.14.1
github.com/hashicorp/go-plugin v1.4.3
github.com/joho/godotenv v1.3.0
github.com/konveyor/volume-snapshot-mover v0.0.0-20220725191622-4b360b792c3e
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.18.1
Expand Down Expand Up @@ -81,7 +82,7 @@ require (
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/jmespath/go-jmespath v0.3.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
Expand Down
10 changes: 7 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.28.2 h1:j5IXG9CdyLfcVfICqo1PXVv+rua+QQHbkXuvuU/JF+8=
github.com/aws/aws-sdk-go v1.28.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.34.11 h1:QF9Gp3vvgIXsp7p5cYS0t7eRkauU3zM2OW4RN6FtYp0=
github.com/aws/aws-sdk-go v1.34.11/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
Expand Down Expand Up @@ -262,6 +262,7 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh
github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU=
github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
Expand Down Expand Up @@ -421,8 +422,9 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE=
github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
Expand All @@ -446,6 +448,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konveyor/volume-snapshot-mover v0.0.0-20220725191622-4b360b792c3e h1:DGsRtnWzUM30smT5qBoglDGZAw4/A1GUm8cpvjrBwc4=
github.com/konveyor/volume-snapshot-mover v0.0.0-20220725191622-4b360b792c3e/go.mod h1:ykj3RTgJyA5tsL2n4fRlk1LS2ln7wluHsryE+lMussY=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
Expand Down
21 changes: 9 additions & 12 deletions pkg/cmd/cli/restic/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,11 @@ func (s *resticServer) markInProgressPVBsFailed(client ctrlclient.Client) {
log.Debugf("the node of podvolumebackup %q is %q, not %q, skip", pvb.GetName(), pvb.Spec.Node, s.nodeName)
continue
}
original := pvb.DeepCopy()
pvb.Status.Phase = velerov1api.PodVolumeBackupPhaseFailed
pvb.Status.Message = fmt.Sprintf("get a podvolumebackup with status %q during the server starting, mark it as %q", velerov1api.PodVolumeBackupPhaseInProgress, pvb.Status.Phase)
pvb.Status.CompletionTimestamp = &metav1.Time{Time: time.Now()}
if err := client.Patch(s.ctx, &pvbs.Items[i], ctrlclient.MergeFrom(original)); err != nil {
log.WithError(errors.WithStack(err)).Errorf("failed to patch podvolumebackup %q", pvb.GetName())

if err := controller.UpdatePVBStatusToFailed(client, s.ctx, &pvbs.Items[i],
fmt.Sprintf("get a podvolumebackup with status %q during the server starting, mark it as %q", velerov1api.PodVolumeBackupPhaseInProgress, velerov1api.PodVolumeBackupPhaseFailed),
time.Now()); err != nil {
s.logger.WithError(errors.WithStack(err)).Errorf("failed to patch podvolumebackup %q", pvb.GetName())
continue
}
log.WithField("podvolumebackup", pvb.GetName()).Warn(pvb.Status.Message)
Expand Down Expand Up @@ -338,12 +337,10 @@ func (s *resticServer) markInProgressPVRsFailed(client ctrlclient.Client) {
continue
}

original := pvr.DeepCopy()
pvr.Status.Phase = velerov1api.PodVolumeRestorePhaseFailed
pvr.Status.Message = fmt.Sprintf("get a podvolumerestore with status %q during the server starting, mark it as %q", velerov1api.PodVolumeRestorePhaseInProgress, pvr.Status.Phase)
pvr.Status.CompletionTimestamp = &metav1.Time{Time: time.Now()}
if err := client.Patch(s.ctx, &pvrs.Items[i], ctrlclient.MergeFrom(original)); err != nil {
log.WithError(errors.WithStack(err)).Errorf("failed to patch podvolumerestore %q", pvr.GetName())
if err := controller.UpdatePVRStatusToFailed(client, s.ctx, &pvrs.Items[i],
fmt.Sprintf("get a podvolumerestore with status %q during the server starting, mark it as %q", velerov1api.PodVolumeRestorePhaseInProgress, velerov1api.PodVolumeRestorePhaseFailed),
time.Now()); err != nil {
s.logger.WithError(errors.WithStack(err)).Errorf("failed to patch podvolumerestore %q", pvr.GetName())
continue
}
log.WithField("podvolumerestore", pvr.GetName()).Warn(pvr.Status.Message)
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ var defaultRestorePriorities = restore.Priorities{
"customresourcedefinitions",
"namespaces",
"storageclasses",
"volumesnapshotbackups.datamover.oadp.openshift.io",
"volumesnapshotclass.snapshot.storage.k8s.io",
"volumesnapshotcontents.snapshot.storage.k8s.io",
"volumesnapshots.snapshot.storage.k8s.io",
Expand Down
Loading