From 445b97da0e588cdbb16cea55c1e7a4ff91f49b5c Mon Sep 17 00:00:00 2001 From: Vladimir Stolyarov Date: Tue, 26 Sep 2017 17:25:06 +0300 Subject: [PATCH 1/3] Fix bug with quotes in volume mount prompt --- chlib/data.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chlib/data.go b/chlib/data.go index 562f1303..4b46dcee 100644 --- a/chlib/data.go +++ b/chlib/data.go @@ -65,5 +65,5 @@ var ( PortRegex = regexp.MustCompile(`^(\D+):(\d+)(:(\d+))?(:(TCP|UDP))?$`) PortNameRegex = LabelRegex VolumesRegex = regexp.MustCompile(`([^"]\S*|".+?")\s*`) - VolumeRegex = regexp.MustCompile(`^"?(` + nameRegex + `)(\/([^/][^\x00]+))?"?="?(\/[^\x00]+)"?$`) // format: "volumeLabel/subPath"="/mountPath" + VolumeRegex = regexp.MustCompile(`(?U)^"?(` + nameRegex + `)(/([^/][^\x00]+))?"?="?(/[^\x00]+)"?$`) // format: "volumeLabel/subPath"="/mountPath" ) \ No newline at end of file From 1d8a757a6f6cc959225f0540fcf328f5a3f2d5b7 Mon Sep 17 00:00:00 2001 From: Vladimir Stolyarov Date: Tue, 26 Sep 2017 17:26:20 +0300 Subject: [PATCH 2/3] Autodetect if user has permissions to run docker without sudo --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 387947df..1d1bb0a0 100644 --- a/Makefile +++ b/Makefile @@ -24,9 +24,16 @@ INSTDIR ?= ${DESTDIR}/${PREFIX}/bin AUTOCOMPDIR ?= ${DESTDIR}/${PREFIX}/share/bash-completion/completions AUTOCOMPFILE = ${AUTOCOMPDIR}/chkit.completion +have_docker_perm = $(shell docker images >/dev/null 2>/dev/null && echo 1) + +ifneq ($(have_docker_perm),1) +$(info You don`t have permissions to run docker, so run with sudo) +sudo=sudo +endif + define do_build @echo -e "\x1b[35mRun go build\x1b[0m" -@docker run --rm \ +@$(sudo) docker run --rm \ -v $(shell pwd)/${BUILDDIR}:/${BUILDDIR} \ -v $(shell pwd):/go/src/${PACKAGE} \ -e GOOS \ From 6b9333f582746f9316088625725cf1584d512d70 Mon Sep 17 00:00:00 2001 From: Vladimir Stolyarov Date: Tue, 26 Sep 2017 17:26:33 +0300 Subject: [PATCH 3/3] Update version to 2.1.2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1d1bb0a0..41639a24 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ COMMIT_HASH = `git rev-parse --short HEAD 2>/dev/null` BUILD_DATE = `date +%FT%T%Z` DEFAULT_TCP_SERVER = sdk.containerum.io:3000 DEFAULT_HTTP_SERVER = http://sdk.containerum.io:3333 -VERSION = 2.1.1 +VERSION = 2.1.2 REQLDFLAGS = -X ${PACKAGE}/chlib.CommitHash=${COMMIT_HASH} \ -X ${PACKAGE}/chlib.BuildDate=${BUILD_DATE} \ -X ${PACKAGE}/chlib/dbconfig.DefaultTCPServer=${DEFAULT_TCP_SERVER} \