Skip to content

Commit

Permalink
Merge pull request rexray#326 from codedellemc/master
Browse files Browse the repository at this point in the history
Update Release Branch for 0.3.3 by Merging Master Into It
  • Loading branch information
akutz committed Nov 9, 2016
2 parents 70c37bd + 159b773 commit bd98e08
Show file tree
Hide file tree
Showing 81 changed files with 362 additions and 230 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ script:
- make -j build
- make -j test
- VFS_INSTANCEID_USE_FIELDS=true ./drivers/storage/vfs/tests/vfs.test
- go clean -i ./client && go build ./client

after_success:
- make -j cover
Expand Down
49 changes: 41 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
SHELL := /bin/bash

ifeq (undefined,$(origin BUILD_TAGS))
BUILD_TAGS := gofig pflag libstorage_integration_driver_docker
endif

all:
# if docker is running, then let's use docker to build it
ifneq (,$(shell if docker version &> /dev/null; then echo -; fi))
Expand Down Expand Up @@ -82,7 +86,9 @@ else
@tar -C $(GOPATH)/src -c $(DTARC) $(DLOCAL_IMPORTS_FILES) | docker cp - $(DNAME):$(DPATH)/vendor
endif
endif
docker exec -t $(DNAME) env GOOS=$(DGOOS) GOARCH=$(DGOARCH) DOCKER=1 make -C $(DPATH) -j build
docker exec -t $(DNAME) \
env BUILD_TAGS="$(BUILD_TAGS)" GOOS=$(DGOOS) GOARCH=$(DGOARCH) DOCKER=1 \
make -C $(DPATH) -j build

docker-build: docker-init
@docker cp $(DNAME):$(DPROG1_PATH) $(DPROG1_NAME)
Expand All @@ -102,7 +108,9 @@ endif
docker-test: DGOOS=linux
docker-test: DTEST_ENV_VARS=TRAVIS=true LIBSTORAGE_DISABLE_STARTUP_INFO=true
docker-test: docker-init
docker exec -t $(DNAME) env $(DTEST_ENV_VARS) make -C $(DPATH) test
docker exec -t $(DNAME) \
env BUILD_TAGS="$(BUILD_TAGS)" $(DTEST_ENV_VARS) \
make -C $(DPATH) test

docker-clean:
-docker stop $(DNAME) &> /dev/null && docker rm $(DNAME) &> /dev/null
Expand Down Expand Up @@ -209,16 +217,16 @@ export PATH := $(GOPATH)/bin:$(PATH)
################################################################################

GO_LIST_BUILD_INFO_CMD := go list -f '{{with $$ip:=.}}{{with $$ctx:=context}}{{printf "%s %s %s %s %s 0,%s" $$ip.ImportPath $$ip.Name $$ip.Dir $$ctx.GOOS $$ctx.GOARCH (join $$ctx.BuildTags ",")}}{{end}}{{end}}'
ifneq (,$(BUILD_TAGS))
GO_LIST_BUILD_INFO_CMD += -tags "$(BUILD_TAGS)"
endif
BUILD_INFO := $(shell $(GO_LIST_BUILD_INFO_CMD))
ROOT_IMPORT_PATH := $(word 1,$(BUILD_INFO))
ROOT_IMPORT_PATH_NV := $(ROOT_IMPORT_PATH)
ROOT_IMPORT_NAME := $(word 2,$(BUILD_INFO))
ROOT_DIR := $(word 3,$(BUILD_INFO))
GOOS ?= $(word 4,$(BUILD_INFO))
GOARCH ?= $(word 5,$(BUILD_INFO))
BUILD_TAGS := $(word 6,$(BUILD_INFO))
BUILD_TAGS := $(subst $(COMMA), ,$(BUILD_TAGS))
BUILD_TAGS := $(wordlist 2,$(words $(BUILD_TAGS)),$(BUILD_TAGS))
VENDORED := 0
ifneq (,$(strip $(findstring vendor,$(ROOT_IMPORT_PATH))))
VENDORED := 1
Expand Down Expand Up @@ -262,7 +270,11 @@ endif
## PROJECT DETAIL ##
################################################################################

