fixup! integration testing: add and validate build-time options for tailscale head

integration testing: comply with linter
This commit is contained in:
Csaba Sarkadi 2024-11-19 18:50:15 +01:00
parent 42994faf18
commit d6662d50e5

View file

@ -48,6 +48,10 @@ var (
errInvalidClientConfig = errors.New("verifiably invalid client config requested") errInvalidClientConfig = errors.New("verifiably invalid client config requested")
) )
const (
VersionHead = "head"
)
func errTailscaleStatus(hostname string, err error) error { func errTailscaleStatus(hostname string, err error) error {
return fmt.Errorf("%s failed to fetch tailscale status: %w", hostname, err) return fmt.Errorf("%s failed to fetch tailscale status: %w", hostname, err)
} }
@ -240,7 +244,7 @@ func New(
} }
if tsic.withWebsocketDERP { if tsic.withWebsocketDERP {
if version != "head" { if version != VersionHead {
return nil, errInvalidClientConfig return nil, errInvalidClientConfig
} }
@ -273,7 +277,7 @@ func New(
var container *dockertest.Resource var container *dockertest.Resource
if version != "head" { if version != VersionHead {
// build options are not meaningful with pre-existing images, // build options are not meaningful with pre-existing images,
// let's not lead anyone astray by pretending otherwise. // let's not lead anyone astray by pretending otherwise.
defaultBuildConfig := TailscaleInContainerBuildConfig{} defaultBuildConfig := TailscaleInContainerBuildConfig{}
@ -284,7 +288,7 @@ func New(
} }
switch version { switch version {
case "head": case VersionHead:
buildOptions := &dockertest.BuildOptions{ buildOptions := &dockertest.BuildOptions{
Dockerfile: "Dockerfile.tailscale-HEAD", Dockerfile: "Dockerfile.tailscale-HEAD",
ContextDir: dockerContextPath, ContextDir: dockerContextPath,