blob: 65bf523a2e45026e52978de2e2362636fb3c1775 [file] [log] [blame]
Serge Bazanskie23717d2020-11-03 20:08:23 +01001# Compatibility for version_x_defs from k8s.io/component-base & co.
2# This makes all the defs be autopopulated from //bzl:workspace-status.sh.
3
Serge Bazanskic3f36e92020-11-03 19:34:42 +01004def version_x_defs():
5 stamp_pkgs = [
6 "k8s.io/component-base/version",
7 "k8s.io/client-go/pkg/version",
8 ]
9
10 # This should match the list of vars in kube::version::ldflags
11 # It should also match the list of vars set in hack/print-workspace-status.sh.
12 stamp_vars = [
13 "buildDate",
14 "gitCommit",
15 "gitMajor",
16 "gitMinor",
17 "gitTreeState",
18 "gitVersion",
19 ]
20
21 # Generate the cross-product.
22 x_defs = {}
23 for pkg in stamp_pkgs:
24 for var in stamp_vars:
Serge Bazanskie23717d2020-11-03 20:08:23 +010025 x_defs["%s.%s" % (pkg, var)] = "{STABLE_KUBERNETES_%s}" % var
Serge Bazanskic3f36e92020-11-03 19:34:42 +010026 return x_defs