Commit ef0581d1 authored by Davanum Srinivas's avatar Davanum Srinivas

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+ed3a29bd-dirty" so parse out the version better using sed Related to #23708
parent ed3a29bd
...@@ -27,7 +27,7 @@ kubectl: ...@@ -27,7 +27,7 @@ kubectl:
cp ../../_output/local/bin/$(GOOS)/$(GOARCH)/kubectl . cp ../../_output/local/bin/$(GOOS)/$(GOARCH)/kubectl .
.tag: 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 tag: .tag
@echo "Suggest using TAG=$(shell cat .tag)" @echo "Suggest using TAG=$(shell cat .tag)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment