mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Merge pull request #87658 from dims/enable-selinux-tags-in-make-targets
Enable selinux tags in make targets
This commit is contained in:
commit
b7a1d61462
@ -700,6 +700,7 @@ kube::golang::build_binaries_for_platform() {
|
||||
-gcflags "${gogcflags:-}"
|
||||
-asmflags "${goasmflags:-}"
|
||||
-ldflags "${goldflags:-}"
|
||||
-tags "${gotags:-}"
|
||||
)
|
||||
CGO_ENABLED=0 kube::golang::build_some_binaries "${statics[@]}"
|
||||
fi
|
||||
@ -710,6 +711,7 @@ kube::golang::build_binaries_for_platform() {
|
||||
-gcflags "${gogcflags:-}"
|
||||
-asmflags "${goasmflags:-}"
|
||||
-ldflags "${goldflags:-}"
|
||||
-tags "${gotags:-}"
|
||||
)
|
||||
kube::golang::build_some_binaries "${nonstatics[@]}"
|
||||
fi
|
||||
@ -725,6 +727,7 @@ kube::golang::build_binaries_for_platform() {
|
||||
-gcflags "${gogcflags:-}" \
|
||||
-asmflags "${goasmflags:-}" \
|
||||
-ldflags "${goldflags:-}" \
|
||||
-tags "${gotags:-}" \
|
||||
-o "${outfile}" \
|
||||
"${testpkg}"
|
||||
done
|
||||
@ -776,7 +779,7 @@ kube::golang::build_binaries() {
|
||||
local host_platform
|
||||
host_platform=$(kube::golang::host_platform)
|
||||
|
||||
local goflags goldflags goasmflags gogcflags
|
||||
local goflags goldflags goasmflags gogcflags gotags
|
||||
# If GOLDFLAGS is unset, then set it to the a default of "-s -w".
|
||||
# Disable SC2153 for this, as it will throw a warning that the local
|
||||
# variable goldflags will exist, and it suggest changing it to this.
|
||||
@ -785,6 +788,10 @@ kube::golang::build_binaries() {
|
||||
goasmflags="-trimpath=${KUBE_ROOT}"
|
||||
gogcflags="${GOGCFLAGS:-} -trimpath=${KUBE_ROOT}"
|
||||
|
||||
# extract tags if any specified in GOFLAGS
|
||||
# shellcheck disable=SC2001
|
||||
gotags="selinux,$(echo "${GOFLAGS:-}" | sed -e 's|.*-tags=\([^-]*\).*|\1|')"
|
||||
|
||||
local -a targets=()
|
||||
local arg
|
||||
|
||||
|
@ -105,6 +105,9 @@ func newAnalyzer(platform string) *analyzer {
|
||||
ctx.BuildTags = append(ctx.BuildTags, tagsSplit...)
|
||||
}
|
||||
|
||||
// add selinux tag explicitly
|
||||
ctx.BuildTags = append(ctx.BuildTags, "selinux")
|
||||
|
||||
a := &analyzer{
|
||||
platform: platform,
|
||||
fset: token.NewFileSet(),
|
||||
|
Loading…
Reference in New Issue
Block a user