GO_LIST_IMPORT_PATHS_INFO_CMD := go list -f '{{with $$ip:=.}}{{if $$ip.ImportPath | le "$(ROOT_IMPORT_PATH)"}}{{if $$ip.ImportPath | gt "$(ROOT_IMPORT_PATH)/vendor" }}{{printf "%s;%s;%s;%s;%v;0,%s,%s,%s,%s;0,%s;0,%s;0,%s" $$ip.ImportPath $$ip.Name $$ip.Dir $$ip.Target $$ip.Stale (join $$ip.GoFiles ",") (join $$ip.CgoFiles ",") (join $$ip.CFiles ",") (join $$ip.HFiles ",") (join $$ip.TestGoFiles ",") (join $$ip.Imports ",") (join $$ip.TestImports ",")}};{{end}}{{end}}{{end}}' ./...
GO_LIST_IMPORT_PATHS_INFO_CMD := go list -f '{{with $$ip:=.}}{{if $$ip.ImportPath | le "$(ROOT_IMPORT_PATH)"}}{{if $$ip.ImportPath | gt "$(ROOT_IMPORT_PATH)/vendor" }}{{printf "%s;%s;%s;%s;%v;0,%s,%s,%s,%s;0,%s;0,%s;0,%s" $$ip.ImportPath $$ip.Name $$ip.Dir $$ip.Target $$ip.Stale (join $$ip.GoFiles ",") (join $$ip.CgoFiles ",") (join $$ip.CFiles ",") (join $$ip.HFiles ",") (join $$ip.TestGoFiles ",") (join $$ip.Imports ",") (join $$ip.TestImports ",")}};{{end}}{{end}}{{end}}'
ifneq (,$(BUILD_TAGS))
GO_LIST_IMPORT_PATHS_INFO_CMD += -tags "$(BUILD_TAGS)"
endif
GO_LIST_IMPORT_PATHS_INFO_CMD += ./...
IMPORT_PATH_INFO := $(shell $(GO_LIST_IMPORT_PATHS_INFO_CMD))

# this runtime ruleset acts as a pre-processor, processing the import path
Expand Down Expand Up @@ -376,6 +388,7 @@ ifeq (1,$(VENDORED))
endif
$(info Project Name................$(ROOT_IMPORT_NAME))
$(info OS / Arch...................$(GOOS)_$(GOARCH))
$(info Build Tags..................$(BUILD_TAGS))
$(info Vendored....................$(VENDORED))
$(info GOPATH......................$(GOPATH))
$(info GOHOSTOS....................$(GOHOSTOS))
Expand Down Expand Up @@ -707,7 +720,11 @@ $$(PKG_D_$1)-clean:
GO_CLEAN += $$(PKG_D_$1)-clean

$$(PKG_A_$1): $$(EXT_DEPS_SRCS_$1) $$(SRCS_$1) | $$(DEPS_ARKS_$1)
ifeq (,$$(BUILD_TAGS))
GOOS=$(GOOS) GOARCH=$(GOARCH) go install $1
else
GOOS=$(GOOS) GOARCH=$(GOARCH) go install -tags "$$(BUILD_TAGS)" $1
endif

ifeq (true,$$(STALE_$1))
GO_PHONY += $$(PKG_A_$1)
Expand Down Expand Up @@ -751,7 +768,12 @@ $$(PKG_TA_$1): $$(SRCS_$1)
endif

$$(PKG_TA_$1): $$(TEST_SRCS_$1) $$(TEST_EXT_DEPS_SRCS_$1) | $$(TEST_DEPS_ARKS_$1)
ifeq (,$$(BUILD_TAGS))
go test -cover -coverpkg '$$(TEST_COVERPKG_$1)' -c -o $$@ $1
else
go test -cover -coverpkg '$$(TEST_COVERPKG_$1)' -tags "$$(BUILD_TAGS)" -c -o $$@ $1
endif

$$(PKG_TA_$1)-clean:
rm -f $$(PKG_TA_$1)
GO_PHONY += $$(PKG_TA_$1)-clean
Expand Down Expand Up @@ -814,7 +836,7 @@ LSX_EMBEDDED_$2 := ./api/server/executors/bin/$$(notdir $1)

