From 9de7891878c34d01d0a6f7d186c55ec8f7e4d0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenkai=20Yin=28=E5=B0=B9=E6=96=87=E5=BC=80=29?= Date: Fri, 30 Sep 2022 14:10:32 +0800 Subject: [PATCH] Update the snapshotter to support VSL credential and bump up golang 1. Update the snapshotter to support VSL credential 2. Bump up golang to v1.18 3. Remove restic related MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/vmware-tanzu/velero/issues/5392 Also related to https://github.com/vmware-tanzu/velero/pull/5313 and https://github.com/vmware-tanzu/velero/issues/5274 Signed-off-by: Wenkai Yin(尹文开) Signed-off-by: msdolbey --- .github/workflows/pr.yaml | 4 ++-- .github/workflows/push.yml | 2 +- Dockerfile | 2 +- README.md | 2 +- go.mod | 2 +- velero-plugin-for-microsoft-azure/volume_snapshotter.go | 7 ++++++- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 659914b..2788b9e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.17 + - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 id: go - name: Check out the code diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a6ef24e..24eaab3 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 id: go - name: Check out code into the Go module directory diff --git a/Dockerfile b/Dockerfile index cb949f0..ea698b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM --platform=$BUILDPLATFORM golang:1.17-buster AS build +FROM --platform=$BUILDPLATFORM golang:1.18-buster AS build ARG TARGETOS ARG TARGETARCH diff --git a/README.md b/README.md index 2d0cc95..36491d7 100644 --- a/README.md +++ b/README.md @@ -381,7 +381,7 @@ velero install \ --use-volume-snapshots=false ``` -Additionally, you can specify `--use-restic` to enable restic support, and `--wait` to wait for the deployment to be ready. +Additionally, you can specify `--use-node-agent` to enable node agent support, and `--wait` to wait for the deployment to be ready. ### Optional installation steps 1. Specify [additional configurable parameters][7] for the `--backup-location-config` flag. diff --git a/go.mod b/go.mod index 4230ff2..b00417a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/vmware-tanzu/velero-plugin-for-microsoft-azure -go 1.17 +go 1.18 require ( github.com/Azure/azure-sdk-for-go v63.4.0+incompatible diff --git a/velero-plugin-for-microsoft-azure/volume_snapshotter.go b/velero-plugin-for-microsoft-azure/volume_snapshotter.go index fd2488a..9fb35db 100644 --- a/velero-plugin-for-microsoft-azure/volume_snapshotter.go +++ b/velero-plugin-for-microsoft-azure/volume_snapshotter.go @@ -86,11 +86,16 @@ func (b *VolumeSnapshotter) Init(config map[string]string) error { subscriptionIDConfigKey, snapsIncrementalConfigKey, snapsTagsConfigKey, + credentialsFileConfigKey, ); err != nil { return err } - if err := loadCredentialsIntoEnv(credentialsFileFromEnv()); err != nil { + credentialsFile, err := selectCredentialsFile(config) + if err != nil { + return err + } + if err := loadCredentialsIntoEnv(credentialsFile); err != nil { return err }