Serge Bazanski | c3f36e9 | 2020-11-03 19:34:42 +0100 | [diff] [blame^] | 1 | def version_x_defs(): |
| 2 | stamp_pkgs = [ |
| 3 | "k8s.io/component-base/version", |
| 4 | "k8s.io/client-go/pkg/version", |
| 5 | ] |
| 6 | |
| 7 | # This should match the list of vars in kube::version::ldflags |
| 8 | # It should also match the list of vars set in hack/print-workspace-status.sh. |
| 9 | stamp_vars = [ |
| 10 | "buildDate", |
| 11 | "gitCommit", |
| 12 | "gitMajor", |
| 13 | "gitMinor", |
| 14 | "gitTreeState", |
| 15 | "gitVersion", |
| 16 | ] |
| 17 | |
| 18 | # Generate the cross-product. |
| 19 | x_defs = {} |
| 20 | for pkg in stamp_pkgs: |
| 21 | for var in stamp_vars: |
| 22 | x_defs["%s.%s" % (pkg, var)] = "{%s}" % var |
| 23 | return x_defs |