Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
64bd79fa
Commit
64bd79fa
authored
Jun 05, 2017
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert go_binary linkstamp to x_defs
parent
14e18893
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
73 additions
and
10 deletions
+73
-10
BUILD
cmd/cloud-controller-manager/BUILD
+2
-1
BUILD
cmd/hyperkube/BUILD
+2
-1
BUILD
cmd/kube-apiserver/BUILD
+2
-1
BUILD
cmd/kube-controller-manager/BUILD
+2
-1
BUILD
cmd/kube-proxy/BUILD
+2
-1
BUILD
cmd/kubeadm/BUILD
+2
-1
BUILD
cmd/kubectl/BUILD
+2
-1
BUILD
cmd/kubelet/BUILD
+2
-1
version.sh
hack/lib/version.sh
+3
-0
print-workspace-status.sh
hack/print-workspace-status.sh
+2
-0
def.bzl
pkg/version/def.bzl
+24
-0
BUILD
plugin/cmd/kube-scheduler/BUILD
+2
-1
def.bzl
staging/src/k8s.io/client-go/pkg/version/def.bzl
+24
-0
BUILD
staging/src/k8s.io/kube-aggregator/BUILD
+2
-1
No files found.
cmd/cloud-controller-manager/BUILD
View file @
64bd79fa
...
...
@@ -7,6 +7,7 @@ load(
"go_binary",
"go_library",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "cloud-controller-manager",
...
...
@@ -17,8 +18,8 @@ go_binary(
"-static",
],
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
x_defs = version_x_defs(),
)
go_library(
...
...
cmd/hyperkube/BUILD
View file @
64bd79fa
...
...
@@ -8,12 +8,13 @@ load(
"go_library",
"go_test",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "hyperkube",
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
x_defs = version_x_defs(),
)
go_test(
...
...
cmd/kube-apiserver/BUILD
View file @
64bd79fa
...
...
@@ -7,6 +7,7 @@ load(
"go_binary",
"go_library",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "kube-apiserver",
...
...
@@ -17,8 +18,8 @@ go_binary(
"-static",
],
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
x_defs = version_x_defs(),
)
go_library(
...
...
cmd/kube-controller-manager/BUILD
View file @
64bd79fa
...
...
@@ -7,6 +7,7 @@ load(
"go_binary",
"go_library",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "kube-controller-manager",
...
...
@@ -17,8 +18,8 @@ go_binary(
"-static",
],
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
x_defs = version_x_defs(),
)
go_library(
...
...
cmd/kube-proxy/BUILD
View file @
64bd79fa
...
...
@@ -7,6 +7,7 @@ load(
"go_binary",
"go_library",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "kube-proxy",
...
...
@@ -17,8 +18,8 @@ go_binary(
"-static",
],
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
x_defs = version_x_defs(),
)
go_library(
...
...
cmd/kubeadm/BUILD
View file @
64bd79fa
...
...
@@ -7,6 +7,7 @@ load(
"go_binary",
"go_library",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "kubeadm",
...
...
@@ -17,8 +18,8 @@ go_binary(
"-static",
],
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
x_defs = version_x_defs(),
)
go_library(
...
...
cmd/kubectl/BUILD
View file @
64bd79fa
...
...
@@ -5,6 +5,7 @@ load(
"go_binary",
"go_library",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "kubectl",
...
...
@@ -15,11 +16,11 @@ go_binary(
"-static",
],
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
visibility = [
"//build/visible_to:COMMON_release",
],
x_defs = version_x_defs(),
)
go_library(
...
...
cmd/kubelet/BUILD
View file @
64bd79fa
...
...
@@ -7,12 +7,13 @@ load(
"go_binary",
"go_library",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "kubelet",
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
x_defs = version_x_defs(),
)
go_library(
...
...
hack/lib/version.sh
View file @
64bd79fa
...
...
@@ -118,12 +118,15 @@ kube::version::ldflag() {
local
key
=
${
1
}
local
val
=
${
2
}
# If you update these, also update the list pkg/version/def.bzl.
echo
"-X
${
KUBE_GO_PACKAGE
}
/pkg/version.
${
key
}
=
${
val
}
"
echo
"-X
${
KUBE_GO_PACKAGE
}
/vendor/k8s.io/client-go/pkg/version.
${
key
}
=
${
val
}
"
}
# Prints the value that needs to be passed to the -ldflags parameter of go build
# in order to set the Kubernetes based on the git tree status.
# IMPORTANT: if you update any of these, also update the lists in
# pkg/version/def.bzl and hack/print-workspace-status.sh.
kube::version::ldflags
()
{
kube::version::get_version_vars
...
...
hack/print-workspace-status.sh
View file @
64bd79fa
...
...
@@ -29,6 +29,8 @@ kube::version::get_version_vars
# instead of volatile-status.txt.
# Stamped rules will be retriggered by changes to stable-status.txt, but not by
# changes to volatile-status.txt.
# IMPORTANT: the camelCase vars should match the lists in hack/lib/version.sh
# and pkg/version/def.bzl.
cat
<<
EOF
STABLE_BUILD_GIT_COMMIT
${
KUBE_GIT_COMMIT
-
}
STABLE_BUILD_SCM_STATUS
${
KUBE_GIT_TREE_STATE
-
}
...
...
pkg/version/def.bzl
0 → 100644
View file @
64bd79fa
# Implements hack/lib/version.sh's kube::version::ldflags() for Bazel.
def version_x_defs():
# This should match the list of packages in kube::version::ldflag
stamp_pkgs = [
"k8s.io/kubernetes/pkg/version",
# In hack/lib/version.sh, this has a vendor/ prefix. That isn't needed here?
"k8s.io/client-go/pkg/version",
]
# This should match the list of vars in kube::version::ldflags
# It should also match the list of vars set in hack/print-workspace-status.sh.
stamp_vars = [
"buildDate",
"gitCommit",
"gitMajor",
"gitMinor",
"gitTreeState",
"gitVersion",
]
# Generate the cross-product.
x_defs = {}
for pkg in stamp_pkgs:
for var in stamp_vars:
x_defs["%s.%s" % (pkg, var)] = "{%s}" % var
return x_defs
plugin/cmd/kube-scheduler/BUILD
View file @
64bd79fa
...
...
@@ -7,6 +7,7 @@ load(
"go_binary",
"go_library",
)
load("//pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "kube-scheduler",
...
...
@@ -17,8 +18,8 @@ go_binary(
"-static",
],
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
x_defs = version_x_defs(),
)
go_library(
...
...
staging/src/k8s.io/client-go/pkg/version/def.bzl
0 → 100644
View file @
64bd79fa
# Implements hack/lib/version.sh's kube::version::ldflags() for Bazel.
def version_x_defs():
# This should match the list of packages in kube::version::ldflag
stamp_pkgs = [
"k8s.io/kubernetes/pkg/version",
# In hack/lib/version.sh, this has a vendor/ prefix. That isn't needed here?
"k8s.io/client-go/pkg/version",
]
# This should match the list of vars in kube::version::ldflags
# It should also match the list of vars set in hack/print-workspace-status.sh.
stamp_vars = [
"buildDate",
"gitCommit",
"gitMajor",
"gitMinor",
"gitTreeState",
"gitVersion",
]
# Generate the cross-product.
x_defs = {}
for pkg in stamp_pkgs:
for var in stamp_vars:
x_defs["%s.%s" % (pkg, var)] = "{%s}" % var
return x_defs
staging/src/k8s.io/kube-aggregator/BUILD
View file @
64bd79fa
...
...
@@ -7,6 +7,7 @@ load(
"go_binary",
"go_library",
)
load("//vendor/k8s.io/client-go/pkg/version:def.bzl", "version_x_defs")
go_binary(
name = "kube-aggregator",
...
...
@@ -17,8 +18,8 @@ go_binary(
"-static",
],
library = ":go_default_library",
linkstamp = "k8s.io/kubernetes/pkg/version",
tags = ["automanaged"],
x_defs = version_x_defs(),
)
go_library(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment