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

Cherry pick of 1509 #1524

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ go:
- 1.10.4
install:
- go get -u github.com/vbatts/git-validation
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
- chmod +x kubectl
- mv kubectl ${GOPATH}/bin
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64
- chmod +x ./kind
- mv ./kind ${GOPATH}/bin
script:
- git-validation -run DCO,short-subject
- go fmt $(go list ./... | grep -v vendor) | wc -l | grep 0
- make docker-proto
- git diff $(find . -name "*.pb.*go" -o -name "api.swagger.json" | grep -v vendor) | wc -l | grep "^0"
- make sdk-check-version
- make install
- make vet
- git grep -rw GPL vendor | grep LICENSE | egrep -v "yaml.v2" | wc -l | grep "^0"
- make install verify
- bash hack/docker-integration-test.sh
- make docker-test
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
echo "${DOCKER_PASS}" | docker login -u "${DOCKER_USER}" --password-stdin;
make push-mock-sdk-server;
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export GO15VENDOREXPERIMENT=1
clean \
generate \
generate-mockfiles \
e2e \
verify \
sdk-check-version


Expand Down Expand Up @@ -159,7 +161,7 @@ build: packr
go build -tags "$(TAGS)" $(BUILDFLAGS) $(PKGS)

install: packr $(OSDSANITY)-install
go install -tags "$(TAGS)" $(PKGS)
go install -gcflags="all=-N -l" -tags "$(TAGS)" $(PKGS)
go install github.com/libopenstorage/openstorage/cmd/osd-token-generator

$(OSDSANITY):
Expand Down Expand Up @@ -416,3 +418,9 @@ mockgen:
mockgen -destination=api/mock/mock_volume.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageVolumeServer,OpenStorageVolumeClient
mockgen -destination=api/mock/mock_fstrim.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageFilesystemTrimServer,OpenStorageFilesystemTrimClient
mockgen -destination=api/mock/mock_fscheck.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageFilesystemCheckServer,OpenStorageFilesystemCheckClient
mockgen -destination=api/server/mock/mock_schedops_k8s.go -package=mock github.com/portworx/sched-ops/k8s/core Ops

e2e: docker-build-osd
cd test && ./run.bash

verify: vet sdk-check-version docker-test e2e
15 changes: 15 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,19 @@ const (
AutoAggregation = math.MaxUint32
)

// The main goal of the following label keys is for the Kubernetes intree middleware
// to keep track of the source location of the PVC with labels that cannot be modified
// by the owner of the volume, but only by the storage administrator.
const (
// KubernetesPvcNameKey is a label on the openstorage volume
// which tracks the source PVC for the volume.
KubernetesPvcNameKey = "openstorage.io/pvc-name"

// KubernetesPvcNamespaceKey is a label on the openstorage volume
// which tracks the source PVC namespace for the volume
KubernetesPvcNamespaceKey = "openstorage.io/pvc-namespace"
)

// Node describes the state of a node.
// It includes the current physical state (CPU, memory, storage, network usage) as
// well as the containers running on the system.
Expand Down Expand Up @@ -1204,4 +1217,6 @@ func (v *Volume) IsAttached() bool {
type TokenSecretContext struct {
SecretName string
SecretNamespace string
PvcName string
PvcNamespace string
}