Skip to content

Commit 2147418

Browse files
Merge remote-tracking branch 'upstream/main' into service-monitoring
2 parents 0346c58 + 2b2e8d0 commit 2147418

File tree

15 files changed

+169
-333
lines changed

15 files changed

+169
-333
lines changed

NOTICE.txt

+30-30
Original file line numberDiff line numberDiff line change
@@ -2220,36 +2220,6 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-licenser@v0.
22202220
limitations under the License.
22212221

22222222

2223-
--------------------------------------------------------------------------------
2224-
Dependency : github.com/elastic/go-service
2225-
Version: v0.0.0-20240611154109-f44f756f194f
2226-
Licence type (autodetected): Zlib
2227-
--------------------------------------------------------------------------------
2228-
2229-
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-service@v0.0.0-20240611154109-f44f756f194f/LICENSE:
2230-
2231-
Copyright (c) 2015 Daniel Theophanes
2232-
2233-
This software is provided 'as-is', without any express or implied
2234-
warranty. In no event will the authors be held liable for any damages
2235-
arising from the use of this software.
2236-
2237-
Permission is granted to anyone to use this software for any purpose,
2238-
including commercial applications, and to alter it and redistribute it
2239-
freely, subject to the following restrictions:
2240-
2241-
1. The origin of this software must not be misrepresented; you must not
2242-
claim that you wrote the original software. If you use this software
2243-
in a product, an acknowledgment in the product documentation would be
2244-
appreciated but is not required.
2245-
2246-
2. Altered source versions must be plainly marked as such, and must not be
2247-
misrepresented as being the original software.
2248-
2249-
3. This notice may not be removed or altered from any source
2250-
distribution.
2251-
2252-
22532223
--------------------------------------------------------------------------------
22542224
Dependency : github.com/elastic/go-sysinfo
22552225
Version: v1.14.0
@@ -3812,6 +3782,36 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38123782
SOFTWARE.
38133783

38143784

