Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
583 changes: 0 additions & 583 deletions Gopkg.lock

This file was deleted.

32 changes: 0 additions & 32 deletions Gopkg.toml

This file was deleted.

31 changes: 20 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
# The binary to build (just the basename).
BIN ?= $(wildcard velero-*)

# This repo's root import path (under GOPATH).
# TODO(nrb): FIX IMPORT PATH
PKG ?= github.com/heptio/velero-csi-plugin

BUILD_IMAGE ?= golang:1.12-stretch
BUILD_IMAGE ?= golang:1.13-stretch

#TODO(nrb): FIX IMAGE PATH
IMAGE ?= gcr.io/heptio-images/velero-plugin-example
REGISTRY ?= velero
IMAGE_NAME ?= $(REGISTRY)/velero-plugin-for-csi
TAG ?= dev

IMAGE ?= $(IMAGE_NAME):$(TAG)

# Which architecture to build - see $(ALL_ARCH) for options.
# if the 'local' rule is being run, detect the ARCH from 'go env'
Expand All @@ -42,7 +42,6 @@ build-%:
local: build-dirs
GOOS=$(GOOS) \
GOARCH=$(GOARCH) \
PKG=$(PKG) \
BIN=$(BIN) \
OUTPUT_DIR=$$(pwd)/_output/bin/$(GOOS)/$(GOARCH) \
./hack/build.sh
Expand All @@ -57,7 +56,7 @@ _output/bin/$(GOOS)/$(GOARCH)/$(BIN): build-dirs
PKG=$(PKG) \
BIN=$(BIN) \
OUTPUT_DIR=/output/$(GOOS)/$(GOARCH) \
go build -v -o _output/bin/$(GOOS)/$(GOARCH)/$(BIN) ./$(BIN)'"
./hack/build.sh'"

TTY := $(shell tty -s && echo "-t")

Expand All @@ -72,11 +71,11 @@ shell: build-dirs
-v $$(pwd)/.go/pkg:/go/pkg \
-v $$(pwd)/.go/src:/go/src \
-v $$(pwd)/.go/std:/go/std \
-v $$(pwd):/go/src/$(PKG) \
-v $$(pwd):/go/src/velero-plugin-for-csi \
-v $$(pwd)/.go/std/$(GOOS)_$(GOARCH):/usr/local/go/pkg/$(GOOS)_$(GOARCH)_static \
-v "$$(pwd)/.go/go-build:/.cache/go-build:delegated" \
-e CGO_ENABLED=0 \
-w /go/src/$(PKG) \
-w /go/src/velero-plugin-for-csi \
$(BUILD_IMAGE) \
/bin/sh $(CMD)

Expand All @@ -90,13 +89,23 @@ container: all

all-ci: $(addprefix ci-, $(BIN))

.PHONY: modules
modules:
go mod tidy

.PHONY: verify-modules
verify-modules: modules
@if !(git diff --quiet HEAD -- go.sum go.mod); then \
echo "go module files are out of date, please commit the changes to go.mod and go.sum"; exit 1; \
fi

ci-%:
$(MAKE) --no-print-directory BIN=$* ci

test: build-dirs
@$(MAKE) shell CMD="-c 'go test -cover ./velero-csi-plugin'"

ci: all test
ci: verify-modules all test

clean:
@echo "cleaning"
Expand Down
21 changes: 21 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module github.com/vmware-tanzu/velero-plugin-for-csi

go 1.13

require (
cloud.google.com/go v0.40.0 // indirect
github.com/hashicorp/go-hclog v0.8.0 // indirect
github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/kubernetes-csi/external-snapshotter/v2 v2.0.1
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.4.0
github.com/spf13/cobra v0.0.3 // indirect
github.com/vmware-tanzu/velero v1.2.1-0.20200109194557-555e8ff2e35d
k8s.io/api v0.17.0
k8s.io/apimachinery v0.17.1-beta.0
k8s.io/client-go v0.17.0
)
365 changes: 365 additions & 0 deletions go.sum

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ set -o errexit
set -o nounset
set -o pipefail

if [ -z "${PKG}" ]; then
echo "PKG must be set"
exit 1
fi
if [ -z "${BIN}" ]; then
echo "BIN must be set"
exit 1
Expand All @@ -45,7 +41,9 @@ if [[ "${GOOS}" = "windows" ]]; then
OUTPUT="${OUTPUT}.exe"
fi

go mod download

go build \
-o ${OUTPUT} \
-installsuffix "static" \
${PKG}/${BIN}
./velero-csi-plugin
4 changes: 2 additions & 2 deletions velero-csi-plugin/csi_snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ limitations under the License.
package main

import (
snapshotv1beta1api "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1beta1"
snapshotter "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned"
snapshotv1beta1api "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1"
snapshotter "github.com/kubernetes-csi/external-snapshotter/v2/pkg/client/clientset/versioned"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

Expand Down
4 changes: 2 additions & 2 deletions velero-csi-plugin/volumesnapshot_restorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

"github.com/vmware-tanzu/velero/pkg/plugin/velero"
snapshotv1beta1api "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1beta1"
snapshotv1beta1api "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
)

// VSRestorer is a restore item action for VolumeSnapshots
Expand Down
4 changes: 2 additions & 2 deletions velero-csi-plugin/volumesnapshotcontents_restorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

"github.com/vmware-tanzu/velero/pkg/plugin/velero"
snapshotv1beta1api "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1beta1"
snapshotv1beta1api "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
)

// VSCRestorer is a restore item action plugin for Velero
Expand Down
202 changes: 0 additions & 202 deletions vendor/cloud.google.com/go/LICENSE

This file was deleted.

Loading