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

test: Add E2E test case for DynamicallyProvisionedCmdVolumeTest #77

Merged
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
  •  
  •  
  •  
37 changes: 0 additions & 37 deletions .github/workflows/e2e.yaml

This file was deleted.

40 changes: 32 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,41 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

CMDS=nfsplugin
DEPLOY_FOLDER = ./deploy/kubernetes
CMDS=nfsplugin
PKG = github.com/kubernetes-csi/csi-driver-nfs
GIT_COMMIT ?= $(shell git rev-parse HEAD)
IMAGE_VERSION ?= v0.5.0
LDFLAGS ?= "-X ${PKG}/pkg/nfs.driverVersion=${IMAGE_VERSION} -X -s -w -extldflags '-static'"
IMAGE_NAME ?= nfsplugin
# Use a custom version for E2E tests if we are testing in CI
ifdef CI
ifndef PUBLISH
override IMAGE_VERSION := e2e-$(GIT_COMMIT)
endif
endif
IMAGE_NAME = nfsplugin
REGISTRY ?= andyzhangx
REGISTRY_NAME = $(shell echo $(REGISTRY) | sed "s/.azurecr.io//g")
IMAGE_TAG = $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_VERSION)
GINKGO_FLAGS = -ginkgo.v
all: build
GO111MODULE = on
GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(GOPATH)/bin
DOCKER_CLI_EXPERIMENTAL = enabled
export GOPATH GOBIN GO111MODULE DOCKER_CLI_EXPERIMENTAL

LDFLAGS = "-X ${PKG}/pkg/nfs.driverVersion=${IMAGE_VERSION} -s -w -extldflags '-static'"

all: nfs

include release-tools/build.make

.PHONY: sanity-test
sanity-test: build
sanity-test: nfs
./test/sanity/run-test.sh

.PHONY: local-build-push
local-build-push: build
local-build-push: nfs
docker build -t $(LOCAL_USER)/nfsplugin:latest .
docker push $(LOCAL_USER)/nfsplugin

Expand All @@ -54,7 +69,15 @@ local-k8s-uninstall:

.PHONY: nfs
nfs:
CGO_ENABLED=0 GOOS=linux go build -a -ldflags ${LDFLAGS} -o _output/nfsplugin ./cmd/nfsplugin
CGO_ENABLED=0 GOOS=linux go build -a -ldflags ${LDFLAGS} -o bin/nfsplugin ./cmd/nfsplugin

.PHONY: container
container: nfs
docker build --no-cache -t $(IMAGE_TAG) .

.PHONY: push
push:
docker push $(IMAGE_TAG)

.PHONY: install-nfs-server
install-nfs-server:
Expand All @@ -66,7 +89,8 @@ install-helm:

.PHONY: e2e-bootstrap
e2e-bootstrap: install-helm
helm install -n csi-driver-nfs ./charts/csi-driver-nfs --namespace kube-system --wait --timeout=15m -v=5 --debug \
docker pull $(IMAGE_TAG) || make container push
helm install csi-driver-nfs ./charts/csi-driver-nfs --namespace kube-system --wait --timeout=15m -v=5 --debug \
--set image.nfs.repository=$(REGISTRY)/$(IMAGE_NAME) \
--set image.nfs.tag=$(IMAGE_VERSION)

Expand Down
6 changes: 3 additions & 3 deletions charts/csi-driver-nfs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ image:
nfs:
repository: quay.io/k8scsi/nfsplugin
tag: v2.0.0
pullPolicy: ifNotPresent
pullPolicy: IfNotPresent
csiProvisioner:
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-provisioner
tag: v1.4.0
pullPolicy: ifNotPresent
pullPolicy: IfNotPresent
livenessProbe:
repository: mcr.microsoft.com/oss/kubernetes-csi/livenessprobe
tag: v2.0.0
pullPolicy: ifNotPresent
pullPolicy: IfNotPresent
nodeDriverRegistrar:
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-node-driver-registrar
tag: v1.2.0
Expand Down
21 changes: 15 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@ module github.com/kubernetes-csi/csi-driver-nfs
go 1.13

require (
github.com/container-storage-interface/spec v1.2.0
github.com/container-storage-interface/spec v1.3.0
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/kubernetes-csi/csi-lib-utils v0.2.0
github.com/kubernetes-csi/csi-driver-smb v0.4.0
github.com/kubernetes-csi/csi-lib-utils v0.7.0
github.com/kubernetes-csi/external-snapshotter/v2 v2.0.0-20200617021606-4800ca72d403
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.7.0
github.com/onsi/gomega v1.7.1
github.com/pborman/uuid v1.2.0
github.com/spf13/cobra v0.0.5
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
golang.org/x/text v0.3.3 // indirect
google.golang.org/grpc v1.26.0
google.golang.org/grpc v1.28.0
k8s.io/api v0.18.1
k8s.io/apimachinery v0.18.2-beta.0
k8s.io/client-go v0.18.1
k8s.io/klog v1.0.0
k8s.io/kubernetes v1.18.0
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
k8s.io/utils v0.0.0-20200411171748-3d5a2fe318e4
)

replace k8s.io/api => k8s.io/api v0.18.0
Expand Down Expand Up @@ -61,3 +68,5 @@ replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.18.0
replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.18.0

replace k8s.io/sample-controller => k8s.io/sample-controller v0.18.0

replace google.golang.org/grpc => google.golang.org/grpc v1.26.0
Loading