From 86f07ed223d13f8be13a08c726ef65697683dc5c Mon Sep 17 00:00:00 2001 From: Andrew Cholakian Date: Wed, 31 Aug 2022 12:26:15 -0500 Subject: [PATCH] [heartbeat] disable browser code on windows via build tags (#32939) None of this is supported or works there, so we should just disable it. Fixes #32937 No release notes necessary since there are no user facing changes --- x-pack/heartbeat/import.go | 12 ++++++++++++ x-pack/heartbeat/main.go | 1 - x-pack/heartbeat/monitors/browser/browser.go | 2 ++ x-pack/heartbeat/monitors/browser/config.go | 3 +++ x-pack/heartbeat/monitors/browser/config_test.go | 2 ++ x-pack/heartbeat/monitors/browser/project.go | 2 ++ x-pack/heartbeat/monitors/browser/project_test.go | 2 ++ x-pack/heartbeat/monitors/browser/source/source.go | 2 ++ .../heartbeat/monitors/browser/source/source_test.go | 3 +++ .../heartbeat/monitors/browser/synthexec/enrich.go | 2 ++ .../monitors/browser/synthexec/enrich_test.go | 2 ++ .../monitors/browser/synthexec/execmultiplexer.go | 2 ++ .../browser/synthexec/execmultiplexer_test.go | 2 ++ .../monitors/browser/synthexec/synthexec.go | 2 ++ .../monitors/browser/synthexec/synthexec_linux.go | 2 ++ .../monitors/browser/synthexec/synthexec_test.go | 3 +++ .../monitors/browser/synthexec/synthtypes.go | 2 ++ .../monitors/browser/synthexec/synthtypes_test.go | 2 ++ .../monitors/browser/synthexec/testcmd/main.go | 3 +++ 19 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 x-pack/heartbeat/import.go diff --git a/x-pack/heartbeat/import.go b/x-pack/heartbeat/import.go new file mode 100644 index 00000000000..c23e267b6ce --- /dev/null +++ b/x-pack/heartbeat/import.go @@ -0,0 +1,12 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build linux || darwin +// +build linux darwin + +package main + +import ( + _ "github.com/elastic/beats/v7/x-pack/heartbeat/monitors/browser" +) diff --git a/x-pack/heartbeat/main.go b/x-pack/heartbeat/main.go index 4c0f220edf6..2cd061dff30 100644 --- a/x-pack/heartbeat/main.go +++ b/x-pack/heartbeat/main.go @@ -9,7 +9,6 @@ import ( _ "github.com/elastic/beats/v7/heartbeat/include" "github.com/elastic/beats/v7/x-pack/heartbeat/cmd" - _ "github.com/elastic/beats/v7/x-pack/heartbeat/monitors/browser" ) func main() { diff --git a/x-pack/heartbeat/monitors/browser/browser.go b/x-pack/heartbeat/monitors/browser/browser.go index 443b19642d2..a84422b4b82 100644 --- a/x-pack/heartbeat/monitors/browser/browser.go +++ b/x-pack/heartbeat/monitors/browser/browser.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package browser diff --git a/x-pack/heartbeat/monitors/browser/config.go b/x-pack/heartbeat/monitors/browser/config.go index f937a6ac813..0f0d1401ec4 100644 --- a/x-pack/heartbeat/monitors/browser/config.go +++ b/x-pack/heartbeat/monitors/browser/config.go @@ -2,6 +2,9 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin + package browser import ( diff --git a/x-pack/heartbeat/monitors/browser/config_test.go b/x-pack/heartbeat/monitors/browser/config_test.go index f1a8cab8565..460fc73bbe0 100644 --- a/x-pack/heartbeat/monitors/browser/config_test.go +++ b/x-pack/heartbeat/monitors/browser/config_test.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package browser diff --git a/x-pack/heartbeat/monitors/browser/project.go b/x-pack/heartbeat/monitors/browser/project.go index fbf6f055729..b7b37f0bb20 100644 --- a/x-pack/heartbeat/monitors/browser/project.go +++ b/x-pack/heartbeat/monitors/browser/project.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package browser diff --git a/x-pack/heartbeat/monitors/browser/project_test.go b/x-pack/heartbeat/monitors/browser/project_test.go index 8c1939f1536..9a89bdabcd7 100644 --- a/x-pack/heartbeat/monitors/browser/project_test.go +++ b/x-pack/heartbeat/monitors/browser/project_test.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package browser diff --git a/x-pack/heartbeat/monitors/browser/source/source.go b/x-pack/heartbeat/monitors/browser/source/source.go index adcc7b17159..b597a045885 100644 --- a/x-pack/heartbeat/monitors/browser/source/source.go +++ b/x-pack/heartbeat/monitors/browser/source/source.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package source diff --git a/x-pack/heartbeat/monitors/browser/source/source_test.go b/x-pack/heartbeat/monitors/browser/source/source_test.go index f8e9e687915..63e19adef78 100644 --- a/x-pack/heartbeat/monitors/browser/source/source_test.go +++ b/x-pack/heartbeat/monitors/browser/source/source_test.go @@ -2,6 +2,9 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin + package source import ( diff --git a/x-pack/heartbeat/monitors/browser/synthexec/enrich.go b/x-pack/heartbeat/monitors/browser/synthexec/enrich.go index 70165ca5480..6e98e26fba8 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/enrich.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/enrich.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package synthexec diff --git a/x-pack/heartbeat/monitors/browser/synthexec/enrich_test.go b/x-pack/heartbeat/monitors/browser/synthexec/enrich_test.go index 854e9c54ec4..9f8a47da3db 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/enrich_test.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/enrich_test.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package synthexec diff --git a/x-pack/heartbeat/monitors/browser/synthexec/execmultiplexer.go b/x-pack/heartbeat/monitors/browser/synthexec/execmultiplexer.go index 77d44846a4d..f37b966322f 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/execmultiplexer.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/execmultiplexer.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package synthexec diff --git a/x-pack/heartbeat/monitors/browser/synthexec/execmultiplexer_test.go b/x-pack/heartbeat/monitors/browser/synthexec/execmultiplexer_test.go index 2980a6da8ed..059423945e2 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/execmultiplexer_test.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/execmultiplexer_test.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package synthexec diff --git a/x-pack/heartbeat/monitors/browser/synthexec/synthexec.go b/x-pack/heartbeat/monitors/browser/synthexec/synthexec.go index 06681e60968..8ba0115ed28 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/synthexec.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/synthexec.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package synthexec diff --git a/x-pack/heartbeat/monitors/browser/synthexec/synthexec_linux.go b/x-pack/heartbeat/monitors/browser/synthexec/synthexec_linux.go index cc6d88f53f0..65843d72737 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/synthexec_linux.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/synthexec_linux.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package synthexec diff --git a/x-pack/heartbeat/monitors/browser/synthexec/synthexec_test.go b/x-pack/heartbeat/monitors/browser/synthexec/synthexec_test.go index 544b58fc2c8..3ff620e67be 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/synthexec_test.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/synthexec_test.go @@ -2,6 +2,9 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin + package synthexec import ( diff --git a/x-pack/heartbeat/monitors/browser/synthexec/synthtypes.go b/x-pack/heartbeat/monitors/browser/synthexec/synthtypes.go index 2619a6292d9..75ee7bed641 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/synthtypes.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/synthtypes.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package synthexec diff --git a/x-pack/heartbeat/monitors/browser/synthexec/synthtypes_test.go b/x-pack/heartbeat/monitors/browser/synthexec/synthtypes_test.go index ae88310fb3b..6a1e416e2be 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/synthtypes_test.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/synthtypes_test.go @@ -1,6 +1,8 @@ // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin package synthexec diff --git a/x-pack/heartbeat/monitors/browser/synthexec/testcmd/main.go b/x-pack/heartbeat/monitors/browser/synthexec/testcmd/main.go index f7799f6a8e2..4627e4edc20 100644 --- a/x-pack/heartbeat/monitors/browser/synthexec/testcmd/main.go +++ b/x-pack/heartbeat/monitors/browser/synthexec/testcmd/main.go @@ -2,6 +2,9 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build linux || darwin +// +build linux darwin + package main import (