mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-02 11:43:05 +00:00
fixup! integration testing: add and validate build-time options for tailscale head
integration testing: comply with linter
This commit is contained in:
parent
42994faf18
commit
d6662d50e5
1 changed files with 7 additions and 3 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue