mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Fix broken SELinux detection
The upgrade of dependencies in #78187 introduced a regression in detecting if SELinux is enabled or not. As the library requires the golang build tag `selinux` to be enabled after that version update. Fixes bug report #83679
This commit is contained in:
parent
50437b4c5d
commit
24d105995d
@ -16,6 +16,9 @@ build --workspace_status_command hack/print-workspace-status.sh
|
|||||||
# Make /tmp hermetic
|
# Make /tmp hermetic
|
||||||
build --sandbox_tmpfs_path=/tmp
|
build --sandbox_tmpfs_path=/tmp
|
||||||
|
|
||||||
|
# This tag is required to build github.com/opencontainers/selinux correctly
|
||||||
|
build --define gotags=selinux
|
||||||
|
|
||||||
# Ensure that Bazel never runs as root, which can cause unit tests to fail.
|
# Ensure that Bazel never runs as root, which can cause unit tests to fail.
|
||||||
# This flag requires Bazel 0.5.0+
|
# This flag requires Bazel 0.5.0+
|
||||||
build --sandbox_fake_username
|
build --sandbox_fake_username
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
# gazelle:exclude _output
|
# gazelle:exclude _output
|
||||||
# gazelle:exclude _tmp
|
# gazelle:exclude _tmp
|
||||||
|
|
||||||
|
# This tag is required to build github.com/opencontainers/selinux correctly
|
||||||
|
# gazelle:build_tags selinux
|
||||||
|
|
||||||
# gazelle:prefix k8s.io/kubernetes
|
# gazelle:prefix k8s.io/kubernetes
|
||||||
|
|
||||||
# Disable proto rules, since the Go sources are currently generated by
|
# Disable proto rules, since the Go sources are currently generated by
|
||||||
|
14
vendor/github.com/opencontainers/selinux/go-selinux/BUILD
generated
vendored
14
vendor/github.com/opencontainers/selinux/go-selinux/BUILD
generated
vendored
@ -2,10 +2,22 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
|||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
srcs = ["selinux_stub.go"],
|
srcs = [
|
||||||
|
"selinux_linux.go",
|
||||||
|
"xattrs.go",
|
||||||
|
],
|
||||||
importmap = "k8s.io/kubernetes/vendor/github.com/opencontainers/selinux/go-selinux",
|
importmap = "k8s.io/kubernetes/vendor/github.com/opencontainers/selinux/go-selinux",
|
||||||
importpath = "github.com/opencontainers/selinux/go-selinux",
|
importpath = "github.com/opencontainers/selinux/go-selinux",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
|
deps = select({
|
||||||
|
"@io_bazel_rules_go//go/platform:android": [
|
||||||
|
"//vendor/golang.org/x/sys/unix:go_default_library",
|
||||||
|
],
|
||||||
|
"@io_bazel_rules_go//go/platform:linux": [
|
||||||
|
"//vendor/golang.org/x/sys/unix:go_default_library",
|
||||||
|
],
|
||||||
|
"//conditions:default": [],
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
|
14
vendor/github.com/opencontainers/selinux/go-selinux/label/BUILD
generated
vendored
14
vendor/github.com/opencontainers/selinux/go-selinux/label/BUILD
generated
vendored
@ -2,10 +2,22 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
|||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
srcs = ["label.go"],
|
srcs = [
|
||||||
|
"label.go",
|
||||||
|
"label_selinux.go",
|
||||||
|
],
|
||||||
importmap = "k8s.io/kubernetes/vendor/github.com/opencontainers/selinux/go-selinux/label",
|
importmap = "k8s.io/kubernetes/vendor/github.com/opencontainers/selinux/go-selinux/label",
|
||||||
importpath = "github.com/opencontainers/selinux/go-selinux/label",
|
importpath = "github.com/opencontainers/selinux/go-selinux/label",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
|
deps = select({
|
||||||
|
"@io_bazel_rules_go//go/platform:android": [
|
||||||
|
"//vendor/github.com/opencontainers/selinux/go-selinux:go_default_library",
|
||||||
|
],
|
||||||
|
"@io_bazel_rules_go//go/platform:linux": [
|
||||||
|
"//vendor/github.com/opencontainers/selinux/go-selinux:go_default_library",
|
||||||
|
],
|
||||||
|
"//conditions:default": [],
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
|
Loading…
Reference in New Issue
Block a user