diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 61b31810127..18455aad058 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -191,6 +191,7 @@ steps: matrix: setup: k8s_version: + - "1.29.0" - "1.28.0" - "1.27.3" - "1.26.6" diff --git a/.github/ISSUE_TEMPLATE/flaky-test.md b/.github/ISSUE_TEMPLATE/flaky-test.yml similarity index 84% rename from .github/ISSUE_TEMPLATE/flaky-test.md rename to .github/ISSUE_TEMPLATE/flaky-test.yml index 12867e88734..e6fe46060a3 100644 --- a/.github/ISSUE_TEMPLATE/flaky-test.md +++ b/.github/ISSUE_TEMPLATE/flaky-test.yml @@ -1,9 +1,8 @@ ---- name: "Flaky Test" -about: "Report a flaky test (one that doesn't pass consistently)" +description: "Report a flaky test (one that doesn't pass consistently)" title: "[Flaky Test]: " labels: ["Team:Elastic-Agent", "flaky-test"] -projects: ["elastic/1457"] +projects: ["elastic/979", "elastic/1457"] body: - type: markdown attributes: @@ -37,19 +36,18 @@ body: attributes: label: OS description: "On which OS the test is failing" - multiple: true - options: - - Linux - - Mac - - Windows - default: 0 + multiple: true + options: + - Linux + - Mac + - Windows + default: 0 validations: required: true - type: textarea attributes: label: "Stacktrace and notes" description: "Detailed output of the test failure and your notes about possible cause." - render: markdown + render: markdown validations: required: true ---- diff --git a/.gitignore b/.gitignore index b0c8ebec457..3ffafb6f0a5 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,4 @@ fleet.yml.lock fleet.yml.old pkg/component/fake/component/component pkg/component/fake/shipper/shipper +internal/pkg/agent/install/testblocking/testblocking diff --git a/NOTICE.txt b/NOTICE.txt index 2304265c99d..55d1a58baaf 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -933,11 +933,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-a -------------------------------------------------------------------------------- Dependency : github.com/elastic/elastic-agent-client/v7 -Version: v7.5.0 +Version: v7.8.0 Licence type (autodetected): Elastic -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-client/v7@v7.5.0/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-client/v7@v7.8.0/LICENSE.txt: ELASTIC LICENSE AGREEMENT @@ -1166,11 +1166,11 @@ SOFTWARE -------------------------------------------------------------------------------- Dependency : github.com/elastic/elastic-agent-libs -Version: v0.7.3 +Version: v0.7.4 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.7.3/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.7.4/LICENSE: Apache License Version 2.0, January 2004 @@ -3026,11 +3026,11 @@ Contents of probable licence file $GOMODCACHE/github.com/google/pprof@v0.0.0-202 -------------------------------------------------------------------------------- Dependency : github.com/google/uuid -Version: v1.4.0 +Version: v1.5.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/google/uuid@v1.4.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/google/uuid@v1.5.0/LICENSE: Copyright (c) 2009,2014 Google Inc. All rights reserved. @@ -4659,11 +4659,11 @@ Contents of probable licence file $GOMODCACHE/github.com/oklog/ulid@v1.3.1/LICEN -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -4870,11 +4870,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -5081,11 +5081,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -5292,11 +5292,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -5503,11 +5503,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -5856,11 +5856,11 @@ SOFTWARE. -------------------------------------------------------------------------------- Dependency : github.com/shirou/gopsutil/v3 -Version: v3.23.11 +Version: v3.23.12 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/shirou/gopsutil/v3@v3.23.11/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/shirou/gopsutil/v3@v3.23.12/LICENSE: gopsutil is distributed under BSD license reproduced below. @@ -7265,11 +7265,11 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/go-licence-detector@ -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/component -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/component@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/component@v0.92.0/LICENSE: Apache License @@ -7477,11 +7477,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/comp -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/confmap -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap@v0.92.0/LICENSE: Apache License @@ -7689,11 +7689,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/exporter -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter@v0.92.0/LICENSE: Apache License @@ -7901,11 +7901,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/expo -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/exporter/debugexporter -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter/debugexporter@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter/debugexporter@v0.92.0/LICENSE: Apache License @@ -8113,11 +8113,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/expo -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/exporter/otlpexporter -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter/otlpexporter@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter/otlpexporter@v0.92.0/LICENSE: Apache License @@ -8325,11 +8325,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/expo -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/otelcol -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/otelcol@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/otelcol@v0.92.0/LICENSE: Apache License @@ -8537,11 +8537,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/otel -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/processor -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor@v0.92.0/LICENSE: Apache License @@ -8749,11 +8749,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/proc -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/processor/batchprocessor -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor/batchprocessor@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor/batchprocessor@v0.92.0/LICENSE: Apache License @@ -8961,11 +8961,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/proc -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/processor/memorylimiterprocessor -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor/memorylimiterprocessor@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor/memorylimiterprocessor@v0.92.0/LICENSE: Apache License @@ -9173,11 +9173,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/proc -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/receiver -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/receiver@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/receiver@v0.92.0/LICENSE: Apache License @@ -9385,11 +9385,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/rece -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/receiver/otlpreceiver -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/receiver/otlpreceiver@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/receiver/otlpreceiver@v0.92.0/LICENSE: Apache License @@ -9626,11 +9626,11 @@ THE SOFTWARE. -------------------------------------------------------------------------------- Dependency : golang.org/x/crypto -Version: v0.17.0 +Version: v0.18.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/golang.org/x/crypto@v0.17.0/LICENSE: +Contents of probable licence file $GOMODCACHE/golang.org/x/crypto@v0.18.0/LICENSE: Copyright (c) 2009 The Go Authors. All rights reserved. @@ -9663,11 +9663,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : golang.org/x/exp -Version: v0.0.0-20231127185646-65229373498e +Version: v0.0.0-20240103183307-be819d1f06fc Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/golang.org/x/exp@v0.0.0-20231127185646-65229373498e/LICENSE: +Contents of probable licence file $GOMODCACHE/golang.org/x/exp@v0.0.0-20240103183307-be819d1f06fc/LICENSE: Copyright (c) 2009 The Go Authors. All rights reserved. @@ -9774,11 +9774,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : golang.org/x/sys -Version: v0.15.0 +Version: v0.16.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.15.0/LICENSE: +Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.16.0/LICENSE: Copyright (c) 2009 The Go Authors. All rights reserved. @@ -9811,11 +9811,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : golang.org/x/term -Version: v0.15.0 +Version: v0.16.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.15.0/LICENSE: +Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.16.0/LICENSE: Copyright (c) 2009 The Go Authors. All rights reserved. @@ -9996,11 +9996,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : google.golang.org/grpc -Version: v1.59.0 +Version: v1.60.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.59.0/LICENSE: +Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.60.1/LICENSE: Apache License @@ -10208,11 +10208,11 @@ Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.59.0/LIC -------------------------------------------------------------------------------- Dependency : google.golang.org/protobuf -Version: v1.31.0 +Version: v1.32.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/protobuf@v1.31.0/LICENSE: +Contents of probable licence file $GOMODCACHE/google.golang.org/protobuf@v1.32.0/LICENSE: Copyright (c) 2018 The Go Authors. All rights reserved. @@ -13955,11 +13955,11 @@ Contents of probable licence file $GOMODCACHE/github.com/docker/docker@v24.0.7+i -------------------------------------------------------------------------------- Dependency : github.com/docker/go-connections -Version: v0.4.0 +Version: v0.5.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/docker/go-connections@v0.4.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/docker/go-connections@v0.5.0/LICENSE: Apache License @@ -15105,15 +15105,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : github.com/expr-lang/expr -Version: v1.15.6 +Version: v1.15.8 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/expr-lang/expr@v1.15.6/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/expr-lang/expr@v1.15.8/LICENSE: MIT License -Copyright (c) 2019 Anton Medvedev +Copyright (c) 2018 Anton Medvedev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18811,6 +18811,380 @@ Exhibit B - “Incompatible With Secondary Licenses” Notice +-------------------------------------------------------------------------------- +Dependency : github.com/hashicorp/golang-lru/v2 +Version: v2.0.7 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/golang-lru/v2@v2.0.7/LICENSE: + +Copyright (c) 2014 HashiCorp, Inc. + +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the terms of + a Secondary License. + +1.6. "Executable Form" + + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a + separate file or files, that is not Covered Software. + +1.8. "License" + + means this document. + +1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether + at the time of the initial grant or subsequently, any and all of the + rights conveyed by this License. + +1.10. "Modifications" + + means any of the following: + + a. any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the License, + by the making, using, selling, offering for sale, having made, import, + or transfer of either its Contributions or its Contributor Version. + +1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution + become effective for each Contribution on the date the Contributor first + distributes such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under + this License. No additional rights or licenses will be implied from the + distribution or licensing of Covered Software under this License. + Notwithstanding Section 2.1(b) above, no patent license is granted by a + Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of + its Contributions. + + This License does not grant any rights in the trademarks, service marks, + or logos of any Contributor (except as may be necessary to comply with + the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this + License (see Section 10.2) or under the terms of a Secondary License (if + permitted under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its + Contributions are its original creation(s) or it has sufficient rights to + grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under + applicable copyright doctrines of fair use, fair dealing, or other + equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under + the terms of this License. You must inform recipients that the Source + Code Form of the Covered Software is governed by the terms of this + License, and how they can obtain a copy of this License. You may not + attempt to alter or restrict the recipients' rights in the Source Code + Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter the + recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for + the Covered Software. If the Larger Work is a combination of Covered + Software with a work governed by one or more Secondary Licenses, and the + Covered Software is not Incompatible With Secondary Licenses, this + License permits You to additionally distribute such Covered Software + under the terms of such Secondary License(s), so that the recipient of + the Larger Work may, at their option, further distribute the Covered + Software under the terms of either this License or such Secondary + License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices + (including copyright notices, patent notices, disclaimers of warranty, or + limitations of liability) contained within the Source Code Form of the + Covered Software, except that You may alter any license notices to the + extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on + behalf of any Contributor. You must make it absolutely clear that any + such warranty, support, indemnity, or liability obligation is offered by + You alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, + judicial order, or regulation then You must: (a) comply with the terms of + this License to the maximum extent possible; and (b) describe the + limitations and the code they affect. Such description must be placed in a + text file included with all distributions of the Covered Software under + this License. Except to the extent prohibited by statute or regulation, + such description must be sufficiently detailed for a recipient of ordinary + skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing + basis, if such Contributor fails to notify You of the non-compliance by + some reasonable means prior to 60 days after You have come back into + compliance. Moreover, Your grants from a particular Contributor are + reinstated on an ongoing basis if such Contributor notifies You of the + non-compliance by some reasonable means, this is the first time You have + received notice of non-compliance with this License from such + Contributor, and You become compliant prior to 30 days after Your receipt + of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, + counter-claims, and cross-claims) alleging that a Contributor Version + directly or indirectly infringes any patent, then the rights granted to + You by any and all Contributors for the Covered Software under Section + 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an "as is" basis, + without warranty of any kind, either expressed, implied, or statutory, + including, without limitation, warranties that the Covered Software is free + of defects, merchantable, fit for a particular purpose or non-infringing. + The entire risk as to the quality and performance of the Covered Software + is with You. Should any Covered Software prove defective in any respect, + You (not any Contributor) assume the cost of any necessary servicing, + repair, or correction. This disclaimer of warranty constitutes an essential + part of this License. No use of any Covered Software is authorized under + this License except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from + such party's negligence to the extent applicable law prohibits such + limitation. Some jurisdictions do not allow the exclusion or limitation of + incidental or consequential damages, so this exclusion and limitation may + not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts + of a jurisdiction where the defendant maintains its principal place of + business and such litigation shall be governed by laws of that + jurisdiction, without reference to its conflict-of-law provisions. Nothing + in this Section shall prevent a party's ability to bring cross-claims or + counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. Any law or regulation which provides that + the language of a contract shall be construed against the drafter shall not + be used to construe this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version + of the License under which You originally received the Covered Software, + or under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a + modified version of this License if you rename the license and remove + any references to the name of the license steward (except to note that + such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary + Licenses If You choose to distribute Source Code Form that is + Incompatible With Secondary Licenses under the terms of this version of + the License, the notice described in Exhibit B of this License must be + attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, +then You may include the notice in a location (such as a LICENSE file in a +relevant directory) where a recipient would be likely to look for such a +notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible + With Secondary Licenses", as defined by + the Mozilla Public License, v. 2.0. + + -------------------------------------------------------------------------------- Dependency : github.com/hexops/gotextdiff Version: v1.0.3 @@ -21895,11 +22269,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -22106,11 +22480,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/common -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/common@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/common@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -22317,11 +22691,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -22528,11 +22902,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -22739,11 +23113,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -22950,11 +23324,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -23161,11 +23535,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -23372,11 +23746,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -23583,11 +23957,11 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.92.0/LICENSE: Apache License Version 2.0, January 2004 @@ -24284,11 +24658,11 @@ SOFTWARE. -------------------------------------------------------------------------------- Dependency : github.com/prometheus/client_golang -Version: v1.17.0 +Version: v1.18.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/prometheus/client_golang@v1.17.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/prometheus/client_golang@v1.18.0/LICENSE: Apache License Version 2.0, January 2004 @@ -24917,11 +25291,11 @@ Contents of probable licence file $GOMODCACHE/github.com/prometheus/common@v0.45 -------------------------------------------------------------------------------- Dependency : github.com/prometheus/procfs -Version: v0.11.1 +Version: v0.12.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/prometheus/procfs@v0.11.1/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/prometheus/procfs@v0.12.0/LICENSE: Apache License Version 2.0, January 2004 @@ -27093,223 +27467,468 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmhttp@v -------------------------------------------------------------------------------- -Dependency : go.elastic.co/apm/module/apmhttp/v2 -Version: v2.0.0 -Licence type (autodetected): Apache-2.0 +Dependency : go.elastic.co/apm/module/apmhttp/v2 +Version: v2.0.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmhttp/v2@v2.0.0/LICENSE: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018 Elasticsearch BV + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +-------------------------------------------------------------------------------- +Dependency : go.elastic.co/apm/v2 +Version: v2.0.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/v2@v2.0.0/LICENSE: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018 Elasticsearch BV + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +-------------------------------------------------------------------------------- +Dependency : go.elastic.co/fastjson +Version: v1.1.0 +Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmhttp/v2@v2.0.0/LICENSE: - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. +Contents of probable licence file $GOMODCACHE/go.elastic.co/fastjson@v1.1.0/LICENSE: - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. +Copyright 2018 Elasticsearch BV - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - END OF TERMS AND CONDITIONS + http://www.apache.org/licenses/LICENSE-2.0 - APPENDIX: How to apply the Apache License to your work. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. +--- - Copyright 2018 Elasticsearch BV +Copyright (c) 2016 Mail.Ru Group - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - http://www.apache.org/licenses/LICENSE-2.0 +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- -Dependency : go.elastic.co/apm/v2 -Version: v2.0.0 +Dependency : go.opencensus.io +Version: v0.24.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/v2@v2.0.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opencensus.io@v0.24.0/LICENSE: + Apache License Version 2.0, January 2004 @@ -27499,7 +28118,7 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/v2@v2.0.0/LICENS same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2018 Elasticsearch BV + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -27513,47 +28132,13 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/v2@v2.0.0/LICENS See the License for the specific language governing permissions and limitations under the License. - --------------------------------------------------------------------------------- -Dependency : go.elastic.co/fastjson -Version: v1.1.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/go.elastic.co/fastjson@v1.1.0/LICENSE: - -Copyright 2018 Elasticsearch BV - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - ---- - -Copyright (c) 2016 Mail.Ru Group - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -------------------------------------------------------------------------------- -Dependency : go.opencensus.io -Version: v0.24.0 +Dependency : go.opentelemetry.io/collector +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opencensus.io@v0.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector@v0.92.0/LICENSE: Apache License @@ -27758,13 +28343,14 @@ Contents of probable licence file $GOMODCACHE/go.opencensus.io@v0.24.0/LICENSE: See the License for the specific language governing permissions and limitations under the License. + -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector -Version: v0.91.0 +Dependency : go.opentelemetry.io/collector/config/configauth +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configauth@v0.92.0/LICENSE: Apache License @@ -27971,12 +28557,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector@v0.9 -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configauth -Version: v0.91.0 +Dependency : go.opentelemetry.io/collector/config/configcompression +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configauth@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configcompression@v0.92.0/LICENSE: Apache License @@ -28183,12 +28769,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configcompression -Version: v0.91.0 +Dependency : go.opentelemetry.io/collector/config/configgrpc +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configcompression@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configgrpc@v0.92.0/LICENSE: Apache License @@ -28395,12 +28981,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configgrpc -Version: v0.91.0 +Dependency : go.opentelemetry.io/collector/config/confighttp +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configgrpc@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/confighttp@v0.92.0/LICENSE: Apache License @@ -28607,12 +29193,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/confighttp -Version: v0.91.0 +Dependency : go.opentelemetry.io/collector/config/confignet +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/confighttp@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/confignet@v0.92.0/LICENSE: Apache License @@ -28819,12 +29405,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/confignet -Version: v0.91.0 +Dependency : go.opentelemetry.io/collector/config/configopaque +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/confignet@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configopaque@v0.92.0/LICENSE: Apache License @@ -29031,12 +29617,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configopaque -Version: v0.91.0 +Dependency : go.opentelemetry.io/collector/config/configretry +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configopaque@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configretry@v0.92.0/LICENSE: Apache License @@ -29244,11 +29830,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/config/configtelemetry -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configtelemetry@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configtelemetry@v0.92.0/LICENSE: Apache License @@ -29456,11 +30042,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/config/configtls -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configtls@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configtls@v0.92.0/LICENSE: Apache License @@ -29668,11 +30254,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/config/internal -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/internal@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/internal@v0.92.0/LICENSE: Apache License @@ -29880,11 +30466,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/connector -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/connector@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/connector@v0.92.0/LICENSE: Apache License @@ -30092,11 +30678,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conn -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/consumer -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/consumer@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/consumer@v0.92.0/LICENSE: Apache License @@ -30304,11 +30890,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/cons -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/extension -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension@v0.92.0/LICENSE: Apache License @@ -30516,11 +31102,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exte -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/extension/auth -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension/auth@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension/auth@v0.92.0/LICENSE: Apache License @@ -30728,11 +31314,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exte -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/extension/zpagesextension -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension/zpagesextension@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension/zpagesextension@v0.92.0/LICENSE: Apache License @@ -30940,11 +31526,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exte -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/featuregate -Version: v1.0.0 +Version: v1.0.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/featuregate@v1.0.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/featuregate@v1.0.1/LICENSE: Apache License @@ -31152,11 +31738,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/feat -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/pdata -Version: v1.0.0 +Version: v1.0.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/pdata@v1.0.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/pdata@v1.0.1/LICENSE: Apache License @@ -31364,11 +31950,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/pdat -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/semconv -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semconv@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semconv@v0.92.0/LICENSE: Apache License @@ -31576,11 +32162,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semc -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/service -Version: v0.91.0 +Version: v0.92.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/service@v0.91.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/service@v0.92.0/LICENSE: Apache License @@ -36316,11 +36902,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : golang.org/x/net -Version: v0.19.0 +Version: v0.20.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/golang.org/x/net@v0.19.0/LICENSE: +Contents of probable licence file $GOMODCACHE/golang.org/x/net@v0.20.0/LICENSE: Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36353,11 +36939,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : golang.org/x/oauth2 -Version: v0.12.0 +Version: v0.13.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/golang.org/x/oauth2@v0.12.0/LICENSE: +Contents of probable licence file $GOMODCACHE/golang.org/x/oauth2@v0.13.0/LICENSE: Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36422,11 +37008,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : google.golang.org/appengine -Version: v1.6.7 +Version: v1.6.8 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/appengine@v1.6.7/LICENSE: +Contents of probable licence file $GOMODCACHE/google.golang.org/appengine@v1.6.8/LICENSE: Apache License @@ -36846,11 +37432,11 @@ Contents of probable licence file $GOMODCACHE/google.golang.org/genproto@v0.0.0- -------------------------------------------------------------------------------- Dependency : google.golang.org/genproto/googleapis/api -Version: v0.0.0-20230822172742-b8732ec3820d +Version: v0.0.0-20231002182017-d307bd883b97 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/genproto/googleapis/api@v0.0.0-20230822172742-b8732ec3820d/LICENSE: +Contents of probable licence file $GOMODCACHE/google.golang.org/genproto/googleapis/api@v0.0.0-20231002182017-d307bd883b97/LICENSE: Apache License diff --git a/changelog/fragments/1701975889-Fix-component-control-protocol-to-allow-checkin-to-be-chunked-across-multiple-messages.yaml b/changelog/fragments/1701975889-Fix-component-control-protocol-to-allow-checkin-to-be-chunked-across-multiple-messages.yaml new file mode 100644 index 00000000000..b3dde7a8933 --- /dev/null +++ b/changelog/fragments/1701975889-Fix-component-control-protocol-to-allow-checkin-to-be-chunked-across-multiple-messages.yaml @@ -0,0 +1,32 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: bug-fix + +# Change summary; a 80ish characters long description of the change. +summary: Fix component control protocol to allow checkin to be chunked across multiple messages + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +#description: + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +pr: https://github.com/elastic/elastic-agent/pull/3884 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +issue: https://github.com/elastic/elastic-agent/issues/2460 diff --git a/changelog/fragments/1704397113-Add-mTLS-flags-to-install-enroll.yaml b/changelog/fragments/1704397113-Add-mTLS-flags-to-install-enroll.yaml new file mode 100644 index 00000000000..bf182210db3 --- /dev/null +++ b/changelog/fragments/1704397113-Add-mTLS-flags-to-install-enroll.yaml @@ -0,0 +1,38 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: feature + +# Change summary; a 80ish characters long description of the change. +summary: Add mTLS flags to install/enroll + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +description: | + Add mTLS flags to the install/enroll commands to allow fleet-server to + use client certs when connecting to Elasticsearch, and to allow + elastic-agent to use client certs when connecting to fleet-server. + Fleet-server will use the CAs passed in `--certificate-authorities` to + validate any client certs. Agent client certs do not influence auth in + fleet-server, an enrollment token, or API key is still required. + +# Affected component; a word indicating the component this changeset affects. +component: + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +#pr: https://github.com/owner/repo/1234 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +#issue: https://github.com/owner/repo/1234 diff --git a/changelog/fragments/1704994055-add-error-statements.yaml b/changelog/fragments/1704994055-add-error-statements.yaml new file mode 100644 index 00000000000..0be47eb9359 --- /dev/null +++ b/changelog/fragments/1704994055-add-error-statements.yaml @@ -0,0 +1,32 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: enhancement + +# Change summary; a 80ish characters long description of the change. +summary: add error descriptors to inspect command, config methods + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +#description: + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: config + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +#pr: https://github.com/owner/repo/1234 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +#issue: https://github.com/owner/repo/1234 diff --git a/changelog/fragments/1705605734-fix-creation-of-directories-when-unpacking-tar.gz-packages.yaml b/changelog/fragments/1705605734-fix-creation-of-directories-when-unpacking-tar.gz-packages.yaml new file mode 100644 index 00000000000..1ea6577599d --- /dev/null +++ b/changelog/fragments/1705605734-fix-creation-of-directories-when-unpacking-tar.gz-packages.yaml @@ -0,0 +1,32 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: feature + +# Change summary; a 80ish characters long description of the change. +summary: fix creation of directories when unpacking tar.gz packages + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +#description: + +# Affected component; a word indicating the component this changeset affects. +component: elastic-agent + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +#pr: https://github.com/owner/repo/1234 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +#issue: https://github.com/owner/repo/1234 diff --git a/control_v2.proto b/control_v2.proto index de0785ada26..60a442d48ae 100644 --- a/control_v2.proto +++ b/control_v2.proto @@ -133,8 +133,7 @@ message ComponentUnitState { message ComponentVersionInfo { // Name of the component. string name = 1; - // Version of the component. - string version = 2; + // 2 reserved - used to be used for version of component. // Extra meta information about the version. map meta = 3; } diff --git a/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go b/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go index df35609de01..b0c93073bc9 100644 --- a/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go +++ b/dev-tools/cmd/buildfleetcfg/buildfleetcfg.go @@ -9,7 +9,6 @@ import ( "flag" "fmt" "go/format" - "io/ioutil" "os" "text/template" @@ -84,7 +83,7 @@ func main() { return } - ioutil.WriteFile(output, data, 0640) + os.WriteFile(output, data, 0640) return } diff --git a/dev-tools/licenses/license_generate.go b/dev-tools/licenses/license_generate.go index e451cddb356..dc5ec58f8ba 100644 --- a/dev-tools/licenses/license_generate.go +++ b/dev-tools/licenses/license_generate.go @@ -8,7 +8,6 @@ import ( "bytes" "flag" "go/format" - "io/ioutil" "os" "text/template" ) @@ -52,13 +51,13 @@ func init() { func main() { Headers := make(map[string]string) - content, err := ioutil.ReadFile("ELASTIC-LICENSE-header.txt") + content, err := os.ReadFile("ELASTIC-LICENSE-header.txt") if err != nil { panic("could not read Elastic license.") } Headers["Elastic"] = string(content) - content, err = ioutil.ReadFile("ELASTIC-LICENSE-2.0-header.txt") + content, err = os.ReadFile("ELASTIC-LICENSE-2.0-header.txt") if err != nil { panic("could not read Elastic License 2.0 license.") } @@ -78,6 +77,6 @@ func main() { if output == "-" { os.Stdout.Write(bs) } else { - ioutil.WriteFile(output, bs, 0640) + os.WriteFile(output, bs, 0640) } } diff --git a/dev-tools/mage/common.go b/dev-tools/mage/common.go index 80108357b89..e7f38f20289 100644 --- a/dev-tools/mage/common.go +++ b/dev-tools/mage/common.go @@ -19,7 +19,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "net/http" "os" @@ -118,7 +117,7 @@ func joinMaps(args ...map[string]interface{}) map[string]interface{} { } func expandFile(src, dst string, args ...map[string]interface{}) error { - tmplData, err := ioutil.ReadFile(src) + tmplData, err := os.ReadFile(src) if err != nil { return fmt.Errorf("failed reading from template %v, %w", src, err) } @@ -133,7 +132,7 @@ func expandFile(src, dst string, args ...map[string]interface{}) error { return err } - if err = ioutil.WriteFile(createDir(dst), []byte(output), 0644); err != nil { + if err = os.WriteFile(createDir(dst), []byte(output), 0644); err != nil { return fmt.Errorf("failed to write rendered template: %w", err) } @@ -236,13 +235,13 @@ func FindReplace(file string, re *regexp.Regexp, repl string) error { return err } - contents, err := ioutil.ReadFile(file) + contents, err := os.ReadFile(file) if err != nil { return err } out := re.ReplaceAllString(string(contents), repl) - return ioutil.WriteFile(file, []byte(out), info.Mode().Perm()) + return os.WriteFile(file, []byte(out), info.Mode().Perm()) } // MustFindReplace invokes FindReplace and panics if an error occurs. diff --git a/dev-tools/mage/config.go b/dev-tools/mage/config.go index 35cebcf759e..2c9763aa851 100644 --- a/dev-tools/mage/config.go +++ b/dev-tools/mage/config.go @@ -7,7 +7,6 @@ package mage import ( "bytes" "fmt" - "io/ioutil" "os" "path/filepath" "regexp" @@ -159,7 +158,7 @@ func makeConfigTemplate(destination string, mode os.FileMode, confParams ConfigF } } - data, err := ioutil.ReadFile(confFile.Template) + data, err := os.ReadFile(confFile.Template) if err != nil { return errors.Wrapf(err, "failed to read config template %q", confFile.Template) } diff --git a/dev-tools/mage/copy.go b/dev-tools/mage/copy.go index 4cb121fc2ad..f3daef703f3 100644 --- a/dev-tools/mage/copy.go +++ b/dev-tools/mage/copy.go @@ -5,8 +5,9 @@ package mage import ( + "fmt" "io" - "io/ioutil" + "io/fs" "os" "path/filepath" "regexp" @@ -41,7 +42,7 @@ func (t *CopyTask) Execute() error { return errors.Wrapf(err, "copy failed: cannot stat source file %v", t.Source) } - return errors.Wrap(t.recursiveCopy(t.Source, t.Dest, info), "copy failed") + return errors.Wrap(t.recursiveCopy(t.Source, t.Dest, fs.FileInfoToDirEntry(info)), "copy failed") } func (t *CopyTask) init() error { @@ -64,14 +65,14 @@ func (t *CopyTask) isExcluded(src string) bool { return false } -func (t *CopyTask) recursiveCopy(src, dest string, info os.FileInfo) error { - if info.IsDir() { - return t.dirCopy(src, dest, info) +func (t *CopyTask) recursiveCopy(src, dest string, entry fs.DirEntry) error { + if entry.IsDir() { + return t.dirCopy(src, dest, entry) } - return t.fileCopy(src, dest, info) + return t.fileCopy(src, dest, entry) } -func (t *CopyTask) fileCopy(src, dest string, info os.FileInfo) error { +func (t *CopyTask) fileCopy(src, dest string, entry fs.DirEntry) error { if t.isExcluded(src) { return nil } @@ -82,6 +83,11 @@ func (t *CopyTask) fileCopy(src, dest string, info os.FileInfo) error { } defer srcFile.Close() + info, err := entry.Info() + if err != nil { + return fmt.Errorf("converting dir entry: %w", err) + } + if !info.Mode().IsRegular() { return errors.Errorf("failed to copy source file because it is not a " + "regular file") @@ -104,28 +110,34 @@ func (t *CopyTask) fileCopy(src, dest string, info os.FileInfo) error { return destFile.Close() } -func (t *CopyTask) dirCopy(src, dest string, info os.FileInfo) error { +func (t *CopyTask) dirCopy(src, dest string, entry fs.DirEntry) error { if t.isExcluded(src) { return nil } + info, err := entry.Info() + if err != nil { + return fmt.Errorf("converting dir entry: %w", err) + } + mode := t.DirMode if mode == 0 { mode = info.Mode() } + if err := os.MkdirAll(dest, mode&os.ModePerm); err != nil { return errors.Wrap(err, "failed creating dirs") } - contents, err := ioutil.ReadDir(src) + contents, err := os.ReadDir(src) if err != nil { return errors.Wrapf(err, "failed to read dir %v", src) } - for _, info := range contents { + for _, entry := range contents { srcFile := filepath.Join(src, info.Name()) destFile := filepath.Join(dest, info.Name()) - if err = t.recursiveCopy(srcFile, destFile, info); err != nil { + if err = t.recursiveCopy(srcFile, destFile, entry); err != nil { return errors.Wrapf(err, "failed to copy %v to %v", srcFile, destFile) } } diff --git a/dev-tools/mage/gotest.go b/dev-tools/mage/gotest.go index 0583306e59a..3a99f2edd3d 100644 --- a/dev-tools/mage/gotest.go +++ b/dev-tools/mage/gotest.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "os" "os/exec" @@ -126,14 +125,14 @@ func DefaultTestBinaryArgs() TestBinaryArgs { // Use MODULE=module to run only tests for `module`. func GoTestIntegrationForModule(ctx context.Context) error { module := EnvOr("MODULE", "") - modulesFileInfo, err := ioutil.ReadDir("./module") + modulesDirEntry, err := os.ReadDir("./module") if err != nil { return err } foundModule := false failedModules := []string{} - for _, fi := range modulesFileInfo { + for _, fi := range modulesDirEntry { if !fi.IsDir() { continue } @@ -327,7 +326,7 @@ func GoTest(ctx context.Context, params GoTestArgs) error { codecovReport = strings.TrimSuffix(params.CoverageProfileFile, filepath.Ext(params.CoverageProfileFile)) + "-cov.xml" - coverage, err := ioutil.ReadFile(params.CoverageProfileFile) + coverage, err := os.ReadFile(params.CoverageProfileFile) if err != nil { return fmt.Errorf("failed to read code coverage report: %w", err) } @@ -364,7 +363,7 @@ func makeCommand(ctx context.Context, env map[string]string, cmd string, args .. for k, v := range env { c.Env = append(c.Env, k+"="+v) } - c.Stdout = ioutil.Discard + c.Stdout = io.Discard if mg.Verbose() { c.Stdout = os.Stdout } diff --git a/dev-tools/mage/gotool/go.go b/dev-tools/mage/gotool/go.go index 5cf5c684d8b..b784cf53299 100644 --- a/dev-tools/mage/gotool/go.go +++ b/dev-tools/mage/gotool/go.go @@ -45,12 +45,18 @@ var Test goTest = runGoTest // GetModuleName returns the name of the module. func GetModuleName() (string, error) { - lines, err := getLines(callGo(nil, "list", "-m")) + lines, err := getLines(callGo( + // Disabling the Go workspaces prevents 'go list' from listing all + // modules within the workspace. + map[string]string{"GOWORK": "off"}, + "list", + "-m")) if err != nil { return "", err } if len(lines) != 1 { - return "", fmt.Errorf("unexpected number of lines") + return "", fmt.Errorf("expected 'go list -m' to return 1 line, got %d", + len(lines)) } return lines[0], nil } diff --git a/dev-tools/mage/integtest_docker.go b/dev-tools/mage/integtest_docker.go index c08e5ba9b52..81c8716dcfc 100644 --- a/dev-tools/mage/integtest_docker.go +++ b/dev-tools/mage/integtest_docker.go @@ -7,7 +7,7 @@ package mage import ( "fmt" "go/build" - "io/ioutil" + "io" "os" "path" "path/filepath" @@ -138,14 +138,14 @@ func (d *DockerIntegrationTester) Test(dir string, mageTarget string, env map[st } // Docker-compose rm is noisy. So only pass through stderr when in verbose. - out := ioutil.Discard + out := io.Discard if mg.Verbose() { out = os.Stderr } _, err = sh.Exec( composeEnv, - ioutil.Discard, + io.Discard, out, "docker-compose", "-p", dockerComposeProjectName(), @@ -266,7 +266,7 @@ func dockerComposeBuildImages() error { args = append(args, "--pull") } - out := ioutil.Discard + out := io.Discard if mg.Verbose() { out = os.Stderr } diff --git a/dev-tools/mage/kubernetes/kind.go b/dev-tools/mage/kubernetes/kind.go index 7d8f0f47e52..957024e0e05 100644 --- a/dev-tools/mage/kubernetes/kind.go +++ b/dev-tools/mage/kubernetes/kind.go @@ -6,7 +6,7 @@ package kubernetes import ( "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -53,8 +53,8 @@ func (m *KindIntegrationTestStep) Setup(env map[string]string) error { } clusterName := kubernetesClusterName() - stdOut := ioutil.Discard - stdErr := ioutil.Discard + stdOut := io.Discard + stdErr := io.Discard if mg.Verbose() { stdOut = os.Stdout stdErr = os.Stderr @@ -103,8 +103,8 @@ func (m *KindIntegrationTestStep) Setup(env map[string]string) error { // Teardown destroys the kubernetes cluster. func (m *KindIntegrationTestStep) Teardown(env map[string]string) error { - stdOut := ioutil.Discard - stdErr := ioutil.Discard + stdOut := io.Discard + stdErr := io.Discard if mg.Verbose() { stdOut = os.Stdout stdErr = os.Stderr diff --git a/dev-tools/mage/kubernetes/kuberemote.go b/dev-tools/mage/kubernetes/kuberemote.go index 8f027820971..4c6ad6fdcdf 100644 --- a/dev-tools/mage/kubernetes/kuberemote.go +++ b/dev-tools/mage/kubernetes/kuberemote.go @@ -14,10 +14,10 @@ import ( "encoding/pem" "fmt" "io" - "io/ioutil" "net" "net/http" "net/url" + "os" "os/exec" "strings" "time" @@ -610,7 +610,7 @@ func podDone(event watch.Event) (bool, error) { func createTempFile(content []byte) (string, error) { randBytes := make([]byte, 16) rand.Read(randBytes) - tmpfile, err := ioutil.TempFile("", hex.EncodeToString(randBytes)) + tmpfile, err := os.CreateTemp("", hex.EncodeToString(randBytes)) if err != nil { return "", err } diff --git a/dev-tools/mage/kubernetes/kubernetes.go b/dev-tools/mage/kubernetes/kubernetes.go index fc0feea6fab..f8a6f7c8a0a 100644 --- a/dev-tools/mage/kubernetes/kubernetes.go +++ b/dev-tools/mage/kubernetes/kubernetes.go @@ -7,7 +7,6 @@ package kubernetes import ( "fmt" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -58,8 +57,8 @@ func (d *IntegrationTester) StepRequirements() mage.IntegrationTestSteps { // Test performs the tests with kubernetes. func (d *IntegrationTester) Test(dir string, mageTarget string, env map[string]string) error { - stdOut := ioutil.Discard - stdErr := ioutil.Discard + stdOut := io.Discard + stdErr := io.Discard if mg.Verbose() { stdOut = os.Stdout stdErr = os.Stderr diff --git a/dev-tools/mage/pkgspecs.go b/dev-tools/mage/pkgspecs.go index e03a6ff303b..c3450c8525f 100644 --- a/dev-tools/mage/pkgspecs.go +++ b/dev-tools/mage/pkgspecs.go @@ -7,8 +7,8 @@ package mage import ( "bytes" "fmt" - "io/ioutil" "log" + "os" "path/filepath" "gopkg.in/yaml.v2" @@ -138,7 +138,7 @@ func LoadNamedSpec(name string, files ...string) error { func LoadSpecs(files ...string) (map[string][]OSPackageArgs, error) { var data [][]byte for _, file := range files { - d, err := ioutil.ReadFile(file) + d, err := os.ReadFile(file) if err != nil { return nil, fmt.Errorf("failed to read from spec file: %w", err) } diff --git a/dev-tools/mage/pkgtypes.go b/dev-tools/mage/pkgtypes.go index 0d63efbef95..e446c90b47a 100644 --- a/dev-tools/mage/pkgtypes.go +++ b/dev-tools/mage/pkgtypes.go @@ -11,7 +11,6 @@ import ( "compress/gzip" "fmt" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -434,7 +433,7 @@ func (s PackageSpec) Evaluate(args ...map[string]interface{}) PackageSpec { } f.Source = filepath.Join(s.packageDir, filepath.Base(f.Target)) - if err = ioutil.WriteFile(CreateDir(f.Source), []byte(content), 0644); err != nil { + if err = os.WriteFile(CreateDir(f.Source), []byte(content), 0644); err != nil { panic(fmt.Errorf("failed to write file containing content for target=%v: %w", target, err)) } case f.Template != "": @@ -575,7 +574,7 @@ func PackageZip(spec PackageSpec) error { spec.OutputFile = Zip.AddFileExtension(spec.OutputFile) // Write the zip file. - if err := ioutil.WriteFile(CreateDir(spec.OutputFile), buf.Bytes(), 0644); err != nil { + if err := os.WriteFile(CreateDir(spec.OutputFile), buf.Bytes(), 0644); err != nil { return fmt.Errorf("failed to write zip file: %w", err) } @@ -638,7 +637,7 @@ func PackageTarGz(spec PackageSpec) error { continue } - tmpdir, err := ioutil.TempDir("", "TmpSymlinkDropPath") + tmpdir, err := os.MkdirTemp("", "TmpSymlinkDropPath") if err != nil { return err } diff --git a/dev-tools/mage/settings.go b/dev-tools/mage/settings.go index d4c6081e597..cb033312c36 100644 --- a/dev-tools/mage/settings.go +++ b/dev-tools/mage/settings.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "go/build" - "io/ioutil" "log" "os" "path/filepath" @@ -516,7 +515,7 @@ func (s *BuildVariableSources) GetBeatVersion() (string, error) { return "", err } - data, err := ioutil.ReadFile(file) + data, err := os.ReadFile(file) if err != nil { return "", fmt.Errorf("failed to read beat version file=%v: %w", file, err) } @@ -534,7 +533,7 @@ func (s *BuildVariableSources) GetGoVersion() (string, error) { return "", err } - data, err := ioutil.ReadFile(file) + data, err := os.ReadFile(file) if err != nil { return "", fmt.Errorf("failed to read go version file=%v: %w", file, err) } @@ -552,7 +551,7 @@ func (s *BuildVariableSources) GetDocBranch() (string, error) { return "", err } - data, err := ioutil.ReadFile(file) + data, err := os.ReadFile(file) if err != nil { return "", fmt.Errorf("failed to read doc branch file=%v: %w", file, err) } diff --git a/go.mod b/go.mod index d66892ad905..c539d5a4dd5 100644 --- a/go.mod +++ b/go.mod @@ -13,8 +13,8 @@ require ( github.com/dolmen-go/contextio v0.0.0-20200217195037-68fc5150bcd5 github.com/elastic/e2e-testing v1.1.0 github.com/elastic/elastic-agent-autodiscover v0.6.6 - github.com/elastic/elastic-agent-client/v7 v7.5.0 - github.com/elastic/elastic-agent-libs v0.7.3 + github.com/elastic/elastic-agent-client/v7 v7.8.0 + github.com/elastic/elastic-agent-libs v0.7.4 github.com/elastic/elastic-agent-system-metrics v0.9.1 github.com/elastic/elastic-transport-go/v8 v8.3.0 github.com/elastic/go-elasticsearch/v8 v8.11.0 @@ -27,7 +27,7 @@ require ( github.com/gofrs/uuid v4.4.0+incompatible github.com/google/go-cmp v0.6.0 github.com/google/pprof v0.0.0-20230426061923-93006964c1fc - github.com/google/uuid v1.4.0 + github.com/google/uuid v1.5.0 github.com/gorilla/mux v1.8.0 github.com/hashicorp/go-multierror v1.1.1 github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 @@ -41,17 +41,17 @@ require ( github.com/mitchellh/hashstructure v1.1.0 github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 github.com/oklog/ulid v1.3.1 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.91.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.91.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.91.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.91.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.91.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.92.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.92.0 github.com/otiai10/copy v1.14.0 github.com/pierrre/gotestcover v0.0.0-20160517101806-924dca7d15f0 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.27.0 github.com/schollz/progressbar/v3 v3.13.1 - github.com/shirou/gopsutil/v3 v3.23.11 + github.com/shirou/gopsutil/v3 v3.23.12 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 @@ -59,30 +59,30 @@ require ( go.elastic.co/apm/module/apmgorilla v1.15.0 go.elastic.co/ecszap v1.0.1 go.elastic.co/go-licence-detector v0.5.0 - go.opentelemetry.io/collector/component v0.91.0 - go.opentelemetry.io/collector/confmap v0.91.0 - go.opentelemetry.io/collector/exporter v0.91.0 - go.opentelemetry.io/collector/exporter/debugexporter v0.91.0 - go.opentelemetry.io/collector/exporter/otlpexporter v0.91.0 - go.opentelemetry.io/collector/otelcol v0.91.0 - go.opentelemetry.io/collector/processor v0.91.0 - go.opentelemetry.io/collector/processor/batchprocessor v0.91.0 - go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.91.0 - go.opentelemetry.io/collector/receiver v0.91.0 - go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 + go.opentelemetry.io/collector/component v0.92.0 + go.opentelemetry.io/collector/confmap v0.92.0 + go.opentelemetry.io/collector/exporter v0.92.0 + go.opentelemetry.io/collector/exporter/debugexporter v0.92.0 + go.opentelemetry.io/collector/exporter/otlpexporter v0.92.0 + go.opentelemetry.io/collector/otelcol v0.92.0 + go.opentelemetry.io/collector/processor v0.92.0 + go.opentelemetry.io/collector/processor/batchprocessor v0.92.0 + go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.92.0 + go.opentelemetry.io/collector/receiver v0.92.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.92.0 go.uber.org/zap v1.26.0 - golang.org/x/crypto v0.17.0 - golang.org/x/exp v0.0.0-20231127185646-65229373498e + golang.org/x/crypto v0.18.0 + golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 golang.org/x/sync v0.5.0 - golang.org/x/sys v0.15.0 - golang.org/x/term v0.15.0 + golang.org/x/sys v0.16.0 + golang.org/x/term v0.16.0 golang.org/x/text v0.14.0 golang.org/x/time v0.3.0 golang.org/x/tools v0.16.0 golang.org/x/tools/go/vcs v0.1.0-deprecated - google.golang.org/grpc v1.59.0 - google.golang.org/protobuf v1.31.0 + google.golang.org/grpc v1.60.1 + google.golang.org/protobuf v1.32.0 gopkg.in/ini.v1 v1.67.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 @@ -110,13 +110,13 @@ require ( github.com/dnephin/pflag v1.0.7 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker v24.0.7+incompatible // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-connections v0.5.0 // indirect github.com/elastic/go-structform v0.0.10 // indirect github.com/elastic/go-windows v1.0.1 // indirect github.com/elastic/gosigar v0.14.2 // indirect github.com/emicklei/go-restful/v3 v3.10.1 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/expr-lang/expr v1.15.6 // indirect + github.com/expr-lang/expr v1.15.8 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-kit/log v0.2.1 // indirect @@ -139,6 +139,7 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -170,20 +171,20 @@ require ( github.com/mostynb/go-grpc-compression v1.2.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/onsi/ginkgo/v2 v2.9.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.91.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.91.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.91.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.92.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.92.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rs/cors v1.10.1 // indirect @@ -202,24 +203,25 @@ require ( go.elastic.co/apm/v2 v2.0.0 // indirect go.elastic.co/fastjson v1.1.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/collector v0.91.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.91.0 // indirect - go.opentelemetry.io/collector/config/configcompression v0.91.0 // indirect - go.opentelemetry.io/collector/config/configgrpc v0.91.0 // indirect - go.opentelemetry.io/collector/config/confighttp v0.91.0 // indirect - go.opentelemetry.io/collector/config/confignet v0.91.0 // indirect - go.opentelemetry.io/collector/config/configopaque v0.91.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect - go.opentelemetry.io/collector/config/configtls v0.91.0 // indirect - go.opentelemetry.io/collector/config/internal v0.91.0 // indirect - go.opentelemetry.io/collector/connector v0.91.0 // indirect - go.opentelemetry.io/collector/consumer v0.91.0 // indirect - go.opentelemetry.io/collector/extension v0.91.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.91.0 // indirect - go.opentelemetry.io/collector/featuregate v1.0.0 // indirect - go.opentelemetry.io/collector/pdata v1.0.0 // indirect - go.opentelemetry.io/collector/semconv v0.91.0 // indirect - go.opentelemetry.io/collector/service v0.91.0 // indirect + go.opentelemetry.io/collector v0.92.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.92.0 // indirect + go.opentelemetry.io/collector/config/configcompression v0.92.0 // indirect + go.opentelemetry.io/collector/config/configgrpc v0.92.0 // indirect + go.opentelemetry.io/collector/config/confighttp v0.92.0 // indirect + go.opentelemetry.io/collector/config/confignet v0.92.0 // indirect + go.opentelemetry.io/collector/config/configopaque v0.92.0 // indirect + go.opentelemetry.io/collector/config/configretry v0.92.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.92.0 // indirect + go.opentelemetry.io/collector/config/configtls v0.92.0 // indirect + go.opentelemetry.io/collector/config/internal v0.92.0 // indirect + go.opentelemetry.io/collector/connector v0.92.0 // indirect + go.opentelemetry.io/collector/consumer v0.92.0 // indirect + go.opentelemetry.io/collector/extension v0.92.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.92.0 // indirect + go.opentelemetry.io/collector/featuregate v1.0.1 // indirect + go.opentelemetry.io/collector/pdata v1.0.1 // indirect + go.opentelemetry.io/collector/semconv v0.92.0 // indirect + go.opentelemetry.io/collector/service v0.92.0 // indirect go.opentelemetry.io/contrib/config v0.1.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect @@ -241,11 +243,11 @@ require ( go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/oauth2 v0.12.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect google.golang.org/grpc/examples v0.0.0-20220304170021-431ea809a767 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index f1e6c6a0bfb..88972a61737 100644 --- a/go.sum +++ b/go.sum @@ -775,8 +775,9 @@ github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= @@ -798,10 +799,10 @@ github.com/elastic/e2e-testing v1.1.0 h1:Y+K215EWkf3ojAWmBK2JrxH/rITjkKM1zR8mnwI github.com/elastic/e2e-testing v1.1.0/go.mod h1:8q2d8dmwavJXISowwaoreHFBnbR/uK4qanfRGhC/W9A= github.com/elastic/elastic-agent-autodiscover v0.6.6 h1:P1y0dDpbhJc7Uw/xe85irPEad4Vljygc+y4iSxtqW7A= github.com/elastic/elastic-agent-autodiscover v0.6.6/go.mod h1:chulyCAyZb/njMHgzkhC/yWnt8v/Y6eCRUhmFVnsA5o= -github.com/elastic/elastic-agent-client/v7 v7.5.0 h1:niI3WQ+01Lnp2r5LxK8SyNhrPJe13vBiOkqrDRK2oTA= -github.com/elastic/elastic-agent-client/v7 v7.5.0/go.mod h1:DYoX95xjC4BW/p2avyu724Qr2+hoUIz9eCU9CVS1d+0= -github.com/elastic/elastic-agent-libs v0.7.3 h1:tc6JDXYR+2XFMHJVv+7+M0OwAbZPxm3caLJEd943dlE= -github.com/elastic/elastic-agent-libs v0.7.3/go.mod h1:9hlSaDPm0XTrUWrZjwvckgov1pDHnsGyybzAjNe/1wA= +github.com/elastic/elastic-agent-client/v7 v7.8.0 h1:GHFzDJIWpdgI0qDk5EcqbQJGvwTsl2E2vQK3/xe+MYQ= +github.com/elastic/elastic-agent-client/v7 v7.8.0/go.mod h1:ihtjqJzYiIltlRhNruaSSc0ogxIhqPD5hOMKq16cI1s= +github.com/elastic/elastic-agent-libs v0.7.4 h1:/cmwOLwNAyJDNeR6sFIbHCDHDLPX2zAb/MAxQq7BRpo= +github.com/elastic/elastic-agent-libs v0.7.4/go.mod h1:pGMj5myawdqu+xE+WKvM5FQzKQ/MonikkWOzoFTJxaU= github.com/elastic/elastic-agent-system-metrics v0.9.1 h1:r0ofKHgPpl+W09ie7tzGcCDC0d4NZbQUv37rSgHf4FM= github.com/elastic/elastic-agent-system-metrics v0.9.1/go.mod h1:9C1UEfj0P687HAzZepHszN6zXA+2tN2Lx3Osvq1zby8= github.com/elastic/elastic-integration-corpus-generator-tool v0.5.0/go.mod h1:uf9N86y+UACGybdEhZLpwZ93XHWVhsYZAA4c2T2v6YM= @@ -861,8 +862,8 @@ github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc= -github.com/expr-lang/expr v1.15.6 h1:dQFgzj5DBu3wnUz8+PGLZdPMpefAvxaCFTNM3iSjkGA= -github.com/expr-lang/expr v1.15.6/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= +github.com/expr-lang/expr v1.15.8 h1:FL8+d3rSSP4tmK9o+vKfSMqqpGL8n15pEPiHcnBpxoI= +github.com/expr-lang/expr v1.15.8/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= @@ -1107,8 +1108,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -1194,6 +1195,8 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -1525,34 +1528,34 @@ github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= github.com/onsi/gomega v1.27.3 h1:5VwIwnBY3vbBDOJrNtA4rVdiTZCsq9B5F12pvy1Drmk= github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.91.0 h1:p8gP126reF8nK4HvgpQ+6R3+CVxnYohjInD67uKqfDw= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.91.0/go.mod h1:j26btuTJfz02X+urX9Qk73I13BdfuJoyjLm+edN1G94= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.91.0 h1:ytN1kuraYaxwO8SmneZ+KZ/ndLAEUZrCBgcocajdb8Q= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.91.0/go.mod h1:yMNXrImknnWzaER0jz7z8s+Mw6FFroQi3mCYq3mWBsA= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 h1:8nzprvG2+4BK6C5wFSgZruZpoPiGKc1kRO2rp33tpTo= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0/go.mod h1:Kw1ZyEtVfeOTaBeNnJ4tWFw3E5TtqGwwpNDjMqT4Zp4= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 h1:I3MFZXcQdnATObbeKseHLEWOWMFt1jHhHCbeunBw3mE= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0/go.mod h1:xHPYTciFeEEE2HnPu65FMgsCQFYNns66mqiHsMqb+HM= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.91.0 h1:/DR7auSrP2JWDiU/BfLeonUJ8AYpT2qglPJ8l8Mge8M= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.91.0/go.mod h1:Xh3jvjVQz3lzSFExZjbGOhnJifyoqQchycaOEoOIRHw= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.91.0 h1:jbzYDR6RLJkruWSunpXUqyj9SuSpuAcvppcdH6hE8PM= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.91.0/go.mod h1:CNM7IdgOO6r4GL2bpd6tAXU9SR26KA+V+qA5JtOkQmA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.91.0 h1:H2XRo5joSzcBhAvOrch7/p+MHighMshJpBdOWji0qh4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.91.0/go.mod h1:+5u+yVQRH/9RmqWwKKLtmGvbopeq6uxRCZDYO7PI7tE= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.91.0 h1:qFnhbBNSv7fzxxkAjobOoGiiFFtx/HpvZ5C6zV3+ZBw= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.91.0/go.mod h1:8T+STqxplIrZN8xQdum3GEVQC3SWSSDN1cW0gEGSxqE= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0 h1:a4XbucJve0K8g7kCO25EpNinBsXRGBJ8IhoLKNM0kdQ= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0/go.mod h1:LrsgmhaNo+f3xb4loclG8+gLTWgyzmiS1bplK1CVRu0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.91.0 h1:b3osuGoTGoj89IBgCD37e4h0S91+Lwr0mJpJUxXoJXA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.91.0/go.mod h1:vma5CXCHQdbnw7kFnGibFYHw9Q2VN/V2cZXB3s2n0ec= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.91.0 h1:2ne+/J0XL8Uxa2xZttKHfa8Ifm8YXiuLzrM4kKR2nU8= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.91.0/go.mod h1:ug97/p5QLzTzF2CJAmmL9GtJP8aKx2TjtXHk/yuZB48= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.91.0 h1:fO7E0Uw+cGgVYzTNkIevO2fr8Wkh/vjglMm74C50uLY= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.91.0/go.mod h1:l+VhjYgCbyLHjVEpUNB1CBv1JV6/qeHt21m56HGDDRk= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.91.0 h1:HrGxse63DjyfvqRDFYzbWyJRrCnp+SMmDqlmaiTgFtI= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.91.0/go.mod h1:u7F9B1mxPiAbkw4EeRYE4QyDHFxto4On+qJvOW5RS1I= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.91.0 h1:T0KUBfCfHsXypaJ1daiuKuzsII4ywKp9rByj8E4FqEQ= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.91.0/go.mod h1:VW6CjoMfDq+aQSEc0JvqC4HKjf4tu7oMd/p12lOmI+E= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.92.0 h1:R9p0RcxnDrkoYjuITbtVAgUeVzJ9+7b1xGdEF9DZDbA= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.92.0/go.mod h1:H12xn4sBQaRtvqYdAb0HL8WrtrP4hcgdVjgAbNE/6BU= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.92.0 h1:0GynhCiPiT3qS8LDTr3vHV9UCCdlr9H1HHi610ISZyo= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.92.0/go.mod h1:SAjAeh25eZIPi1TK7KIZ2hpwSNRhoQVnwjsM6B2mu3w= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.92.0 h1:x36ZvOy+ad363p3viPF2FZnaxcM2yoUPQpg9VX89unw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.92.0/go.mod h1:qELp3+4I6DZUAbv5S3oyzxKGZHhwC82A0oOutosMtYg= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.0 h1:1UF2MF9boARNt/3L9SExlIMggp8htU4OiPz050CS6SM= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.92.0/go.mod h1:MwTANoi8W1PxCOR3VcRNjPvoDpCLe98tzjFTU55jXhQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.92.0 h1:8ULgM2gWQYl9jq5uX2KqtQPFeBIM4TufAL91fFG2e5g= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.92.0/go.mod h1:AOTtYRG7j3hw/yPnul76yBNTN52bzUX1XigKS7c5+HI= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.92.0 h1:jG9K/J2UtjlsTnQaQZHyDB2uOD1ZMhzf39Ko3fwHJsw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.92.0/go.mod h1:OhiKMy/kHVp8Lfm6a75axDwtoU+1xEAWjT8qOxtuioM= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.92.0 h1:hYDw9amC8zJl9uik4zkaPqPHogZ7PMhoY5qaBwMSRQ4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.92.0/go.mod h1:6V4eg/9WNeiAJ1bqUyHE7t5wP03L/1ecB1dRk7jWm0Q= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.92.0 h1:2cjUFC0jNSqAYcO+ZWUQ8sqPZdAX03Bd90SpsGcnrNY= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.92.0/go.mod h1:SOBg+bs2hOmckkRr/yURA78AuMePwRYIpao4EmI6xdw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.92.0 h1:sqs1y0Exyxons2mWMAmBSdcdl2UizUgOmoibEBRX/4I= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.92.0/go.mod h1:me0dUlXvkVpDA6bN2z+qAggsXqOBEcm/dFFPw2mp7n8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.92.0 h1:HpZYkjb3z9DSF79iAw/NAa4/2H2qqWWqYudJ25P4A/g= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.92.0/go.mod h1:csRtnY1VNPVO82nxvGuH5s+4iVbxb9jLIuCSnUp5vwQ= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.92.0 h1:H7mtRBrLtCKqmA4RTrAOxvnvzKUU5KEr4dQvORkmrGc= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.92.0/go.mod h1:feJBCo8tq/NFlHfL5eG+88QdaoZwyj/C9HLxg0C8b6M= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.92.0 h1:L+pCvFFY1sFLQI8bzLsjpj3jbk/vu/URan7jL0tY+m0= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.92.0/go.mod h1:XuEsoBYYtIvJghTAZcuL5cS/k6kKBpJhPCZukUfsUDY= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.92.0 h1:5MFfqmUWCpQpuxlUeN3wOROeL4F2HtmhAJvJPVf+66E= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.92.0/go.mod h1:ls/06DNIHU6YEesJk1qpCABrmD/yZe99BvfOY4yKTKQ= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.92.0 h1:rYpAvfIurB6zjjl1CzmaDtj6br1HT8taGed3IwDmdoY= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.92.0/go.mod h1:4PiIhpYsRDxFHHtuGP3JbA7NfXfSN6owqKCfPG17/30= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1638,8 +1641,8 @@ github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrb github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1676,8 +1679,8 @@ github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= @@ -1724,8 +1727,8 @@ github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M= -github.com/shirou/gopsutil/v3 v3.23.11 h1:i3jP9NjCPUz7FiZKxlMnODZkdSIp2gnzfrvsu9CuWEQ= -github.com/shirou/gopsutil/v3 v3.23.11/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= +github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= +github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -1937,66 +1940,68 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.91.0 h1:C7sGUJDJ5nwm+CkWpAaVP3lNsuYpwSRbkmLncFjkmO8= -go.opentelemetry.io/collector v0.91.0/go.mod h1:YhQpIDZsn+bICAAqgBwXk9wqK8GKZDv+aogfG52zUuE= -go.opentelemetry.io/collector/component v0.91.0 h1:aBT1i2zGyfh9PalYJLfXVvQp+osHyalwyDFselI1CtA= -go.opentelemetry.io/collector/component v0.91.0/go.mod h1:2KBHvjNFdU7oOjsObQeC4Ta2Ef607OISU5obznW00fw= -go.opentelemetry.io/collector/config/configauth v0.91.0 h1:SjWKimuqlpfS3sIlFpfzdkSY/AmMMCEmn9+KRcjEU+s= -go.opentelemetry.io/collector/config/configauth v0.91.0/go.mod h1:wmmMYqv6PxwY+/h7qqvd/LP0XN/wzXoECDu6PYz2Of0= -go.opentelemetry.io/collector/config/configcompression v0.91.0 h1:v+jEpFhLgfJDCUCPsSF03gjoFEvm77PofTCqHKKgXTs= -go.opentelemetry.io/collector/config/configcompression v0.91.0/go.mod h1:LaavoxZsro5lL7qh1g9DMifG0qixWPEecW18Qr8bpag= -go.opentelemetry.io/collector/config/configgrpc v0.91.0 h1:+2zPmgVOhKgelluGaGwE3OMKqwi56i6OiU0+7xWTetM= -go.opentelemetry.io/collector/config/configgrpc v0.91.0/go.mod h1:iWDbg9vYaayewmbKfM2zEk4YvaOOwrs0eiUffypcZFk= -go.opentelemetry.io/collector/config/confighttp v0.91.0 h1:YAOyXcDaLDnF3UqPHH4kYU8lx8BqXJ7hS3Ou8GcmqpQ= -go.opentelemetry.io/collector/config/confighttp v0.91.0/go.mod h1:R6y8KSJzqDe6CE6JsYwt4CTZ2B4AlqRA+V74OJPX3vE= -go.opentelemetry.io/collector/config/confignet v0.91.0 h1:3huNXh04O3wXaN4qPhmmiefyz4dYbOlNcR/OKMByqig= -go.opentelemetry.io/collector/config/confignet v0.91.0/go.mod h1:cpO8JYWGONaViOygKVw+Hd2UoBcn2cUiyi0WWeFTwJY= -go.opentelemetry.io/collector/config/configopaque v0.91.0 h1:bQgJPyARbuXAsU2p6h2YbEm1kHb1stS6hg42ekyMZmI= -go.opentelemetry.io/collector/config/configopaque v0.91.0/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= -go.opentelemetry.io/collector/config/configtelemetry v0.91.0 h1:mEwvqrYfwUJ7LwYfpcF9M8z7LHFoYaKhEPhnERD/88E= -go.opentelemetry.io/collector/config/configtelemetry v0.91.0/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= -go.opentelemetry.io/collector/config/configtls v0.91.0 h1:lZromNeOslPwyVlTPMOzF2q++SY+VONvfH3cDqA0kKk= -go.opentelemetry.io/collector/config/configtls v0.91.0/go.mod h1:E+CW5gZoH8V3z5aSlZxwiof7GAcayzn1HRM+uRILLEI= -go.opentelemetry.io/collector/config/internal v0.91.0 h1:Yx17oFdXOPnY83Jfe1oiXhvfYW7RX/xh3/kpV/iYibM= -go.opentelemetry.io/collector/config/internal v0.91.0/go.mod h1:42VsQ/1kP2qnvzjNi+dfNP+KyCFRADejyrJ8m2GVL3M= -go.opentelemetry.io/collector/confmap v0.91.0 h1:7U2MT+u74oEzq/WWrpXSLKB7nX5jPNC4drwtQdYfwKk= -go.opentelemetry.io/collector/confmap v0.91.0/go.mod h1:uxV+fZ85kG31oovL6Cl3fAMQ3RRPwUvfAbbA9WT1Yhk= -go.opentelemetry.io/collector/connector v0.91.0 h1:p2YsgBtr26guCib99ExQHtGuNmX+awgmH1Mbz23wYGU= -go.opentelemetry.io/collector/connector v0.91.0/go.mod h1:dG34jAOATtXFdqzp8IxZJsFwFLaUIkYK69WT1WQ03ZY= -go.opentelemetry.io/collector/consumer v0.91.0 h1:0nU1lUe2S0b8iOmF3w3R/9Dt24n413thRTbXz/nJgrM= -go.opentelemetry.io/collector/consumer v0.91.0/go.mod h1:phTUQmr7hpYfwXyDXo4mFHVjYrlSbZE+nZYlKlbVxGs= -go.opentelemetry.io/collector/exporter v0.91.0 h1:guWcGflFjaenp3BMxAmAKjb8RQG80jQQKjuUFouS+z8= -go.opentelemetry.io/collector/exporter v0.91.0/go.mod h1:hkOBunNNWu6CaTtkRsCJ/OJ509REJZg+DDElevFIQCQ= -go.opentelemetry.io/collector/exporter/debugexporter v0.91.0 h1:jrpyPtSLm+4xJ9oJ0pNse9Jx6BNAOEZYSiFhrLNe6+A= -go.opentelemetry.io/collector/exporter/debugexporter v0.91.0/go.mod h1:UI8Kv+xGp2AI5DQZVWwfdTMPcRqzfPv7jyckCVFBOPc= -go.opentelemetry.io/collector/exporter/otlpexporter v0.91.0 h1:PEVJgEZIUMQ/M2/aQ9uuEfjptW4t0bmm91LeeNpa8mc= -go.opentelemetry.io/collector/exporter/otlpexporter v0.91.0/go.mod h1:ebWRIZhk6zere5QnvUpPHjfTvbapscwI6QfCial/X0Y= -go.opentelemetry.io/collector/extension v0.91.0 h1:bkoSLgnWm4g6n+RLmyKG6Up7dr8KmJy68quonoLZnr0= -go.opentelemetry.io/collector/extension v0.91.0/go.mod h1:F3r0fVTTh4sYR0GVv51Qez8lk8v77kTDPdyMOp6A2kg= -go.opentelemetry.io/collector/extension/auth v0.91.0 h1:28Hv5W0GZgv2jR5IiFdJzutTs91KmXFh8DUfVTjwwmI= -go.opentelemetry.io/collector/extension/auth v0.91.0/go.mod h1:diY6Sw7cOAn2qivKipZk4niBFzCCFBj7swAXiG2h9ro= -go.opentelemetry.io/collector/extension/zpagesextension v0.91.0 h1:d787uZ6cNHN1uaJ3pIgFlcrkHVB4ML6AlXBiCQRJ9t0= -go.opentelemetry.io/collector/extension/zpagesextension v0.91.0/go.mod h1:S1T9YKuxRqCKFENC+GuEZhz0fzuUBACOrScNY13Y96w= -go.opentelemetry.io/collector/featuregate v1.0.0 h1:5MGqe2v5zxaoo73BUOvUTunftX5J8RGrbFsC2Ha7N3g= -go.opentelemetry.io/collector/featuregate v1.0.0/go.mod h1:xGbRuw+GbutRtVVSEy3YR2yuOlEyiUMhN2M9DJljgqY= -go.opentelemetry.io/collector/otelcol v0.91.0 h1:gq/PY/tHgkTr2fuMLp+F+NAm+03iiU+j/Eilvx38p5w= -go.opentelemetry.io/collector/otelcol v0.91.0/go.mod h1:9j8gKdZvuEgZoeUhz5f5D/fwCxx7M7Tg+6D207/KjNs= -go.opentelemetry.io/collector/pdata v1.0.0 h1:ECP2jnLztewsHmL1opL8BeMtWVc7/oSlKNhfY9jP8ec= -go.opentelemetry.io/collector/pdata v1.0.0/go.mod h1:TsDFgs4JLNG7t6x9D8kGswXUz4mme+MyNChHx8zSF6k= -go.opentelemetry.io/collector/processor v0.91.0 h1:Xi52gYMXTG4zYmNhsqJ8ly/9f7b0n0crMhKxVVI9HpY= -go.opentelemetry.io/collector/processor v0.91.0/go.mod h1:naTuusZNfzM5MSqoTVzkKbR1MaJ8oD8v5ginR5JreDE= -go.opentelemetry.io/collector/processor/batchprocessor v0.91.0 h1:YuPG52D7otNr4lNd8KGsIIBHvawAAaOqGoNTK9799ko= -go.opentelemetry.io/collector/processor/batchprocessor v0.91.0/go.mod h1:U2ZVSMwgr4OsaKKMfvX9OGaurG83zAPKjVdpTgmj0ok= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.91.0 h1:7QVCd9NzpC0DMDeX5ZNhcUOS8qO5sRM1Cj8h5na3a4Y= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.91.0/go.mod h1:O1hcC0DZv5ak3eWML2NphwdLl5PESVeHN6QIi5j2bwU= -go.opentelemetry.io/collector/receiver v0.91.0 h1:0TZF/0OXoJtxgm+mvOinRRXo9LgVyOsOgCQfWkNGXJA= -go.opentelemetry.io/collector/receiver v0.91.0/go.mod h1:d5qo2mpovqKoi47hrMxj5BLdLzOXM0mUHL5CKrjfWNM= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 h1:1Eyc1uR8yr3heKkC4YXFoZip0JqgOXuOiN/tXvl9WUo= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0/go.mod h1:7am8EW0xmHLxeeGIb0xTcsoVc6+1LfNCGdc+b7OvE8k= -go.opentelemetry.io/collector/semconv v0.91.0 h1:TRd+yDDfKQl+aNtS24wmEbJp1/QE/xAFV9SB5zWGxpE= -go.opentelemetry.io/collector/semconv v0.91.0/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= -go.opentelemetry.io/collector/service v0.91.0 h1:AQS6YAiZO6V+ohcMX4upfyp/Ydi6y862yQEbFt8t+fQ= -go.opentelemetry.io/collector/service v0.91.0/go.mod h1:8Pf8mPo3YqcTNwOzXa0Ok/o+g2+d8hSCaGxRqR/c6CY= +go.opentelemetry.io/collector v0.92.0 h1:XiC0ptaT1EmOkK2RI0gt3n2tkzLAkNQGf0E7hrGdyeA= +go.opentelemetry.io/collector v0.92.0/go.mod h1:wbksjM63DTKA1BbdUVS7gAFzAngCZTWb46RBpKdtsPw= +go.opentelemetry.io/collector/component v0.92.0 h1:/tRgPT1hr4KNB8ABHa0oJsjJFRZ5oiCIYHcTpZGwm9s= +go.opentelemetry.io/collector/component v0.92.0/go.mod h1:C2JwPTjauu36UCAzwX71/glNnOc5BR18p8FVccCFsqc= +go.opentelemetry.io/collector/config/configauth v0.92.0 h1:m4O5QLerdsuWYEV8bZGZWDHnM8TtHkr52q9r6hAkasw= +go.opentelemetry.io/collector/config/configauth v0.92.0/go.mod h1:P3tCzSFgxxmBdELVA/h05fGjyYXOr6mCDG4995yPzqo= +go.opentelemetry.io/collector/config/configcompression v0.92.0 h1:LtHx4ZkW3BMxa4CfQGMOE7+ZhXvd4W10Pxa91Hr8IL0= +go.opentelemetry.io/collector/config/configcompression v0.92.0/go.mod h1:fA36AZC/Qcyl+HvMnvFZuV/iUWGQJrchimmk+qYWuMM= +go.opentelemetry.io/collector/config/configgrpc v0.92.0 h1:vXUlGdAfg8ZvzkCyYx5+eagbzj2cQK306C3tZpWb7hY= +go.opentelemetry.io/collector/config/configgrpc v0.92.0/go.mod h1:MOUXJ4rVhsYQ+1nv8AxuwuFNWeCWrWRnjo2aP+5zRh0= +go.opentelemetry.io/collector/config/confighttp v0.92.0 h1:O1iAgwVJBnHgLqzHMBBbI0pa0nBZHalTQrFQGwiEuiE= +go.opentelemetry.io/collector/config/confighttp v0.92.0/go.mod h1:ZnZz2+bIHk4PRnJMvSPjQWdTDkfoBb4cH2R2gQVf1V4= +go.opentelemetry.io/collector/config/confignet v0.92.0 h1:4B4Ir68P+ew3nVz2/9lBN+KGXtkETPqErM8nQCg8tFo= +go.opentelemetry.io/collector/config/confignet v0.92.0/go.mod h1:rraribsOoZsYZm51+3TXHavmXKJOC5a5/X20vfmNbdw= +go.opentelemetry.io/collector/config/configopaque v0.92.0 h1:YvUSVa3Vxt2gSl5SwEohtn9HG0+8bO4zuAOCVICBIVU= +go.opentelemetry.io/collector/config/configopaque v0.92.0/go.mod h1:dQK8eUXjIGKaw1RB7UIg2nqx56AueNxeKFCdB0P1ypg= +go.opentelemetry.io/collector/config/configretry v0.92.0 h1:3WUabmCRIBHSkOLGCHGieUGchlHkBw3Fa4Cj9Do5Xdw= +go.opentelemetry.io/collector/config/configretry v0.92.0/go.mod h1:gt1HRYyMxcMca9lbDLPbivQzsUCjVjkPAn/3S6fiD14= +go.opentelemetry.io/collector/config/configtelemetry v0.92.0 h1:iCfxJ2DhWVOAHpGgkWUZRfUvUPyWGhpVRCqjPQ2D87Y= +go.opentelemetry.io/collector/config/configtelemetry v0.92.0/go.mod h1:2XLhyR/GVpWeZ2K044vCmrvH/d4Ewt0aD/y46avZyMU= +go.opentelemetry.io/collector/config/configtls v0.92.0 h1:jJHZvRp8CZ76IYbhHdGgGosBMQ/EShQAc0NlE3/tlHk= +go.opentelemetry.io/collector/config/configtls v0.92.0/go.mod h1:rL9BH5Hyrkni4t+QOx/opuwD0CHq/ZIFTsh6QLLsbmA= +go.opentelemetry.io/collector/config/internal v0.92.0 h1:1GCj5swGzCZQphHqzt1OSsA/vOmAgFLoydY8bBqAhs4= +go.opentelemetry.io/collector/config/internal v0.92.0/go.mod h1:rPjglfSd4K/kNLfH7TJO8AsstHGMmWTdntOqH7WiFLg= +go.opentelemetry.io/collector/confmap v0.92.0 h1:xz20zNIvF9ZA1eWE+MZmZunmdXPIP/fr33ZvU0QUSxg= +go.opentelemetry.io/collector/confmap v0.92.0/go.mod h1:CmqTszB2uwiJ9ieEqISdecuoVuyt3jMnJ/9kD53GYHs= +go.opentelemetry.io/collector/connector v0.92.0 h1:RgQAU1QKATCVGVPsVfUYF/6CsAblV02hNWcIh/YEq7w= +go.opentelemetry.io/collector/connector v0.92.0/go.mod h1:aWfeV4mEpnmiJbpFOZP7nudATb9ypW74qTsltEdS9PQ= +go.opentelemetry.io/collector/consumer v0.92.0 h1:twa8T0iR9KVglvRbwZ5OPKLXPCC2DO6gVhrgDZ47MPE= +go.opentelemetry.io/collector/consumer v0.92.0/go.mod h1:fBZqP7bou3I7pDhWjleBuzdaLfQgJBc92wPJVOcKaGU= +go.opentelemetry.io/collector/exporter v0.92.0 h1:z6u+/hswJUuZbuPYIF2gXMZsqjIDd/tJO60XjLM850U= +go.opentelemetry.io/collector/exporter v0.92.0/go.mod h1:54ODYn1weY/Wr0bdxESj4P1fgyX+zaUsnJJnafORqIY= +go.opentelemetry.io/collector/exporter/debugexporter v0.92.0 h1:f+RjK3bJiBK/fg0Iizoobvlc4qHhQ98zy0yrFVYuSww= +go.opentelemetry.io/collector/exporter/debugexporter v0.92.0/go.mod h1:KvdXPSTiXawf/ZD1OlzU/t4c90kl6DkHCwvKf18sGGM= +go.opentelemetry.io/collector/exporter/otlpexporter v0.92.0 h1:t1Bw82ziGkilLdGFU7r7EeXrK+sH5V/iwafEeFD/kik= +go.opentelemetry.io/collector/exporter/otlpexporter v0.92.0/go.mod h1:zmZiMKuPrhPqcILsZbXg28V8biywyjzse5m3jjN6AB0= +go.opentelemetry.io/collector/extension v0.92.0 h1:zaehgW+LXCMNEb1d6Af/VHWphh5ZwX9aZl+NuQLGhpQ= +go.opentelemetry.io/collector/extension v0.92.0/go.mod h1:5EYwiaGU6deSY8YWqT5gvlnD850yJXP3NqFRKVVbYLs= +go.opentelemetry.io/collector/extension/auth v0.92.0 h1:FlCObeiYXsVStltFivg+gD5PSFUM6dXHigkgkUMitv0= +go.opentelemetry.io/collector/extension/auth v0.92.0/go.mod h1:fqCblNQV8Iz5w7Nrp1B865EJzKlVWS0aRgrr/c2HDDg= +go.opentelemetry.io/collector/extension/zpagesextension v0.92.0 h1:n2W8Lla4P22P88WJ+e1n/AtcAEO47WnSYXlUUideU8g= +go.opentelemetry.io/collector/extension/zpagesextension v0.92.0/go.mod h1:oZwtuGVYK8C3Uh4exR0v0KQSkIUkngA3h9qutnmn7Qo= +go.opentelemetry.io/collector/featuregate v1.0.1 h1:ok//hLSXttBbyu4sSV1pTx1nKdr5udSmrWy5sFMIIbM= +go.opentelemetry.io/collector/featuregate v1.0.1/go.mod h1:QQXjP4etmJQhkQ20j4P/rapWuItYxoFozg/iIwuKnYg= +go.opentelemetry.io/collector/otelcol v0.92.0 h1:F2plXKY8/ULnVOvQPHrSOEUE8OSGEcBhJIntzT+BRKI= +go.opentelemetry.io/collector/otelcol v0.92.0/go.mod h1:8UUTPe216UnLQ8LQJtTp+WZpyrUF/nLWoVpT73MGV/k= +go.opentelemetry.io/collector/pdata v1.0.1 h1:dGX2h7maA6zHbl5D3AsMnF1c3Nn+3EUftbVCLzeyNvA= +go.opentelemetry.io/collector/pdata v1.0.1/go.mod h1:jutXeu0QOXYY8wcZ/hege+YAnSBP3+jpTqYU1+JTI5Y= +go.opentelemetry.io/collector/processor v0.92.0 h1:fbtBPdtQbFZWOhPfgx6LXZM0fwQRHvjE3NeJS1d1GPg= +go.opentelemetry.io/collector/processor v0.92.0/go.mod h1:7UFWYbuXy/GC5eyUYsGPn2FpQzOY22sgW4QykXspAFE= +go.opentelemetry.io/collector/processor/batchprocessor v0.92.0 h1:dLcXaOQVpEhevZdPlfa3zWGbceMZxatTFcRi+XpRBnE= +go.opentelemetry.io/collector/processor/batchprocessor v0.92.0/go.mod h1:ecE0bXWi0OckZg98ElvBtXjPxpMw8quSE0FurbL2tsA= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.92.0 h1:BC2fE/gxjlw9oqxQmAU7taLAiiigFeJM6slSXQfXrlI= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.92.0/go.mod h1:m1XAO859A1wrKco8K5wmJhnaXzeQEPzu3jj4F3mqvUI= +go.opentelemetry.io/collector/receiver v0.92.0 h1:TRz4ufr5bFEszpAWgYVEx/b7VPZzEcECsyMzztf5PsQ= +go.opentelemetry.io/collector/receiver v0.92.0/go.mod h1:bYAAYbMuUVj3wx7ave2iyyJ+aGUpACliYOQ5xI92I7k= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.92.0 h1:77oFMYYJfRu4yqlRkExMHDieg9gPv38UsMtK/0cu5kU= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.92.0/go.mod h1:eZIrA6CY6xcm9uu3hmycS+L9kmBzyXE66Ci8FwkJpmI= +go.opentelemetry.io/collector/semconv v0.92.0 h1:3+OGPPuVu4rtrz8qGbpbiw7eKKULj4iJaSDTV52HM40= +go.opentelemetry.io/collector/semconv v0.92.0/go.mod h1:gZ0uzkXsN+J5NpiRcdp9xOhNGQDDui8Y62p15sKrlzo= +go.opentelemetry.io/collector/service v0.92.0 h1:KhicjajrbhEpjzSYCHvVZBYW5Qvd/UXi88oCegSanZI= +go.opentelemetry.io/collector/service v0.92.0/go.mod h1:hlq/Vyj0un+HKx8nAI77eaK/mABNL8hhPH7rKh9SOu4= go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/config v0.1.1 h1:lIUTrMWkfDE0GvzBLhwv6ATDB1vntrnTsRvUMkZKnfQ= @@ -2142,8 +2147,8 @@ golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80 golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -2154,8 +2159,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No= -golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -2277,8 +2282,8 @@ golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2306,8 +2311,8 @@ golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2481,8 +2486,9 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -2497,8 +2503,8 @@ golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2685,8 +2691,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -2809,8 +2816,8 @@ google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614G google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f/go.mod h1:nWSwAFPb+qfNJXsoeO3Io7zf4tMSfN8EA8RlDA04GhY= -google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q= -google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -2858,8 +2865,8 @@ google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/examples v0.0.0-20220304170021-431ea809a767 h1:r16FSFCMhn7+LU8CzbtAIKppYeU6NUPJVdvXeIqVIq8= google.golang.org/grpc/examples v0.0.0-20220304170021-431ea809a767/go.mod h1:wKDg0brwMZpaizQ1i7IzYcJjH1TmbJudYdnQC9+J+LE= @@ -2878,8 +2885,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_policy_change.go b/internal/pkg/agent/application/actions/handlers/handler_action_policy_change.go index 25d7b2bdd4e..c4f2c10dc96 100644 --- a/internal/pkg/agent/application/actions/handlers/handler_action_policy_change.go +++ b/internal/pkg/agent/application/actions/handlers/handler_action_policy_change.go @@ -9,7 +9,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "net/http" "sort" "time" @@ -198,7 +197,7 @@ func (h *PolicyChangeHandler) handleFleetServerHosts(ctx context.Context, c *con } // discard body for proper cancellation and connection reuse - _, _ = io.Copy(ioutil.Discard, resp.Body) + _, _ = io.Copy(io.Discard, resp.Body) resp.Body.Close() reader, err := fleetToReader(h.agentInfo, h.config) diff --git a/internal/pkg/agent/application/application.go b/internal/pkg/agent/application/application.go index c277382ae93..64df27c9ae9 100644 --- a/internal/pkg/agent/application/application.go +++ b/internal/pkg/agent/application/application.go @@ -28,6 +28,7 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/capabilities" "github.com/elastic/elastic-agent/internal/pkg/composable" "github.com/elastic/elastic-agent/internal/pkg/config" + "github.com/elastic/elastic-agent/internal/pkg/otel" "github.com/elastic/elastic-agent/internal/pkg/release" "github.com/elastic/elastic-agent/pkg/component" "github.com/elastic/elastic-agent/pkg/component/runtime" @@ -46,6 +47,7 @@ func New( testingMode bool, fleetInitTimeout time.Duration, disableMonitoring bool, + runAsOtel bool, modifiers ...component.PlatformModifier, ) (*coordinator.Coordinator, coordinator.ConfigManager, composable.Controller, error) { @@ -144,6 +146,9 @@ func New( log.Debugf("Reloading of configuration is on, frequency is set to %s", cfg.Settings.Reload.Period) configMgr = newPeriodic(log, cfg.Settings.Reload.Period, discover, loader) } + } else if runAsOtel { + // ignoring configuration in elastic-agent.yml + configMgr = otel.NewOtelModeConfigManager() } else { isManaged = true var store storage.Store diff --git a/internal/pkg/agent/application/application_test.go b/internal/pkg/agent/application/application_test.go index cf67f19c6cf..37744a54a3e 100644 --- a/internal/pkg/agent/application/application_test.go +++ b/internal/pkg/agent/application/application_test.go @@ -63,6 +63,7 @@ func TestLimitsLog(t *testing.T) { true, // testingMode time.Millisecond, // fleetInitTimeout true, // disable monitoring + false, // not otel mode ) require.NoError(t, err) diff --git a/internal/pkg/agent/application/coordinator/diagnostics_test.go b/internal/pkg/agent/application/coordinator/diagnostics_test.go index 2ccc239fe34..a5cdaf5a100 100644 --- a/internal/pkg/agent/application/coordinator/diagnostics_test.go +++ b/internal/pkg/agent/application/coordinator/diagnostics_test.go @@ -427,8 +427,7 @@ func TestDiagnosticState(t *testing.T) { State: client.UnitStateDegraded, Message: "degraded message", VersionInfo: runtime.ComponentVersionInfo{ - Name: "version name", - Version: "version value", + Name: "version name", }, }, }, @@ -462,7 +461,6 @@ components: units: {} version_info: name: "version name" - version: "version value" upgrade_details: target_version: 8.12.0 state: UPG_DOWNLOADING @@ -505,8 +503,7 @@ func TestDiagnosticStateForAPM(t *testing.T) { State: client.UnitStateDegraded, Message: "degraded message", VersionInfo: runtime.ComponentVersionInfo{ - Name: "version name", - Version: "version value", + Name: "version name", }, Component: &proto.Component{ ApmConfig: &proto.APMConfig{ @@ -543,7 +540,6 @@ components: units: {} version_info: name: "version name" - version: "version value" component: apmconfig: elastic: diff --git a/internal/pkg/agent/application/filelock/locker_test.go b/internal/pkg/agent/application/filelock/locker_test.go index 1b7f764fb71..51191e6c0ea 100644 --- a/internal/pkg/agent/application/filelock/locker_test.go +++ b/internal/pkg/agent/application/filelock/locker_test.go @@ -5,7 +5,6 @@ package filelock import ( - "io/ioutil" "os" "testing" @@ -16,7 +15,7 @@ import ( const testLockFile = "test.lock" func TestAppLocker(t *testing.T) { - tmp, _ := ioutil.TempDir("", "locker") + tmp, _ := os.MkdirTemp("", "locker") defer os.RemoveAll(tmp) locker1 := NewAppLocker(tmp, testLockFile) diff --git a/internal/pkg/agent/application/gateway/fleet/fleet_gateway_test.go b/internal/pkg/agent/application/gateway/fleet/fleet_gateway_test.go index de40565c0b5..4c28aa8c0b2 100644 --- a/internal/pkg/agent/application/gateway/fleet/fleet_gateway_test.go +++ b/internal/pkg/agent/application/gateway/fleet/fleet_gateway_test.go @@ -11,7 +11,6 @@ import ( "fmt" "io" - "io/ioutil" "net/http" "net/url" "os" @@ -115,7 +114,7 @@ func wrapStrToResp(code int, body string) *http.Response { Proto: "HTTP/1.1", ProtoMajor: 1, ProtoMinor: 1, - Body: ioutil.NopCloser(bytes.NewBufferString(body)), + Body: io.NopCloser(bytes.NewBufferString(body)), ContentLength: int64(len(body)), Header: make(http.Header), } @@ -499,7 +498,7 @@ func runFleetGateway(ctx context.Context, g coordinator.FleetGateway) <-chan err } func newStateStore(t *testing.T, log *logger.Logger) *store.StateStore { - dir, err := ioutil.TempDir("", "fleet-gateway-unit-test") + dir, err := os.MkdirTemp("", "fleet-gateway-unit-test") require.NoError(t, err) filename := filepath.Join(dir, "state.enc") diff --git a/internal/pkg/agent/application/monitoring/process.go b/internal/pkg/agent/application/monitoring/process.go index f89597c6d03..dc969553d09 100644 --- a/internal/pkg/agent/application/monitoring/process.go +++ b/internal/pkg/agent/application/monitoring/process.go @@ -8,7 +8,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "strings" "syscall" @@ -174,7 +174,7 @@ func processMetrics(ctx context.Context, endpoint, path string) ([]byte, int, er } defer resp.Body.Close() - rb, err := ioutil.ReadAll(resp.Body) + rb, err := io.ReadAll(resp.Body) if err != nil { return nil, 0, errorWithStatus(http.StatusInternalServerError, err) } diff --git a/internal/pkg/agent/application/upgrade/artifact/download/headers_rtt_test.go b/internal/pkg/agent/application/upgrade/artifact/download/headers_rtt_test.go index 28fbf53b61e..9dfd1b252ae 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/headers_rtt_test.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/headers_rtt_test.go @@ -6,7 +6,7 @@ package download import ( "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "testing" @@ -31,7 +31,7 @@ func TestAddingHeaders(t *testing.T) { c.Transport = rtt resp, err := c.Get(server.URL) require.NoError(t, err) - b, err := ioutil.ReadAll(resp.Body) + b, err := io.ReadAll(resp.Body) defer resp.Body.Close() require.NoError(t, err) assert.Equal(t, b, msg) diff --git a/internal/pkg/agent/application/upgrade/artifact/download/http/downloader_test.go b/internal/pkg/agent/application/upgrade/artifact/download/http/downloader_test.go index d8c6e2a9304..2faf2159876 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/http/downloader_test.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/http/downloader_test.go @@ -9,7 +9,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "net" "net/http" "net/http/httptest" @@ -36,7 +35,7 @@ import ( ) func TestDownload(t *testing.T) { - targetDir, err := ioutil.TempDir(os.TempDir(), "") + targetDir, err := os.MkdirTemp(os.TempDir(), "") if err != nil { t.Fatal(err) } @@ -98,7 +97,7 @@ func TestDownloadBodyError(t *testing.T) { defer srv.Close() client := srv.Client() - targetDir, err := ioutil.TempDir(os.TempDir(), "") + targetDir, err := os.MkdirTemp(os.TempDir(), "") if err != nil { t.Fatal(err) } @@ -152,7 +151,7 @@ func TestDownloadLogProgressWithLength(t *testing.T) { defer srv.Close() client := srv.Client() - targetDir, err := ioutil.TempDir(os.TempDir(), "") + targetDir, err := os.MkdirTemp(os.TempDir(), "") if err != nil { t.Fatal(err) } @@ -235,7 +234,7 @@ func TestDownloadLogProgressWithoutLength(t *testing.T) { defer srv.Close() client := srv.Client() - targetDir, err := ioutil.TempDir(os.TempDir(), "") + targetDir, err := os.MkdirTemp(os.TempDir(), "") if err != nil { t.Fatal(err) } diff --git a/internal/pkg/agent/application/upgrade/artifact/download/http/verifier.go b/internal/pkg/agent/application/upgrade/artifact/download/http/verifier.go index 5197f931285..587b968ff66 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/http/verifier.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/http/verifier.go @@ -7,7 +7,7 @@ package http import ( "context" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "os" @@ -182,5 +182,5 @@ func (v *Verifier) getPublicAsc(sourceURI string) ([]byte, error) { return nil, errors.New(fmt.Sprintf("call to '%s' returned unsuccessful status code: %d", sourceURI, resp.StatusCode), errors.TypeNetwork, errors.M(errors.MetaKeyURI, sourceURI)) } - return ioutil.ReadAll(resp.Body) + return io.ReadAll(resp.Body) } diff --git a/internal/pkg/agent/application/upgrade/artifact/download/verifier.go b/internal/pkg/agent/application/upgrade/artifact/download/verifier.go index e466c0119ea..991ab9ce16c 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/verifier.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/verifier.go @@ -12,7 +12,6 @@ import ( "encoding/hex" "fmt" "io" - "io/ioutil" "net/http" "net/url" "os" @@ -313,7 +312,7 @@ func fetchPgpFromURI(uri string, client HTTPClient) ([]byte, error) { return nil, errors.New(fmt.Sprintf("call to '%s' returned unsuccessful status code: %d", uri, resp.StatusCode), errors.TypeNetwork, errors.M(errors.MetaKeyURI, uri)) } - return ioutil.ReadAll(resp.Body) + return io.ReadAll(resp.Body) } type HTTPClient interface { diff --git a/internal/pkg/agent/application/upgrade/step_mark.go b/internal/pkg/agent/application/upgrade/step_mark.go index bca67d307f0..90bc11dfda6 100644 --- a/internal/pkg/agent/application/upgrade/step_mark.go +++ b/internal/pkg/agent/application/upgrade/step_mark.go @@ -6,7 +6,6 @@ package upgrade import ( "context" - "io/ioutil" "os" "path/filepath" "time" @@ -129,7 +128,7 @@ func (u *Upgrader) markUpgrade(_ context.Context, log *logger.Logger, hash strin markerPath := markerFilePath() log.Infow("Writing upgrade marker file", "file.path", markerPath, "hash", marker.Hash, "prev_hash", prevHash) - if err := ioutil.WriteFile(markerPath, markerBytes, 0600); err != nil { + if err := os.WriteFile(markerPath, markerBytes, 0600); err != nil { return errors.New(err, errors.TypeFilesystem, "failed to create update marker file", errors.M(errors.MetaKeyPath, markerPath)) } @@ -144,7 +143,7 @@ func (u *Upgrader) markUpgrade(_ context.Context, log *logger.Logger, hash strin func UpdateActiveCommit(log *logger.Logger, hash string) error { activeCommitPath := filepath.Join(paths.Top(), agentCommitFile) log.Infow("Updating active commit", "file.path", activeCommitPath, "hash", hash) - if err := ioutil.WriteFile(activeCommitPath, []byte(hash), 0600); err != nil { + if err := os.WriteFile(activeCommitPath, []byte(hash), 0600); err != nil { return errors.New(err, errors.TypeFilesystem, "failed to update active commit", errors.M(errors.MetaKeyPath, activeCommitPath)) } diff --git a/internal/pkg/agent/application/upgrade/step_unpack.go b/internal/pkg/agent/application/upgrade/step_unpack.go index c418e54b182..4f5b0bd7440 100644 --- a/internal/pkg/agent/application/upgrade/step_unpack.go +++ b/internal/pkg/agent/application/upgrade/step_unpack.go @@ -10,6 +10,7 @@ import ( "compress/gzip" "fmt" "io" + "io/fs" "os" "path/filepath" "runtime" @@ -17,21 +18,20 @@ import ( "github.com/hashicorp/go-multierror" - "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" "github.com/elastic/elastic-agent/pkg/core/logger" ) // unpack unpacks archive correctly, skips root (symlink, config...) unpacks data/* -func (u *Upgrader) unpack(version, archivePath string) (string, error) { +func (u *Upgrader) unpack(version, archivePath, dataDir string) (string, error) { // unpack must occur in directory that holds the installation directory // or the extraction will be double nested var hash string var err error if runtime.GOOS == windows { - hash, err = unzip(u.log, archivePath) + hash, err = unzip(u.log, archivePath, dataDir) } else { - hash, err = untar(u.log, version, archivePath) + hash, err = untar(u.log, version, archivePath, dataDir) } if err != nil { @@ -43,7 +43,7 @@ func (u *Upgrader) unpack(version, archivePath string) (string, error) { return hash, nil } -func unzip(log *logger.Logger, archivePath string) (string, error) { +func unzip(log *logger.Logger, archivePath, dataDir string) (string, error) { var hash, rootDir string r, err := zip.OpenReader(archivePath) if err != nil { @@ -81,7 +81,7 @@ func unzip(log *logger.Logger, archivePath string) (string, error) { return nil } - path := filepath.Join(paths.Data(), strings.TrimPrefix(fileName, "data/")) + path := filepath.Join(dataDir, strings.TrimPrefix(fileName, "data/")) if f.FileInfo().IsDir() { log.Debugw("Unpacking directory", "archive", "zip", "file.path", path) @@ -126,7 +126,7 @@ func unzip(log *logger.Logger, archivePath string) (string, error) { return hash, nil } -func untar(log *logger.Logger, version string, archivePath string) (string, error) { +func untar(log *logger.Logger, version string, archivePath, dataDir string) (string, error) { r, err := os.Open(archivePath) if err != nil { return "", errors.New(fmt.Sprintf("artifact for 'elastic-agent' version '%s' could not be found at '%s'", version, archivePath), errors.TypeFilesystem, errors.M(errors.MetaKeyPath, archivePath)) @@ -179,7 +179,7 @@ func untar(log *logger.Logger, version string, archivePath string) (string, erro } rel := filepath.FromSlash(strings.TrimPrefix(fileName, "data/")) - abs := filepath.Join(paths.Data(), rel) + abs := filepath.Join(dataDir, rel) // find the root dir if currentDir := filepath.Dir(abs); rootDir == "" || len(filepath.Dir(rootDir)) > len(currentDir) { @@ -193,7 +193,7 @@ func untar(log *logger.Logger, version string, archivePath string) (string, erro log.Debugw("Unpacking file", "archive", "tar", "file.path", abs) // just to be sure, it should already be created by Dir type // remove any world permissions from the directory - if err := os.MkdirAll(filepath.Dir(abs), mode.Perm()&0770); err != nil { + if err = os.MkdirAll(filepath.Dir(abs), 0o750); err != nil { return "", errors.New(err, "TarInstaller: creating directory for file "+abs, errors.TypeFilesystem, errors.M(errors.MetaKeyPath, abs)) } @@ -214,8 +214,19 @@ func untar(log *logger.Logger, version string, archivePath string) (string, erro case mode.IsDir(): log.Debugw("Unpacking directory", "archive", "tar", "file.path", abs) // remove any world permissions from the directory - if err := os.MkdirAll(abs, mode.Perm()&0770); err != nil { - return "", errors.New(err, "TarInstaller: creating directory for file "+abs, errors.TypeFilesystem, errors.M(errors.MetaKeyPath, abs)) + _, err = os.Stat(abs) + if errors.Is(err, fs.ErrNotExist) { + if err := os.MkdirAll(abs, mode.Perm()&0770); err != nil { + return "", errors.New(err, "TarInstaller: creating directory for file "+abs, errors.TypeFilesystem, errors.M(errors.MetaKeyPath, abs)) + } + } else if err != nil { + return "", errors.New(err, "TarInstaller: stat() directory for file "+abs, errors.TypeFilesystem, errors.M(errors.MetaKeyPath, abs)) + } else { + // set the appropriate permissions + err = os.Chmod(abs, mode.Perm()&0o770) + if err != nil { + return "", errors.New(err, fmt.Sprintf("TarInstaller: setting permissions %O for directory %q", mode.Perm()&0o770, abs), errors.TypeFilesystem, errors.M(errors.MetaKeyPath, abs)) + } } default: return "", errors.New(fmt.Sprintf("tar file entry %s contained unsupported file type %v", fileName, mode), errors.TypeFilesystem, errors.M(errors.MetaKeyPath, fileName)) diff --git a/internal/pkg/agent/application/upgrade/step_unpack_test.go b/internal/pkg/agent/application/upgrade/step_unpack_test.go new file mode 100644 index 00000000000..c2d5bf0ece7 --- /dev/null +++ b/internal/pkg/agent/application/upgrade/step_unpack_test.go @@ -0,0 +1,212 @@ +// 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. + +package upgrade + +import ( + "archive/tar" + "compress/gzip" + "fmt" + "io" + "io/fs" + "os" + "path" + "path/filepath" + "runtime" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/elastic/elastic-agent/pkg/core/logger" +) + +const foo_component_spec = ` +version: 2 +inputs: + - name: foobar + description: "Foo input" + platforms: + - linux/amd64 + - linux/arm64 + - darwin/amd64 + - darwin/arm64 + outputs: + - elasticsearch + - kafka + - logstash + command: + args: + - foo + - bar + - baz +` + +type fileType uint + +const ( + REGULAR fileType = iota + DIRECTORY + SYMLINK +) + +type files struct { + fType fileType + path string + content string + mode fs.FileMode +} + +func (f files) Name() string { + return path.Base(f.path) +} + +func (f files) Size() int64 { + return int64(len(f.content)) +} + +func (f files) Mode() fs.FileMode { + return f.mode +} + +func (f files) ModTime() time.Time { + return time.Unix(0, 0) +} + +func (f files) IsDir() bool { + return f.fType == DIRECTORY +} + +func (f files) Sys() any { + return nil +} + +type createArchiveFunc func(t *testing.T, archiveFiles []files) (string, error) +type checkExtractedPath func(t *testing.T, testDataDir string) + +func TestUpgrader_unpack(t *testing.T) { + type args struct { + version string + archiveGenerator createArchiveFunc + archiveFiles []files + } + tests := []struct { + name string + args args + want string + wantErr assert.ErrorAssertionFunc + checkFiles checkExtractedPath + }{ + { + name: "targz with file before containing folder", + args: args{ + version: "1.2.3", + archiveFiles: []files{ + {fType: DIRECTORY, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64", mode: fs.ModeDir | (fs.ModePerm & 0o750)}, + {fType: REGULAR, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64/" + agentCommitFile, content: "abcdefghijklmnopqrstuvwxyz", mode: fs.ModePerm & 0o640}, + {fType: REGULAR, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64/data/elastic-agent-abcdef/package.version", content: "1.2.3", mode: fs.ModePerm & 0o640}, + {fType: DIRECTORY, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64/data", mode: fs.ModeDir | (fs.ModePerm & 0o750)}, + {fType: DIRECTORY, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64/data/elastic-agent-abcdef", mode: fs.ModeDir | (fs.ModePerm & 0o700)}, + {fType: REGULAR, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64/data/elastic-agent-abcdef/" + agentName, content: "Placeholder for the elastic-agent binary", mode: fs.ModePerm & 0o750}, + {fType: DIRECTORY, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64/data/elastic-agent-abcdef/components", mode: fs.ModeDir | (fs.ModePerm & 0o750)}, + {fType: REGULAR, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64/data/elastic-agent-abcdef/components/comp1", content: "Placeholder for component", mode: fs.ModePerm & 0o750}, + {fType: REGULAR, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64/data/elastic-agent-abcdef/components/comp1.spec.yml", content: foo_component_spec, mode: fs.ModePerm & 0o640}, + {fType: SYMLINK, path: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64/" + agentName, content: "data/elastic-agent-abcdef/" + agentName, mode: fs.ModeSymlink | (fs.ModePerm & 0o750)}, + }, + archiveGenerator: func(t *testing.T, i []files) (string, error) { + return createTarArchive(t, "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz", i) + }, + }, + want: "abcdef", + wantErr: assert.NoError, + checkFiles: func(t *testing.T, testDataDir string) { + + versionedHome := filepath.Join(testDataDir, "elastic-agent-abcdef") + require.DirExists(t, versionedHome, "directory for package.version does not exists") + stat, err := os.Stat(versionedHome) + require.NoErrorf(t, err, "error calling Stat() for versionedHome %q", versionedHome) + expectedPermissions := fs.ModePerm & 0o700 + actualPermissions := fs.ModePerm & stat.Mode() + assert.Equalf(t, expectedPermissions, actualPermissions, "Wrong permissions set on versioned home %q: expected %O, got %O", versionedHome, expectedPermissions, actualPermissions) + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("tar.gz tests only run on Linux/MacOS") + } + + testTop := t.TempDir() + testDataDir := filepath.Join(testTop, "data") + err := os.MkdirAll(testDataDir, 0o777) + assert.NoErrorf(t, err, "error creating initial structure %q", testDataDir) + log, _ := logger.NewTesting(tt.name) + u := &Upgrader{ + log: log, + } + + archiveFile, err := tt.args.archiveGenerator(t, tt.args.archiveFiles) + require.NoError(t, err, "creation of test archive file failed") + + got, err := u.unpack(tt.args.version, archiveFile, testDataDir) + if !tt.wantErr(t, err, fmt.Sprintf("unpack(%v, %v, %v)", tt.args.version, archiveFile, testDataDir)) { + return + } + assert.Equalf(t, tt.want, got, "unpack(%v, %v, %v)", tt.args.version, archiveFile, testDataDir) + if tt.checkFiles != nil { + tt.checkFiles(t, testDataDir) + } + }) + } +} + +func createTarArchive(t *testing.T, archiveName string, archiveFiles []files) (string, error) { + + outDir := t.TempDir() + + outFilePath := filepath.Join(outDir, archiveName) + file, err := os.OpenFile(outFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0o644) + require.NoErrorf(t, err, "error creating output archive %q", outFilePath) + defer file.Close() + zipWriter := gzip.NewWriter(file) + writer := tar.NewWriter(zipWriter) + defer func(writer *tar.Writer) { + err := writer.Close() + require.NoError(t, err, "error closing tar writer") + err = zipWriter.Close() + require.NoError(t, err, "error closing gzip writer") + }(writer) + + for _, af := range archiveFiles { + err = addEntryToTarArchive(af, writer) + require.NoErrorf(t, err, "error adding %q to tar archive", af.path) + } + + return outFilePath, err +} + +func addEntryToTarArchive(af files, writer *tar.Writer) error { + header, err := tar.FileInfoHeader(&af, af.content) + if err != nil { + return err + } + + header.Name = af.path + + if err := writer.WriteHeader(header); err != nil { + return err + } + + if af.IsDir() || af.fType == SYMLINK { + return nil + } + + if _, err = io.Copy(writer, strings.NewReader(af.content)); err != nil { + return fmt.Errorf("copying file %q content: %w", af.path, err) + } + return nil +} diff --git a/internal/pkg/agent/application/upgrade/upgrade.go b/internal/pkg/agent/application/upgrade/upgrade.go index 5fd8d7d989d..46cf449f963 100644 --- a/internal/pkg/agent/application/upgrade/upgrade.go +++ b/internal/pkg/agent/application/upgrade/upgrade.go @@ -170,7 +170,7 @@ func (u *Upgrader) Upgrade(ctx context.Context, version string, sourceURI string det.SetState(details.StateExtracting) - newHash, err := u.unpack(version, archivePath) + newHash, err := u.unpack(version, archivePath, paths.Data()) if err != nil { return nil, err } diff --git a/internal/pkg/agent/application/upgrade/upgrade_test.go b/internal/pkg/agent/application/upgrade/upgrade_test.go index d0e3f756ab4..57230fdedbe 100644 --- a/internal/pkg/agent/application/upgrade/upgrade_test.go +++ b/internal/pkg/agent/application/upgrade/upgrade_test.go @@ -8,7 +8,6 @@ import ( "context" "crypto/tls" "fmt" - "io/ioutil" "os" "path/filepath" "runtime" @@ -112,7 +111,7 @@ func Test_CopyFile(t *testing.T) { func TestShutdownCallback(t *testing.T) { l, _ := logger.New("test", false) - tmpDir, err := ioutil.TempDir("", "shutdown-test-") + tmpDir, err := os.MkdirTemp("", "shutdown-test-") require.NoError(t, err) defer os.RemoveAll(tmpDir) @@ -135,14 +134,14 @@ func TestShutdownCallback(t *testing.T) { cb := shutdownCallback(l, homePath, sourceVersion, targetVersion, newCommit) oldFilename := filepath.Join(sourceDir, filename) - err = ioutil.WriteFile(oldFilename, content, 0640) + err = os.WriteFile(oldFilename, content, 0640) require.NoError(t, err, "preparing file failed") err = cb() require.NoError(t, err, "callback failed") newFilename := filepath.Join(targetDir, filename) - newContent, err := ioutil.ReadFile(newFilename) + newContent, err := os.ReadFile(newFilename) require.NoError(t, err, "reading file failed") require.Equal(t, content, newContent, "contents are not equal") } diff --git a/internal/pkg/agent/cleaner/cleaner_test.go b/internal/pkg/agent/cleaner/cleaner_test.go index cf189b784d3..f242f8fc257 100644 --- a/internal/pkg/agent/cleaner/cleaner_test.go +++ b/internal/pkg/agent/cleaner/cleaner_test.go @@ -6,7 +6,6 @@ package cleaner import ( "context" - "io/ioutil" "os" "path/filepath" "testing" @@ -31,14 +30,14 @@ func TestCleaner(t *testing.T) { checkDir(t, dir, 0) // Create files - err := ioutil.WriteFile(watchFilePath, []byte{}, 0600) + err := os.WriteFile(watchFilePath, []byte{}, 0600) if err != nil { t.Fatal(err) } for i, fn := range removeFiles { removeFilePaths[i] = filepath.Join(dir, fn) - err := ioutil.WriteFile(removeFilePaths[i], []byte{}, 0600) + err := os.WriteFile(removeFilePaths[i], []byte{}, 0600) if err != nil { t.Fatal(err) } diff --git a/internal/pkg/agent/cmd/component_spec.go b/internal/pkg/agent/cmd/component_spec.go index 1025e488b42..96eebeb123a 100644 --- a/internal/pkg/agent/cmd/component_spec.go +++ b/internal/pkg/agent/cmd/component_spec.go @@ -6,7 +6,7 @@ package cmd import ( "fmt" - "io/ioutil" + "os" "github.com/spf13/cobra" @@ -22,7 +22,7 @@ func newComponentSpecCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra. Long: "Validates a component specification that instructs the Elastic Agent how it should be ran.", Args: cobra.ExactArgs(1), RunE: func(c *cobra.Command, args []string) error { - data, err := ioutil.ReadFile(args[0]) + data, err := os.ReadFile(args[0]) if err != nil { return err } diff --git a/internal/pkg/agent/cmd/enroll.go b/internal/pkg/agent/cmd/enroll.go index 95a13341a87..b6cd4071578 100644 --- a/internal/pkg/agent/cmd/enroll.go +++ b/internal/pkg/agent/cmd/enroll.go @@ -55,6 +55,8 @@ func addEnrollFlags(cmd *cobra.Command) { cmd.Flags().StringP("fleet-server-es-ca", "", "", "Path to certificate authority to use with communicate with elasticsearch") cmd.Flags().StringP("fleet-server-es-ca-trusted-fingerprint", "", "", "Elasticsearch certificate authority's SHA256 fingerprint") cmd.Flags().BoolP("fleet-server-es-insecure", "", false, "Disables validation of certificates") + cmd.Flags().StringP("fleet-server-es-cert", "", "", "Client certificate to use when connecting to Elasticsearch.") + cmd.Flags().StringP("fleet-server-es-cert-key", "", "", "Client private key to use when connecing to Elasticsearch.") cmd.Flags().StringP("fleet-server-service-token", "", "", "Service token to use for communication with elasticsearch") cmd.Flags().StringP("fleet-server-service-token-path", "", "", "Filepath for service token secret file to use for communication with elasticsearch") cmd.Flags().StringP("fleet-server-policy", "", "", "Start and run a Fleet Server on this specific policy") @@ -63,10 +65,13 @@ func addEnrollFlags(cmd *cobra.Command) { cmd.Flags().StringP("fleet-server-cert", "", "", "Certificate to use for exposed Fleet Server HTTPS endpoint") cmd.Flags().StringP("fleet-server-cert-key", "", "", "Private key to use for exposed Fleet Server HTTPS endpoint") cmd.Flags().StringP("fleet-server-cert-key-passphrase", "", "", "Path for private key passphrase file used to decrypt certificate key") + cmd.Flags().StringP("fleet-server-client-auth", "", "none", "Fleet-server mTLS client authentication for connecting elastic-agents. Must be one of [none, optional, required]") cmd.Flags().StringSliceP("header", "", []string{}, "Headers used in communication with elasticsearch") cmd.Flags().BoolP("fleet-server-insecure-http", "", false, "Expose Fleet Server over HTTP (not recommended; insecure)") cmd.Flags().StringP("certificate-authorities", "a", "", "Comma separated list of root certificate for server verifications") cmd.Flags().StringP("ca-sha256", "p", "", "Comma separated list of certificate authorities hash pins used for certificate verifications") + cmd.Flags().StringP("elastic-agent-cert", "", "", "Elastic-agent client certificate to use with fleet-server during authentication") + cmd.Flags().StringP("elastic-agent-cert-key", "", "", "Elastic-agent client certificate to use with fleet-server during authentication") cmd.Flags().BoolP("insecure", "i", false, "Allow insecure connection to fleet-server") cmd.Flags().StringP("staging", "", "", "Configures agent to download artifacts from a staging build") cmd.Flags().StringP("proxy-url", "", "", "Configures the proxy url") @@ -86,10 +91,26 @@ func validateEnrollFlags(cmd *cobra.Command) error { if ca != "" && !filepath.IsAbs(ca) { return errors.New("--certificate-authorities must be provided as an absolute path", errors.M("path", ca), errors.TypeConfig) } + cert, _ := cmd.Flags().GetString("elastic-agent-cert") + if cert != "" && !filepath.IsAbs(cert) { + return errors.New("--elastic-agent-cert must be provided as an absolute path", errors.M("path", cert), errors.TypeConfig) + } + key, _ := cmd.Flags().GetString("elastic-agent-cert-key") + if key != "" && !filepath.IsAbs(key) { + return errors.New("--elastic-agent-cert-key must be provided as an absolute path", errors.M("path", key), errors.TypeConfig) + } esCa, _ := cmd.Flags().GetString("fleet-server-es-ca") if esCa != "" && !filepath.IsAbs(esCa) { return errors.New("--fleet-server-es-ca must be provided as an absolute path", errors.M("path", esCa), errors.TypeConfig) } + esCert, _ := cmd.Flags().GetString("fleet-server-es-cert") + if esCert != "" && !filepath.IsAbs(esCert) { + return errors.New("--fleet-server-es-cert must be provided as an absolute path", errors.M("path", esCert), errors.TypeConfig) + } + esCertKey, _ := cmd.Flags().GetString("fleet-server-es-cert-key") + if esCertKey != "" && !filepath.IsAbs(esCertKey) { + return errors.New("--fleet-server-es-cert-key must be provided as an absolute path", errors.M("path", esCertKey), errors.TypeConfig) + } fCert, _ := cmd.Flags().GetString("fleet-server-cert") if fCert != "" && !filepath.IsAbs(fCert) { return errors.New("--fleet-server-cert must be provided as an absolute path", errors.M("path", fCert), errors.TypeConfig) @@ -110,6 +131,13 @@ func validateEnrollFlags(cmd *cobra.Command) error { if fPassphrase != "" && !filepath.IsAbs(fPassphrase) { return errors.New("--fleet-server-cert-key-passphrase must be provided as an absolute path", errors.M("path", fPassphrase), errors.TypeConfig) } + fClientAuth, _ := cmd.Flags().GetString("fleet-server-client-auth") + switch fClientAuth { + case "none", "optional", "required": + // NOTE we can split this case if we want to do additional checks when optional or required is passed. + default: + return errors.New("--fleet-server-client-auth must be one of [none, optional, required]") + } return nil } @@ -124,6 +152,8 @@ func buildEnrollmentFlags(cmd *cobra.Command, url string, token string) []string fElasticSearchCA, _ := cmd.Flags().GetString("fleet-server-es-ca") fElasticSearchCASHA256, _ := cmd.Flags().GetString("fleet-server-es-ca-trusted-fingerprint") fElasticSearchInsecure, _ := cmd.Flags().GetBool("fleet-server-es-insecure") + fElasticSearchClientCert, _ := cmd.Flags().GetString("fleet-server-es-cert") + fElasticSearchClientCertKey, _ := cmd.Flags().GetString("fleet-server-es-cert-key") fServiceToken, _ := cmd.Flags().GetString("fleet-server-service-token") fServiceTokenPath, _ := cmd.Flags().GetString("fleet-server-service-token-path") fPolicy, _ := cmd.Flags().GetString("fleet-server-policy") @@ -132,9 +162,12 @@ func buildEnrollmentFlags(cmd *cobra.Command, url string, token string) []string fCert, _ := cmd.Flags().GetString("fleet-server-cert") fCertKey, _ := cmd.Flags().GetString("fleet-server-cert-key") fPassphrase, _ := cmd.Flags().GetString("fleet-server-cert-key-passphrase") + fClientAuth, _ := cmd.Flags().GetString("fleet-server-client-auth") fHeaders, _ := cmd.Flags().GetStringSlice("header") fInsecure, _ := cmd.Flags().GetBool("fleet-server-insecure-http") ca, _ := cmd.Flags().GetString("certificate-authorities") + cert, _ := cmd.Flags().GetString("elastic-agent-cert") + key, _ := cmd.Flags().GetString("elastic-agent-cert-key") sha256, _ := cmd.Flags().GetString("ca-sha256") insecure, _ := cmd.Flags().GetBool("insecure") staging, _ := cmd.Flags().GetString("staging") @@ -167,6 +200,14 @@ func buildEnrollmentFlags(cmd *cobra.Command, url string, token string) []string args = append(args, "--fleet-server-es-ca-trusted-fingerprint") args = append(args, fElasticSearchCASHA256) } + if fElasticSearchClientCert != "" { + args = append(args, "--fleet-server-es-cert") + args = append(args, fElasticSearchClientCert) + } + if fElasticSearchClientCertKey != "" { + args = append(args, "--fleet-server-es-cert-key") + args = append(args, fElasticSearchClientCertKey) + } if fServiceToken != "" { args = append(args, "--fleet-server-service-token") args = append(args, fServiceToken) @@ -199,6 +240,10 @@ func buildEnrollmentFlags(cmd *cobra.Command, url string, token string) []string args = append(args, "--fleet-server-cert-key-passphrase") args = append(args, fPassphrase) } + if fClientAuth != "" { + args = append(args, "--fleet-server-client-auth") + args = append(args, fClientAuth) + } if daemonTimeout != 0 { args = append(args, "--daemon-timeout") args = append(args, daemonTimeout.String()) @@ -220,6 +265,14 @@ func buildEnrollmentFlags(cmd *cobra.Command, url string, token string) []string args = append(args, "--certificate-authorities") args = append(args, ca) } + if cert != "" { + args = append(args, "--elastic-agent-cert") + args = append(args, cert) + } + if key != "" { + args = append(args, "--elastic-agent-cert-key") + args = append(args, key) + } if sha256 != "" { args = append(args, "--ca-sha256") args = append(args, sha256) @@ -328,6 +381,8 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { fElasticSearchCA, _ := cmd.Flags().GetString("fleet-server-es-ca") fElasticSearchCASHA256, _ := cmd.Flags().GetString("fleet-server-es-ca-trusted-fingerprint") fElasticSearchInsecure, _ := cmd.Flags().GetBool("fleet-server-es-insecure") + fElasticSearchClientCert, _ := cmd.Flags().GetString("fleet-server-es-cert") + fElasticSearchClientCertKey, _ := cmd.Flags().GetString("fleet-server-es-cert-key") fHeaders, _ := cmd.Flags().GetStringSlice("header") fServiceToken, _ := cmd.Flags().GetString("fleet-server-service-token") fServiceTokenPath, _ := cmd.Flags().GetString("fleet-server-service-token-path") @@ -338,6 +393,7 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { fCert, _ := cmd.Flags().GetString("fleet-server-cert") fCertKey, _ := cmd.Flags().GetString("fleet-server-cert-key") fPassphrase, _ := cmd.Flags().GetString("fleet-server-cert-key-passphrase") + fClientAuth, _ := cmd.Flags().GetString("fleet-server-client-auth") fInsecure, _ := cmd.Flags().GetBool("fleet-server-insecure-http") proxyURL, _ := cmd.Flags().GetString("proxy-url") proxyDisabled, _ := cmd.Flags().GetBool("proxy-disabled") @@ -352,6 +408,8 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { CAs := cli.StringToSlice(caStr) caSHA256str, _ := cmd.Flags().GetString("ca-sha256") caSHA256 := cli.StringToSlice(caSHA256str) + cert, _ := cmd.Flags().GetString("elastic-agent-cert") + key, _ := cmd.Flags().GetString("elastic-agent-cert-key") ctx := handleSignal(context.Background()) @@ -369,6 +427,8 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { URL: url, CAs: CAs, CASha256: caSHA256, + Certificate: cert, + Key: key, Insecure: insecure, UserProvidedMetadata: make(map[string]interface{}), Staging: staging, @@ -385,6 +445,8 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { ElasticsearchCA: fElasticSearchCA, ElasticsearchCASHA256: fElasticSearchCASHA256, ElasticsearchInsecure: fElasticSearchInsecure, + ElasticsearchCert: fElasticSearchClientCert, + ElasticsearchCertKey: fElasticSearchClientCertKey, ServiceToken: fServiceToken, ServiceTokenPath: fServiceTokenPath, PolicyID: fPolicy, @@ -393,6 +455,7 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { Cert: fCert, CertKey: fCertKey, CertKeyPassphrasePath: fPassphrase, + ClientAuth: fClientAuth, Insecure: fInsecure, SpawnAgent: !fromInstall, Headers: mapFromEnvList(fHeaders), diff --git a/internal/pkg/agent/cmd/enroll_cmd.go b/internal/pkg/agent/cmd/enroll_cmd.go index 0d36e5cef36..dc9f4503dac 100644 --- a/internal/pkg/agent/cmd/enroll_cmd.go +++ b/internal/pkg/agent/cmd/enroll_cmd.go @@ -80,6 +80,8 @@ type enrollCmdFleetServerOption struct { ElasticsearchCA string ElasticsearchCASHA256 string ElasticsearchInsecure bool + ElasticsearchCert string + ElasticsearchCertKey string ServiceToken string ServiceTokenPath string PolicyID string @@ -89,6 +91,7 @@ type enrollCmdFleetServerOption struct { Cert string CertKey string CertKeyPassphrasePath string + ClientAuth string Insecure bool SpawnAgent bool Headers map[string]string @@ -101,6 +104,8 @@ type enrollCmdOption struct { InternalURL string `yaml:"-"` CAs []string `yaml:"ca,omitempty"` CASha256 []string `yaml:"ca_sha256,omitempty"` + Certificate string `yaml:"certificate,omitempty"` + Key string `yaml:"key,omitempty"` Insecure bool `yaml:"insecure,omitempty"` EnrollAPIKey string `yaml:"enrollment_key,omitempty"` Staging string `yaml:"staging,omitempty"` @@ -137,6 +142,12 @@ func (e *enrollCmdOption) remoteConfig() (remote.Config, error) { if e.Insecure { tlsCfg.VerificationMode = tlscommon.VerifyNone } + if e.Certificate != "" || e.Key != "" { + tlsCfg.Certificate = tlscommon.CertificateConfig{ + Certificate: e.Certificate, + Key: e.Key, + } + } cfg.Transport.TLS = &tlsCfg @@ -344,6 +355,8 @@ func (c *enrollCmd) fleetServerBootstrap(ctx context.Context, persistentConfig m c.options.FleetServer.PolicyID, c.options.FleetServer.Host, c.options.FleetServer.Port, c.options.FleetServer.InternalPort, c.options.FleetServer.Cert, c.options.FleetServer.CertKey, c.options.FleetServer.CertKeyPassphrasePath, c.options.FleetServer.ElasticsearchCA, c.options.FleetServer.ElasticsearchCASHA256, + c.options.CAs, c.options.FleetServer.ClientAuth, + c.options.FleetServer.ElasticsearchCert, c.options.FleetServer.ElasticsearchCertKey, c.options.FleetServer.Headers, c.options.ProxyURL, c.options.ProxyDisabled, @@ -570,6 +583,8 @@ func (c *enrollCmd) enroll(ctx context.Context, persistentConfig map[string]inte c.options.FleetServer.PolicyID, c.options.FleetServer.Host, c.options.FleetServer.Port, c.options.FleetServer.InternalPort, c.options.FleetServer.Cert, c.options.FleetServer.CertKey, c.options.FleetServer.CertKeyPassphrasePath, c.options.FleetServer.ElasticsearchCA, c.options.FleetServer.ElasticsearchCASHA256, + c.options.CAs, c.options.FleetServer.ClientAuth, + c.options.FleetServer.ElasticsearchCert, c.options.FleetServer.ElasticsearchCertKey, c.options.FleetServer.Headers, c.options.ProxyURL, c.options.ProxyDisabled, c.options.ProxyHeaders, c.options.FleetServer.ElasticsearchInsecure, @@ -921,6 +936,8 @@ func createFleetServerBootstrapConfig( connStr, serviceToken, serviceTokenPath, policyID, host string, port uint16, internalPort uint16, cert, key, passphrasePath, esCA, esCASHA256 string, + cas []string, clientAuth string, + esClientCert, esClientCertKey string, headers map[string]string, proxyURL string, proxyDisabled bool, @@ -951,6 +968,16 @@ func createFleetServerBootstrapConfig( es.TLS.CATrustedFingerprint = esCASHA256 } } + if esClientCert != "" || esClientCertKey != "" { + if es.TLS == nil { + es.TLS = &tlscommon.Config{} + } + + es.TLS.Certificate = tlscommon.CertificateConfig{ + Certificate: esClientCert, + Key: esClientCertKey, + } + } if host == "" { host = defaultFleetServerHost } @@ -988,7 +1015,7 @@ func createFleetServerBootstrapConfig( cfg.Server.Policy = &configuration.FleetServerPolicyConfig{ID: policyID} } if cert != "" || key != "" { - cfg.Server.TLS = &tlscommon.Config{ + cfg.Server.TLS = &tlscommon.ServerConfig{ Certificate: tlscommon.CertificateConfig{ Certificate: cert, Key: key, @@ -998,6 +1025,14 @@ func createFleetServerBootstrapConfig( if insecure { cfg.Server.TLS.VerificationMode = tlscommon.VerifyNone } + + cfg.Server.TLS.CAs = cas + + var cAuth tlscommon.TLSClientAuth + cfg.Server.TLS.ClientAuth = &cAuth + if err := cfg.Server.TLS.ClientAuth.Unpack(clientAuth); err != nil { + return nil, errors.New(err, "failed to unpack --fleet-server-client-auth", errors.TypeConfig) + } } if localFleetServer { diff --git a/internal/pkg/agent/cmd/enroll_cmd_test.go b/internal/pkg/agent/cmd/enroll_cmd_test.go index 2d28db5a4f8..d9c2f7207e4 100644 --- a/internal/pkg/agent/cmd/enroll_cmd_test.go +++ b/internal/pkg/agent/cmd/enroll_cmd_test.go @@ -9,7 +9,6 @@ import ( "context" "crypto/tls" "io" - "io/ioutil" "net" "net/http" "net/http/httptest" @@ -352,13 +351,15 @@ func TestValidateArgs(t *testing.T) { require.NoError(t, err) args := buildEnrollmentFlags(cmd, url, enrolmentToken) require.NotNil(t, args) - require.Equal(t, len(args), 9) + require.Equal(t, len(args), 11) require.Contains(t, args, "--tag") require.Contains(t, args, "windows") require.Contains(t, args, "production") require.Contains(t, args, "--insecure") require.Contains(t, args, enrolmentToken) require.Contains(t, args, url) + require.Contains(t, args, "--fleet-server-client-auth") + require.Contains(t, args, "none") cleanedTags := cleanTags(args) require.Contains(t, cleanedTags, "windows") require.Contains(t, cleanedTags, "production") @@ -372,12 +373,14 @@ func TestValidateArgs(t *testing.T) { require.Contains(t, args, "--tag") require.Contains(t, args, "windows") require.Contains(t, args, " production") + require.Contains(t, args, "--fleet-server-client-auth") + require.Contains(t, args, "none") cleanedTags := cleanTags(args) require.Contains(t, cleanedTags, "windows") require.Contains(t, cleanedTags, "production") // Validate that we remove the duplicates - require.Equal(t, len(args), 10) - require.Equal(t, len(cleanedTags), 7) + require.Equal(t, len(args), 12) + require.Equal(t, len(cleanedTags), 9) }) t.Run("valid tag and empty tag", func(t *testing.T) { @@ -388,6 +391,8 @@ func TestValidateArgs(t *testing.T) { require.Contains(t, args, "--tag") require.Contains(t, args, "windows") require.Contains(t, args, " ") + require.Contains(t, args, "--fleet-server-client-auth") + require.Contains(t, args, "none") cleanedTags := cleanTags(args) require.Contains(t, cleanedTags, "windows") require.NotContains(t, cleanedTags, " ") @@ -406,6 +411,32 @@ func TestValidateArgs(t *testing.T) { require.Contains(t, args, "--fleet-server-service-token-path") require.Contains(t, args, "/path/to/token") }) + + t.Run("fleet-es client certificates are passed", func(t *testing.T) { + cmd := newEnrollCommandWithArgs([]string{}, streams) + err := cmd.Flags().Set("fleet-server-es-cert", "/path/to/cert") + require.NoError(t, err) + err = cmd.Flags().Set("fleet-server-es-cert-key", "/path/to/key") + require.NoError(t, err) + args := buildEnrollmentFlags(cmd, url, enrolmentToken) + require.Contains(t, args, "--fleet-server-es-cert") + require.Contains(t, args, "/path/to/cert") + require.Contains(t, args, "--fleet-server-es-cert-key") + require.Contains(t, args, "/path/to/key") + }) + + t.Run("elastic-agent client certificates are passed", func(t *testing.T) { + cmd := newEnrollCommandWithArgs([]string{}, streams) + err := cmd.Flags().Set("elastic-agent-cert", "/path/to/cert") + require.NoError(t, err) + err = cmd.Flags().Set("elastic-agent-cert-key", "/path/to/key") + require.NoError(t, err) + args := buildEnrollmentFlags(cmd, url, enrolmentToken) + require.Contains(t, args, "--elastic-agent-cert") + require.Contains(t, args, "/path/to/cert") + require.Contains(t, args, "--elastic-agent-cert-key") + require.Contains(t, args, "/path/to/key") + }) } func TestValidateEnrollFlags(t *testing.T) { @@ -478,7 +509,7 @@ func withTLSServer( } func bytesToTMPFile(b []byte) (string, error) { - f, err := ioutil.TempFile("", "prefix") + f, err := os.CreateTemp("", "prefix") if err != nil { return "", err } diff --git a/internal/pkg/agent/cmd/inspect.go b/internal/pkg/agent/cmd/inspect.go index 094d4584a06..24f1cc0bc79 100644 --- a/internal/pkg/agent/cmd/inspect.go +++ b/internal/pkg/agent/cmd/inspect.go @@ -130,20 +130,23 @@ type inspectConfigOpts struct { func inspectConfig(ctx context.Context, cfgPath string, opts inspectConfigOpts, streams *cli.IOStreams) error { l, err := newErrorLogger() if err != nil { - return err + return fmt.Errorf("error creating logger: %w", err) } if !opts.variables && !opts.includeMonitoring { fullCfg, err := operations.LoadFullAgentConfig(ctx, l, cfgPath, true) if err != nil { - return err + return fmt.Errorf("error loading agent config: %w", err) + } + err = printConfig(fullCfg, streams) + if err != nil { + return fmt.Errorf("error printing config: %w", err) } - return printConfig(fullCfg, streams) } cfg, lvl, err := getConfigWithVariables(ctx, l, cfgPath, opts.variablesWait) if err != nil { - return err + return fmt.Errorf("error fetching config with variables: %w", err) } agentInfo, err := info.NewAgentInfoWithLog(ctx, "error", false) @@ -212,12 +215,17 @@ func printMapStringConfig(mapStr map[string]interface{}, streams *cli.IOStreams) return err } +// convert the config object to a mapstr and print to the stream specified in in streams.Out func printConfig(cfg *config.Config, streams *cli.IOStreams) error { mapStr, err := cfg.ToMapStr() if err != nil { - return err + return fmt.Errorf("error parsing config as hashmap: %w", err) + } + err = printMapStringConfig(mapStr, streams) + if err != nil { + return fmt.Errorf("error printing config to output: %w", err) } - return printMapStringConfig(mapStr, streams) + return nil } type inspectComponentsOpts struct { diff --git a/internal/pkg/agent/cmd/install_test.go b/internal/pkg/agent/cmd/install_test.go index a94864568c8..221fda4648d 100644 --- a/internal/pkg/agent/cmd/install_test.go +++ b/internal/pkg/agent/cmd/install_test.go @@ -9,7 +9,6 @@ package cmd import ( "testing" - "github.com/spf13/cobra" "github.com/stretchr/testify/require" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" @@ -52,10 +51,11 @@ func TestInvalidBasePath(t *testing.T) { for name, test := range tests { t.Run(name, func(t *testing.T) { streams := cli.NewIOStreams() - cmd := cobra.Command{} - cmd.Flags().String(flagInstallBasePath, test.basePath, "") + cmd := newInstallCommandWithArgs([]string{}, streams) + err := cmd.Flags().Set(flagInstallBasePath, test.basePath) + require.NoError(t, err) - err := installCmd(streams, &cmd) + err = installCmd(streams, cmd) if test.expectedError == "" { require.NoError(t, err) diff --git a/internal/pkg/agent/cmd/install_windows_test.go b/internal/pkg/agent/cmd/install_windows_test.go index 58afb650e8b..855f1107146 100644 --- a/internal/pkg/agent/cmd/install_windows_test.go +++ b/internal/pkg/agent/cmd/install_windows_test.go @@ -9,7 +9,6 @@ package cmd import ( "testing" - "github.com/spf13/cobra" "github.com/stretchr/testify/require" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" @@ -52,10 +51,11 @@ func TestInvalidBasePath(t *testing.T) { for name, test := range tests { t.Run(name, func(t *testing.T) { streams := cli.NewIOStreams() - cmd := cobra.Command{} - cmd.Flags().String(flagInstallBasePath, test.basePath, "") + cmd := newInstallCommandWithArgs([]string{}, streams) + err := cmd.Flags().Set(flagInstallBasePath, test.basePath) + require.NoError(t, err) - err := installCmd(streams, &cmd) + err = installCmd(streams, cmd) if test.expectedError == "" { require.NoError(t, err) diff --git a/internal/pkg/agent/cmd/run.go b/internal/pkg/agent/cmd/run.go index 927a79808df..e878e75bb98 100644 --- a/internal/pkg/agent/cmd/run.go +++ b/internal/pkg/agent/cmd/run.go @@ -12,6 +12,7 @@ import ( "os/signal" "path/filepath" "strings" + "sync" "syscall" "time" @@ -19,6 +20,7 @@ import ( apmtransport "go.elastic.co/apm/transport" "gopkg.in/yaml.v2" + "github.com/hashicorp/go-multierror" "github.com/spf13/cobra" "github.com/elastic/elastic-agent-libs/api" @@ -61,6 +63,7 @@ const ( ) type cfgOverrider func(cfg *configuration.Configuration) +type awaiters []<-chan struct{} func newRunCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command { cmd := &cobra.Command{ @@ -136,17 +139,38 @@ func run(override cfgOverrider, testingMode bool, fleetInitTimeout time.Duration go service.ProcessWindowsControlEvents(stopBeat) // detect otel - if runAsOtel := otel.IsOtelConfig(ctx, paths.ConfigFile()); runAsOtel { - return otel.Run(ctx, cancel, stop, testingMode) + runAsOtel := otel.IsOtelConfig(ctx, paths.ConfigFile()) + var awaiters awaiters + var resErr error + if runAsOtel { + var otelStartWg sync.WaitGroup + otelAwaiter := make(chan struct{}) + awaiters = append(awaiters, otelAwaiter) + + otelStartWg.Add(1) + go func() { + otelStartWg.Done() + if err := otel.Run(ctx, stop); err != nil { + resErr = multierror.Append(resErr, err) + } + + // close awaiter handled in run loop + close(otelAwaiter) + }() + + // wait for otel to start + otelStartWg.Wait() } - // not otel continue as usual - return runElasticAgent(ctx, cancel, override, stop, testingMode, fleetInitTimeout, modifiers...) + if err := runElasticAgent(ctx, cancel, override, stop, testingMode, fleetInitTimeout, runAsOtel, awaiters, modifiers...); err != nil { + resErr = multierror.Append(resErr, err) + } + return resErr } -func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cfgOverrider, stop chan bool, testingMode bool, fleetInitTimeout time.Duration, modifiers ...component.PlatformModifier) error { - cfg, err := loadConfig(ctx, override) +func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cfgOverrider, stop chan bool, testingMode bool, fleetInitTimeout time.Duration, runAsOtel bool, awaiters awaiters, modifiers ...component.PlatformModifier) error { + cfg, err := loadConfig(ctx, override, runAsOtel) if err != nil { return err } @@ -259,7 +283,7 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf l.Info("APM instrumentation disabled") } - coord, configMgr, composable, err := application.New(ctx, l, baseLogger, logLvl, agentInfo, rex, tracer, testingMode, fleetInitTimeout, configuration.IsFleetServerBootstrap(cfg.Fleet), modifiers...) + coord, configMgr, composable, err := application.New(ctx, l, baseLogger, logLvl, agentInfo, rex, tracer, testingMode, fleetInitTimeout, configuration.IsFleetServerBootstrap(cfg.Fleet), runAsOtel, modifiers...) if err != nil { return err } @@ -366,6 +390,9 @@ LOOP: } cancel() err = <-appErr + for _, a := range awaiters { + <-a // wait for awaiter to be done + } if logShutdown { l.Info("Shutting down completed.") @@ -376,7 +403,11 @@ LOOP: return err } -func loadConfig(ctx context.Context, override cfgOverrider) (*configuration.Configuration, error) { +func loadConfig(ctx context.Context, override cfgOverrider, runAsOtel bool) (*configuration.Configuration, error) { + if runAsOtel { + return configuration.DefaultConfiguration(), nil + } + pathConfigFile := paths.ConfigFile() rawConfig, err := config.LoadFile(pathConfigFile) if err != nil { @@ -527,7 +558,7 @@ func tryDelayEnroll(ctx context.Context, logger *logger.Logger, cfg *configurati errors.M("path", enrollPath))) } logger.Info("Successfully performed delayed enrollment of this Elastic Agent.") - return loadConfig(ctx, override) + return loadConfig(ctx, override, false) } func initTracer(agentName, version string, mcfg *monitoringCfg.MonitoringConfig) (*apm.Tracer, error) { diff --git a/internal/pkg/agent/cmd/upgrade.go b/internal/pkg/agent/cmd/upgrade.go index 767560f873f..6c33fa43498 100644 --- a/internal/pkg/agent/cmd/upgrade.go +++ b/internal/pkg/agent/cmd/upgrade.go @@ -7,7 +7,6 @@ package cmd import ( "context" "fmt" - "io/ioutil" "os" "github.com/spf13/cobra" @@ -80,7 +79,7 @@ func upgradeCmd(streams *cli.IOStreams, cmd *cobra.Command, args []string) error // get local PGP pgpPath, _ := cmd.Flags().GetString(flagPGPBytesPath) if len(pgpPath) > 0 { - content, err := ioutil.ReadFile(pgpPath) + content, err := os.ReadFile(pgpPath) if err != nil { return errors.New(err, "failed to read pgp file") } diff --git a/internal/pkg/agent/configuration/fleet_server.go b/internal/pkg/agent/configuration/fleet_server.go index 5d541ba3386..7e1290df758 100644 --- a/internal/pkg/agent/configuration/fleet_server.go +++ b/internal/pkg/agent/configuration/fleet_server.go @@ -19,7 +19,7 @@ type FleetServerConfig struct { Host string `config:"host" yaml:"host,omitempty"` Port uint16 `config:"port" yaml:"port,omitempty"` InternalPort uint16 `config:"internal_port" yaml:"internal_port,omitempty"` - TLS *tlscommon.Config `config:"ssl" yaml:"ssl,omitempty"` + TLS *tlscommon.ServerConfig `config:"ssl" yaml:"ssl,omitempty"` } // FleetServerPolicyConfig is the configuration for the policy Fleet Server should run on. diff --git a/internal/pkg/agent/configuration/grpc.go b/internal/pkg/agent/configuration/grpc.go index 28210edb979..652aa04f4f3 100644 --- a/internal/pkg/agent/configuration/grpc.go +++ b/internal/pkg/agent/configuration/grpc.go @@ -8,17 +8,19 @@ import "fmt" // GRPCConfig is a configuration of GRPC server. type GRPCConfig struct { - Address string `config:"address"` - Port uint16 `config:"port"` - MaxMsgSize int `config:"max_message_size"` + Address string `config:"address"` + Port uint16 `config:"port"` + MaxMsgSize int `config:"max_message_size"` + CheckinChunkingDisabled bool `config:"checkin_chunking_disabled"` } // DefaultGRPCConfig creates a default server configuration. func DefaultGRPCConfig() *GRPCConfig { return &GRPCConfig{ - Address: "localhost", - Port: 6789, - MaxMsgSize: 1024 * 1024 * 100, // grpc default 4MB is unsufficient for diagnostics + Address: "localhost", + Port: 6789, + MaxMsgSize: 1024 * 1024 * 100, // grpc default 4MB is unsufficient for diagnostics + CheckinChunkingDisabled: false, // on by default } } diff --git a/internal/pkg/agent/storage/encrypted_disk_storage_windows_linux_test.go b/internal/pkg/agent/storage/encrypted_disk_storage_windows_linux_test.go index c29c7ec8fd9..83d0106d308 100644 --- a/internal/pkg/agent/storage/encrypted_disk_storage_windows_linux_test.go +++ b/internal/pkg/agent/storage/encrypted_disk_storage_windows_linux_test.go @@ -10,8 +10,8 @@ import ( "bytes" "context" "errors" + "io" "io/fs" - "io/ioutil" "os" "path/filepath" "testing" @@ -42,7 +42,7 @@ func TestEncryptedDiskStorageWindowsLinuxLoad(t *testing.T) { } defer r.Close() - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { t.Fatal(err) } @@ -99,7 +99,7 @@ func TestEncryptedDiskStorageWindowsLinuxLoad(t *testing.T) { } defer nr.Close() - b, err = ioutil.ReadAll(nr) + b, err = io.ReadAll(nr) if err != nil { t.Fatal(err) } diff --git a/internal/pkg/agent/storage/replace_store.go b/internal/pkg/agent/storage/replace_store.go index 5c166613d9f..fa495f9dc1e 100644 --- a/internal/pkg/agent/storage/replace_store.go +++ b/internal/pkg/agent/storage/replace_store.go @@ -8,7 +8,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "os" "time" @@ -43,7 +42,7 @@ func NewReplaceOnSuccessStore(target string, replaceWith []byte, wrapped Store) // Save will replace a target file with new content if the wrapped store is successful. func (r *ReplaceOnSuccessStore) Save(in io.Reader) error { // Ensure we can read the target files before delegating any call to the wrapped store. - target, err := ioutil.ReadFile(r.target) + target, err := os.ReadFile(r.target) if err != nil { return errors.New(err, fmt.Sprintf("fail to read content of %s", r.target), diff --git a/internal/pkg/agent/storage/storage_test.go b/internal/pkg/agent/storage/storage_test.go index 52cd1960b22..98f11a772e0 100644 --- a/internal/pkg/agent/storage/storage_test.go +++ b/internal/pkg/agent/storage/storage_test.go @@ -8,7 +8,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "os" "path/filepath" "runtime" @@ -45,7 +44,7 @@ func TestReplaceOrRollbackStore(t *testing.T) { err = s.Save(in) require.NoError(t, err) - writtenContent, err := ioutil.ReadFile(target) + writtenContent, err := os.ReadFile(target) require.NoError(t, err) require.True(t, bytes.Equal(writtenContent, replaceWith)) @@ -70,7 +69,7 @@ func TestReplaceOrRollbackStore(t *testing.T) { err = s.Save(in) require.Error(t, err) - writtenContent, err := ioutil.ReadFile(target) + writtenContent, err := os.ReadFile(target) require.NoError(t, err) require.True(t, bytes.Equal(writtenContent, oldContent)) @@ -94,7 +93,7 @@ func TestReplaceOrRollbackStore(t *testing.T) { err = s.Save(in) require.Error(t, err) - writtenContent, err := ioutil.ReadFile(target) + writtenContent, err := os.ReadFile(target) require.NoError(t, err) require.True(t, bytes.Equal(writtenContent, replaceWith)) @@ -124,7 +123,7 @@ func TestDiskStore(t *testing.T) { err = d.Save(bytes.NewReader(msg)) require.NoError(t, err) - content, err := ioutil.ReadFile(target) + content, err := os.ReadFile(target) require.NoError(t, err) require.Equal(t, msg, content) @@ -132,7 +131,7 @@ func TestDiskStore(t *testing.T) { }) t.Run("when the target do no exist", func(t *testing.T) { - dir, err := ioutil.TempDir("", "configs") + dir, err := os.MkdirTemp("", "configs") require.NoError(t, err) defer os.Remove(dir) @@ -143,7 +142,7 @@ func TestDiskStore(t *testing.T) { err = d.Save(bytes.NewReader(msg)) require.NoError(t, err) - content, err := ioutil.ReadFile(target) + content, err := os.ReadFile(target) require.NoError(t, err) require.Equal(t, msg, content) @@ -160,7 +159,7 @@ func TestDiskStore(t *testing.T) { require.NoError(t, err) defer r.Close() - content, err := ioutil.ReadAll(r) + content, err := io.ReadAll(r) require.NoError(t, err) require.Equal(t, msg, content) checkPerms(t, target, perms) @@ -168,12 +167,12 @@ func TestDiskStore(t *testing.T) { } func genFile(b []byte) (string, error) { - dir, err := ioutil.TempDir("", "configs") + dir, err := os.MkdirTemp("", "configs") if err != nil { return "", err } - f, err := ioutil.TempFile(dir, "config-") + f, err := os.CreateTemp(dir, "config-") if err != nil { return "", err } @@ -187,7 +186,7 @@ func genFile(b []byte) (string, error) { } func requireFilesCount(t *testing.T, dir string, l int) { - files, err := ioutil.ReadDir(dir) + files, err := os.ReadDir(dir) require.NoError(t, err) require.Equal(t, l, len(files)) } diff --git a/internal/pkg/agent/storage/store/action_store_test.go b/internal/pkg/agent/storage/store/action_store_test.go index e193183ab22..5a5d56b8056 100644 --- a/internal/pkg/agent/storage/store/action_store_test.go +++ b/internal/pkg/agent/storage/store/action_store_test.go @@ -5,7 +5,6 @@ package store import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -21,7 +20,7 @@ func TestActionStore(t *testing.T) { log, _ := logger.New("action_store", false) withFile := func(fn func(t *testing.T, file string)) func(*testing.T) { return func(t *testing.T) { - dir, err := ioutil.TempDir("", "action-store") + dir, err := os.MkdirTemp("", "action-store") require.NoError(t, err) defer os.RemoveAll(dir) file := filepath.Join(dir, "config.yml") diff --git a/internal/pkg/agent/vault/seed.go b/internal/pkg/agent/vault/seed.go index 6112e48313e..50c96a4a715 100644 --- a/internal/pkg/agent/vault/seed.go +++ b/internal/pkg/agent/vault/seed.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io/fs" - "io/ioutil" "os" "path/filepath" "sync" @@ -32,7 +31,7 @@ func getSeed(path string) ([]byte, error) { mxSeed.Lock() defer mxSeed.Unlock() - b, err := ioutil.ReadFile(fp) + b, err := os.ReadFile(fp) if err != nil { return nil, fmt.Errorf("could not read seed file: %w", err) } @@ -50,7 +49,7 @@ func createSeedIfNotExists(path string) ([]byte, error) { mxSeed.Lock() defer mxSeed.Unlock() - b, err := ioutil.ReadFile(fp) + b, err := os.ReadFile(fp) if err != nil { if !errors.Is(err, os.ErrNotExist) { return nil, err @@ -66,7 +65,7 @@ func createSeedIfNotExists(path string) ([]byte, error) { return nil, err } - err = ioutil.WriteFile(fp, seed, 0600) + err = os.WriteFile(fp, seed, 0600) if err != nil { return nil, err } diff --git a/internal/pkg/basecmd/version/cmd_test.go b/internal/pkg/basecmd/version/cmd_test.go index 2959c576183..93ed88101e2 100644 --- a/internal/pkg/basecmd/version/cmd_test.go +++ b/internal/pkg/basecmd/version/cmd_test.go @@ -5,7 +5,7 @@ package version import ( - "io/ioutil" + "io" "strings" "testing" @@ -30,7 +30,7 @@ func TestCmdBinaryOnly(t *testing.T) { require.NoError(t, err) err = cmd.Execute() require.NoError(t, err) - version, err := ioutil.ReadAll(out) + version, err := io.ReadAll(out) require.NoError(t, err) assert.True(t, strings.Contains(string(version), "Binary: ")) @@ -46,7 +46,7 @@ func TestCmdBinaryOnlyYAML(t *testing.T) { require.NoError(t, err) err = cmd.Execute() require.NoError(t, err) - version, err := ioutil.ReadAll(out) + version, err := io.ReadAll(out) require.NoError(t, err) @@ -67,7 +67,7 @@ func TestCmdDaemon(t *testing.T) { cmd := NewCommandWithArgs(streams) err := cmd.Execute() require.NoError(t, err) - version, err := ioutil.ReadAll(out) + version, err := io.ReadAll(out) require.NoError(t, err) assert.True(t, strings.Contains(string(version), "Binary: ")) @@ -85,7 +85,7 @@ func TestCmdDaemonYAML(t *testing.T) { require.NoError(t, err) err = cmd.Execute() require.NoError(t, err) - version, err := ioutil.ReadAll(out) + version, err := io.ReadAll(out) require.NoError(t, err) @@ -103,7 +103,7 @@ func TestCmdDaemonErr(t *testing.T) { cmd := NewCommandWithArgs(streams) err := cmd.Execute() require.Error(t, err) - version, err := ioutil.ReadAll(out) + version, err := io.ReadAll(out) require.NoError(t, err) assert.True(t, strings.Contains(string(version), "Binary: ")) @@ -118,7 +118,7 @@ func TestCmdDaemonErrYAML(t *testing.T) { require.NoError(t, err) err = cmd.Execute() require.Error(t, err) - version, err := ioutil.ReadAll(out) + version, err := io.ReadAll(out) require.NoError(t, err) var output Output diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index d9b5d956618..0f0f9a53dea 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -7,7 +7,6 @@ package config import ( "fmt" "io" - "io/ioutil" "os" "gopkg.in/yaml.v2" @@ -74,7 +73,7 @@ func NewConfigFrom(from interface{}, opts ...interface{}) (*Config, error) { if closer, ok := from.(io.Closer); ok { defer closer.Close() } - fData, err := ioutil.ReadAll(in) + fData, err := io.ReadAll(in) if err != nil { return nil, err } @@ -156,7 +155,7 @@ func (c *Config) ToMapStr(opts ...interface{}) (map[string]interface{}, error) { } ucfgOpts, local, err := getOptions(opts...) if err != nil { - return nil, err + return nil, fmt.Errorf("error unpacking logs: %w", err) } // remove and unpack each skip keys into its own map with no resolve @@ -167,21 +166,21 @@ func (c *Config) ToMapStr(opts ...interface{}) (map[string]interface{}, error) { if c.access().HasField(skip) { subCfg, err := c.access().Child(skip, -1) if err != nil { - return nil, err + return nil, fmt.Errorf("error accessing skip key %s: %w", skip, err) } var subUnpacked interface{} if subCfg.IsDict() { var subDict map[string]interface{} err = subCfg.Unpack(&subDict, ucfg.ResolveNOOP) if err != nil { - return nil, err + return nil, fmt.Errorf("error unpacking subdict object in config for skip key %s: %w", skip, err) } subUnpacked = subDict } else if subCfg.IsArray() { var subArr []interface{} err = subCfg.Unpack(&subArr, ucfg.ResolveNOOP) if err != nil { - return nil, err + return nil, fmt.Errorf("error unpacking subarray in config for skip key %s: %w ", skip, err) } subUnpacked = subArr } else { @@ -189,7 +188,7 @@ func (c *Config) ToMapStr(opts ...interface{}) (map[string]interface{}, error) { } _, err = c.access().Remove(skip, -1) if err != nil { - return nil, err + return nil, fmt.Errorf("error removing skip key %s: %w", skip, err) } skippedKeys[skip] = subUnpacked skippedKeysOrig[skip] = subCfg @@ -199,7 +198,7 @@ func (c *Config) ToMapStr(opts ...interface{}) (map[string]interface{}, error) { // perform unpack with the skip keys removed var m map[string]interface{} if err := c.access().Unpack(&m, ucfgOpts...); err != nil { - return nil, err + return nil, fmt.Errorf("error unpacking config to MapStr object: %w", err) } // add the skipped keys into the map and back into the config @@ -209,7 +208,7 @@ func (c *Config) ToMapStr(opts ...interface{}) (map[string]interface{}, error) { if len(skippedKeysOrig) > 0 { err := c.access().Merge(skippedKeysOrig, ucfg.ResolveNOOP) if err != nil { - return nil, err + return nil, fmt.Errorf("error merging config with skipped key config: %w", err) } } return m, nil diff --git a/internal/pkg/config/operations/inspector.go b/internal/pkg/config/operations/inspector.go index f1066c22531..55e78069292 100644 --- a/internal/pkg/config/operations/inspector.go +++ b/internal/pkg/config/operations/inspector.go @@ -29,12 +29,12 @@ var ( func LoadFullAgentConfig(ctx context.Context, logger *logger.Logger, cfgPath string, failOnFleetMissing bool) (*config.Config, error) { rawConfig, err := loadConfig(ctx, cfgPath) if err != nil { - return nil, err + return nil, fmt.Errorf("error loading raw config: %w", err) } cfg, err := configuration.NewFromConfig(rawConfig) if err != nil { - return nil, err + return nil, fmt.Errorf("error creating config object from raw agent config: %w", err) } if configuration.IsStandalone(cfg.Fleet) { @@ -57,7 +57,7 @@ func LoadFullAgentConfig(ctx context.Context, logger *logger.Logger, cfgPath str fleetConfig, err := loadFleetConfig(ctx, logger) if err != nil { - return nil, err + return nil, fmt.Errorf("error obtaining fleet config: %w", err) } else if fleetConfig == nil { if failOnFleetMissing { return nil, ErrNoFleetConfig @@ -78,7 +78,7 @@ func LoadFullAgentConfig(ctx context.Context, logger *logger.Logger, cfgPath str func loadConfig(ctx context.Context, configPath string) (*config.Config, error) { rawConfig, err := config.LoadFile(configPath) if err != nil { - return nil, err + return nil, fmt.Errorf("error loading config file %s: %w", configPath, err) } path := paths.AgentConfigFile() @@ -100,10 +100,13 @@ func loadConfig(ctx context.Context, configPath string) (*config.Config, error) } // merge local configuration and configuration persisted from fleet. - _ = rawConfig.Merge(config) + err = rawConfig.Merge(config) + if err != nil { + return nil, fmt.Errorf("error merging local and fleet config: %w", err) + } if err := info.InjectAgentConfig(rawConfig); err != nil { - return nil, err + return nil, fmt.Errorf("error injecting agent config: %w", err) } return rawConfig, nil diff --git a/internal/pkg/crypto/io_test.go b/internal/pkg/crypto/io_test.go index 1e3bd24685f..57daafe4bf2 100644 --- a/internal/pkg/crypto/io_test.go +++ b/internal/pkg/crypto/io_test.go @@ -8,7 +8,6 @@ import ( "bufio" "bytes" "io" - "io/ioutil" "testing" "github.com/stretchr/testify/require" @@ -34,7 +33,7 @@ func TestIO(t *testing.T) { r, err := NewReaderWithDefaults(dest, passwd) require.NoError(t, err) - content, err := ioutil.ReadAll(r) + content, err := io.ReadAll(r) require.NoError(t, err) require.Equal(t, msg, content) @@ -61,7 +60,7 @@ func TestIO(t *testing.T) { r, err := NewReaderWithDefaults(dest, passwd) require.NoError(t, err) - content, err := ioutil.ReadAll(r) + content, err := io.ReadAll(r) require.NoError(t, err) require.Equal(t, msg, content) @@ -86,7 +85,7 @@ func TestIO(t *testing.T) { r, err := NewReaderWithDefaults(dest, []byte("bad password")) require.NoError(t, err) - _, err = ioutil.ReadAll(r) + _, err = io.ReadAll(r) require.Error(t, err) }) @@ -115,7 +114,7 @@ func TestIO(t *testing.T) { r, err := NewReaderWithDefaults(dest, passwd) require.NoError(t, err) - content, err := ioutil.ReadAll(r) + content, err := io.ReadAll(r) require.NoError(t, err) require.Equal(t, msg, content) @@ -143,7 +142,7 @@ func TestIO(t *testing.T) { b := bufio.NewReaderSize(r, 100) - content, err := ioutil.ReadAll(b) + content, err := io.ReadAll(b) require.NoError(t, err) require.Equal(t, msg, content) @@ -159,7 +158,7 @@ func TestIO(t *testing.T) { b := bufio.NewReaderSize(r, 100) - _, err = ioutil.ReadAll(b) + _, err = io.ReadAll(b) require.Error(t, err) }) @@ -188,7 +187,7 @@ func TestIO(t *testing.T) { r, err := NewReaderWithDefaults(dest, passwd) require.NoError(t, err) - content, err := ioutil.ReadAll(r) + content, err := io.ReadAll(r) require.NoError(t, err) require.Equal(t, expected, content) diff --git a/internal/pkg/diagnostics/diagnostics_test.go b/internal/pkg/diagnostics/diagnostics_test.go index a130035eb3d..6fc33d27558 100644 --- a/internal/pkg/diagnostics/diagnostics_test.go +++ b/internal/pkg/diagnostics/diagnostics_test.go @@ -33,7 +33,7 @@ import ( ) func TestRedactResults(t *testing.T) { - privKey := `-----BEGIN OPENSSH PRIVATE KEY----- + privKey := `-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn NhAAAAAwEAAQAAAgEAnomdLTF3Vp52cT55PealM+qwSQVEkEBsKB3dSXEIvCqvOmDRZic6 mjhkShOBr6nHUzhdHiNlMTNUaU0AxyuMofFnCCBVhnnC9w+CnTrL+lbVXmMClTrbqIGT8g @@ -126,7 +126,7 @@ sequence: - one - two mapping: - ? sky + ? sky : blue ? sea : green` @@ -149,7 +149,7 @@ func TestUnitAndStateMapping(t *testing.T) { {UnitType: agentclient.UnitTypeInput, UnitID: "test-unit"}: {Message: "test unit"}, {UnitType: agentclient.UnitTypeOutput, UnitID: "test-unit-2"}: {Message: "test unit 2"}, }, - VersionInfo: agentruntime.ComponentVersionInfo{Name: "test-component", Version: "0"}, + VersionInfo: agentruntime.ComponentVersionInfo{Name: "test-component"}, } formatted, err := yaml.Marshal(exampleState) diff --git a/internal/pkg/dir/discover_test.go b/internal/pkg/dir/discover_test.go index 153e94d0304..c4cc03a8c62 100644 --- a/internal/pkg/dir/discover_test.go +++ b/internal/pkg/dir/discover_test.go @@ -5,7 +5,6 @@ package dir import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -59,7 +58,7 @@ func TestDiscover(t *testing.T) { func withFiles(files []string, fn func(dst string, t *testing.T)) func(t *testing.T) { return func(t *testing.T) { - tmp, _ := ioutil.TempDir("", "watch") + tmp, _ := os.MkdirTemp("", "watch") defer os.RemoveAll(tmp) for _, file := range files { diff --git a/internal/pkg/filewatcher/watcher_test.go b/internal/pkg/filewatcher/watcher_test.go index 140376ca197..07dba632012 100644 --- a/internal/pkg/filewatcher/watcher_test.go +++ b/internal/pkg/filewatcher/watcher_test.go @@ -5,7 +5,6 @@ package filewatcher import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -24,7 +23,7 @@ func TestWatch(t *testing.T) { })) t.Run("newly added files are discovered", withWatch(func(t *testing.T, w *Watch) { - tmp, err := ioutil.TempDir("", "watch") + tmp, err := os.MkdirTemp("", "watch") require.NoError(t, err) defer os.RemoveAll(tmp) @@ -43,7 +42,7 @@ func TestWatch(t *testing.T) { })) t.Run("ignore old files", withWatch(func(t *testing.T, w *Watch) { - tmp, err := ioutil.TempDir("", "watch") + tmp, err := os.MkdirTemp("", "watch") require.NoError(t, err) defer os.RemoveAll(tmp) @@ -68,7 +67,7 @@ func TestWatch(t *testing.T) { })) t.Run("can unwatch a watched file", withWatch(func(t *testing.T, w *Watch) { - tmp, err := ioutil.TempDir("", "watch") + tmp, err := os.MkdirTemp("", "watch") require.NoError(t, err) defer os.RemoveAll(tmp) @@ -97,7 +96,7 @@ func TestWatch(t *testing.T) { w.Unwatch(path) // Add new content to the file. - ioutil.WriteFile(path, []byte("heeeelo"), 0644) + os.WriteFile(path, []byte("heeeelo"), 0644) // Should not find the file. r, u, err = w.scan() @@ -107,7 +106,7 @@ func TestWatch(t *testing.T) { })) t.Run("can returns the list of watched files", withWatch(func(t *testing.T, w *Watch) { - tmp, err := ioutil.TempDir("", "watch") + tmp, err := os.MkdirTemp("", "watch") require.NoError(t, err) defer os.RemoveAll(tmp) @@ -125,7 +124,7 @@ func TestWatch(t *testing.T) { })) t.Run("update returns updated, unchanged and watched files", withWatch(func(t *testing.T, w *Watch) { - tmp, err := ioutil.TempDir("", "watch") + tmp, err := os.MkdirTemp("", "watch") require.NoError(t, err) defer os.RemoveAll(tmp) @@ -184,7 +183,7 @@ func TestWatch(t *testing.T) { })) t.Run("should cleanup files that disapear", withWatch(func(t *testing.T, w *Watch) { - tmp, err := ioutil.TempDir("", "watch") + tmp, err := os.MkdirTemp("", "watch") require.NoError(t, err) defer os.RemoveAll(tmp) @@ -201,7 +200,7 @@ func TestWatch(t *testing.T) { })) t.Run("should allow to invalidate the cache ", withWatch(func(t *testing.T, w *Watch) { - tmp, err := ioutil.TempDir("", "watch") + tmp, err := os.MkdirTemp("", "watch") require.NoError(t, err) defer os.RemoveAll(tmp) diff --git a/internal/pkg/fleetapi/ack_cmd.go b/internal/pkg/fleetapi/ack_cmd.go index e5fe956753c..a12839dcb2d 100644 --- a/internal/pkg/fleetapi/ack_cmd.go +++ b/internal/pkg/fleetapi/ack_cmd.go @@ -9,7 +9,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "go.elastic.co/apm" @@ -124,7 +124,7 @@ func (e *AckCmd) Execute(ctx context.Context, r *AckRequest) (_ *AckResponse, er defer resp.Body.Close() // Read ack response always it can be sent with any status code. - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } diff --git a/internal/pkg/fleetapi/acker/fleet/fleet_acker_test.go b/internal/pkg/fleetapi/acker/fleet/fleet_acker_test.go index 6abe28fec72..fcde240fe34 100644 --- a/internal/pkg/fleetapi/acker/fleet/fleet_acker_test.go +++ b/internal/pkg/fleetapi/acker/fleet/fleet_acker_test.go @@ -10,7 +10,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" "testing" @@ -64,7 +63,7 @@ func wrapStrToResp(code int, body string) *http.Response { Proto: "HTTP/1.1", ProtoMajor: 1, ProtoMinor: 1, - Body: ioutil.NopCloser(bytes.NewBufferString(body)), + Body: io.NopCloser(bytes.NewBufferString(body)), ContentLength: int64(len(body)), Header: make(http.Header), } diff --git a/internal/pkg/fleetapi/checkin_cmd.go b/internal/pkg/fleetapi/checkin_cmd.go index 4c14454ce18..6f407708b8b 100644 --- a/internal/pkg/fleetapi/checkin_cmd.go +++ b/internal/pkg/fleetapi/checkin_cmd.go @@ -9,7 +9,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "time" @@ -137,7 +137,7 @@ func (e *CheckinCmd) Execute(ctx context.Context, r *CheckinRequest) (*CheckinRe return nil, sendDuration, client.ExtractError(resp.Body) } - rs, err := ioutil.ReadAll(resp.Body) + rs, err := io.ReadAll(resp.Body) if err != nil { return nil, sendDuration, errors.New(err, "failed to read checkin response") } diff --git a/internal/pkg/fleetapi/checkin_cmd_test.go b/internal/pkg/fleetapi/checkin_cmd_test.go index 56726bb5559..46a0b4db4d1 100644 --- a/internal/pkg/fleetapi/checkin_cmd_test.go +++ b/internal/pkg/fleetapi/checkin_cmd_test.go @@ -8,7 +8,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "testing" "time" @@ -214,7 +214,7 @@ func TestCheckin(t *testing.T) { var req *Request - content, err := ioutil.ReadAll(r.Body) + content, err := io.ReadAll(r.Body) assert.NoError(t, err) assert.NoError(t, json.Unmarshal(content, &req)) assert.Equal(t, "linux", req.Metadata.OS.Name) @@ -248,7 +248,7 @@ func TestCheckin(t *testing.T) { var req *Request - content, err := ioutil.ReadAll(r.Body) + content, err := io.ReadAll(r.Body) assert.NoError(t, err) assert.NoError(t, json.Unmarshal(content, &req)) assert.Nil(t, req.Metadata) diff --git a/internal/pkg/fleetapi/client/client.go b/internal/pkg/fleetapi/client/client.go index b6c9f7584ef..cddd162726b 100644 --- a/internal/pkg/fleetapi/client/client.go +++ b/internal/pkg/fleetapi/client/client.go @@ -9,7 +9,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" "os" @@ -100,7 +99,7 @@ func ExtractError(resp io.Reader) error { Message string `json:"message"` }{} - data, err := ioutil.ReadAll(resp) + data, err := io.ReadAll(resp) if err != nil { return errors.New(err, "fail to read original error") } diff --git a/internal/pkg/fleetapi/client/client_test.go b/internal/pkg/fleetapi/client/client_test.go index cc5d2501aa8..40be306bc80 100644 --- a/internal/pkg/fleetapi/client/client_test.go +++ b/internal/pkg/fleetapi/client/client_test.go @@ -7,7 +7,7 @@ package client import ( "context" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "strings" @@ -47,7 +47,7 @@ func TestHTTPClient(t *testing.T) { resp, err := client.Send(ctx, "GET", "/echo-hello", nil, nil, nil) require.NoError(t, err) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) defer resp.Body.Close() assert.Equal(t, `{ message: "hello" }`, string(body)) @@ -104,7 +104,7 @@ func TestHTTPClient(t *testing.T) { resp, err := client.Send(ctx, "GET", "/echo-hello", nil, nil, nil) require.NoError(t, err) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) defer resp.Body.Close() assert.Equal(t, `{ message: "hello" }`, string(body)) diff --git a/internal/pkg/otel/README.md b/internal/pkg/otel/README.md index 45556290403..c084e3f9677 100644 --- a/internal/pkg/otel/README.md +++ b/internal/pkg/otel/README.md @@ -27,8 +27,8 @@ This section provides a summary of components included in the Elastic Distributi | Component | Version | |---|---| -| filelogreceiver | v0.91.0| -| otlpreceiver | v0.91.0| +| filelogreceiver | v0.92.0| +| otlpreceiver | v0.92.0| @@ -37,9 +37,9 @@ This section provides a summary of components included in the Elastic Distributi | Component | Version | |---|---| -| fileexporter | v0.91.0| -| debugexporter | v0.91.0| -| otlpexporter | v0.91.0| +| fileexporter | v0.92.0| +| debugexporter | v0.92.0| +| otlpexporter | v0.92.0| @@ -48,11 +48,11 @@ This section provides a summary of components included in the Elastic Distributi | Component | Version | |---|---| -| attributesprocessor | v0.91.0| -| resourceprocessor | v0.91.0| -| transformprocessor | v0.91.0| -| batchprocessor | v0.91.0| -| memorylimiterprocessor | v0.91.0| +| attributesprocessor | v0.92.0| +| resourceprocessor | v0.92.0| +| transformprocessor | v0.92.0| +| batchprocessor | v0.92.0| +| memorylimiterprocessor | v0.92.0| diff --git a/internal/pkg/otel/config_manager.go b/internal/pkg/otel/config_manager.go new file mode 100644 index 00000000000..a9a90cab627 --- /dev/null +++ b/internal/pkg/otel/config_manager.go @@ -0,0 +1,47 @@ +// 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. + +package otel + +import ( + "context" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" +) + +// OtelModeConfigManager serves as a config manager for OTel use cases +// In this case agent should ignore all configuration coming from elastic-agent.yml file +// or other sources. +type OtelModeConfigManager struct { + ch chan coordinator.ConfigChange + errCh chan error +} + +// NewOtelModeConfigManager creates new OtelModeConfigManager ignoring +// configuration coming from other sources. +func NewOtelModeConfigManager() *OtelModeConfigManager { + return &OtelModeConfigManager{ + ch: make(chan coordinator.ConfigChange), + errCh: make(chan error), + } +} + +func (t *OtelModeConfigManager) Run(ctx context.Context) error { + <-ctx.Done() + return ctx.Err() +} + +func (t *OtelModeConfigManager) Errors() <-chan error { + return t.errCh +} + +// ActionErrors returns the error channel for actions. +// Returns nil channel. +func (t *OtelModeConfigManager) ActionErrors() <-chan error { + return nil +} + +func (t *OtelModeConfigManager) Watch() <-chan coordinator.ConfigChange { + return t.ch +} diff --git a/internal/pkg/otel/run.go b/internal/pkg/otel/run.go index ae2f4249823..833121221d0 100644 --- a/internal/pkg/otel/run.go +++ b/internal/pkg/otel/run.go @@ -43,7 +43,7 @@ func IsOtelConfig(ctx context.Context, pathConfigFile string) bool { return false } -func Run(ctx context.Context, cancel context.CancelFunc, stop chan bool, testingMode bool) error { +func Run(ctx context.Context, stop chan bool) error { fmt.Fprintln(os.Stdout, "Starting in otel mode") settings, err := newSettings(paths.ConfigFile(), release.Version()) if err != nil { diff --git a/internal/pkg/remote/client_test.go b/internal/pkg/remote/client_test.go index 892bd5099c5..696121395c8 100644 --- a/internal/pkg/remote/client_test.go +++ b/internal/pkg/remote/client_test.go @@ -8,7 +8,7 @@ import ( "bytes" "context" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "strings" @@ -102,7 +102,7 @@ func TestHTTPClient(t *testing.T) { resp, err := client.Send(ctx, http.MethodGet, "/nested/echo-hello", nil, nil, nil) require.NoError(t, err) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) defer resp.Body.Close() assert.Equal(t, successResp, string(body)) @@ -127,7 +127,7 @@ func TestHTTPClient(t *testing.T) { resp, err := client.Send(ctx, http.MethodGet, "/echo-hello", nil, nil, nil) require.NoError(t, err) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) defer resp.Body.Close() assert.Equal(t, successResp, string(body)) @@ -231,7 +231,7 @@ func TestHTTPClient(t *testing.T) { resp, err := client.Send(ctx, http.MethodGet, "/echo-hello", nil, nil, nil) require.NoError(t, err) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) defer resp.Body.Close() assert.Equal(t, successResp, string(body)) @@ -257,7 +257,7 @@ func TestHTTPClient(t *testing.T) { require.NoError(t, err) assert.Equal(t, http.StatusOK, resp.StatusCode) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) defer resp.Body.Close() assert.Equal(t, successResp, string(body)) @@ -300,7 +300,7 @@ func TestHTTPClient(t *testing.T) { resp, err := client.Send(ctx, http.MethodGet, "/echo-hello", nil, nil, nil) require.NoError(t, err) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) defer resp.Body.Close() assert.Equal(t, successResp, string(body)) @@ -331,7 +331,7 @@ func TestHTTPClient(t *testing.T) { resp, err := client.Send(ctx, http.MethodGet, "/echo-hello", nil, nil, bytes.NewBuffer([]byte("hello"))) require.NoError(t, err) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) defer resp.Body.Close() assert.Equal(t, successResp, string(body)) @@ -363,7 +363,7 @@ func TestHTTPClient(t *testing.T) { resp, err := client.Send(ctx, http.MethodGet, "/echo-hello", nil, nil, nil) require.NoError(t, err) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) defer resp.Body.Close() assert.Equal(t, successResp, string(body)) diff --git a/internal/pkg/remote/round_trippers.go b/internal/pkg/remote/round_trippers.go index e6583af57a8..76c3fec139e 100644 --- a/internal/pkg/remote/round_trippers.go +++ b/internal/pkg/remote/round_trippers.go @@ -8,7 +8,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "strings" "time" @@ -67,13 +67,13 @@ func (r *DebugRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) } if req.Body != nil { - dataReq, err := ioutil.ReadAll(req.Body) + dataReq, err := io.ReadAll(req.Body) if err != nil { return nil, errors.Wrap(err, "fail to read the body of the request") } req.Body.Close() - req.Body = ioutil.NopCloser(bytes.NewBuffer(dataReq)) + req.Body = io.NopCloser(bytes.NewBuffer(dataReq)) b.WriteString("Request Body:\n") b.WriteString(string(prettyBody(dataReq)) + "\n") @@ -101,7 +101,7 @@ func (r *DebugRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) } // Hijack the body and output it in the log, this is only for debugging and development. - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return resp, errors.Wrap(err, "fail to read the body of the response") } @@ -110,7 +110,7 @@ func (r *DebugRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) b.WriteString("Response Body:\n") b.WriteString(string(prettyBody(data)) + "\n") - resp.Body = ioutil.NopCloser(bytes.NewBuffer(data)) + resp.Body = io.NopCloser(bytes.NewBuffer(data)) r.log.Debug(b.String()) diff --git a/pkg/component/fake/component/main.go b/pkg/component/fake/component/main.go index 508357fa75b..c673401a980 100644 --- a/pkg/component/fake/component/main.go +++ b/pkg/component/fake/component/main.go @@ -31,8 +31,7 @@ func main() { func run() error { logger := zerolog.New(os.Stderr).Level(zerolog.TraceLevel).With().Timestamp().Logger() ver := client.VersionInfo{ - Name: comp.Fake, - Version: "1.0", + Name: comp.Fake, Meta: map[string]string{ "input": comp.Fake, }, diff --git a/pkg/component/fake/shipper/main.go b/pkg/component/fake/shipper/main.go index 1f1376cd4aa..5dcd440ecc6 100644 --- a/pkg/component/fake/shipper/main.go +++ b/pkg/component/fake/shipper/main.go @@ -49,8 +49,7 @@ func main() { func run() error { logger := zerolog.New(os.Stderr).With().Timestamp().Logger() ver := client.VersionInfo{ - Name: fakeShipper, - Version: "1.0", + Name: fakeShipper, Meta: map[string]string{ "shipper": fakeShipper, }, diff --git a/pkg/component/load.go b/pkg/component/load.go index 021b42dbb43..39343842dc5 100644 --- a/pkg/component/load.go +++ b/pkg/component/load.go @@ -7,7 +7,6 @@ package component import ( "errors" "fmt" - "io/ioutil" "os" "path/filepath" @@ -196,7 +195,7 @@ func specFilesForDirectory(dir string) (map[string]Spec, error) { return nil, err } for _, match := range matches { - data, err := ioutil.ReadFile(match) + data, err := os.ReadFile(match) if err != nil { return nil, fmt.Errorf("failed reading spec %s: %w", match, err) } diff --git a/pkg/component/load_test.go b/pkg/component/load_test.go index 91a6d1a1be6..1bc4bed8915 100644 --- a/pkg/component/load_test.go +++ b/pkg/component/load_test.go @@ -5,7 +5,7 @@ package component import ( - "io/ioutil" + "os" "path/filepath" "testing" @@ -97,7 +97,7 @@ func TestLoadSpec_Components(t *testing.T) { for _, scenario := range scenarios { t.Run(scenario.Name, func(t *testing.T) { - data, err := ioutil.ReadFile(filepath.Join("..", "..", "specs", scenario.Path)) + data, err := os.ReadFile(filepath.Join("..", "..", "specs", scenario.Path)) require.NoError(t, err) _, err = LoadSpec(data) require.NoError(t, err) diff --git a/pkg/component/runtime/conn_info_server_test.go b/pkg/component/runtime/conn_info_server_test.go index 8d445e0a5db..7c2b3ee1a79 100644 --- a/pkg/component/runtime/conn_info_server_test.go +++ b/pkg/component/runtime/conn_info_server_test.go @@ -25,14 +25,14 @@ import ( ) type mockCommunicator struct { - ch chan *proto.CheckinObserved - connInfo *proto.ConnInfo + ch chan *proto.CheckinObserved + startupInfo *proto.StartUpInfo } func newMockCommunicator() *mockCommunicator { return &mockCommunicator{ ch: make(chan *proto.CheckinObserved, 1), - connInfo: &proto.ConnInfo{ + startupInfo: &proto.StartUpInfo{ Addr: getAddress(), ServerName: "endpoint", Token: "some token", @@ -45,7 +45,7 @@ func newMockCommunicator() *mockCommunicator { } func (c *mockCommunicator) WriteConnInfo(w io.Writer, services ...client.Service) error { - infoBytes, err := protobuf.Marshal(c.connInfo) + infoBytes, err := protobuf.Marshal(c.startupInfo) if err != nil { return fmt.Errorf("failed to marshal connection information: %w", err) } @@ -104,14 +104,14 @@ func TestConnInfoNormal(t *testing.T) { t.Fatal(err) } - var connInfo proto.ConnInfo - err = protobuf.Unmarshal(b, &connInfo) + var startupInfo proto.StartUpInfo + err = protobuf.Unmarshal(b, &startupInfo) if err != nil { t.Fatal(err) } // Check the received result - diff := cmp.Diff(&connInfo, comm.connInfo, cmpopts.IgnoreUnexported(proto.ConnInfo{})) + diff := cmp.Diff(&startupInfo, comm.startupInfo, cmpopts.IgnoreUnexported(proto.StartUpInfo{})) if diff != "" { t.Error(diff) } @@ -158,14 +158,14 @@ func TestConnInfoConnCloseThenAnotherConn(t *testing.T) { t.Fatal(err) } - var connInfo proto.ConnInfo - err = protobuf.Unmarshal(b, &connInfo) + var startupInfo proto.StartUpInfo + err = protobuf.Unmarshal(b, &startupInfo) if err != nil { t.Fatal(err) } // Check the received result - diff := cmp.Diff(&connInfo, comm.connInfo, cmpopts.IgnoreUnexported(proto.ConnInfo{})) + diff := cmp.Diff(&startupInfo, comm.startupInfo, cmpopts.IgnoreUnexported(proto.StartUpInfo{})) if diff != "" { t.Error(diff) } diff --git a/pkg/component/runtime/manager.go b/pkg/component/runtime/manager.go index a375ddf816a..0756b663149 100644 --- a/pkg/component/runtime/manager.go +++ b/pkg/component/runtime/manager.go @@ -658,6 +658,25 @@ func (m *Manager) CheckinV2(server proto.ElasticAgent_CheckinV2Server) error { return status.Error(codes.PermissionDenied, "invalid token") } + // enable chunking with the communicator if the initial checkin + // states that it supports chunking + runtime.comm.chunkingAllowed = false + for _, support := range initCheckin.Supports { + if support == proto.ConnectionSupports_CheckinChunking { + runtime.comm.chunkingAllowed = true + break + } + } + if runtime.comm.chunkingAllowed { + if m.grpcConfig.CheckinChunkingDisabled { + // chunking explicitly disabled + runtime.comm.chunkingAllowed = false + runtime.logger.Warn("control checkin v2 protocol supports chunking, but chunking was explicitly disabled") + } else { + runtime.logger.Info("control checkin v2 protocol has chunking enabled") + } + } + return runtime.comm.checkin(server, initCheckin) } diff --git a/pkg/component/runtime/manager_fake_input_test.go b/pkg/component/runtime/manager_fake_input_test.go index 1eceeb44025..5a61fcde1ac 100644 --- a/pkg/component/runtime/manager_fake_input_test.go +++ b/pkg/component/runtime/manager_fake_input_test.go @@ -1307,35 +1307,11 @@ LOOP: require.Equal(t, context.Canceled, err, "Run should return with context canceled, got %v", err.Error()) } -func (suite *FakeInputSuite) TestManager_NoDeadlock() { - t := suite.T() - // NOTE: This is a long-running test that spams the runtime managers `Update` function to try and - // trigger a deadlock. This test takes 2 minutes to run trying to re-produce issue: - // https://github.com/elastic/elastic-agent/issues/2691 - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - ai, _ := info.NewAgentInfo(ctx, true) - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) - require.NoError(t, err) - errCh := make(chan error) - go func() { - err := m.Run(ctx) - if errors.Is(err, context.Canceled) { - err = nil - } - errCh <- err - }() - - waitCtx, waitCancel := context.WithTimeout(ctx, 1*time.Second) - defer waitCancel() - if err := waitForReady(waitCtx, m); err != nil { - require.NoError(t, err) - } - +// A component that can be fed to Manager.Update, with an index to allow +// looping with distinct configurations at each step. +func noDeadlockTestComponent(t *testing.T, index int) component.Component { binaryPath := testBinary(t, "component") - comp := component.Component{ + return component.Component{ ID: "fake-default", InputSpec: &component.InputRuntimeSpec{ InputType: "fake", @@ -1351,99 +1327,92 @@ func (suite *FakeInputSuite) TestManager_NoDeadlock() { Config: component.MustExpectedConfig(map[string]interface{}{ "type": "fake", "state": int(client.UnitStateHealthy), - "message": "Fake Healthy", + "message": fmt.Sprintf("Fake Healthy %d", index), }), }, }, } +} + +func (suite *FakeInputSuite) TestManager_NoDeadlock() { + t := suite.T() + // NOTE: This is a long-running test that spams the runtime managers `Update` function to try and + // trigger a deadlock. This test takes 2 minutes to run trying to re-produce issue: + // https://github.com/elastic/elastic-agent/issues/2691 + + // How long to run the test + testDuration := 2 * time.Minute - updatedCh := make(chan time.Time) - updatedErr := make(chan error) - updatedCtx, updatedCancel := context.WithCancel(context.Background()) - defer updatedCancel() + // How long without an update before we report it as a deadlock + maxUpdateInterval := 15 * time.Second + + // Create the runtime manager + ai, _ := info.NewAgentInfo(context.Background(), true) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + require.NoError(t, err) + + // Start the runtime manager in a goroutine, passing its termination state + // to managerResultChan. + managerCtx, managerCancel := context.WithCancel(context.Background()) + defer managerCancel() + managerResultChan := make(chan error) go func() { - // spam update on component trying to cause a deadlock - comp := comp - i := 0 - for { - if updatedCtx.Err() != nil { - return - } - updatedComp := comp - updatedComp.Units = make([]component.Unit, 1) - updatedComp.Units[0] = component.Unit{ - ID: "fake-input", - Type: client.UnitTypeInput, - LogLevel: client.UnitLogLevelError, // test log will get spammed with the constant updates (error to prevent spam) - Config: component.MustExpectedConfig(map[string]interface{}{ - "type": "fake", - "state": int(client.UnitStateHealthy), - "message": fmt.Sprintf("Fake Healthy %d", i), - }), - } - i += 1 - comp = updatedComp - m.Update(component.Model{Components: []component.Component{updatedComp}}) - err := <-m.errCh - if err != nil { - updatedErr <- err - return - } - updatedCh <- time.Now() - } + managerResultChan <- m.Run(managerCtx) }() - deadlockErr := make(chan error) + // Wait for the manager to become active + timedWaitForReady(t, m, 1*time.Second) + + // Start a goroutine to spam the manager update trying to cause + // a deadlock. When the test context finishes, the update loop + // closes updateResultChan to signal that it is done. + updateResultChan := make(chan error) + updateLoopCtx, updateLoopCancel := context.WithTimeout(context.Background(), testDuration) + defer updateLoopCancel() go func() { - t := time.NewTimer(15 * time.Second) - defer t.Stop() - for { - select { - case <-updatedCtx.Done(): - return - case <-updatedCh: - // update did occur - t.Reset(15 * time.Second) - case <-t.C: - // timeout hit waiting for another update to work - deadlockErr <- errors.New("hit deadlock") + defer close(updateResultChan) + for i := 0; updateLoopCtx.Err() == nil; i++ { + comp := noDeadlockTestComponent(t, i) + m.Update(component.Model{Components: []component.Component{comp}}) + err := <-m.errCh + updateResultChan <- err + if err != nil { + // If the update gave an error, end the test return } } }() - defer drainErrChan(errCh) - defer drainErrChan(updatedErr) - defer drainErrChan(deadlockErr) - - // wait 2 minutes for a deadlock to occur - endTimer := time.NewTimer(2 * time.Minute) - defer endTimer.Stop() + // The component state is being changed constantly. If updateTimeout + // triggers without any updates, report it as a deadlock. + updateTimeout := time.NewTicker(maxUpdateInterval) + defer updateTimeout.Stop() LOOP: for { select { - case <-endTimer.C: - // no deadlock after timeout (all good stop the component) - updatedCancel() - m.Update(component.Model{Components: []component.Component{}}) - <-m.errCh // Don't care about the result of Update, just that it runs - break LOOP - case err := <-errCh: - require.NoError(t, err) - case err := <-updatedErr: - require.NoError(t, err) - break LOOP - case err := <-deadlockErr: - require.NoError(t, err) - break LOOP + case err, ok := <-updateResultChan: + if ok { + // update did occur + require.NoError(t, err) + updateTimeout.Reset(15 * time.Second) + } else { + // Update goroutine is terminating, test is over + break LOOP + } + case <-managerResultChan: + require.Fail(t, "Runtime manager terminated before test was over") + case <-updateTimeout.C: + require.Fail(t, "Timed out waiting for Manager.Update result") } } - - updatedCancel() - cancel() - - err = <-errCh + // Finished without a deadlock. Stop the component and shut down the manager. + m.Update(component.Model{Components: []component.Component{}}) + err = <-m.errCh require.NoError(t, err) + + managerCancel() + err = <-managerResultChan + require.Equal(t, err, context.Canceled) } func (suite *FakeInputSuite) TestManager_Configure() { @@ -3414,6 +3383,160 @@ LOOP: require.NoError(t, err) } +func (suite *FakeInputSuite) TestManager_Chunk() { + t := suite.T() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + const grpcDefaultSize = 1024 * 1024 * 4 + grpcConfig := configuration.DefaultGRPCConfig() + grpcConfig.MaxMsgSize = grpcDefaultSize * 2 // set to double the default size + + ai, _ := info.NewAgentInfo(ctx, true) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), grpcConfig) + require.NoError(t, err) + errCh := make(chan error) + go func() { + err := m.Run(ctx) + if errors.Is(err, context.Canceled) { + err = nil + } + errCh <- err + }() + + // build the units to ensure that there is more than double the units required for the GRPC configuration + minimumMsgSize := int(float64(grpcConfig.MaxMsgSize) * 1.2) // increase by 20% + var units []component.Unit + var unitsSize int + var nextUnitID int + for { + unit := component.Unit{ + ID: fmt.Sprintf("fake-input-%d", nextUnitID), + Type: client.UnitTypeInput, + LogLevel: client.UnitLogLevelError, + Config: component.MustExpectedConfig(map[string]interface{}{ + "type": "fake", + "state": int(client.UnitStateHealthy), + "message": fmt.Sprintf("Fake Healthy %d", nextUnitID), + "payload": map[string]interface{}{ + "fake-id": nextUnitID, + "extra-data": fmt.Sprintf("extra data for the unit %d to make it some what larger", nextUnitID), + }, + }), + } + unitExpected := proto.UnitExpected{ + Id: unit.ID, + Type: proto.UnitType_INPUT, + State: proto.State_HEALTHY, + ConfigStateIdx: 1, + Config: unit.Config, + LogLevel: proto.UnitLogLevel_ERROR, + } + units = append(units, unit) + unitsSize += gproto.Size(&unitExpected) + nextUnitID++ + + if unitsSize > minimumMsgSize { + break + } + } + + binaryPath := testBinary(t, "component") + comp := component.Component{ + ID: "fake-default", + InputSpec: &component.InputRuntimeSpec{ + InputType: "fake", + BinaryName: "", + BinaryPath: binaryPath, + Spec: fakeInputSpec, + }, + Units: units, + } + + waitCtx, waitCancel := context.WithTimeout(ctx, 1*time.Second) + defer waitCancel() + if err := waitForReady(waitCtx, m); err != nil { + require.NoError(t, err) + } + + subCtx, subCancel := context.WithCancel(context.Background()) + defer subCancel() + subErrCh := make(chan error) + go func() { + sub := m.Subscribe(subCtx, "fake-default") + for { + select { + case <-subCtx.Done(): + return + case state := <-sub.Ch(): + if state.State == client.UnitStateFailed { + subErrCh <- fmt.Errorf("component failed: %s", state.Message) + } else { + healthyCount := 0 + stoppedCount := 0 + for _, unit := range state.Units { + if unit.State == client.UnitStateFailed { + subErrCh <- fmt.Errorf("unit failed: %s", unit.Message) + } else if unit.State == client.UnitStateHealthy { + healthyCount += 1 + } else if unit.State == client.UnitStateStopped { + stoppedCount += 1 + } else if unit.State == client.UnitStateStarting { + // acceptable + } else { + // unknown state that should not have occurred + subErrCh <- fmt.Errorf("unit reported unexpected state: %v", unit.State) + } + } + if healthyCount == len(units) { + // remove the component which will stop it + m.Update(component.Model{Components: []component.Component{}}) + err := <-m.errCh + if err != nil { + subErrCh <- err + } + } else if stoppedCount == len(units) { + subErrCh <- nil + } + } + } + } + }() + + defer drainErrChan(errCh) + defer drainErrChan(subErrCh) + + m.Update(component.Model{Components: []component.Component{comp}}) + err = <-m.errCh + require.NoError(t, err) + + endTimer := time.NewTimer(6 * time.Minute) // very large number of units will take time + defer endTimer.Stop() +LOOP: + for { + select { + case <-endTimer.C: + t.Fatalf("timed out after 6 minutes") + case err := <-errCh: + require.NoError(t, err) + case err := <-subErrCh: + require.NoError(t, err) + break LOOP + } + } + + subCancel() + cancel() + + err = <-errCh + require.NoError(t, err) + + workDir := filepath.Join(paths.Run(), comp.ID) + _, err = os.Stat(workDir) + require.ErrorIs(t, err, os.ErrNotExist) +} + func signalState(subErrCh chan error, state *ComponentState, acceptableStates []client.UnitState) { if state.State == client.UnitStateFailed { subErrCh <- fmt.Errorf("component failed: %s", state.Message) diff --git a/pkg/component/runtime/runtime.go b/pkg/component/runtime/runtime.go index feeee2c6d7e..3cb031f501d 100644 --- a/pkg/component/runtime/runtime.go +++ b/pkg/component/runtime/runtime.go @@ -100,7 +100,7 @@ type componentRuntimeState struct { } func newComponentRuntimeState(m *Manager, logger *logger.Logger, monitor MonitoringManager, comp component.Component) (*componentRuntimeState, error) { - comm, err := newRuntimeComm(logger, m.getListenAddr(), m.ca, m.agentInfo) + comm, err := newRuntimeComm(logger, m.getListenAddr(), m.ca, m.agentInfo, m.grpcConfig.MaxMsgSize) if err != nil { return nil, err } diff --git a/pkg/component/runtime/runtime_comm.go b/pkg/component/runtime/runtime_comm.go index b86d3d1ec12..47322f82108 100644 --- a/pkg/component/runtime/runtime_comm.go +++ b/pkg/component/runtime/runtime_comm.go @@ -18,6 +18,7 @@ import ( "github.com/gofrs/uuid" "github.com/elastic/elastic-agent-client/v7/pkg/client" + "github.com/elastic/elastic-agent-client/v7/pkg/client/chunk" "github.com/elastic/elastic-agent-client/v7/pkg/proto" "github.com/elastic/elastic-agent/internal/pkg/agent/application/info" "github.com/elastic/elastic-agent/internal/pkg/core/authority" @@ -49,6 +50,9 @@ type runtimeComm struct { token string cert *authority.Pair + maxMessageSize int + chunkingAllowed bool + checkinConn bool checkinDone chan bool checkinLock sync.RWMutex @@ -67,7 +71,7 @@ type runtimeComm struct { actionsResponse chan *proto.ActionResponse } -func newRuntimeComm(logger *logger.Logger, listenAddr string, ca *authority.CertificateAuthority, agentInfo *info.AgentInfo) (*runtimeComm, error) { +func newRuntimeComm(logger *logger.Logger, listenAddr string, ca *authority.CertificateAuthority, agentInfo *info.AgentInfo, maxMessageSize int) (*runtimeComm, error) { token, err := uuid.NewV4() if err != nil { return nil, err @@ -88,6 +92,8 @@ func newRuntimeComm(logger *logger.Logger, listenAddr string, ca *authority.Cert name: name, token: token.String(), cert: pair, + maxMessageSize: maxMessageSize, + chunkingAllowed: false, // not allow until the client says they support it checkinConn: true, checkinExpected: make(chan *proto.CheckinExpected, 1), checkinObserved: make(chan *proto.CheckinObserved), @@ -112,7 +118,7 @@ func (c *runtimeComm) WriteConnInfo(w io.Writer, services ...client.Service) err if !hasV2 { srvs = append(srvs, proto.ConnInfoServices_CheckinV2) } - connInfo := &proto.ConnInfo{ + startupInfo := &proto.StartUpInfo{ Addr: c.listenAddr, ServerName: c.name, Token: c.token, @@ -120,14 +126,17 @@ func (c *runtimeComm) WriteConnInfo(w io.Writer, services ...client.Service) err PeerCert: c.cert.Crt, PeerKey: c.cert.Key, Services: srvs, + // chunking is always allowed if the client supports it + Supports: []proto.ConnectionSupports{proto.ConnectionSupports_CheckinChunking}, + MaxMessageSize: uint32(c.maxMessageSize), } - infoBytes, err := protobuf.Marshal(connInfo) + infoBytes, err := protobuf.Marshal(startupInfo) if err != nil { - return fmt.Errorf("failed to marshal connection information: %w", err) + return fmt.Errorf("failed to marshal startup information: %w", err) } _, err = w.Write(infoBytes) if err != nil { - return fmt.Errorf("failed to write connection information: %w", err) + return fmt.Errorf("failed to write startup information: %w", err) } return nil } @@ -137,7 +146,7 @@ func (c *runtimeComm) CheckinExpected( observed *proto.CheckinObserved, ) { if c.agentInfo != nil && c.agentInfo.AgentID() != "" { - expected.AgentInfo = &proto.CheckinAgentInfo{ + expected.AgentInfo = &proto.AgentInfo{ Id: c.agentInfo.AgentID(), Version: c.agentInfo.Version(), Snapshot: c.agentInfo.Snapshot(), @@ -221,7 +230,7 @@ func (c *runtimeComm) checkin(server proto.ElasticAgent_CheckinV2Server, init *p case <-recvDone: return case expected := <-initExp: - err := server.Send(expected) + err := sendExpectedChunked(server, expected, c.chunkingAllowed, c.maxMessageSize) if err != nil { if reportableErr(err) { c.logger.Debugf("check-in stream failed to send initial expected state: %s", err) @@ -240,7 +249,7 @@ func (c *runtimeComm) checkin(server proto.ElasticAgent_CheckinV2Server, init *p case expected = <-c.checkinExpected: } - err := server.Send(expected) + err := sendExpectedChunked(server, expected, c.chunkingAllowed, c.maxMessageSize) if err != nil { if reportableErr(err) { c.logger.Debugf("check-in stream failed to send expected state: %s", err) @@ -270,7 +279,8 @@ func (c *runtimeComm) checkin(server proto.ElasticAgent_CheckinV2Server, init *p go func() { for { - checkin, err := server.Recv() + // always allow a chunked observed message to be received + checkin, err := chunk.RecvObserved(server) if err != nil { if reportableErr(err) { c.logger.Debugf("check-in stream failed to receive data: %s", err) @@ -401,3 +411,20 @@ func genServerName() (string, error) { } return strings.Replace(u.String(), "-", "", -1), nil } + +func sendExpectedChunked(server proto.ElasticAgent_CheckinV2Server, msg *proto.CheckinExpected, chunkingAllowed bool, maxSize int) error { + if !chunkingAllowed { + // chunking is disabled + return server.Send(msg) + } + msgs, err := chunk.Expected(msg, maxSize) + if err != nil { + return err + } + for _, msg := range msgs { + if err := server.Send(msg); err != nil { + return err + } + } + return nil +} diff --git a/pkg/component/runtime/state.go b/pkg/component/runtime/state.go index 5c1237293b4..f376a4e184a 100644 --- a/pkg/component/runtime/state.go +++ b/pkg/component/runtime/state.go @@ -52,8 +52,6 @@ func (key ComponentUnitKey) MarshalYAML() (interface{}, error) { type ComponentVersionInfo struct { // Name of the binary. Name string `yaml:"name"` - // Version of the binary. - Version string `yaml:"version"` // Additional metadata about the binary. Meta map[string]string `yaml:"meta,omitempty"` } @@ -347,10 +345,6 @@ func (s *ComponentState) syncCheckin(checkin *proto.CheckinObserved) bool { s.VersionInfo.Name = checkin.VersionInfo.Name changed = true } - if checkin.VersionInfo.Version != "" && s.VersionInfo.Version != checkin.VersionInfo.Version { - s.VersionInfo.Version = checkin.VersionInfo.Version - changed = true - } if checkin.VersionInfo.Meta != nil && diffMeta(s.VersionInfo.Meta, checkin.VersionInfo.Meta) { s.VersionInfo.Meta = checkin.VersionInfo.Meta changed = true diff --git a/pkg/control/v1/proto/control_v1.pb.go b/pkg/control/v1/proto/control_v1.pb.go index e156a052c36..139273e5f6b 100644 --- a/pkg/control/v1/proto/control_v1.pb.go +++ b/pkg/control/v1/proto/control_v1.pb.go @@ -4,8 +4,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.12 +// protoc-gen-go v1.28.1 +// protoc v4.23.4 // source: control_v1.proto // proto namespace/package name is shared with elastic-agent-client diff --git a/pkg/control/v1/proto/control_v1_grpc.pb.go b/pkg/control/v1/proto/control_v1_grpc.pb.go index 013e8636fdf..90fc475812e 100644 --- a/pkg/control/v1/proto/control_v1_grpc.pb.go +++ b/pkg/control/v1/proto/control_v1_grpc.pb.go @@ -4,15 +4,10 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v4.23.4 // source: control_v1.proto -// proto namespace/package name is shared with elastic-agent-client -// we need to be careful with modifications to avoid name collisions -// proto is here to maintain backward compatibility and cannot be changed. -// elastic-agent-client namespace is likely change after 8.6 - package proto import ( @@ -28,13 +23,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - ElasticAgentControl_Version_FullMethodName = "/proto.ElasticAgentControl/Version" - ElasticAgentControl_Status_FullMethodName = "/proto.ElasticAgentControl/Status" - ElasticAgentControl_Restart_FullMethodName = "/proto.ElasticAgentControl/Restart" - ElasticAgentControl_Upgrade_FullMethodName = "/proto.ElasticAgentControl/Upgrade" -) - // ElasticAgentControlClient is the client API for ElasticAgentControl service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -59,7 +47,7 @@ func NewElasticAgentControlClient(cc grpc.ClientConnInterface) ElasticAgentContr func (c *elasticAgentControlClient) Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VersionResponse, error) { out := new(VersionResponse) - err := c.cc.Invoke(ctx, ElasticAgentControl_Version_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ElasticAgentControl/Version", in, out, opts...) if err != nil { return nil, err } @@ -68,7 +56,7 @@ func (c *elasticAgentControlClient) Version(ctx context.Context, in *Empty, opts func (c *elasticAgentControlClient) Status(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) - err := c.cc.Invoke(ctx, ElasticAgentControl_Status_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ElasticAgentControl/Status", in, out, opts...) if err != nil { return nil, err } @@ -77,7 +65,7 @@ func (c *elasticAgentControlClient) Status(ctx context.Context, in *Empty, opts func (c *elasticAgentControlClient) Restart(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*RestartResponse, error) { out := new(RestartResponse) - err := c.cc.Invoke(ctx, ElasticAgentControl_Restart_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ElasticAgentControl/Restart", in, out, opts...) if err != nil { return nil, err } @@ -86,7 +74,7 @@ func (c *elasticAgentControlClient) Restart(ctx context.Context, in *Empty, opts func (c *elasticAgentControlClient) Upgrade(ctx context.Context, in *UpgradeRequest, opts ...grpc.CallOption) (*UpgradeResponse, error) { out := new(UpgradeResponse) - err := c.cc.Invoke(ctx, ElasticAgentControl_Upgrade_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ElasticAgentControl/Upgrade", in, out, opts...) if err != nil { return nil, err } @@ -147,7 +135,7 @@ func _ElasticAgentControl_Version_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_Version_FullMethodName, + FullMethod: "/proto.ElasticAgentControl/Version", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).Version(ctx, req.(*Empty)) @@ -165,7 +153,7 @@ func _ElasticAgentControl_Status_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_Status_FullMethodName, + FullMethod: "/proto.ElasticAgentControl/Status", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).Status(ctx, req.(*Empty)) @@ -183,7 +171,7 @@ func _ElasticAgentControl_Restart_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_Restart_FullMethodName, + FullMethod: "/proto.ElasticAgentControl/Restart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).Restart(ctx, req.(*Empty)) @@ -201,7 +189,7 @@ func _ElasticAgentControl_Upgrade_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_Upgrade_FullMethodName, + FullMethod: "/proto.ElasticAgentControl/Upgrade", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).Upgrade(ctx, req.(*UpgradeRequest)) diff --git a/pkg/control/v2/client/client.go b/pkg/control/v2/client/client.go index 6479782d90f..13ab946ca0c 100644 --- a/pkg/control/v2/client/client.go +++ b/pkg/control/v2/client/client.go @@ -74,8 +74,6 @@ type Version struct { type ComponentVersionInfo struct { // Name of the component. Name string `json:"name" yaml:"name"` - // Version of the component. - Version string `json:"version" yaml:"version"` // Extra meta information about the version. Meta map[string]string `json:"meta,omitempty" yaml:"meta,omitempty"` } @@ -511,9 +509,8 @@ func toState(res *cproto.StateResponse) (*AgentState, error) { } if comp.VersionInfo != nil { cs.VersionInfo = ComponentVersionInfo{ - Name: comp.VersionInfo.Name, - Version: comp.VersionInfo.Version, - Meta: comp.VersionInfo.Meta, + Name: comp.VersionInfo.Name, + Meta: comp.VersionInfo.Meta, } } s.Components = append(s.Components, cs) diff --git a/pkg/control/v2/cproto/control_v2.pb.go b/pkg/control/v2/cproto/control_v2.pb.go index cdb6456afd0..461fae9a2f0 100644 --- a/pkg/control/v2/cproto/control_v2.pb.go +++ b/pkg/control/v2/cproto/control_v2.pb.go @@ -4,8 +4,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v3.21.12 +// protoc-gen-go v1.28.1 +// protoc v4.23.4 // source: control_v2.proto package cproto @@ -731,8 +731,7 @@ type ComponentVersionInfo struct { // Name of the component. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Version of the component. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // 2 reserved - used to be used for version of component. // Extra meta information about the version. Meta map[string]string `protobuf:"bytes,3,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } @@ -776,13 +775,6 @@ func (x *ComponentVersionInfo) GetName() string { return "" } -func (x *ComponentVersionInfo) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - func (x *ComponentVersionInfo) GetMeta() map[string]string { if x != nil { return x.Meta @@ -1969,240 +1961,238 @@ var file_control_v2_proto_rawDesc = []byte{ 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x22, 0xb9, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x61, 0x64, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x04, 0x6d, 0x65, 0x74, - 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe6, - 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x9e, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0xc6, 0x02, 0x0a, 0x0d, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x69, 0x6e, - 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x66, 0x6c, 0x65, 0x65, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x66, 0x6c, 0x65, 0x65, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x6c, 0x65, 0x65, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x6c, 0x65, 0x65, - 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x3f, 0x0a, 0x0f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x52, 0x0e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3a, - 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, - 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xef, 0x01, 0x0a, 0x16, 0x55, - 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x6f, 0x77, 0x6e, - 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x02, 0x52, 0x0f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x65, 0x72, 0x63, - 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x61, 0x69, 0x6c, 0x65, - 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, - 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x4d, 0x73, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, - 0x74, 0x72, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x72, - 0x65, 0x74, 0x72, 0x79, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x72, 0x65, 0x74, 0x72, 0x79, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x22, 0xdf, 0x01, 0x0a, - 0x14, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, - 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, - 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x22, 0x6c, - 0x0a, 0x16, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x52, 0x0a, 0x12, 0x61, 0x64, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, - 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x11, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0xb5, 0x01, 0x0a, - 0x1b, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0a, - 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, - 0x73, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x52, 0x0a, 0x12, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x52, 0x11, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x22, 0x3f, 0x0a, 0x1a, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, - 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x51, 0x0a, 0x17, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, - 0x74, 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, - 0x6f, 0x73, 0x74, 0x69, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x15, 0x44, 0x69, 0x61, - 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x74, 0x49, 0x64, 0x22, 0x4d, 0x0a, - 0x16, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x22, 0xd1, 0x01, 0x0a, - 0x16, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x6e, - 0x69, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, - 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x08, 0x75, 0x6e, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x6e, 0x69, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x74, - 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x46, 0x69, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, - 0x22, 0x8e, 0x01, 0x0a, 0x1b, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, - 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x46, 0x69, - 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x73, 0x22, 0x4f, 0x0a, 0x17, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, - 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x05, - 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, - 0x6e, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x05, 0x75, 0x6e, 0x69, - 0x74, 0x73, 0x22, 0x2a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x85, - 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x52, - 0x54, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, - 0x55, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x45, 0x41, 0x4c, 0x54, - 0x48, 0x59, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x45, 0x47, 0x52, 0x41, 0x44, 0x45, 0x44, - 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x0c, - 0x0a, 0x08, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, - 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x50, 0x47, - 0x52, 0x41, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x07, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x4f, 0x4c, 0x4c, - 0x42, 0x41, 0x43, 0x4b, 0x10, 0x08, 0x2a, 0x21, 0x0a, 0x08, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x10, 0x00, 0x12, 0x0a, 0x0a, - 0x06, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x10, 0x01, 0x2a, 0x28, 0x0a, 0x0c, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, - 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, - 0x45, 0x10, 0x01, 0x2a, 0x7f, 0x0a, 0x0b, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x4c, 0x4c, 0x4f, 0x43, 0x53, 0x10, 0x00, 0x12, 0x09, - 0x0a, 0x05, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4d, 0x44, - 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x47, 0x4f, 0x52, 0x4f, 0x55, 0x54, - 0x49, 0x4e, 0x45, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x50, 0x10, 0x04, 0x12, - 0x09, 0x0a, 0x05, 0x4d, 0x55, 0x54, 0x45, 0x58, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, - 0x4f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x48, 0x52, 0x45, 0x41, - 0x44, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x07, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x52, 0x41, - 0x43, 0x45, 0x10, 0x08, 0x2a, 0x26, 0x0a, 0x1b, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x07, 0x0a, 0x03, 0x43, 0x50, 0x55, 0x10, 0x00, 0x32, 0xdf, 0x04, 0x0a, - 0x13, 0x45, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x31, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, - 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, - 0x15, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x57, - 0x61, 0x74, 0x63, 0x68, 0x12, 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x31, 0x0a, 0x07, - 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3a, 0x0a, 0x07, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x63, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x67, 0x72, - 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0f, 0x44, - 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1e, - 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, - 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, - 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x53, 0x0a, 0x0f, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, - 0x74, 0x73, 0x12, 0x1e, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, - 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, - 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x30, 0x01, 0x12, 0x62, 0x0a, 0x14, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, - 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x63, + 0x3a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, + 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x4d, + 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe6, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x75, 0x6e, + 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x69, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x0c, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x9e, 0x01, + 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x70, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0xc6, + 0x02, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2a, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x66, + 0x6c, 0x65, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0a, + 0x66, 0x6c, 0x65, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x6c, + 0x65, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x66, 0x6c, 0x65, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x0f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, + 0x65, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x0e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x67, 0x72, + 0x61, 0x64, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x22, 0xef, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x41, 0x74, 0x12, 0x29, + 0x0a, 0x10, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, + 0x61, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x61, 0x69, + 0x6c, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x65, 0x74, + 0x72, 0x79, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x74, 0x72, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, + 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x74, 0x72, 0x79, 0x55, 0x6e, 0x74, + 0x69, 0x6c, 0x22, 0xdf, 0x01, 0x0a, 0x14, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x22, 0x6c, 0x0a, 0x16, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, + 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x52, + 0x0a, 0x12, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x44, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, + 0x11, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x22, 0xb5, 0x01, 0x0a, 0x1b, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x52, 0x0a, 0x12, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x11, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x3f, 0x0a, 0x1a, 0x44, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x51, 0x0a, 0x17, 0x44, + 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x82, + 0x01, 0x0a, 0x15, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x09, 0x75, + 0x6e, 0x69, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, + 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x08, 0x75, 0x6e, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x6e, + 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x6e, 0x69, + 0x74, 0x49, 0x64, 0x22, 0x4d, 0x0a, 0x16, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, + 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, + 0x55, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x05, 0x75, 0x6e, 0x69, + 0x74, 0x73, 0x22, 0xd1, 0x01, 0x0a, 0x16, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x6e, 0x69, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x75, 0x6e, 0x69, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x36, + 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, + 0x74, 0x69, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x8e, 0x01, 0x0a, 0x1b, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x34, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x18, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x29, - 0x5a, 0x24, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x76, 0x32, 0x2f, - 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, + 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, + 0x36, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, + 0x73, 0x74, 0x69, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x4f, 0x0a, 0x17, 0x44, 0x69, 0x61, 0x67, 0x6e, + 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, + 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x22, 0x2a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x85, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0c, + 0x0a, 0x08, 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, + 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x55, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, + 0x07, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x45, + 0x47, 0x52, 0x41, 0x44, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, + 0x45, 0x44, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x49, 0x4e, 0x47, + 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x06, 0x12, + 0x0d, 0x0a, 0x09, 0x55, 0x50, 0x47, 0x52, 0x41, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x07, 0x12, 0x0c, + 0x0a, 0x08, 0x52, 0x4f, 0x4c, 0x4c, 0x42, 0x41, 0x43, 0x4b, 0x10, 0x08, 0x2a, 0x21, 0x0a, 0x08, + 0x55, 0x6e, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x50, 0x55, + 0x54, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x10, 0x01, 0x2a, + 0x28, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, + 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x01, 0x2a, 0x7f, 0x0a, 0x0b, 0x50, 0x70, 0x72, + 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x4c, 0x4c, 0x4f, + 0x43, 0x53, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x01, 0x12, + 0x0b, 0x0a, 0x07, 0x43, 0x4d, 0x44, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, + 0x47, 0x4f, 0x52, 0x4f, 0x55, 0x54, 0x49, 0x4e, 0x45, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x48, + 0x45, 0x41, 0x50, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x55, 0x54, 0x45, 0x58, 0x10, 0x05, + 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x10, 0x0a, + 0x0c, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x07, 0x12, + 0x09, 0x0a, 0x05, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x08, 0x2a, 0x26, 0x0a, 0x1b, 0x41, 0x64, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, + 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x07, 0x0a, 0x03, 0x43, 0x50, 0x55, + 0x10, 0x00, 0x32, 0xdf, 0x04, 0x0a, 0x13, 0x45, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x31, 0x0a, 0x07, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, + 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0a, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, 0x0d, 0x2e, 0x63, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x63, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x30, 0x01, 0x12, 0x31, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x0d, 0x2e, + 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x63, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, + 0x12, 0x16, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x52, 0x0a, 0x0f, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0f, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, + 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x1e, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x55, 0x6e, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x62, 0x0a, 0x14, 0x44, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, + 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, + 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x34, + 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x18, 0x2e, 0x63, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x42, 0x29, 0x5a, 0x24, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xf8, 0x01, 0x01, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/control/v2/cproto/control_v2_grpc.pb.go b/pkg/control/v2/cproto/control_v2_grpc.pb.go index ad355917892..8375317eb4e 100644 --- a/pkg/control/v2/cproto/control_v2_grpc.pb.go +++ b/pkg/control/v2/cproto/control_v2_grpc.pb.go @@ -4,8 +4,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v4.23.4 // source: control_v2.proto package cproto @@ -23,18 +23,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - ElasticAgentControl_Version_FullMethodName = "/cproto.ElasticAgentControl/Version" - ElasticAgentControl_State_FullMethodName = "/cproto.ElasticAgentControl/State" - ElasticAgentControl_StateWatch_FullMethodName = "/cproto.ElasticAgentControl/StateWatch" - ElasticAgentControl_Restart_FullMethodName = "/cproto.ElasticAgentControl/Restart" - ElasticAgentControl_Upgrade_FullMethodName = "/cproto.ElasticAgentControl/Upgrade" - ElasticAgentControl_DiagnosticAgent_FullMethodName = "/cproto.ElasticAgentControl/DiagnosticAgent" - ElasticAgentControl_DiagnosticUnits_FullMethodName = "/cproto.ElasticAgentControl/DiagnosticUnits" - ElasticAgentControl_DiagnosticComponents_FullMethodName = "/cproto.ElasticAgentControl/DiagnosticComponents" - ElasticAgentControl_Configure_FullMethodName = "/cproto.ElasticAgentControl/Configure" -) - // ElasticAgentControlClient is the client API for ElasticAgentControl service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -77,7 +65,7 @@ func NewElasticAgentControlClient(cc grpc.ClientConnInterface) ElasticAgentContr func (c *elasticAgentControlClient) Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VersionResponse, error) { out := new(VersionResponse) - err := c.cc.Invoke(ctx, ElasticAgentControl_Version_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cproto.ElasticAgentControl/Version", in, out, opts...) if err != nil { return nil, err } @@ -86,7 +74,7 @@ func (c *elasticAgentControlClient) Version(ctx context.Context, in *Empty, opts func (c *elasticAgentControlClient) State(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*StateResponse, error) { out := new(StateResponse) - err := c.cc.Invoke(ctx, ElasticAgentControl_State_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cproto.ElasticAgentControl/State", in, out, opts...) if err != nil { return nil, err } @@ -94,7 +82,7 @@ func (c *elasticAgentControlClient) State(ctx context.Context, in *Empty, opts . } func (c *elasticAgentControlClient) StateWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (ElasticAgentControl_StateWatchClient, error) { - stream, err := c.cc.NewStream(ctx, &ElasticAgentControl_ServiceDesc.Streams[0], ElasticAgentControl_StateWatch_FullMethodName, opts...) + stream, err := c.cc.NewStream(ctx, &ElasticAgentControl_ServiceDesc.Streams[0], "/cproto.ElasticAgentControl/StateWatch", opts...) if err != nil { return nil, err } @@ -127,7 +115,7 @@ func (x *elasticAgentControlStateWatchClient) Recv() (*StateResponse, error) { func (c *elasticAgentControlClient) Restart(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*RestartResponse, error) { out := new(RestartResponse) - err := c.cc.Invoke(ctx, ElasticAgentControl_Restart_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cproto.ElasticAgentControl/Restart", in, out, opts...) if err != nil { return nil, err } @@ -136,7 +124,7 @@ func (c *elasticAgentControlClient) Restart(ctx context.Context, in *Empty, opts func (c *elasticAgentControlClient) Upgrade(ctx context.Context, in *UpgradeRequest, opts ...grpc.CallOption) (*UpgradeResponse, error) { out := new(UpgradeResponse) - err := c.cc.Invoke(ctx, ElasticAgentControl_Upgrade_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cproto.ElasticAgentControl/Upgrade", in, out, opts...) if err != nil { return nil, err } @@ -145,7 +133,7 @@ func (c *elasticAgentControlClient) Upgrade(ctx context.Context, in *UpgradeRequ func (c *elasticAgentControlClient) DiagnosticAgent(ctx context.Context, in *DiagnosticAgentRequest, opts ...grpc.CallOption) (*DiagnosticAgentResponse, error) { out := new(DiagnosticAgentResponse) - err := c.cc.Invoke(ctx, ElasticAgentControl_DiagnosticAgent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cproto.ElasticAgentControl/DiagnosticAgent", in, out, opts...) if err != nil { return nil, err } @@ -153,7 +141,7 @@ func (c *elasticAgentControlClient) DiagnosticAgent(ctx context.Context, in *Dia } func (c *elasticAgentControlClient) DiagnosticUnits(ctx context.Context, in *DiagnosticUnitsRequest, opts ...grpc.CallOption) (ElasticAgentControl_DiagnosticUnitsClient, error) { - stream, err := c.cc.NewStream(ctx, &ElasticAgentControl_ServiceDesc.Streams[1], ElasticAgentControl_DiagnosticUnits_FullMethodName, opts...) + stream, err := c.cc.NewStream(ctx, &ElasticAgentControl_ServiceDesc.Streams[1], "/cproto.ElasticAgentControl/DiagnosticUnits", opts...) if err != nil { return nil, err } @@ -185,7 +173,7 @@ func (x *elasticAgentControlDiagnosticUnitsClient) Recv() (*DiagnosticUnitRespon } func (c *elasticAgentControlClient) DiagnosticComponents(ctx context.Context, in *DiagnosticComponentsRequest, opts ...grpc.CallOption) (ElasticAgentControl_DiagnosticComponentsClient, error) { - stream, err := c.cc.NewStream(ctx, &ElasticAgentControl_ServiceDesc.Streams[2], ElasticAgentControl_DiagnosticComponents_FullMethodName, opts...) + stream, err := c.cc.NewStream(ctx, &ElasticAgentControl_ServiceDesc.Streams[2], "/cproto.ElasticAgentControl/DiagnosticComponents", opts...) if err != nil { return nil, err } @@ -218,7 +206,7 @@ func (x *elasticAgentControlDiagnosticComponentsClient) Recv() (*DiagnosticCompo func (c *elasticAgentControlClient) Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) - err := c.cc.Invoke(ctx, ElasticAgentControl_Configure_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cproto.ElasticAgentControl/Configure", in, out, opts...) if err != nil { return nil, err } @@ -312,7 +300,7 @@ func _ElasticAgentControl_Version_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_Version_FullMethodName, + FullMethod: "/cproto.ElasticAgentControl/Version", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).Version(ctx, req.(*Empty)) @@ -330,7 +318,7 @@ func _ElasticAgentControl_State_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_State_FullMethodName, + FullMethod: "/cproto.ElasticAgentControl/State", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).State(ctx, req.(*Empty)) @@ -369,7 +357,7 @@ func _ElasticAgentControl_Restart_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_Restart_FullMethodName, + FullMethod: "/cproto.ElasticAgentControl/Restart", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).Restart(ctx, req.(*Empty)) @@ -387,7 +375,7 @@ func _ElasticAgentControl_Upgrade_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_Upgrade_FullMethodName, + FullMethod: "/cproto.ElasticAgentControl/Upgrade", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).Upgrade(ctx, req.(*UpgradeRequest)) @@ -405,7 +393,7 @@ func _ElasticAgentControl_DiagnosticAgent_Handler(srv interface{}, ctx context.C } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_DiagnosticAgent_FullMethodName, + FullMethod: "/cproto.ElasticAgentControl/DiagnosticAgent", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).DiagnosticAgent(ctx, req.(*DiagnosticAgentRequest)) @@ -465,7 +453,7 @@ func _ElasticAgentControl_Configure_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ElasticAgentControl_Configure_FullMethodName, + FullMethod: "/cproto.ElasticAgentControl/Configure", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ElasticAgentControlServer).Configure(ctx, req.(*ConfigureRequest)) diff --git a/pkg/control/v2/server/server.go b/pkg/control/v2/server/server.go index 2bfa3b06ec7..cea7712623e 100644 --- a/pkg/control/v2/server/server.go +++ b/pkg/control/v2/server/server.go @@ -357,9 +357,8 @@ func stateToProto(state *coordinator.State, agentInfo *info.AgentInfo) (*cproto. Message: comp.State.Message, Units: units, VersionInfo: &cproto.ComponentVersionInfo{ - Name: comp.State.VersionInfo.Name, - Version: comp.State.VersionInfo.Version, - Meta: comp.State.VersionInfo.Meta, + Name: comp.State.VersionInfo.Name, + Meta: comp.State.VersionInfo.Meta, }, }) } diff --git a/pkg/control/v2/server/server_test.go b/pkg/control/v2/server/server_test.go index c001072863a..e3f53558ae1 100644 --- a/pkg/control/v2/server/server_test.go +++ b/pkg/control/v2/server/server_test.go @@ -101,8 +101,7 @@ func TestStateMapping(t *testing.T) { State: client.UnitStateHealthy, Message: "component healthy", VersionInfo: runtime.ComponentVersionInfo{ - Name: "awesome-comp", - Version: "0.0.1", + Name: "awesome-comp", Meta: map[string]string{ "foo": "bar", }, @@ -159,9 +158,8 @@ func TestStateMapping(t *testing.T) { }, }, VersionInfo: &cproto.ComponentVersionInfo{ - Name: "awesome-comp", - Version: "0.0.1", - Meta: map[string]string{"foo": "bar"}, + Name: "awesome-comp", + Meta: map[string]string{"foo": "bar"}, }, } assert.Equal(t, expectedCompState, stateResponse.Components[0]) diff --git a/pkg/core/process/process.go b/pkg/core/process/process.go index 69924ed6df4..a9c7aa26782 100644 --- a/pkg/core/process/process.go +++ b/pkg/core/process/process.go @@ -119,7 +119,9 @@ func (i *Info) StopWait() error { return err } -// Wait returns a channel that will send process state once it exits. +// Wait returns a channel that will send process state once it exits. Each +// call to Wait() creates a goroutine. Failure to read from the returned +// channel will leak this goroutine. func (i *Info) Wait() <-chan *os.ProcessState { ch := make(chan *os.ProcessState) diff --git a/pkg/packer/packer.go b/pkg/packer/packer.go index 6bec521fe1c..2b220290293 100644 --- a/pkg/packer/packer.go +++ b/pkg/packer/packer.go @@ -10,7 +10,7 @@ import ( "encoding/base64" "encoding/json" "fmt" - "io/ioutil" + "os" "path/filepath" "strings" @@ -33,7 +33,7 @@ func Pack(patterns ...string) (string, []string, error) { return "", []string{}, errors.New(err, fmt.Sprintf("error while reading pattern %s", p)) } for _, f := range files { - b, err := ioutil.ReadFile(f) + b, err := os.ReadFile(f) if err != nil { return "", []string{}, errors.New(err, fmt.Sprintf("cannot read file %s", f)) } diff --git a/pkg/packer/packer_test.go b/pkg/packer/packer_test.go index 253aa8d5e7d..e85d124736c 100644 --- a/pkg/packer/packer_test.go +++ b/pkg/packer/packer_test.go @@ -6,7 +6,6 @@ package packer import ( "crypto/rand" - "io/ioutil" "os" "path/filepath" "reflect" @@ -25,13 +24,13 @@ func TestPacker(t *testing.T) { withFiles := func(test tt, fn func(pattern []string, t *testing.T)) func(t *testing.T) { return func(t *testing.T) { - d, err := ioutil.TempDir("", "packer") + d, err := os.MkdirTemp("", "packer") require.NoError(t, err) defer os.RemoveAll(d) for f, v := range test.content { path := filepath.Join(d, f) - err := ioutil.WriteFile(path, []byte(v), 0666) + err := os.WriteFile(path, []byte(v), 0666) require.NoError(t, err) } diff --git a/pkg/testing/fixture.go b/pkg/testing/fixture.go index 2a3b659d398..7a1b45ee49a 100644 --- a/pkg/testing/fixture.go +++ b/pkg/testing/fixture.go @@ -9,7 +9,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -313,9 +312,10 @@ func (f *Fixture) RunBeat(ctx context.Context) error { return fmt.Errorf("failed to spawn %s: %w", f.binaryName, err) } + procWaitCh := proc.Wait() killProc := func() { _ = proc.Kill() - <-proc.Wait() + <-procWaitCh } var doneChan <-chan time.Time @@ -329,7 +329,7 @@ func (f *Fixture) RunBeat(ctx context.Context) error { case <-ctx.Done(): killProc() return ctx.Err() - case ps := <-proc.Wait(): + case ps := <-procWaitCh: if stopping { return nil } @@ -385,9 +385,10 @@ func RunProcess(t *testing.T, return fmt.Errorf("failed to spawn %q: %w", processPath, err) } + procWaitCh := proc.Wait() killProc := func() { _ = proc.Kill() - <-proc.Wait() + <-procWaitCh } var doneChan <-chan time.Time @@ -401,7 +402,7 @@ func RunProcess(t *testing.T, case <-ctx.Done(): killProc() return ctx.Err() - case ps := <-proc.Wait(): + case ps := <-procWaitCh: if stopping { return nil } @@ -444,7 +445,7 @@ func RunProcess(t *testing.T, // when `Run` is called. // // if shouldWatchState is set to false, communicating state does not happen. -func (f *Fixture) RunWithClient(ctx context.Context, shouldWatchState bool, states ...State) error { +func (f *Fixture) RunWithClient(ctx context.Context, shouldWatchState bool, enableTestingMode bool, states ...State) error { if _, deadlineSet := ctx.Deadline(); !deadlineSet { f.t.Fatal("Context passed to Fixture.Run() has no deadline set.") } @@ -483,13 +484,6 @@ func (f *Fixture) RunWithClient(ctx context.Context, shouldWatchState bool, stat return fmt.Errorf("failed to get control protcol address: %w", err) } - if shouldWatchState { - agentClient = client.New(client.WithAddress(cAddr)) - f.setClient(agentClient) - defer f.setClient(nil) - stateCh, stateErrCh = watchState(ctx, f.t, agentClient, f.connectTimout) - } - var logProxy Logger if f.logOutput { logProxy = f.t @@ -497,7 +491,10 @@ func (f *Fixture) RunWithClient(ctx context.Context, shouldWatchState bool, stat stdOut := newLogWatcher(logProxy) stdErr := newLogWatcher(logProxy) - args := []string{"run", "-e", "--disable-encrypted-store", "--testing-mode"} + args := []string{"run", "-e", "--disable-encrypted-store"} + if enableTestingMode { + args = append(args, "--testing-mode") + } args = append(args, f.additionalArgs...) @@ -511,9 +508,11 @@ func (f *Fixture) RunWithClient(ctx context.Context, shouldWatchState bool, stat return fmt.Errorf("failed to spawn %s: %w", f.binaryName, err) } - killProc := func() { - _ = proc.Kill() - <-proc.Wait() + if shouldWatchState { + agentClient = client.New(client.WithAddress(cAddr)) + f.setClient(agentClient) + defer f.setClient(nil) + stateCh, stateErrCh = watchState(ctx, f.t, agentClient, f.connectTimout) } var doneChan <-chan time.Time @@ -521,13 +520,19 @@ func (f *Fixture) RunWithClient(ctx context.Context, shouldWatchState bool, stat doneChan = time.After(f.runLength) } + procWaitCh := proc.Wait() + killProc := func() { + _ = proc.Kill() + <-procWaitCh + } + stopping := false for { select { case <-ctx.Done(): killProc() return ctx.Err() - case ps := <-proc.Wait(): + case ps := <-procWaitCh: if stopping { return nil } @@ -599,7 +604,7 @@ func (f *Fixture) RunWithClient(ctx context.Context, shouldWatchState bool, stat // The `elastic-agent.yml` generated by `Fixture.Configure` is ignored // when `Run` is called. func (f *Fixture) Run(ctx context.Context, states ...State) error { - return f.RunWithClient(ctx, true, states...) + return f.RunWithClient(ctx, true, true, states...) } // Exec provides a way of performing subcommand on the prepared Elastic Agent binary. @@ -839,7 +844,7 @@ func (f *Fixture) prepareComponents(workDir string, components ...UsableComponen if err != nil { return err } - contents, err := ioutil.ReadDir(componentsDir) + contents, err := os.ReadDir(componentsDir) if err != nil { return fmt.Errorf("failed to read contents of components directory %s: %w", componentsDir, err) } @@ -979,7 +984,7 @@ func getCacheDir(caller string, name string) (string, error) { // FindComponentsDir identifies the directory that holds the components. func FindComponentsDir(dir string) (string, error) { dataDir := filepath.Join(dir, "data") - agentVersions, err := ioutil.ReadDir(dataDir) + agentVersions, err := os.ReadDir(dataDir) if err != nil { return "", fmt.Errorf("failed to read contents of the data directory %s: %w", dataDir, err) } @@ -1042,6 +1047,7 @@ func watchState(ctx context.Context, t *testing.T, c client.Client, timeout time // get a valid StateWatch connection var sub client.ClientStateWatch expBackoff := backoff.NewExponentialBackOff() + expBackoff.InitialInterval = 100 * time.Millisecond expBackoff.MaxElapsedTime = timeout expBackoff.MaxInterval = 2 * time.Second err = backoff.RetryNotify( @@ -1060,6 +1066,7 @@ func watchState(ctx context.Context, t *testing.T, c client.Client, timeout time return } + t.Logf("%s: StateWatch started", time.Now().UTC().Format(time.RFC3339Nano)) for { recv, err := sub.Recv() if err != nil { diff --git a/testing/integration/apm_propagation_test.go b/testing/integration/apm_propagation_test.go index af778837899..83b76e7db34 100644 --- a/testing/integration/apm_propagation_test.go +++ b/testing/integration/apm_propagation_test.go @@ -13,7 +13,6 @@ import ( "fmt" "io" "net/http" - "runtime" "strings" "testing" "text/template" @@ -57,12 +56,6 @@ func TestAPMConfig(t *testing.T) { Group: Default, Stack: &define.Stack{}, }) - - if runtime.GOOS == "windows" { - // This test hangs indefinitely on Windows. Root cause is TBD. - t.Skip("Flaky test: https://github.com/elastic/ingest-dev/issues/2668") - } - f, err := define.NewFixture(t, define.Version()) require.NoError(t, err) diff --git a/testing/integration/fake_test.go b/testing/integration/fake_test.go index cf58ba11c4a..dc9cf5ecaa6 100644 --- a/testing/integration/fake_test.go +++ b/testing/integration/fake_test.go @@ -57,9 +57,6 @@ func TestFakeComponent(t *testing.T) { err = f.Prepare(ctx, fakeComponent, fakeShipper) require.NoError(t, err) - ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - err = f.Run(ctx, atesting.State{ Configure: simpleConfig1, AgentState: atesting.NewClientState(client.Healthy), diff --git a/testing/integration/otel_test.go b/testing/integration/otel_test.go index c3b22ef3723..6aa06c9031e 100644 --- a/testing/integration/otel_test.go +++ b/testing/integration/otel_test.go @@ -124,7 +124,7 @@ func TestOtelFileProcessing(t *testing.T) { fixtureWg.Add(1) go func() { defer fixtureWg.Done() - err = fixture.RunWithClient(ctx, false) + err = fixture.RunWithClient(ctx, false, false) }() var content []byte @@ -132,6 +132,23 @@ func TestOtelFileProcessing(t *testing.T) { `"stringValue":"syslog"`, // syslog is being processed `"stringValue":"system.log"`, // system.log is being processed }) + + // check `elastic-agent status` returns successfully + require.Eventuallyf(t, func() bool { + // This will return errors until it connects to the agent, + // they're mostly noise because until the agent starts running + // we will get connection errors. If the test fails + // the agent logs will be present in the error message + // which should help to explain why the agent was not + // healthy. + err := fixture.IsHealthy(ctx) + return err == nil + }, + 2*time.Minute, time.Second, + "Elastic-Agent did not report healthy. Agent status error: \"%v\"", + err, + ) + require.Eventually(t, func() bool { // verify file exists @@ -240,7 +257,7 @@ func TestOtelAPMIngestion(t *testing.T) { var fixtureWg sync.WaitGroup fixtureWg.Add(1) go func() { - fixture.RunWithClient(ctx, false) + fixture.RunWithClient(ctx, false, false) fixtureWg.Done() }() diff --git a/testing/integration/upgrade_downgrade_test.go b/testing/integration/upgrade_downgrade_test.go index a1b763dd600..b45c9b39e59 100644 --- a/testing/integration/upgrade_downgrade_test.go +++ b/testing/integration/upgrade_downgrade_test.go @@ -23,6 +23,10 @@ import ( "github.com/elastic/elastic-agent/testing/upgradetest" ) +const ( + artifactElasticAgentProject = "elastic-agent-package" +) + func TestStandaloneDowngradeToSpecificSnapshotBuild(t *testing.T) { define.Require(t, define.Requirements{ Group: Upgrade, @@ -41,25 +45,45 @@ func TestStandaloneDowngradeToSpecificSnapshotBuild(t *testing.T) { ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) defer cancel() - // retrieve all the versions of agent from the artifact API aac := tools.NewArtifactAPIClient() latestSnapshotVersion, err := aac.GetLatestSnapshotVersion(ctx, t) require.NoError(t, err) - // get all the builds of the snapshot version (need to pass x.y.z-SNAPSHOT format) - // 2 builds are required to be available for the test to work. This is because - // if we upgrade to the latest build there would be no difference then passing the version - // string without the buildid, being agent would pick that build anyway. - // We pick the build that is 2 builds back to upgrade to, to ensure that the buildid is - // working correctly and agent is not only picking the latest build. - builds, err := aac.GetBuildsForVersion(ctx, latestSnapshotVersion.VersionWithPrerelease()) + // start at the build version as we want to test the retry + // logic that is in the build. + startFixture, err := define.NewFixture(t, define.Version()) + require.NoError(t, err) + startVersion, err := startFixture.ExecVersion(ctx) + require.NoError(t, err) + + // We need to find a build which is not the latest (so, we can make sure we address it by a build ID + // in the version prefix, e.g. x.y.z-SNAPSHOT-) and does not have the same commit hash + // as the currently running binary (so, we don't have a file system collision). + // Multiple builds can have different IDs but the same commit hash. + preReleaseVersion := latestSnapshotVersion.VersionWithPrerelease() + resp, err := aac.GetBuildsForVersion(ctx, preReleaseVersion) require.NoError(t, err) - if len(builds.Builds) < 2 { - t.Skipf("not enough SNAPSHOT builds exist for version %s. Found %d", latestSnapshotVersion.VersionWithPrerelease(), len(builds.Builds)) + + if len(resp.Builds) < 2 { + t.Skipf("need at least 2 builds in the version %s", latestSnapshotVersion.VersionWithPrerelease()) + return + } + + var upgradeVersionString string + for _, buildID := range resp.Builds[1:] { + details, err := aac.GetBuildDetails(ctx, preReleaseVersion, buildID) + require.NoError(t, err) + if details.Build.Projects[artifactElasticAgentProject].CommitHash != startVersion.Binary.Commit { + upgradeVersionString = buildID + break + } + } + + if upgradeVersionString == "" { + t.Skipf("there is no other build with a non-matching commit hash in the given version %s", latestSnapshotVersion.VersionWithPrerelease()) + return } - // find the specific build to use for the test - upgradeVersionString := builds.Builds[1] buildFragments := strings.Split(upgradeVersionString, "-") require.Lenf(t, buildFragments, 2, "version %q returned by artifact api is not in format -", upgradeVersionString) endParsedVersion := version.NewParsedSemVer( @@ -70,11 +94,6 @@ func TestStandaloneDowngradeToSpecificSnapshotBuild(t *testing.T) { buildFragments[1], ) - // Start at the build version as we want to test the retry - // logic that is in the build. - startFixture, err := define.NewFixture(t, define.Version()) - require.NoError(t, err) - // Upgrade to the specific build. endFixture, err := atesting.NewFixture( t, diff --git a/testing/integration/upgrade_fleet_test.go b/testing/integration/upgrade_fleet_test.go index 6cd43154fb8..4103093dc9f 100644 --- a/testing/integration/upgrade_fleet_test.go +++ b/testing/integration/upgrade_fleet_test.go @@ -182,6 +182,11 @@ func testUpgradeFleetManagedElasticAgent( endVersionInfo, err := endFixture.ExecVersion(ctx) require.NoError(t, err) + if startVersionInfo.Binary.Commit == endVersionInfo.Binary.Commit { + t.Skipf("target version has the same commit hash %q", endVersionInfo.Binary.Commit) + return + } + t.Log("Creating Agent policy...") policyResp, err := kibClient.CreatePolicy(ctx, policy) require.NoError(t, err, "failed creating policy") diff --git a/testing/upgradetest/upgrader.go b/testing/upgradetest/upgrader.go index c9b23203e20..91fe2dafb92 100644 --- a/testing/upgradetest/upgrader.go +++ b/testing/upgradetest/upgrader.go @@ -174,6 +174,10 @@ func PerformUpgrade( return fmt.Errorf("failed to get end agent build version info: %w", err) } + if startVersionInfo.Binary.Commit == endVersionInfo.Binary.Commit { + return fmt.Errorf("target version has the same commit hash %q", endVersionInfo.Binary.Commit) + } + // For asserting on the effects of any Upgrade Watcher changes made in 8.12.0, we need // the endVersion to be >= 8.12.0. Otherwise, these assertions will fail as those changes // won't be present in the Upgrade Watcher. So we disable these assertions if the endVersion @@ -233,7 +237,7 @@ func PerformUpgrade( } } - logger.Logf("Upgrading from version %q (%s) to version %q (%s)", startParsedVersion, startVersionInfo.Binary.Commit, endVersionInfo.Binary.String(), endVersionInfo.Binary.Commit) + logger.Logf("Upgrading from version \"%s-%s\" to version \"%s-%s\"", startParsedVersion, startVersionInfo.Binary.Commit, endVersionInfo.Binary.String(), endVersionInfo.Binary.Commit) upgradeCmdArgs := []string{"upgrade", endVersionInfo.Binary.String()} if upgradeOpts.sourceURI == nil { @@ -278,7 +282,7 @@ func PerformUpgrade( // wait for the watcher to show up logger.Logf("waiting for upgrade watcher to start") - err = WaitForWatcher(ctx, 2*time.Minute, 10*time.Second) + err = WaitForWatcher(ctx, 5*time.Minute, 10*time.Second) if err != nil { return fmt.Errorf("failed to find watcher: %w", err) }