3785+
--------------------------------------------------------------------------------
3786+
Dependency : github.com/kardianos/service
3787+
Version: v1.2.1-0.20210728001519-a323c3813bc7
3788+
Licence type (autodetected): Zlib
3789+
--------------------------------------------------------------------------------
3790+
3791+
Contents of probable licence file $GOMODCACHE/github.com/kardianos/service@v1.2.1-0.20210728001519-a323c3813bc7/LICENSE:
3792+
3793+
Copyright (c) 2015 Daniel Theophanes
3794+
3795+
This software is provided 'as-is', without any express or implied
3796+
warranty. In no event will the authors be held liable for any damages
3797+
arising from the use of this software.
3798+
3799+
Permission is granted to anyone to use this software for any purpose,
3800+
including commercial applications, and to alter it and redistribute it
3801+
freely, subject to the following restrictions:
3802+
3803+
1. The origin of this software must not be misrepresented; you must not
3804+
claim that you wrote the original software. If you use this software
3805+
in a product, an acknowledgment in the product documentation would be
3806+
appreciated but is not required.
3807+
3808+
2. Altered source versions must be plainly marked as such, and must not be
3809+
misrepresented as being the original software.
3810+
3811+
3. This notice may not be removed or altered from any source
3812+
distribution.
3813+
3814+
38153815
--------------------------------------------------------------------------------
38163816
Dependency : github.com/magefile/mage
38173817
Version: v1.15.0

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ require (
1919
github.com/elastic/elastic-transport-go/v8 v8.6.0
2020
github.com/elastic/go-elasticsearch/v8 v8.14.0
2121
github.com/elastic/go-licenser v0.4.1
22-
github.com/elastic/go-service v0.0.0-20240611154109-f44f756f194f
2322
github.com/elastic/go-sysinfo v1.14.0
2423
github.com/elastic/go-ucfg v0.8.8
2524
github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f
@@ -37,6 +36,7 @@ require (
3736
github.com/jedib0t/go-pretty/v6 v6.4.6
3837
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901
3938
github.com/josephspurrier/goversioninfo v0.0.0-20190209210621-63e6d1acd3dd
39+
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7
4040
github.com/magefile/mage v1.15.0
4141
github.com/mitchellh/gox v1.0.1
4242
github.com/mitchellh/hashstructure v1.1.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,6 @@ github.com/elastic/go-elasticsearch/v8 v8.14.0/go.mod h1:WRvnlGkSuZyp83M2U8El/LG
816816
github.com/elastic/go-licenser v0.3.1/go.mod h1:D8eNQk70FOCVBl3smCGQt/lv7meBeQno2eI1S5apiHQ=
817817
github.com/elastic/go-licenser v0.4.1 h1:1xDURsc8pL5zYT9R29425J3vkHdt4RT5TNEMeRN48x4=
818818
github.com/elastic/go-licenser v0.4.1/go.mod h1:V56wHMpmdURfibNBggaSBfqgPxyT1Tldns1i87iTEvU=
819-
github.com/elastic/go-service v0.0.0-20240611154109-f44f756f194f h1:kMtsJ3zfcBBR6wfbf5yUExmvWLru6R7zSLaJIfSjU3g=
820-
github.com/elastic/go-service v0.0.0-20240611154109-f44f756f194f/go.mod h1:3lVNFcuNMdWJrSpGF5SMPUVuC+qOYobfPIrMQUoizrk=
821819
github.com/elastic/go-structform v0.0.10 h1:oy08o/Ih2hHTkNcRY/1HhaYvIp5z6t8si8gnCJPDo1w=
822820
github.com/elastic/go-structform v0.0.10/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
823821
github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0=
@@ -1283,6 +1281,8 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV
12831281
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
12841282
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
12851283
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
1284+
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7 h1:oohm9Rk9JAxxmp2NLZa7Kebgz9h4+AJDcc64txg3dQ0=
1285+
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM=
12861286
github.com/karrick/godirwalk v1.15.6/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
12871287
github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw=
12881288
github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=

internal/pkg/agent/application/gateway/fleet/fleet_gateway.go

-4
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,6 @@ func (f *FleetGateway) execute(ctx context.Context) (*fleetapi.CheckinResponse,
329329
// convert components into checkin components structure
330330
components := f.convertToCheckinComponents(state.Components)
331331

332-
f.log.Debugf("correcting agent loglevel from %s to %s using coordinator state", ecsMeta.Elastic.Agent.LogLevel, state.LogLevel.String())
333-
// Fix loglevel with the current log level used by coordinator
334-
ecsMeta.Elastic.Agent.LogLevel = state.LogLevel.String()
335-
336332
// checkin
337333
cmd := fleetapi.NewCheckinCmd(f.agentInfo, f.client)
338334
req := &fleetapi.CheckinRequest{

internal/pkg/agent/application/info/agent_metadata_test.go

-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ func TestECSMetadata(t *testing.T) {
2929
metadata, err := agentInfo.ECSMetadata(l)
3030
require.NoError(t, err)
3131

32-
if assert.NotNil(t, metadata.Elastic, "metadata.Elastic must not be nil") {
33-
assert.NotNil(t, metadata.Elastic.Agent, "metadata.Elastic.Agent must not be nil")
34-
}
35-
3632
sysInfo, err := sysinfo.Host()
3733
require.NoError(t, err)
3834

internal/pkg/agent/application/upgrade/service_update_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"gopkg.in/ini.v1"
1414

15-
"github.com/elastic/go-service"
15+
"github.com/kardianos/service"
1616

1717
"github.com/elastic/elastic-agent/internal/pkg/agent/application/paths"
1818
)

internal/pkg/agent/install/install.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ import (
1313
"strings"
1414
"time"
1515

16-
"github.com/elastic/go-service"
17-
1816
"github.com/jaypipes/ghw"
17+
"github.com/kardianos/service"
1918
"github.com/otiai10/copy"
2019
"github.com/schollz/progressbar/v3"
2120

internal/pkg/agent/install/installed.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"os"
99
"path/filepath"
1010

11-
"github.com/elastic/go-service"
11+
"github.com/kardianos/service"
1212

1313
"github.com/elastic/elastic-agent/internal/pkg/agent/application/paths"
1414
"github.com/elastic/elastic-agent/internal/pkg/agent/install/pkgmgr"

internal/pkg/agent/install/svc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"path/filepath"
1010
"runtime"
1111

12-
"github.com/elastic/go-service"
12+
"github.com/kardianos/service"
1313

1414
"github.com/elastic/elastic-agent/internal/pkg/agent/application/paths"
1515
)

internal/pkg/agent/install/switch.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ package install
77
import (
88
"fmt"
99

10+
"github.com/kardianos/service"
1011
"github.com/schollz/progressbar/v3"
1112

12-
"github.com/elastic/go-service"
13-
1413
"github.com/elastic/elastic-agent/internal/pkg/agent/application/paths"
1514
"github.com/elastic/elastic-agent/internal/pkg/agent/perms"
1615
"github.com/elastic/elastic-agent/pkg/utils"

internal/pkg/agent/install/uninstall.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import (
1515
"strings"
1616
"time"
1717

18+
"github.com/kardianos/service"
1819
"github.com/schollz/progressbar/v3"
1920

20-
"github.com/elastic/go-service"
21-
2221
"github.com/elastic/elastic-agent-libs/logp"
2322
"github.com/elastic/elastic-agent/internal/pkg/agent/application/paths"
2423
"github.com/elastic/elastic-agent/internal/pkg/agent/application/secret"

pkg/component/runtime/service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"runtime"
1313
"time"
1414

15-
"github.com/elastic/go-service"
15+
"github.com/kardianos/service"
1616

1717
"github.com/elastic/elastic-agent-client/v7/pkg/client"
1818
"github.com/elastic/elastic-agent-client/v7/pkg/proto"

pkg/testing/fixture.go

-10
Original file line numberDiff line numberDiff line change
@@ -665,16 +665,6 @@ func (f *Fixture) PrepareAgentCommand(ctx context.Context, args []string, opts .
665665
return nil, fmt.Errorf("failed to prepare before exec: %w", err)
666666
}
667667

668-
// prepare a client if it's not already set
669-
if f.c == nil {
670-
cAddr, err := control.AddressFromPath(f.operatingSystem, f.workDir)
671-
if err != nil {
672-
return nil, fmt.Errorf("failed to get control protcol address: %w", err)
673-
}
674-
agentClient := client.New(client.WithAddress(cAddr))
675-
f.setClient(agentClient)
676-
}
677-
678668
// #nosec G204 -- Not so many ways to support variadic arguments to the elastic-agent command :(
679669
cmd := exec.CommandContext(ctx, f.binaryPath(), args...)
680670
for _, o := range opts {

0 commit comments

Comments
 (0)