ifneq ($2,$$(GOOS))
$1:
env GOOS=$2 GOARCH=amd64 $$(MAKE) $$@
BUILD_TAGS="$$(BUILD_TAGS)" GOOS=$2 GOARCH=amd64 $$(MAKE) $$@
$1-clean:
rm -f $1
GO_PHONY += $1-clean
Expand Down Expand Up @@ -866,7 +888,11 @@ libstor-c: $(C_LIBSTOR_C_SO) $(C_LIBSTOR_C_BIN)

$(C_LIBSTOR_C_SO): $(EXT_DEPS_SRCS_./c/libstor-c) \
$(SRCS_./c/libstor-c) | $(DEPS_ARKS_./c/libstor-c)
ifeq (,$(BUILD_TAGS))
go build -buildmode=c-shared -o $@ $(C_LIBSTOR_C_DIR)
else
go build -tags "$(BUILD_TAGS)" -buildmode=c-shared -o $@ $(C_LIBSTOR_C_DIR)
endif

$(C_LIBSTOR_C_SO)-clean:
rm -f $(C_LIBSTOR_C_SO) $(basename $(C_LIBSTOR_C_SO).h)
Expand Down Expand Up @@ -897,7 +923,11 @@ libstor-s: $(C_LIBSTOR_S_BIN) $(C_LIBSTOR_S_SO)

$(C_LIBSTOR_S_SO): $(EXT_DEPS_SRCS_./c/libstor-s) \
$(SRCS_./c/libstor-s) | $(DEPS_ARKS_./c/libstor-s)
ifeq (,$(BUILD_TAGS))
go build -buildmode=c-shared -o $@ $(C_LIBSTOR_S_DIR)
else
go build -tags "$(BUILD_TAGS)" -buildmode=c-shared -o $@ $(C_LIBSTOR_S_DIR)
endif

$(C_LIBSTOR_S_SO)-clean:
rm -f $(C_LIBSTOR_S_SO) $(basename $(C_LIBSTOR_S_SO).h)
Expand Down Expand Up @@ -931,7 +961,7 @@ build-lss-windows: $(LSS_WINDOWS)
define LSS_RULES
ifneq ($2,$$(GOOS))
$1:
env GOOS=$2 GOARCH=amd64 $$(MAKE) $$@
BUILD_TAGS="$$(BUILD_TAGS)" GOOS=$2 GOARCH=amd64 $$(MAKE) $$@
$1-clean:
rm -f $1
GO_PHONY += $1-clean
Expand Down Expand Up @@ -1002,6 +1032,9 @@ build-generated:
$(MAKE) build-lsx
$(MAKE) $(API_GENERATED_SRC)

build-client-nogofig:
go build ./client

build:
$(MAKE) build-generated
$(MAKE) build-libstorage
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ coordinating requests between clients and backend orchestration packages. The
server's reference implementation is also written using Go.

