Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
ksonnet
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ijaz Ahmad
ksonnet
Commits
957019af
Commit
957019af
authored
7 years ago
by
Angus Lees
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #73 from anguslees/version
Report client-go version in `version` subcommand
parents
d15f26f0
4d6290cf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.travis.yml
+18
-11
18 additions, 11 deletions
.travis.yml
Makefile
+2
-1
2 additions, 1 deletion
Makefile
cmd/version.go
+2
-0
2 additions, 0 deletions
cmd/version.go
with
22 additions
and
12 deletions
.travis.yml
+
18
−
11
View file @
957019af
language
:
go
go
:
-
1.7.x
-
1.8.x
-
1.7.x
os
:
-
linux
-
osx
env
:
global
:
-
VERSION="${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID}"
-
EXTRA_GO_FLAGS_TEST="-race"
# Frequent jsonnet_cgo crashes with xcode7.3 (default)
osx_image
:
xcode8.3
matrix
:
include
:
-
env
:
TARGET=x86_64-linux-musl
os
:
linux
-
env
:
TARGET=x86_64-linux-musl EXTRA_GO_FLAGS_TEST=""
go
:
1.8.x
exclude
:
# cgo requires golang >= 1.8.1 (or other workarounds) on recent
# osx/xcode - see https://github.com/golang/go/issues/19734
-
go
:
1.7.x
os
:
osx
# 'go test' also hangs repeatably on go-1.8.3/MacOS ?
-
os
:
osx
go
:
1.8.x
fast_finish
:
true
allow_failures
:
# Let us know if/when 'go test' works again on MacOS..
-
os
:
osx
go
:
1.8.x
addons
:
apt
:
...
...
@@ -68,9 +75,9 @@ install:
-
go build -i -ldflags "$GO_LDFLAGS" .
script
:
-
make VERSION=
${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID}
-
make
VERSION=${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID} tes
t
-
make VERSION=${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID} vet
-
make VERSION=
"$VERSION" EXTRA_GO_FLAGS="$EXTRA_GO_FLAGS_TEST" test
-
make
ve
t
-
rm -f ./kubecfg && make VERSION="$VERSION"
-
>
ldd ./kubecfg || otool -L ./kubecfg || :
-
./kubecfg help
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
2
−
1
View file @
957019af
...
...
@@ -16,7 +16,8 @@
VERSION
=
dev-
$(
shell
date
+%FT%T%z
)
GO
=
go
GO_FLAGS
=
-ldflags
=
"-X main.version=
$(
VERSION
)
$(
GO_LDFLAGS
)
"
EXTRA_GO_FLAGS
=
GO_FLAGS
=
-ldflags
=
"-X main.version=
$(
VERSION
)
$(
GO_LDFLAGS
)
"
$(
EXTRA_GO_FLAGS
)
GOFMT
=
gofmt
JSONNET_FILES
=
lib/kubecfg_test.jsonnet examples/guestbook.jsonnet
...
...
This diff is collapsed.
Click to expand it.
cmd/version.go
+
2
−
0
View file @
957019af
...
...
@@ -20,6 +20,7 @@ import (
"github.com/spf13/cobra"
jsonnet
"github.com/strickyak/jsonnet_cgo"
"k8s.io/client-go/pkg/version"
)
func
init
()
{
...
...
@@ -36,5 +37,6 @@ var versionCmd = &cobra.Command{
out
:=
cmd
.
OutOrStdout
()
fmt
.
Fprintln
(
out
,
"kubecfg version:"
,
Version
)
fmt
.
Fprintln
(
out
,
"jsonnet version:"
,
jsonnet
.
Version
())
fmt
.
Fprintln
(
out
,
"client-go version:"
,
version
.
Get
())
},
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment