Logo
Explore Help
Sign In
TheArchive/tailscale
1
0
Fork 0
You've already forked tailscale
mirror of https://github.com/tailscale/tailscale.git synced 2025-05-09 00:56:53 +00:00
Code Issues Packages Projects Releases Wiki Activity
tailscale/hostinfo/hostinfo_container_linux_test.go

17 lines
354 B
Go
Raw Normal View History

hostinfo,build_docker.sh,tailcfg: more reliably detect being in a container (#13826) Our existing container-detection tricks did not work on Kubernetes, where Docker is no longer used as a container runtime. Extends the existing go build tags for containers to the other container packages and uses that to reliably detect builds that were created by Tailscale for use in a container. Unfortunately this doesn't necessarily improve detection for users' custom builds, but that's a separate issue. Updates #13825 Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
2024-10-15 19:38:11 +01:00
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux && !android && ts_package_container
package hostinfo
import (
"testing"
)
func TestInContainer(t *testing.T) {
if got := inContainer(); !got.EqualBool(true) {
t.Errorf("inContainer = %v; want true due to ts_package_container build tag", got)
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.6 Page: 142ms Template: 5ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API