## Model
The `libStorage` [model](http://libstorage.rtfd.org/en/latest/user-guide/model/)
The `libStorage` [model](http://docs.libstorage.apiary.io)
defines several data structures that are easily represented using Go structs or
a portable format such as JSON.

Expand Down
8 changes: 8 additions & 0 deletions api/registry/registry_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package registry

import (
gofig "github.com/akutz/gofig/types"
)

// NewConfig is a function that returns a new Config object.
var NewConfig func() gofig.Config
11 changes: 11 additions & 0 deletions api/registry/registry_config_gofig.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// +build gofig

package registry

import (
"github.com/akutz/gofig"
)

func init() {
NewConfig = gofig.New
}
4 changes: 2 additions & 2 deletions api/registry/registry_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sync"

log "github.com/Sirupsen/logrus"
"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/codedellemc/libstorage/api/context"
"github.com/codedellemc/libstorage/api/types"
Expand Down Expand Up @@ -60,7 +60,7 @@ func (d *idm) initPathCache(ctx types.Context) {
return
}

if _, ok := context.ServiceName(ctx); !ok {
if name, ok := context.ServiceName(ctx); !ok || name == "" {
ctx.Info("path cache initializion disabled; no service name in ctx")
return
}
Expand Down
3 changes: 2 additions & 1 deletion api/server/httputils/httputils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"net/http/httptest"
"time"

"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/codedellemc/libstorage/api/server/services"
"github.com/codedellemc/libstorage/api/types"
)
Expand Down
2 changes: 1 addition & 1 deletion api/server/router/executor/executor.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package executor

import (
"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/server/httputils"
Expand Down
2 changes: 1 addition & 1 deletion api/server/router/help/help.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package help

import (
"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/server/httputils"
Expand Down
2 changes: 1 addition & 1 deletion api/server/router/root/root.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package root

import (
"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/server/httputils"
Expand Down
2 changes: 1 addition & 1 deletion api/server/router/service/service.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package service

import (
"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/server/handlers"
Expand Down
2 changes: 1 addition & 1 deletion api/server/router/snapshot/snapshot.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package snapshot

import (
"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/server/handlers"
Expand Down
3 changes: 2 additions & 1 deletion api/server/router/tasks/tasks.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package tasks

import (
"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/server/httputils"
"github.com/codedellemc/libstorage/api/types"
Expand Down
2 changes: 1 addition & 1 deletion api/server/router/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package volume
import (
"net/http"

"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/server/handlers"
Expand Down
2 changes: 1 addition & 1 deletion api/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
gocontext "golang.org/x/net/context"

log "github.com/Sirupsen/logrus"
"github.com/akutz/gofig"

gofig "github.com/akutz/gofig/types"
"github.com/codedellemc/gournal"
glogrus "github.com/codedellemc/gournal/logrus"

Expand Down
2 changes: 1 addition & 1 deletion api/server/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"sync"

"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"
"github.com/akutz/goof"

"github.com/codedellemc/libstorage/api/context"
Expand Down
2 changes: 1 addition & 1 deletion api/server/services/services_storage.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package services

import (
"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"
"github.com/akutz/goof"

"github.com/codedellemc/libstorage/api/context"
Expand Down
3 changes: 2 additions & 1 deletion api/server/services/services_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (
"time"

log "github.com/Sirupsen/logrus"
"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/akutz/goof"

"github.com/codedellemc/libstorage/api/context"
Expand Down
6 changes: 4 additions & 2 deletions api/tests/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import (
"testing"

log "github.com/Sirupsen/logrus"
"github.com/akutz/gofig"
gofigCore "github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"

"github.com/akutz/goof"
"github.com/akutz/gotil"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -315,7 +317,7 @@ func getTestConfig(
configBuf []byte,
debug bool) gofig.Config {

config := gofig.New()
config := gofigCore.New()

if debug {
log.SetLevel(log.DebugLevel)
Expand Down
2 changes: 1 addition & 1 deletion api/tests/tests_executors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io/ioutil"
"testing"

"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"
"github.com/stretchr/testify/assert"

"github.com/codedellemc/libstorage/api/types"
Expand Down
2 changes: 1 addition & 1 deletion api/tests/tests_std.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"testing"

"github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"
"github.com/stretchr/testify/assert"

"github.com/codedellemc/libstorage/api/context"
Expand Down
6 changes: 4 additions & 2 deletions api/types/types_config_compat.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package types

import "github.com/akutz/gofig"
import log "github.com/Sirupsen/logrus"
import (
log "github.com/Sirupsen/logrus"
gofig "github.com/akutz/gofig/types"
)

const (
//ConfigOldRoot is a config key.
Expand Down
4 changes: 1 addition & 3 deletions api/types/types_drivers.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package types

import (
"github.com/akutz/gofig"
)
import gofig "github.com/akutz/gofig/types"

// Driver is the base interface for a libStorage driver.
type Driver interface {
Expand Down
4 changes: 1 addition & 3 deletions api/types/types_http_routes.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package types

import (
"github.com/akutz/gofig"
)
import gofig "github.com/akutz/gofig/types"

// Router defines an interface to specify a group of routes to add the the
// server.
Expand Down

0 comments on commit bd98e08

Please sign in to comment.