From ef0581d1e9e8227374b7d496a1c3bb19c79a1ae0 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Tue, 26 Jul 2016 13:42:53 -0400 Subject: [PATCH] kubectl container - Extract version better 1. Use --client since -c is deprecated now 2. The command (./kubectl version --client | grep -o 'GitVersion:"[^"]*"') now returns: GitVersion:"v1.4.0-alpha.1.784+ed3a29bd6aeb98-dirty" so parse out the version better using sed Related to #23708 --- examples/kubectl-container/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/kubectl-container/Makefile b/examples/kubectl-container/Makefile index 3383644f14c..e3b21a5b293 100644 --- a/examples/kubectl-container/Makefile +++ b/examples/kubectl-container/Makefile @@ -27,7 +27,7 @@ kubectl: cp ../../_output/local/bin/$(GOOS)/$(GOARCH)/kubectl . .tag: kubectl - ./kubectl version -c | grep -o 'GitVersion:"[^"]*"' | cut -f 2 -d '"' > .tag + ./kubectl version --client | grep -o 'GitVersion:"[^"]*"' | sed 's/[^"]*"\([^"+]*\).*/\1/' > .tag tag: .tag @echo "Suggest using TAG=$(shell cat .tag)"