Skip to content

Commit

Permalink
kubectl container - Extract version better
Browse files Browse the repository at this point in the history
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 kubernetes#23708
  • Loading branch information
dims committed Jul 26, 2016
1 parent ed3a29b commit ef0581d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/kubectl-container/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit ef0581d

Please sign in to comment.