diff --git a/.agent-versions.json b/.agent-versions.json index cea3993e8b2..a4c62ef0fad 100644 --- a/.agent-versions.json +++ b/.agent-versions.json @@ -1,10 +1,10 @@ { "testVersions": [ - "8.13.0-SNAPSHOT", - "8.12.3-SNAPSHOT", - "8.12.2", - "8.12.1", - "7.17.19-SNAPSHOT", - "7.17.18" + "8.14.1", + "8.14.1-SNAPSHOT", + "8.13.5-SNAPSHOT", + "8.13.4", + "7.17.22-SNAPSHOT", + "7.17.21" ] } diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 0d64284efd2..6153e122293 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -46,7 +46,7 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-package" ]]; then fi fi -if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent" && "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then +if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-extended-testing" && "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then # Set GCP credentials export GOOGLE_APPLICATION_GCP_SECRET=$(retry 5 vault kv get -format=json -field=data ${CI_GCP_OBS_PATH}) echo "${GOOGLE_APPLICATION_GCP_SECRET}" > ./gcp.json diff --git a/.buildkite/hooks/pre-exit b/.buildkite/hooks/pre-exit index 213f51aff7b..f6fea04d0d2 100755 --- a/.buildkite/hooks/pre-exit +++ b/.buildkite/hooks/pre-exit @@ -2,7 +2,7 @@ set -eo pipefail -if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent" && "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then +if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-extended-testing" && "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then if [[ -z "${WORKSPACE-""}" ]]; then WORKSPACE=$(git rev-parse --show-toplevel) fi @@ -10,11 +10,8 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent" && "$BUILDKITE_STEP_KEY" == # Perform cleanup of integration tests resources echo "--- Cleaning up integration test resources" - if [[ "$BUILDKITE_STEP_KEY" == "serverless-integration-tests" ]]; then - STACK_PROVISIONER=serverless SNAPSHOT=true mage integration:clean - else - SNAPSHOT=true mage integration:clean - fi + STACK_PROVISIONER=serverless SNAPSHOT=true mage integration:clean + SNAPSHOT=true mage integration:clean fi if [ -n "$GOOGLE_APPLICATION_CREDENTIALS" ]; then diff --git a/.buildkite/integration.pipeline.yml b/.buildkite/integration.pipeline.yml new file mode 100644 index 00000000000..37b4c2d1d25 --- /dev/null +++ b/.buildkite/integration.pipeline.yml @@ -0,0 +1,76 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json + +env: + DOCKER_REGISTRY: "docker.elastic.co" + VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp" + +steps: + - label: "Serverless integration test" + key: "serverless-integration-tests" + concurrency_group: elastic-agent-extended-testing/serverless-integration + concurrency: 8 + env: + # we run each step in a different data center to spread the load + TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-a" + command: ".buildkite/scripts/steps/integration_tests.sh serverless integration:single TestLogIngestionFleetManaged" #right now, run a single test in serverless mode as a sort of smoke test, instead of re-running the entire suite + artifact_paths: + - "build/TEST-**" + - "build/diagnostics/*" + agents: + provider: "gcp" + machineType: "n1-standard-8" + notify: + - github_commit_status: + context: "buildkite/elastic-agent-extended-testing - Serverless integration test" + + - label: "Extended runtime leak tests" + key: "extended-integration-tests" + concurrency_group: elastic-agent-extended-testing/leak-tests + concurrency: 8 + env: + TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-b" + command: ".buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks" + artifact_paths: + - "build/TEST-**" + - "build/diagnostics/*" + agents: + provider: "gcp" + machineType: "n1-standard-8" + notify: + - github_commit_status: + context: "buildkite/elastic-agent-extended-testing - Extended runtime leak tests" + + - label: "Integration tests" + key: "integration-tests" + concurrency_group: elastic-agent-extended-testing/integration + concurrency: 8 + env: + TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-f" + command: ".buildkite/scripts/steps/integration_tests.sh stateful" + artifact_paths: + - "build/TEST-**" + - "build/diagnostics/*" + agents: + provider: "gcp" + machineType: "n1-standard-8" + notify: + - github_commit_status: + context: "buildkite/elastic-agent-extended-testing - Integration tests" + + - label: "Serverless Beats Tests" + key: "serverless-beats-integration-tests" + concurrency_group: elastic-agent-extended-testing/beats-integration + concurrency: 8 + env: + TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-a" + command: ".buildkite/scripts/steps/beats_tests.sh" + # if: "build.env('CRON') == 'yes'" + agents: + provider: "gcp" + machineType: "n1-standard-8" + retry: + manual: + allowed: true + notify: + - github_commit_status: + context: "buildkite/elastic-agent-extended-testing - Serverless Beats Tests" diff --git a/.buildkite/misc/gce-cleanup.yml b/.buildkite/misc/gce-cleanup.yml index c9d4b440e45..6606f4a6c11 100644 --- a/.buildkite/misc/gce-cleanup.yml +++ b/.buildkite/misc/gce-cleanup.yml @@ -18,7 +18,7 @@ scanners: filters: - type: "<" pointer: "/extra/creationTimestamp" - param: "${CREATION_DATE}" + param: "${DELETE_CREATED_AFTER_DATE}" converters: param: "date" value: "date" diff --git a/.buildkite/pipeline.elastic-agent-package.yml b/.buildkite/pipeline.elastic-agent-package.yml index dcd91c110ca..25c538f25f9 100644 --- a/.buildkite/pipeline.elastic-agent-package.yml +++ b/.buildkite/pipeline.elastic-agent-package.yml @@ -10,10 +10,10 @@ env: steps: - input: "Build parameters" - if: build.env("ManifestURL") == null + if: build.env("MANIFEST_URL") == null fields: - - text: "ManifestURL" - key: "ManifestURL" + - text: "MANIFEST_URL" + key: "MANIFEST_URL" default: "" required: true hint: "Link to the build manifest URL." @@ -51,7 +51,7 @@ steps: hint: "If the DRA release manager script would actually publish anything or just print" - wait: ~ - if: build.env("ManifestURL") == null + if: build.env("MANIFEST_URL") == null - group: ":Packaging Artefacts" key: "package" @@ -63,10 +63,10 @@ steps: machineType: "c2-standard-16" diskSizeGb: 400 command: | - if [[ -z "${ManifestURL}" ]]; then - export ManifestURL=$(buildkite-agent meta-data get ManifestURL --default "") - if [[ -z "${ManifestURL}" ]]; then - echo ":broken_heart: Missing ManifestURL variable or empty string provided" + if [[ -z "${MANIFEST_URL}" ]]; then + export MANIFEST_URL=$(buildkite-agent meta-data get MANIFEST_URL --default "") + if [[ -z "${MANIFEST_URL}" ]]; then + echo ":broken_heart: Missing MANIFEST_URL variable or empty string provided" exit 1 fi fi @@ -86,10 +86,10 @@ steps: PLATFORMS: "linux/arm64" PACKAGES: "docker" command: | - if [[ -z "${ManifestURL}" ]]; then - export ManifestURL=$(buildkite-agent meta-data get ManifestURL --default "") - if [[ -z "${ManifestURL}" ]]; then - echo ":broken_heart: Missing ManifestURL variable or empty string provided" + if [[ -z "${MANIFEST_URL}" ]]; then + export MANIFEST_URL=$(buildkite-agent meta-data get MANIFEST_URL --default "") + if [[ -z "${MANIFEST_URL}" ]]; then + echo ":broken_heart: Missing MANIFEST_URL variable or empty string provided" exit 1 fi fi @@ -134,6 +134,8 @@ steps: depends_on: package agents: provider: "gcp" + machineType: "n2-standard-8" + diskSizeGb: 250 env: DRA_PROJECT_ID: "elastic-agent-package" DRA_PROJECT_ARTIFACT_ID: "agent-package" diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c19b13a8b85..daeacdebe67 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -213,47 +213,6 @@ steps: manual: allowed: true - - label: "Serverless integration test" - key: "serverless-integration-tests" - command: ".buildkite/scripts/steps/integration_tests.sh serverless integration:single TestLogIngestionFleetManaged" #right now, run a single test in serverless mode as a sort of smoke test, instead of re-running the entire suite - artifact_paths: - - "build/TEST-**" - - "build/diagnostics/*" - agents: - provider: "gcp" - machineType: "n1-standard-8" - - - label: "Extended runtime leak tests" - key: "extended-integration-tests" - command: ".buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks" - artifact_paths: - - "build/TEST-**" - - "build/diagnostics/*" - agents: - provider: "gcp" - machineType: "n1-standard-8" - - - label: "Integration tests" - key: "integration-tests" - command: ".buildkite/scripts/steps/integration_tests.sh stateful" - artifact_paths: - - "build/TEST-**" - - "build/diagnostics/*" - agents: - provider: "gcp" - machineType: "n1-standard-8" - - - label: "Serverless Beats Tests" - key: "serverless-beats-integration-tests" - command: ".buildkite/scripts/steps/beats_tests.sh" - if: "build.env('CRON') == 'yes'" - agents: - provider: "gcp" - machineType: "n1-standard-8" - retry: - manual: - allowed: true - # Triggers a dynamic step: Sync K8s # Runs only on main and if k8s files are changed - label: "Trigger k8s sync" @@ -273,3 +232,51 @@ steps: image: "family/core-ubuntu-2204" env: - GH_VERSION=2.4.0 + + # Trigger for pull requests + - label: "Trigger Integration tests for Pull request" + if: | + (build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) || + build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /.*extended.*/ + + plugins: + - monorepo-diff#v1.0.1: + diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" + watch: + - path: + - internal/ + - dev-tools/ + - pkg/ + - testing/ + - version/ + - specs/ + - .agent-versions.json + - .go-version + - .package-version + - go.mod + - go.sum + - magefile.go + - main.go + + - .buildkite/integration.pipeline.yml + - .buildkite/pipeline.yml + - .buildkite/scripts/ + - .buildkite/hooks/ + + config: + trigger: "elastic-agent-extended-testing" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + env: + - BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST} + - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} + - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + + # Trigger for branches + - label: "Triggering Integration tests for branches" + if: build.pull_request.id == null + trigger: "elastic-agent-extended-testing" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 6b6ef40b827..c33e5e6febc 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -1,19 +1,19 @@ { "jobs": [ { - "enabled": true, + "enabled": true, "pipelineSlug": "elastic-agent", "allow_org_users": true, "allowed_repo_permissions": ["admin", "write"], - "allowed_list": ["dependabot[bot]", "mergify[bot]"], + "allowed_list": ["dependabot[bot]", "mergify[bot]", "github-actions[bot]"], "set_commit_status": true, "build_on_commit": true, "build_on_comment": true, - "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", - "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", - "skip_ci_labels": [ ], + "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)", + "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)", + "skip_ci_labels": [ "skip-ci" ], "skip_target_branches": [ ], - "skip_ci_on_only_changed": [ ], + "skip_ci_on_only_changed": [ "^.ci/", "^changelog", "^docs/", "\\.md$", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"], "always_require_ci_on_changed": [ ] }, { @@ -21,7 +21,7 @@ "pipelineSlug": "elastic-agent-package", "allow_org_users": true, "allowed_repo_permissions": ["admin", "write"], - "allowed_list": [], + "allowed_list": ["dependabot[bot]", "mergify[bot]"], "set_commit_status": false, "build_on_commit": false, "build_on_comment": true, @@ -37,7 +37,7 @@ "pipelineSlug": "elastic-agent-binary-dra", "allow_org_users": true, "allowed_repo_permissions": ["admin", "write"], - "allowed_list": [], + "allowed_list": ["dependabot[bot]", "mergify[bot]"], "set_commit_status": false, "build_on_commit": false, "build_on_comment": true, diff --git a/.buildkite/scripts/steps/gce-cleanup.sh b/.buildkite/scripts/steps/gce-cleanup.sh index 813a3ac37bd..96fecd68314 100644 --- a/.buildkite/scripts/steps/gce-cleanup.sh +++ b/.buildkite/scripts/steps/gce-cleanup.sh @@ -5,11 +5,11 @@ set -euo pipefail export ACCOUNT_KEY_SECRET=$(vault kv get -field=client_email $VAULT_PATH) export ACCOUNT_SECRET=$(vault kv get -field=private_key $VAULT_PATH) export ACCOUNT_PROJECT_SECRET=$(vault kv get -field=project_id $VAULT_PATH) -export CREATION_DATE=$(date -Is -d "24 hours ago") +export DELETE_CREATED_AFTER_DATE=$(date -Is -d "5 hours ago") docker run -v $(pwd)/.buildkite/misc/gce-cleanup.yml:/etc/cloud-reaper/config.yml \ -e ACCOUNT_SECRET="$ACCOUNT_SECRET" \ -e ACCOUNT_KEY="$ACCOUNT_KEY_SECRET" \ -e ACCOUNT_PROJECT=$ACCOUNT_PROJECT_SECRET \ - -e CREATION_DATE=$CREATION_DATE \ + -e DELETE_CREATED_AFTER_DATE=$DELETE_CREATED_AFTER_DATE \ ${DOCKER_REGISTRY}/observability-ci/cloud-reaper:0.3.0 cloud-reaper --config /etc/cloud-reaper/config.yml destroy --confirm diff --git a/.buildkite/scripts/steps/integration_tests.sh b/.buildkite/scripts/steps/integration_tests.sh index 4143e2413e5..c211fb74b44 100755 --- a/.buildkite/scripts/steps/integration_tests.sh +++ b/.buildkite/scripts/steps/integration_tests.sh @@ -9,9 +9,9 @@ MAGE_SUBTARGET="${3:-""}" # Override the agent package version using a string with format .. -# NOTE: use only after version bump when the new version is not yet available, for example: -# OVERRIDE_AGENT_PACKAGE_VERSION="8.10.3" otherwise OVERRIDE_AGENT_PACKAGE_VERSION="". -OVERRIDE_AGENT_PACKAGE_VERSION="" +# There is a time when the snapshot is not built yet, so we cannot use the latest version automatically +# This file is managed by an automation (mage integration:UpdateAgentPackageVersion) that check if the snapshot is ready. +OVERRIDE_AGENT_PACKAGE_VERSION="$(cat .package-version)" if [[ -n "$OVERRIDE_AGENT_PACKAGE_VERSION" ]]; then OVERRIDE_TEST_AGENT_VERSION=${OVERRIDE_AGENT_PACKAGE_VERSION}"-SNAPSHOT" diff --git a/.buildkite/scripts/steps/package.sh b/.buildkite/scripts/steps/package.sh index 57a885a451d..734869fef85 100755 --- a/.buildkite/scripts/steps/package.sh +++ b/.buildkite/scripts/steps/package.sh @@ -5,19 +5,19 @@ set -euo pipefail _SELF=$(dirname $0) source "${_SELF}/../common.sh" -if test -z "${ManifestURL=:""}"; then - echo "Missing variable ManifestURL, export it before use." +if test -z "${MANIFEST_URL=:""}"; then + echo "Missing variable MANIFEST_URL, export it before use." exit 2 fi export AGENT_DROP_PATH=build/elastic-agent-drop mkdir -p $AGENT_DROP_PATH -# Download the components from the ManifestURL and then package those downloaded into the $AGENT_DROP_PATH -mage clean downloadManifest package ironbank fixDRADockerArtifacts +# Download the components from the MANIFEST_URL and then package those downloaded into the $AGENT_DROP_PATH +mage clean downloadManifest packageUsingDRA ironbank fixDRADockerArtifacts echo "+++ Generate dependencies report" -BEAT_VERSION_FULL=$(curl -s -XGET "${ManifestURL}" |jq '.version' -r ) +BEAT_VERSION_FULL=$(curl -s -XGET "${MANIFEST_URL}" |jq '.version' -r ) bash "${_SELF}/../../../dev-tools/dependencies-report" mkdir -p build/distributions/reports mv dependencies.csv "build/distributions/reports/dependencies-${BEAT_VERSION_FULL}.csv" diff --git a/.buildkite/scripts/steps/sync-k8s.sh b/.buildkite/scripts/steps/sync-k8s.sh index ecd64e815a4..02220d3f8d8 100644 --- a/.buildkite/scripts/steps/sync-k8s.sh +++ b/.buildkite/scripts/steps/sync-k8s.sh @@ -6,7 +6,14 @@ export PATH=$HOME/bin:${PATH} source .buildkite/scripts/install-gh.sh source .buildkite/scripts/common.sh -export GITHUB_TOKEN=$(retry 5 vault kv get -field token kv/ci-shared/platform-ingest/github_token) +echo "--- [Prepare env] Create required env variables" +GITHUB_TOKEN_VAULT_PATH="kv/ci-shared/platform-ingest/github_token" +GITHUB_USERNAME_SECRET=$(retry 5 vault kv get -field username ${GITHUB_TOKEN_VAULT_PATH}) +export GITHUB_USERNAME_SECRET +GITHUB_EMAIL_SECRET=$(retry 5 vault kv get -field email ${GITHUB_TOKEN_VAULT_PATH}) +export GITHUB_EMAIL_SECRET +GITHUB_TOKEN_SECRET=$(retry 5 vault kv get -field token ${GITHUB_TOKEN_VAULT_PATH}) +export GITHUB_TOKEN_SECRET cd deploy/kubernetes diff --git a/.ci/bump-golang.yml b/.ci/bump-golang.yml index 470c6f4c8d5..5d51f9d5895 100644 --- a/.ci/bump-golang.yml +++ b/.ci/bump-golang.yml @@ -123,8 +123,8 @@ targets: - Dockerfile - Dockerfile.skaffold matchpattern: 'ARG GO_VERSION=\d+.\d+.\d+' - update-gomod: - name: "Update go.mod" + update-gomod-minor-version: + name: "Update go.mod minor version" sourceid: gomod scmid: githubConfig kind: file @@ -132,3 +132,12 @@ targets: content: 'go {{ source "gomod" }}' file: go.mod matchpattern: 'go \d+.\d+' + update-gomod-toolchain-version: + name: "Update go.mod toolchain version" + sourceid: latestGoVersion + scmid: githubConfig + kind: file + spec: + content: 'toolchain go{{ source "latestGoVersion" }}' + file: go.mod + matchpattern: 'toolchain go\d+.\d+.\d+' diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ff84a72f710..3335fee4631 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -36,12 +36,13 @@ List here all the items you have verified BEFORE sending this PR. Please DO NOT - [ ] I have added an entry in `./changelog/fragments` using the [changelog tool](https://github.com/elastic/elastic-agent#changelog) - [ ] I have added an integration test or an E2E test -## Author's Checklist +## Disruptive User Impact - -- [ ] ## How to test this PR locally @@ -59,32 +60,22 @@ Link related issues below. Insert the issue link or reference after the word "Cl - Requires #123 - Superseds #123 --> -- - -## Use cases - - - -## Screenshots - - - -## Logs - - +- ## Questions to ask yourself -- How are we going to support this in production? -- How are we going to measure its adoption? +- How are we going to support this in production? +- How are we going to measure its adoption? - How are we going to debug this? - What are the metrics I should take care of? - ... + + \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0c061c06c56..a309f5c8b47 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,7 @@ updates: labels: - automation - skip-changelog - - Team:Elastic-Agent + - Team:Elastic-Agent-Control-Plane groups: otel-dependencies: exclude-patterns: @@ -24,3 +24,15 @@ updates: reviewers: - "elastic/elastic-agent-control-plane" open-pull-requests-limit: 10 + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + labels: + - automation + - skip-changelog + - Team:Elastic-Agent-Control-Plane + reviewers: + - "elastic/elastic-agent-control-plane" + open-pull-requests-limit: 10 diff --git a/.github/workflows/bump-agent-versions.sh b/.github/workflows/bump-agent-versions.sh new file mode 100755 index 00000000000..95bd0c156ef --- /dev/null +++ b/.github/workflows/bump-agent-versions.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -e + +package_version=$(mage integration:updatePackageVersion) +version_requirements=$(mage integration:updateVersions) +changes=$(git status -s -uno .agent-versions.json .package-version) +if [ -z "$changes" ] +then + echo "The version files didn't change, skipping..." +else + echo "The version file(s) changed" + git diff -p + open=$(gh pr list --repo "$GITHUB_REPOSITORY" --label="update-versions" --limit 1 --state open --base "$GITHUB_REF_NAME") + if [ -n "$open" ] + then + echo "Another PR for $GITHUB_REF_NAME is in review, skipping..." + exit 0 + fi + # the mage target above requires to be on a release branch + # so, the new branch should not be created before the target is run + git checkout -b update-agent-versions-$GITHUB_RUN_ID + git add .agent-versions.json .package-version + + nl=$'\n' # otherwise the new line character is not recognized properly + commit_desc="These files are used for picking agent versions in integration tests.${nl}${nl}The content is based on responses from https://www.elastic.co/api/product_versions and https://snapshots.elastic.co${nl}${nl}The current update is generated based on the following requirements:${nl}${nl}Package version: ${package_version}${nl}${nl}\`\`\`json${nl}${version_requirements}${nl}\`\`\`" + + git commit -m "[$GITHUB_REF_NAME][Automation] Update versions" -m "$commit_desc" + git push --set-upstream origin "update-agent-versions-$GITHUB_RUN_ID" + pr=$(gh pr create \ + --base "$GITHUB_REF_NAME" \ + --fill-first \ + --head "update-agent-versions-$GITHUB_RUN_ID" \ + --label 'Team:Elastic-Agent' \ + --label 'Team:Elastic-Agent-Control-Plane' \ + --label 'update-versions' \ + --label 'skip-changelog' \ + --label 'backport-skip' \ + --repo $GITHUB_REPOSITORY) + echo "pr=$pr" >> "$GITHUB_OUTPUT" # set the step output for Slack notifications + echo "Created a PR with the an update: $pr" +fi diff --git a/.github/workflows/bump-agent-versions.yml b/.github/workflows/bump-agent-versions.yml index 259c065c2bb..ca0ba2b3fe3 100644 --- a/.github/workflows/bump-agent-versions.yml +++ b/.github/workflows/bump-agent-versions.yml @@ -2,59 +2,86 @@ name: update-agent-versions on: + workflow_dispatch: schedule: - cron: "0 0 * * *" jobs: update_versions: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: + - name: Checkout uses: actions/checkout@v4 + with: + # no depth limit + # so, we can generate snapshot versions based on release branches + fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.21 - - name: Set up branch - run: git checkout -b update-agent-versions-$GITHUB_RUN_ID + - name: Set git config + run: | + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" - - name: Update the agent version file + - name: Install mage uses: magefile/mage-action@v3 with: version: v1.13.0 - args: integration:updateVersions + install-only: true - - name: Check for file changes + - name: Update versions + id: update env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - changes=$(git status -s -uno .agent-versions.json) - if [ -z "$changes" ] - then - echo "The versions file didn't change, skipping..." - else - echo "The versions file changed" - open=$(gh pr list --repo "$GITHUB_REPOSITORY" --label="update-versions" --limit 1 --state open --base "$GITHUB_REF_NAME") - if [ -n "$open" ] - then - echo "Another PR for $GITHUB_REF_NAME is in review, skipping..." - exit 0 - fi - git diff -p - git config --global user.name 'apmmachine' - git config --global user.email 'apmmachine@users.noreply.github.com' - git add ".agent-versions.json" - git commit -m "[$GITHUB_REF_NAME](automation) Update .agent-versions.json" -m "This file is used for picking agent versions in integration tests. It's content is based on the reponse from https://artifacts-api.elastic.co/v1/versions/" - git push --set-upstream origin "update-agent-versions-$GITHUB_RUN_ID" - gh pr create \ - --base "$GITHUB_REF_NAME" \ - --fill-first \ - --head "update-agent-versions-$GITHUB_RUN_ID" \ - --label 'Team:Elastic-Agent' \ - --label 'update-versions' \ - --label 'skip-changelog' \ - --label 'backport-skip' \ - --repo $GITHUB_REPOSITORY - fi + run: ./.github/workflows/bump-agent-versions.sh + + - if: ${{ failure() }} + uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 + with: + channel-id: '#ingest-notifications' + payload: | + { + "text": "${{ env.SLACK_MESSAGE }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ env.SLACK_MESSAGE }}" + } + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + SLACK_MESSAGE: ":traffic_cone: Elastic Agent version update failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + + # if a PR was created as a result of this job, we notify on the Slack channel + - if: ${{ startsWith(steps.update.outputs.pr, 'https') }} + uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 + with: + channel-id: '#ingest-notifications' + payload: | + { + "text": "${{ env.SLACK_MESSAGE }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ env.SLACK_MESSAGE }}" + } + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + SLACK_MESSAGE: "Update for Elastic Agent versions has been created: ${{ steps.update.outputs.pr }}" diff --git a/.github/workflows/bump-golang.yml b/.github/workflows/bump-golang.yml index 4127cea9e4f..4af36c556e4 100644 --- a/.github/workflows/bump-golang.yml +++ b/.github/workflows/bump-golang.yml @@ -14,15 +14,40 @@ env: jobs: bump: + permissions: + contents: write + pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: elastic/apm-pipeline-library/.github/actions/updatecli@current + - name: Install Updatecli in the runner + uses: updatecli/updatecli-action@eb158f6fd9e425b940a6750d6318f98e050ac390 # v0.76.1 + + - name: Run Updatecli in Apply mode + run: updatecli apply --config .github/updatecli-bump-golang.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_USER: "github-actions[bot]" + GIT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com" + + - if: ${{ failure() }} + uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 with: - vaultUrl: ${{ secrets.VAULT_ADDR }} - vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} - vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - pipeline: ./.github/updatecli-bump-golang.yml - notifySlackChannel: "#ingest-notifications" - messageIfFailure: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@agent-team` please look what's going on <${{ env.JOB_URL }}|here>" + channel-id: '#ingest-notifications' + payload: | + { + "text": "${{ env.SLACK_MESSAGE }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ env.SLACK_MESSAGE }}" + } + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@agent-team` please look what's going on <${{ env.JOB_URL }}|here>" diff --git a/.github/workflows/fragment-in-pr.yml b/.github/workflows/fragment-in-pr.yml index ea98842804c..6c6b67801fa 100644 --- a/.github/workflows/fragment-in-pr.yml +++ b/.github/workflows/fragment-in-pr.yml @@ -8,8 +8,8 @@ jobs: if: "!contains(github.event.pull_request.labels.*.name, 'skip-changelog') && !contains(github.event.pull_request.labels.*.name, 'backport')" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version-file: .go-version - name: check pr-has-fragment diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 33cac15330a..8feed628a2a 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -18,14 +18,14 @@ jobs: name: lint runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: go-version-file: .go-version - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version version: v1.55.2 @@ -39,8 +39,5 @@ jobs: # into fixing all linting issues in the whole file instead. args: --timeout=30m --whole-files - # Optional: if set to true then the action will use pre-installed Go. - skip-go-installation: true - # Optional: show only new issues if it's a pull request. The default value is `false`. only-new-issues: true diff --git a/.github/workflows/opentelemetry.yml b/.github/workflows/opentelemetry.yml deleted file mode 100644 index 16d0101ed59..00000000000 --- a/.github/workflows/opentelemetry.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -# Look up results at https://ela.st/oblt-ci-cd-stats -# There will be one service per GitHub repository, including the org name, and one Transaction per Workflow. -name: OpenTelemetry Export Trace - -on: - workflow_run: - workflows: [ "*" ] - types: [completed] - -permissions: - contents: read - -jobs: - otel-export-trace: - runs-on: ubuntu-latest - steps: - - uses: elastic/apm-pipeline-library/.github/actions/opentelemetry@current - with: - vaultUrl: ${{ secrets.VAULT_ADDR }} - vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} - vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} diff --git a/.github/workflows/post-dependabot.yml b/.github/workflows/post-dependabot.yml index 8542b41ae9c..ba9402e9d5a 100644 --- a/.github/workflows/post-dependabot.yml +++ b/.github/workflows/post-dependabot.yml @@ -16,9 +16,9 @@ jobs: contents: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version-file: .go-version diff --git a/.go-version b/.go-version index 428abfd24fb..88863fd8e36 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.21.8 +1.21.11 diff --git a/.golangci.yml b/.golangci.yml index 8fa3c93173c..71346681f33 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -116,7 +116,7 @@ linters-settings: gosimple: # Select the Go version to target. The default is '1.13'. - go: "1.21.8" + go: "1.21.11" nakedret: # make an issue if func has more lines of code than this setting and it has naked returns; default is 30 @@ -136,17 +136,17 @@ linters-settings: staticcheck: # Select the Go version to target. The default is '1.13'. - go: "1.21.8" + go: "1.21.11" checks: ["all"] stylecheck: # Select the Go version to target. The default is '1.13'. - go: "1.21.8" + go: "1.21.11" checks: ["all"] unused: # Select the Go version to target. The default is '1.13'. - go: "1.21.8" + go: "1.21.11" gosec: excludes: diff --git a/.mergify.yml b/.mergify.yml index 6da091c7e2a..ddfee7828e5 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -306,3 +306,16 @@ pull_request_rules: labels: - "backport" title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}" + - name: backport patches to 8.14 branch + conditions: + - merged + - label=backport-v8.14.0 + actions: + backport: + assignees: + - "{{ author }}" + branches: + - "8.14" + labels: + - "backport" + title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}" diff --git a/.mockery.yaml b/.mockery.yaml index 2cf0461278e..42937061c85 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -1,5 +1,25 @@ -inpackage: False -testonly: False with-expecter: True -keeptree: True -case: underscore \ No newline at end of file +inpackage: false +dir: testing/mocks/{{ replaceAll .InterfaceDirRelative "internal" "internal_" }} +mockname: "{{.InterfaceName}}" +outpkg: "{{.PackageName}}" +filename: "{{ snakecase .InterfaceName}}_mock.go" +packages: + github.com/elastic/elastic-agent/pkg/control/v2/client: + interfaces: + Client: + github.com/elastic/elastic-agent/internal/pkg/agent/application/actions/handlers: + interfaces: + Uploader: + diagnosticsProvider: + config: + mockname: "DiagnosticsProvider" + logLevelSetter: + config: + mockname: "LogLevelSetter" + github.com/elastic/elastic-agent/internal/pkg/fleetapi/acker: + interfaces: + Acker: + github.com/elastic/elastic-agent/internal/pkg/agent/application/info: + interfaces: + Agent: \ No newline at end of file diff --git a/.package-version b/.package-version new file mode 100644 index 00000000000..f8089586e98 --- /dev/null +++ b/.package-version @@ -0,0 +1 @@ +8.15.0 \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af7954520b9..047700875f2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,10 +3,3 @@ repos: rev: v4.0.1 hooks: - id: check-merge-conflict - -- repo: https://github.com/elastic/apm-pipeline-library.git - rev: current - hooks: - - id: check-jenkins-pipelines - files: ^(.ci/(.*\.groovy|Jenkinsfile)|Jenkinsfile)$ - - id: check-jjbb diff --git a/Dockerfile b/Dockerfile index b9d91c6565f..e586161e548 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.21.8 +ARG GO_VERSION=1.21.11 FROM circleci/golang:${GO_VERSION} diff --git a/Dockerfile.skaffold b/Dockerfile.skaffold index 0b0cac33caf..c8ced4bd313 100644 --- a/Dockerfile.skaffold +++ b/Dockerfile.skaffold @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.21.8 +ARG GO_VERSION=1.21.11 ARG crossbuild_image="docker.elastic.co/beats-dev/golang-crossbuild" ARG AGENT_VERSION=8.9.0-SNAPSHOT ARG AGENT_IMAGE="docker.elastic.co/beats/elastic-agent" diff --git a/Makefile b/Makefile index 13aab51123b..8592bdf06a3 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ check: ## check-go: download and run the go linter. .PHONY: check-go check-go: ## - Run golangci-lint - @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.44.2 + @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2 @./bin/golangci-lint run -v ## check-no-changes : Check there is no local changes. diff --git a/NOTICE.txt b/NOTICE.txt index 6ee2c399fb7..d5c77d6c512 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -176,11 +176,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : github.com/cenkalti/backoff/v4 -Version: v4.2.1 +Version: v4.3.0 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/cenkalti/backoff/v4@v4.2.1/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/cenkalti/backoff/v4@v4.3.0/LICENSE: The MIT License (MIT) @@ -619,11 +619,11 @@ Contents of probable licence file $GOMODCACHE/github.com/dolmen-go/contextio@v0. -------------------------------------------------------------------------------- Dependency : github.com/elastic/e2e-testing -Version: v1.1.0 +Version: v1.2.1 Licence type (autodetected): Elastic -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/e2e-testing@v1.1.0/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/elastic/e2e-testing@v1.2.1/LICENSE.txt: Elastic License 2.0 @@ -722,11 +722,11 @@ these terms. -------------------------------------------------------------------------------- Dependency : github.com/elastic/elastic-agent-autodiscover -Version: v0.6.8 +Version: v0.7.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-autodiscover@v0.6.8/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-autodiscover@v0.7.0/LICENSE: Apache License Version 2.0, January 2004 @@ -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.8.1 +Version: v7.11.0 Licence type (autodetected): Elastic -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-client/v7@v7.8.1/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-client/v7@v7.11.0/LICENSE.txt: ELASTIC LICENSE AGREEMENT @@ -1166,11 +1166,11 @@ SOFTWARE -------------------------------------------------------------------------------- Dependency : github.com/elastic/elastic-agent-libs -Version: v0.8.0 +Version: v0.9.12 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.8.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.9.12/LICENSE: Apache License Version 2.0, January 2004 @@ -1377,11 +1377,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-l -------------------------------------------------------------------------------- Dependency : github.com/elastic/elastic-agent-system-metrics -Version: v0.9.2 +Version: v0.10.3 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.9.2/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.10.3/LICENSE.txt: Apache License Version 2.0, January 2004 @@ -1588,11 +1588,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-s -------------------------------------------------------------------------------- Dependency : github.com/elastic/elastic-transport-go/v8 -Version: v8.4.0 +Version: v8.6.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-transport-go/v8@v8.4.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-transport-go/v8@v8.6.0/LICENSE: Apache License Version 2.0, January 2004 @@ -1799,11 +1799,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-transpo -------------------------------------------------------------------------------- Dependency : github.com/elastic/go-elasticsearch/v8 -Version: v8.12.1 +Version: v8.14.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.12.1/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v8@v8.14.0/LICENSE: Apache License Version 2.0, January 2004 @@ -2010,11 +2010,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearc -------------------------------------------------------------------------------- Dependency : github.com/elastic/go-licenser -Version: v0.4.1 +Version: v0.4.2 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/go-licenser@v0.4.1/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/go-licenser@v0.4.2/LICENSE: Apache License @@ -2222,11 +2222,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-licenser@v0. -------------------------------------------------------------------------------- Dependency : github.com/elastic/go-sysinfo -Version: v1.13.1 +Version: v1.14.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/go-sysinfo@v1.13.1/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/elastic/go-sysinfo@v1.14.0/LICENSE.txt: Apache License @@ -2644,182 +2644,35 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-ucfg@v0.8.8/ -------------------------------------------------------------------------------- -Dependency : github.com/fatih/color -Version: v1.15.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/fatih/color@v1.15.0/LICENSE.md: - -The MIT License (MIT) - -Copyright (c) 2013 Fatih Arslan - -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 : github.com/fsnotify/fsnotify -Version: v1.7.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/fsnotify/fsnotify@v1.7.0/LICENSE: - -Copyright © 2012 The Go Authors. All rights reserved. -Copyright © fsnotify Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. -* Neither the name of Google Inc. nor the names of its contributors may be used - to endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/gofrs/flock -Version: v0.8.1 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/gofrs/flock@v0.8.1/LICENSE: - -Copyright (c) 2015-2020, Tim Heckman -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of gofrs nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/gofrs/uuid -Version: v4.4.0+incompatible -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/gofrs/uuid@v4.4.0+incompatible/LICENSE: - -Copyright (C) 2013-2018 by Maxim Bublis - -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 : github.com/google/go-cmp -Version: v0.6.0 -Licence type (autodetected): BSD-3-Clause +Dependency : github.com/elastic/mock-es +Version: v0.0.0-20240605193845-b5546a703d6f +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/google/go-cmp@v0.6.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/elastic/mock-es@v0.0.0-20240605193845-b5546a703d6f/LICENSE: -Copyright (c) 2017 The Go Authors. All rights reserved. +Copyright 2024 Elasticsearch B.V. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +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 - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + http://www.apache.org/licenses/LICENSE-2.0 -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +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 : github.com/google/pprof -Version: v0.0.0-20230426061923-93006964c1fc +Dependency : github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor +Version: v0.2.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/google/pprof@v0.0.0-20230426061923-93006964c1fc/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor@v0.2.0/LICENSE: Apache License Version 2.0, January 2004 @@ -3009,7 +2862,7 @@ Contents of probable licence file $GOMODCACHE/github.com/google/pprof@v0.0.0-202 same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + 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. @@ -3025,14 +2878,395 @@ Contents of probable licence file $GOMODCACHE/github.com/google/pprof@v0.0.0-202 -------------------------------------------------------------------------------- -Dependency : github.com/google/uuid -Version: v1.6.0 +Dependency : github.com/fatih/color +Version: v1.16.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/fatih/color@v1.16.0/LICENSE.md: + +The MIT License (MIT) + +Copyright (c) 2013 Fatih Arslan + +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 : github.com/fsnotify/fsnotify +Version: v1.7.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/google/uuid@v1.6.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/fsnotify/fsnotify@v1.7.0/LICENSE: -Copyright (c) 2009,2014 Google Inc. All rights reserved. +Copyright © 2012 The Go Authors. All rights reserved. +Copyright © fsnotify Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. +* Neither the name of Google Inc. nor the names of its contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/gofrs/flock +Version: v0.8.1 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/gofrs/flock@v0.8.1/LICENSE: + +Copyright (c) 2015-2020, Tim Heckman +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of gofrs nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/gofrs/uuid +Version: v4.4.0+incompatible +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/gofrs/uuid@v4.4.0+incompatible/LICENSE: + +Copyright (C) 2013-2018 by Maxim Bublis + +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 : github.com/google/go-cmp +Version: v0.6.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/google/go-cmp@v0.6.0/LICENSE: + +Copyright (c) 2017 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/google/pprof +Version: v0.0.0-20230426061923-93006964c1fc +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/google/pprof@v0.0.0-20230426061923-93006964c1fc/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 [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. + 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 : github.com/google/uuid +Version: v1.6.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/google/uuid@v1.6.0/LICENSE: + +Copyright (c) 2009,2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -4658,12 +4892,12 @@ 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.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -4869,12 +5103,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -5080,12 +5314,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -5291,12 +5525,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -5502,12 +5736,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -5713,287 +5947,225 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/otiai10/copy -Version: v1.14.0 -Licence type (autodetected): MIT +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor +Version: v0.103.0 +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/otiai10/copy@v1.14.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor@v0.103.0/LICENSE: -The MIT License (MIT) + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Copyright (c) 2018 otiai10 + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -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: + 1. Definitions. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -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. + "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. --------------------------------------------------------------------------------- -Dependency : github.com/pierrre/gotestcover -Version: v0.0.0-20160517101806-924dca7d15f0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. -Contents of probable licence file $GOMODCACHE/github.com/pierrre/gotestcover@v0.0.0-20160517101806-924dca7d15f0/LICENSE: + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -Copyright (C) 2015 Pierre Durand + "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. -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: + "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). -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + "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. -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. + "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." --------------------------------------------------------------------------------- -Dependency : github.com/pkg/errors -Version: v0.9.1 -Licence type (autodetected): BSD-2-Clause --------------------------------------------------------------------------------- + "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. -Contents of probable licence file $GOMODCACHE/github.com/pkg/errors@v0.9.1/LICENSE: + 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. -Copyright (c) 2015, Dave Cheney -All rights reserved. + 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. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: + 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: -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + (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. --------------------------------------------------------------------------------- -Dependency : github.com/rs/zerolog -Version: v1.27.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + 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. -Contents of probable licence file $GOMODCACHE/github.com/rs/zerolog@v1.27.0/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. -MIT License + 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. -Copyright (c) 2017 Olivier Poitrey + 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. -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: + 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. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + 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. -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. + END OF TERMS AND CONDITIONS + APPENDIX: How to apply the Apache License to your work. --------------------------------------------------------------------------------- -Dependency : github.com/sajari/regression -Version: v1.0.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + 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. -Contents of probable licence file $GOMODCACHE/github.com/sajari/regression@v1.0.1/LICENSE: + Copyright [yyyy] [name of copyright owner] -The MIT License (MIT) + 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 -Copyright (c) 2014 Sajari Pty Ltd + http://www.apache.org/licenses/LICENSE-2.0 -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 : github.com/schollz/progressbar/v3 -Version: v3.13.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/schollz/progressbar/v3@v3.13.1/LICENSE: - -MIT License - -Copyright (c) 2017 Zack - -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 : github.com/shirou/gopsutil/v3 -Version: v3.24.1 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/shirou/gopsutil/v3@v3.24.1/LICENSE: - -gopsutil is distributed under BSD license reproduced below. - -Copyright (c) 2014, WAKAYAMA Shirou -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the gopsutil authors nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -------- -internal/common/binary.go in the gopsutil is copied and modified from golang/encoding/binary.go. - - - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------------------- -Dependency : github.com/sirupsen/logrus -Version: v1.9.3 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/sirupsen/logrus@v1.9.3/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2014 Simon Eskildsen - -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. + 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 : github.com/spf13/cobra -Version: v1.8.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/spf13/cobra@v1.8.0/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor@v0.103.0/LICENSE: - Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -6168,120 +6340,41 @@ Contents of probable licence file $GOMODCACHE/github.com/spf13/cobra@v1.8.0/LICE incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + END OF TERMS AND CONDITIONS --------------------------------------------------------------------------------- -Dependency : github.com/spf13/pflag -Version: v1.0.5 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/spf13/pflag@v1.0.5/LICENSE: - -Copyright (c) 2012 Alex Ogier. All rights reserved. -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/stretchr/testify -Version: v1.8.4 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/stretchr/testify@v1.8.4/LICENSE: - -MIT License - -Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. - -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 : github.com/tsg/go-daemon -Version: v0.0.0-20200207173439-e704b93fd89b -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- + APPENDIX: How to apply the Apache License to your work. -Contents of probable licence file $GOMODCACHE/github.com/tsg/go-daemon@v0.0.0-20200207173439-e704b93fd89b/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 (c) 2013-2014 Alexandre Fiori. All rights reserved. + Copyright [yyyy] [name of copyright owner] -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + 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 - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * The names of authors or contributors may NOT be used to endorse or -promote products derived from this software without specific prior -written permission. + http://www.apache.org/licenses/LICENSE-2.0 -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 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 -Version: v1.15.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.elastic.co/apm@v1.15.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -6471,7 +6564,7 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm@v1.15.0/LICENSE: 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. @@ -6487,12 +6580,12 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm@v1.15.0/LICENSE: -------------------------------------------------------------------------------- -Dependency : go.elastic.co/apm/module/apmgorilla -Version: v1.15.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmgorilla@v1.15.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -6682,7 +6775,7 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmgorill 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. @@ -6698,12 +6791,12 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmgorill -------------------------------------------------------------------------------- -Dependency : go.elastic.co/apm/module/apmgrpc -Version: v1.15.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmgrpc@v1.15.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -6893,7 +6986,7 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmgrpc@v 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. @@ -6909,13 +7002,12 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmgrpc@v -------------------------------------------------------------------------------- -Dependency : go.elastic.co/ecszap -Version: v1.0.1 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.elastic.co/ecszap@v1.0.1/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -7105,7 +7197,7 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/ecszap@v1.0.1/LICENS same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2020 Elastic and contributors + 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. @@ -7119,14 +7211,14 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/ecszap@v1.0.1/LICENS See the License for the specific language governing permissions and limitations under the License. + -------------------------------------------------------------------------------- -Dependency : go.elastic.co/go-licence-detector -Version: v0.5.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.elastic.co/go-licence-detector@v0.5.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -7332,13 +7424,12 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/go-licence-detector@ -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/component -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/component@v0.96.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -7544,13 +7635,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/comp -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/confmap -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap@v0.96.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -7756,13 +7846,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/confmap/converter/expandconverter -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/converter/expandconverter@v0.96.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -7968,15 +8057,326 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/confmap/provider/envprovider -Version: v0.96.0 -Licence type (autodetected): Apache-2.0 +Dependency : github.com/otiai10/copy +Version: v1.14.0 +Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/envprovider@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/otiai10/copy@v1.14.0/LICENSE: +The MIT License (MIT) - Apache License +Copyright (c) 2018 otiai10 + +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 : github.com/pierrre/gotestcover +Version: v0.0.0-20160517101806-924dca7d15f0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/pierrre/gotestcover@v0.0.0-20160517101806-924dca7d15f0/LICENSE: + +Copyright (C) 2015 Pierre Durand + +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 : github.com/pkg/errors +Version: v0.9.1 +Licence type (autodetected): BSD-2-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/pkg/errors@v0.9.1/LICENSE: + +Copyright (c) 2015, Dave Cheney +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/rcrowley/go-metrics +Version: v0.0.0-20201227073835-cf1acfcdf475 +Licence type (autodetected): BSD-2-Clause-FreeBSD +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/rcrowley/go-metrics@v0.0.0-20201227073835-cf1acfcdf475/LICENSE: + +Copyright 2012 Richard Crowley. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +THIS SOFTWARE IS PROVIDED BY RICHARD CROWLEY ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL RICHARD CROWLEY OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation +are those of the authors and should not be interpreted as representing +official policies, either expressed or implied, of Richard Crowley. + + +-------------------------------------------------------------------------------- +Dependency : github.com/rs/zerolog +Version: v1.27.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/rs/zerolog@v1.27.0/LICENSE: + +MIT License + +Copyright (c) 2017 Olivier Poitrey + +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 : github.com/sajari/regression +Version: v1.0.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/sajari/regression@v1.0.1/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Sajari Pty Ltd + +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 : github.com/schollz/progressbar/v3 +Version: v3.13.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/schollz/progressbar/v3@v3.13.1/LICENSE: + +MIT License + +Copyright (c) 2017 Zack + +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 : github.com/shirou/gopsutil/v3 +Version: v3.24.5 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/shirou/gopsutil/v3@v3.24.5/LICENSE: + +gopsutil is distributed under BSD license reproduced below. + +Copyright (c) 2014, WAKAYAMA Shirou +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the gopsutil authors nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +------- +internal/common/binary.go in the gopsutil is copied and modified from golang/encoding/binary.go. + + + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------------------- +Dependency : github.com/sirupsen/logrus +Version: v1.9.3 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/sirupsen/logrus@v1.9.3/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Simon Eskildsen + +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 : github.com/spf13/cobra +Version: v1.8.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/spf13/cobra@v1.8.0/LICENSE.txt: + + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -8151,254 +8551,332 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf 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 [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. - 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.opentelemetry.io/collector/confmap/provider/fileprovider -Version: v0.96.0 -Licence type (autodetected): Apache-2.0 +Dependency : github.com/spf13/pflag +Version: v1.0.5 +Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/fileprovider@v0.96.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). +Contents of probable licence file $GOMODCACHE/github.com/spf13/pflag@v1.0.5/LICENSE: - "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. +Copyright (c) 2012 Alex Ogier. All rights reserved. +Copyright (c) 2012 The Go Authors. All rights reserved. - "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." +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: - "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. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. - 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. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - 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: +-------------------------------------------------------------------------------- +Dependency : github.com/stretchr/testify +Version: v1.9.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and +Contents of probable licence file $GOMODCACHE/github.com/stretchr/testify@v1.9.0/LICENSE: - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and +MIT License - (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 +Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. - (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. +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: - 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. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - 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. +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. - 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. +-------------------------------------------------------------------------------- +Dependency : github.com/tsg/go-daemon +Version: v0.0.0-20200207173439-e704b93fd89b +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- - 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. +Contents of probable licence file $GOMODCACHE/github.com/tsg/go-daemon@v0.0.0-20200207173439-e704b93fd89b/LICENSE: - 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. +Copyright (c) 2013-2014 Alexandre Fiori. All rights reserved. - END OF TERMS AND CONDITIONS +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: - APPENDIX: How to apply the Apache License to your work. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * The names of authors or contributors may NOT be used to endorse or +promote products derived from this software without specific prior +written permission. - 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. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - 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. - You may obtain a copy of the License at +-------------------------------------------------------------------------------- +Dependency : github.com/winlabs/gowin32 +Version: v0.0.0-20221003142512-0d265587d3c9 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- - http://www.apache.org/licenses/LICENSE-2.0 +Contents of probable licence file $GOMODCACHE/github.com/winlabs/gowin32@v0.0.0-20221003142512-0d265587d3c9/LICENSE: - 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. + + 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 [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. + 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.opentelemetry.io/collector/confmap/provider/httpprovider -Version: v0.96.0 +Dependency : go.elastic.co/apm +Version: v1.15.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/httpprovider@v0.96.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/go.elastic.co/apm@v1.15.0/LICENSE: Apache License Version 2.0, January 2004 @@ -8588,7 +9066,7 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + 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. @@ -8604,13 +9082,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/confmap/provider/httpsprovider -Version: v0.96.0 +Dependency : go.elastic.co/apm/module/apmgorilla +Version: v1.15.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/httpsprovider@v0.96.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmgorilla@v1.15.0/LICENSE: Apache License Version 2.0, January 2004 @@ -8800,7 +9277,7 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + 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. @@ -8816,13 +9293,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/confmap/provider/yamlprovider -Version: v0.96.0 +Dependency : go.elastic.co/apm/module/apmgrpc +Version: v1.15.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/yamlprovider@v0.96.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmgrpc@v1.15.0/LICENSE: Apache License Version 2.0, January 2004 @@ -9012,7 +9488,7 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + 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. @@ -9028,12 +9504,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/exporter -Version: v0.96.0 +Dependency : go.elastic.co/ecszap +Version: v1.0.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.elastic.co/ecszap@v1.0.1/LICENSE: Apache License @@ -9224,7 +9700,7 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/expo same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 Elastic and contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -9238,14 +9714,13 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/expo See the License for the specific language governing permissions and limitations under the License. - -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/exporter/debugexporter -Version: v0.96.0 +Dependency : go.elastic.co/go-licence-detector +Version: v0.5.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter/debugexporter@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.elastic.co/go-licence-detector@v0.5.0/LICENSE: Apache License @@ -9452,12 +9927,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/expo -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/exporter/otlpexporter -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/component +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter/otlpexporter@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/component@v0.103.0/LICENSE: Apache License @@ -9664,12 +10139,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/expo -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/featuregate -Version: v1.3.0 +Dependency : go.opentelemetry.io/collector/confmap +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/featuregate@v1.3.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap@v0.103.0/LICENSE: Apache License @@ -9876,12 +10351,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/feat -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/otelcol -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/confmap/converter/expandconverter +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/otelcol@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/converter/expandconverter@v0.103.0/LICENSE: Apache License @@ -10088,12 +10563,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/otel -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/processor -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/confmap/provider/envprovider +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/envprovider@v0.103.0/LICENSE: Apache License @@ -10300,12 +10775,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/proc -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/processor/batchprocessor -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/confmap/provider/fileprovider +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor/batchprocessor@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/fileprovider@v0.103.0/LICENSE: Apache License @@ -10512,12 +10987,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/proc -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/processor/memorylimiterprocessor -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/confmap/provider/httpprovider +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor/memorylimiterprocessor@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/httpprovider@v0.103.0/LICENSE: Apache License @@ -10724,12 +11199,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/proc -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/receiver -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/confmap/provider/httpsprovider +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/receiver@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/httpsprovider@v0.103.0/LICENSE: Apache License @@ -10936,12 +11411,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/rece -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/receiver/otlpreceiver -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/confmap/provider/yamlprovider +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/receiver/otlpreceiver@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/confmap/provider/yamlprovider@v0.103.0/LICENSE: Apache License @@ -11148,411 +11623,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/rece -------------------------------------------------------------------------------- -Dependency : go.uber.org/zap -Version: v1.27.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/go.uber.org/zap@v1.27.0/LICENSE: - -Copyright (c) 2016-2017 Uber Technologies, Inc. - -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 : golang.org/x/crypto -Version: v0.19.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/crypto@v0.19.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/exp -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-20240103183307-be819d1f06fc/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/lint -Version: v0.0.0-20210508222113-6edffad5e616 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/lint@v0.0.0-20210508222113-6edffad5e616/LICENSE: - -Copyright (c) 2013 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/sync -Version: v0.6.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/sync@v0.6.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/sys -Version: v0.17.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.17.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/term -Version: v0.17.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.17.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/text -Version: v0.14.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/text@v0.14.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/time -Version: v0.3.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/time@v0.3.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/tools -Version: v0.16.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/tools@v0.16.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/tools/go/vcs -Version: v0.1.0-deprecated -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/tools/go/vcs@v0.1.0-deprecated/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : google.golang.org/grpc -Version: v1.62.0 +Dependency : go.opentelemetry.io/collector/connector +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.62.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/connector@v0.103.0/LICENSE: Apache License @@ -11759,250 +11835,13 @@ Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.62.0/LIC -------------------------------------------------------------------------------- -Dependency : google.golang.org/protobuf -Version: v1.33.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/google.golang.org/protobuf@v1.33.0/LICENSE: - -Copyright (c) 2018 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : gopkg.in/ini.v1 -Version: v1.67.0 +Dependency : go.opentelemetry.io/collector/exporter +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/gopkg.in/ini.v1@v1.67.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. +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter@v0.103.0/LICENSE: -"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: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -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 -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 2014 Unknwon - - 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 : gopkg.in/yaml.v2 -Version: v2.4.0 -Licence type (autodetected): Apache-2.0 --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v2@v2.4.0/LICENSE: Apache License Version 2.0, January 2004 @@ -12184,7 +12023,7 @@ Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v2@v2.4.0/LICENSE: 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 "{}" + 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 @@ -12192,7 +12031,7 @@ Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v2@v2.4.0/LICENSE: same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + 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. @@ -12208,95 +12047,12 @@ Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v2@v2.4.0/LICENSE: -------------------------------------------------------------------------------- -Dependency : gopkg.in/yaml.v3 -Version: v3.0.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v3@v3.0.1/LICENSE: - - -This project is covered by two different licenses: MIT and Apache. - -#### MIT License #### - -The following files were ported to Go from C files of libyaml, and thus -are still covered by their original MIT license, with the additional -copyright staring in 2011 when the project was ported over: - - apic.go emitterc.go parserc.go readerc.go scannerc.go - writerc.go yamlh.go yamlprivateh.go - -Copyright (c) 2006-2010 Kirill Simonov -Copyright (c) 2006-2011 Kirill Simonov - -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. - -### Apache License ### - -All the remaining project files are covered by the Apache license: - -Copyright (c) 2011-2019 Canonical Ltd - -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 : gotest.tools -Version: v2.2.0+incompatible -Licence type (autodetected): Apache-2.0 --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/gotest.tools@v2.2.0+incompatible/LICENSE: - -Copyright 2018 gotest.tools authors - -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 : gotest.tools/gotestsum -Version: v1.9.0 +Dependency : go.opentelemetry.io/collector/exporter/debugexporter +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/gotest.tools/gotestsum@v1.9.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter/debugexporter@v0.103.0/LICENSE: Apache License @@ -12503,12 +12259,12 @@ Contents of probable licence file $GOMODCACHE/gotest.tools/gotestsum@v1.9.0/LICE -------------------------------------------------------------------------------- -Dependency : k8s.io/api -Version: v0.26.3 +Dependency : go.opentelemetry.io/collector/exporter/otlpexporter +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/k8s.io/api@v0.26.3/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter/otlpexporter@v0.103.0/LICENSE: Apache License @@ -12715,12 +12471,12 @@ Contents of probable licence file $GOMODCACHE/k8s.io/api@v0.26.3/LICENSE: -------------------------------------------------------------------------------- -Dependency : k8s.io/apimachinery -Version: v0.26.3 +Dependency : go.opentelemetry.io/collector/exporter/otlphttpexporter +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/k8s.io/apimachinery@v0.26.3/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exporter/otlphttpexporter@v0.103.0/LICENSE: Apache License @@ -12927,12 +12683,12 @@ Contents of probable licence file $GOMODCACHE/k8s.io/apimachinery@v0.26.3/LICENS -------------------------------------------------------------------------------- -Dependency : k8s.io/client-go -Version: v0.26.3 +Dependency : go.opentelemetry.io/collector/extension +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/k8s.io/client-go@v0.26.3/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension@v0.103.0/LICENSE: Apache License @@ -13139,12 +12895,12 @@ Contents of probable licence file $GOMODCACHE/k8s.io/client-go@v0.26.3/LICENSE: -------------------------------------------------------------------------------- -Dependency : k8s.io/utils -Version: v0.0.0-20221128185143-99ec85e7a448 +Dependency : go.opentelemetry.io/collector/extension/memorylimiterextension +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/k8s.io/utils@v0.0.0-20221128185143-99ec85e7a448/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension/memorylimiterextension@v0.103.0/LICENSE: Apache License @@ -13350,19 +13106,13 @@ Contents of probable licence file $GOMODCACHE/k8s.io/utils@v0.0.0-20221128185143 limitations under the License. - - -================================================================================ -Indirect dependencies - - -------------------------------------------------------------------------------- -Dependency : cloud.google.com/go -Version: v0.105.0 +Dependency : go.opentelemetry.io/collector/featuregate +Version: v1.10.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/cloud.google.com/go@v0.105.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/featuregate@v1.10.0/LICENSE: Apache License @@ -13569,12 +13319,12 @@ Contents of probable licence file $GOMODCACHE/cloud.google.com/go@v0.105.0/LICEN -------------------------------------------------------------------------------- -Dependency : cloud.google.com/go/compute -Version: v1.23.3 +Dependency : go.opentelemetry.io/collector/otelcol +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/cloud.google.com/go/compute@v1.23.3/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/otelcol@v0.103.0/LICENSE: Apache License @@ -13781,12 +13531,12 @@ Contents of probable licence file $GOMODCACHE/cloud.google.com/go/compute@v1.23. -------------------------------------------------------------------------------- -Dependency : cloud.google.com/go/compute/metadata -Version: v0.2.4-0.20230617002413-005d2dfb6b68 +Dependency : go.opentelemetry.io/collector/processor +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/cloud.google.com/go/compute/metadata@v0.2.4-0.20230617002413-005d2dfb6b68/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor@v0.103.0/LICENSE: Apache License @@ -13993,46 +13743,15 @@ Contents of probable licence file $GOMODCACHE/cloud.google.com/go/compute/metada -------------------------------------------------------------------------------- -Dependency : github.com/Azure/go-ansiterm -Version: v0.0.0-20210617225240-d185dfc1b5a1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/!azure/go-ansiterm@v0.0.0-20210617225240-d185dfc1b5a1/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2015 Microsoft Corporation - -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 : github.com/Flaque/filet -Version: v0.0.0-20201012163910-45f684403088 +Dependency : go.opentelemetry.io/collector/processor/batchprocessor +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/!flaque/filet@v0.0.0-20201012163910-45f684403088/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/processor/batchprocessor@v0.103.0/LICENSE: - Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -14207,375 +13926,42 @@ Contents of probable licence file $GOMODCACHE/github.com/!flaque/filet@v0.0.0-20 incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + END OF TERMS AND CONDITIONS --------------------------------------------------------------------------------- -Dependency : github.com/Jeffail/gabs/v2 -Version: v2.6.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/!jeffail/gabs/v2@v2.6.0/LICENSE: - -Copyright (c) 2019 Ashley Jeffs - -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 : github.com/StackExchange/wmi -Version: v1.2.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/!stack!exchange/wmi@v1.2.1/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2013 Stack Exchange - -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 : github.com/akavel/rsrc -Version: v0.8.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/akavel/rsrc@v0.8.0/LICENSE.txt: - -The MIT License (MIT) - -Copyright (c) 2013-2017 The rsrc Authors. - -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 : github.com/alecthomas/assert/v2 -Version: v2.3.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/alecthomas/assert/v2@v2.3.0/COPYING: - -Copyright (C) 2021 Alec Thomas - -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 : github.com/alecthomas/participle/v2 -Version: v2.1.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/alecthomas/participle/v2@v2.1.1/COPYING: - -Copyright (C) 2017-2022 Alec Thomas - -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 : github.com/alecthomas/repr -Version: v0.2.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/alecthomas/repr@v0.2.0/COPYING: - -The MIT License (MIT) - -Copyright (c) 2016 Alec Thomas - -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 : github.com/armon/go-radix -Version: v1.0.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/armon/go-radix@v1.0.0/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2014 Armon Dadgar - -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 : github.com/armon/go-socks5 -Version: v0.0.0-20160902184237-e75332964ef5 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/armon/go-socks5@v0.0.0-20160902184237-e75332964ef5/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2014 Armon Dadgar - -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 : github.com/beorn7/perks -Version: v1.0.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/beorn7/perks@v1.0.1/LICENSE: - -Copyright (C) 2013 Blake Mizerany - -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 : github.com/bmatcuk/doublestar/v4 -Version: v4.6.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/bmatcuk/doublestar/v4@v4.6.1/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2014 Bob Matcuk - -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 : github.com/cavaliercoder/badio -Version: v0.0.0-20160213150051-ce5280129e9e -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/cavaliercoder/badio@v0.0.0-20160213150051-ce5280129e9e/LICENSE: - -Copyright (c) 2015 Ryan Armstrong - -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 : github.com/cespare/xxhash/v2 -Version: v2.2.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/cespare/xxhash/v2@v2.2.0/LICENSE.txt: + APPENDIX: How to apply the Apache License to your work. -Copyright (c) 2016 Caleb Spare + 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. -MIT License + Copyright [yyyy] [name of copyright owner] -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: + 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 -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. + http://www.apache.org/licenses/LICENSE-2.0 -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. + 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 : github.com/cncf/xds/go -Version: v0.0.0-20231128003011-0fa0005c9caa +Dependency : go.opentelemetry.io/collector/receiver +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/cncf/xds/go@v0.0.0-20231128003011-0fa0005c9caa/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/receiver@v0.103.0/LICENSE: + Apache License Version 2.0, January 2004 @@ -14781,115 +14167,15 @@ Contents of probable licence file $GOMODCACHE/github.com/cncf/xds/go@v0.0.0-2023 -------------------------------------------------------------------------------- -Dependency : github.com/cyphar/filepath-securejoin -Version: v0.2.4 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/cyphar/filepath-securejoin@v0.2.4/LICENSE: - -Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. -Copyright (C) 2017 SUSE LLC. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/davecgh/go-spew -Version: v1.1.1 -Licence type (autodetected): ISC --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/davecgh/go-spew@v1.1.1/LICENSE: - -ISC License - -Copyright (c) 2012-2016 Dave Collins - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - --------------------------------------------------------------------------------- -Dependency : github.com/dnephin/pflag -Version: v1.0.7 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/dnephin/pflag@v1.0.7/LICENSE: - -Copyright (c) 2012 Alex Ogier. All rights reserved. -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/docker/distribution -Version: v2.8.2+incompatible +Dependency : go.opentelemetry.io/collector/receiver/otlpreceiver +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/docker/distribution@v2.8.2+incompatible/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/receiver/otlpreceiver@v0.103.0/LICENSE: -Apache License + + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -15069,7 +14355,7 @@ Apache License 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 "{}" + 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 @@ -15077,7 +14363,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + 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. @@ -15092,19 +14378,380 @@ Apache License limitations under the License. +-------------------------------------------------------------------------------- +Dependency : go.uber.org/zap +Version: v1.27.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/go.uber.org/zap@v1.27.0/LICENSE: + +Copyright (c) 2016-2017 Uber Technologies, Inc. + +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 : github.com/docker/docker -Version: v24.0.7+incompatible +Dependency : golang.org/x/crypto +Version: v0.24.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/crypto@v0.24.0/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/lint +Version: v0.0.0-20210508222113-6edffad5e616 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/lint@v0.0.0-20210508222113-6edffad5e616/LICENSE: + +Copyright (c) 2013 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/sync +Version: v0.7.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/sync@v0.7.0/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/sys +Version: v0.21.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.21.0/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/term +Version: v0.21.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.21.0/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/text +Version: v0.16.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/text@v0.16.0/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/time +Version: v0.5.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/time@v0.5.0/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/tools +Version: v0.21.1-0.20240508182429-e35e4ccd0d2d +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/tools@v0.21.1-0.20240508182429-e35e4ccd0d2d/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/tools/go/vcs +Version: v0.1.0-deprecated +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/tools/go/vcs@v0.1.0-deprecated/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : google.golang.org/grpc +Version: v1.64.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/docker/docker@v24.0.7+incompatible/LICENSE: +Contents of probable licence file $GOMODCACHE/google.golang.org/grpc@v1.64.0/LICENSE: Apache License Version 2.0, January 2004 - https://www.apache.org/licenses/ + http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -15279,13 +14926,24 @@ Contents of probable licence file $GOMODCACHE/github.com/docker/docker@v24.0.7+i END OF TERMS AND CONDITIONS - Copyright 2013-2018 Docker, Inc. + 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 [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. You may obtain a copy of the License at - https://www.apache.org/licenses/LICENSE-2.0 + 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, @@ -15295,30 +14953,267 @@ Contents of probable licence file $GOMODCACHE/github.com/docker/docker@v24.0.7+i -------------------------------------------------------------------------------- -Dependency : github.com/docker/go-connections -Version: v0.5.0 -Licence type (autodetected): Apache-2.0 +Dependency : google.golang.org/protobuf +Version: v1.34.2 +Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/docker/go-connections@v0.5.0/LICENSE: - - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +Contents of probable licence file $GOMODCACHE/google.golang.org/protobuf@v1.34.2/LICENSE: - 1. Definitions. +Copyright (c) 2018 The Go Authors. All rights reserved. - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : gopkg.in/ini.v1 +Version: v1.67.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/gopkg.in/ini.v1@v1.67.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: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +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 +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 2014 Unknwon + + 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 : gopkg.in/yaml.v2 +Version: v2.4.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v2@v2.4.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 @@ -15480,13 +15375,24 @@ Contents of probable licence file $GOMODCACHE/github.com/docker/go-connections@v END OF TERMS AND CONDITIONS - Copyright 2015 Docker, Inc. + 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 {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. You may obtain a copy of the License at - https://www.apache.org/licenses/LICENSE-2.0 + 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, @@ -15496,12 +15402,96 @@ Contents of probable licence file $GOMODCACHE/github.com/docker/go-connections@v -------------------------------------------------------------------------------- -Dependency : github.com/elastic/go-structform -Version: v0.0.10 +Dependency : gopkg.in/yaml.v3 +Version: v3.0.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v3@v3.0.1/LICENSE: + + +This project is covered by two different licenses: MIT and Apache. + +#### MIT License #### + +The following files were ported to Go from C files of libyaml, and thus +are still covered by their original MIT license, with the additional +copyright staring in 2011 when the project was ported over: + + apic.go emitterc.go parserc.go readerc.go scannerc.go + writerc.go yamlh.go yamlprivateh.go + +Copyright (c) 2006-2010 Kirill Simonov +Copyright (c) 2006-2011 Kirill Simonov + +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. + +### Apache License ### + +All the remaining project files are covered by the Apache license: + +Copyright (c) 2011-2019 Canonical Ltd + +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 : gotest.tools +Version: v2.2.0+incompatible Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/go-structform@v0.0.10/LICENSE: +Contents of probable licence file $GOMODCACHE/gotest.tools@v2.2.0+incompatible/LICENSE: + +Copyright 2018 gotest.tools authors + +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 : gotest.tools/gotestsum +Version: v1.9.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/gotest.tools/gotestsum@v1.9.0/LICENSE: + Apache License Version 2.0, January 2004 @@ -15683,7 +15673,7 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-structform@v 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 "{}" + 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 @@ -15691,7 +15681,7 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-structform@v same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2012–2018 Elastic + 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. @@ -15707,12 +15697,12 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-structform@v -------------------------------------------------------------------------------- -Dependency : github.com/elastic/go-windows -Version: v1.0.1 +Dependency : k8s.io/api +Version: v0.29.5 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/go-windows@v1.0.1/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/k8s.io/api@v0.29.5/LICENSE: Apache License @@ -15919,291 +15909,224 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-windows@v1.0 -------------------------------------------------------------------------------- -Dependency : github.com/elastic/gosigar -Version: v0.14.2 +Dependency : k8s.io/apimachinery +Version: v0.29.5 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/gosigar@v0.14.2/LICENSE: - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ +Contents of probable licence file $GOMODCACHE/k8s.io/apimachinery@v0.29.5/LICENSE: -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -1. Definitions. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. + 1. Definitions. - "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. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. + "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. - "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. + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. - "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). + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. - "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. + "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. - "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." + "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). - "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. + "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. -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. + "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." -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. + "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. -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: + 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. - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and + 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. - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and + 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: - (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 [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. -You may obtain a copy of the License at + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and - http://www.apache.org/licenses/LICENSE-2.0 + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and -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. + (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. --------------------------------------------------------------------------------- -Dependency : github.com/elazarl/goproxy -Version: v0.0.0-20180725130230-947c36da3153 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- + 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. -Contents of probable licence file $GOMODCACHE/github.com/elazarl/goproxy@v0.0.0-20180725130230-947c36da3153/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. -Copyright (c) 2012 Elazar Leibovich. All rights reserved. + 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. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + 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. - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Elazar Leibovich. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + 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. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + 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 --------------------------------------------------------------------------------- -Dependency : github.com/emicklei/go-restful/v3 -Version: v3.10.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + APPENDIX: How to apply the Apache License to your work. -Contents of probable licence file $GOMODCACHE/github.com/emicklei/go-restful/v3@v3.10.1/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 (c) 2012,2013 Ernest Micklei + Copyright [yyyy] [name of copyright owner] -MIT License + 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 : github.com/envoyproxy/protoc-gen-validate -Version: v1.0.4 +Dependency : k8s.io/client-go +Version: v0.29.5 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/envoyproxy/protoc-gen-validate@v1.0.4/LICENSE: +Contents of probable licence file $GOMODCACHE/k8s.io/client-go@v0.29.5/LICENSE: Apache License @@ -16410,167 +16333,13 @@ Contents of probable licence file $GOMODCACHE/github.com/envoyproxy/protoc-gen-v -------------------------------------------------------------------------------- -Dependency : github.com/evanphx/json-patch -Version: v5.6.0+incompatible -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/evanphx/json-patch@v5.6.0+incompatible/LICENSE: - -Copyright (c) 2014, Evan Phoenix -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -* Neither the name of the Evan Phoenix nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/expr-lang/expr -Version: v1.16.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/expr-lang/expr@v1.16.1/LICENSE: - -MIT License - -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 -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 : github.com/felixge/httpsnoop -Version: v1.0.4 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/felixge/httpsnoop@v1.0.4/LICENSE.txt: - -Copyright (c) 2016 Felix Geisendörfer (felix@debuggable.com) - - 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 : github.com/ghodss/yaml -Version: v1.0.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/ghodss/yaml@v1.0.0/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2014 Sam Ghods - -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. - - -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/go-logr/logr -Version: v1.4.1 +Dependency : k8s.io/utils +Version: v0.0.0-20230726121419-3b25d923346b Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/go-logr/logr@v1.4.1/LICENSE: +Contents of probable licence file $GOMODCACHE/k8s.io/utils@v0.0.0-20230726121419-3b25d923346b/LICENSE: + Apache License Version 2.0, January 2004 @@ -16752,7 +16521,7 @@ Contents of probable licence file $GOMODCACHE/github.com/go-logr/logr@v1.4.1/LIC 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 "{}" + 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 @@ -16760,7 +16529,7 @@ Contents of probable licence file $GOMODCACHE/github.com/go-logr/logr@v1.4.1/LIC same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + 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. @@ -16775,13 +16544,20 @@ Contents of probable licence file $GOMODCACHE/github.com/go-logr/logr@v1.4.1/LIC limitations under the License. + + +================================================================================ +Indirect dependencies + + -------------------------------------------------------------------------------- -Dependency : github.com/go-logr/stdr -Version: v1.2.2 +Dependency : cloud.google.com/go/compute/metadata +Version: v0.3.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/go-logr/stdr@v1.2.2/LICENSE: +Contents of probable licence file $GOMODCACHE/cloud.google.com/go/compute/metadata@v0.3.0/LICENSE: + Apache License Version 2.0, January 2004 @@ -16987,46 +16763,84 @@ Contents of probable licence file $GOMODCACHE/github.com/go-logr/stdr@v1.2.2/LIC -------------------------------------------------------------------------------- -Dependency : github.com/go-ole/go-ole -Version: v1.2.6 +Dependency : dario.cat/mergo +Version: v1.0.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/dario.cat/mergo@v1.0.0/LICENSE: + +Copyright (c) 2013 Dario Castañé. All rights reserved. +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/Azure/go-ansiterm +Version: v0.0.0-20230124172434-306776ec8161 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/go-ole/go-ole@v1.2.6/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/!azure/go-ansiterm@v0.0.0-20230124172434-306776ec8161/LICENSE: The MIT License (MIT) -Copyright © 2013-2017 Yasuhiro Matsumoto, +Copyright (c) 2015 Microsoft Corporation -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: +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 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 +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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. -------------------------------------------------------------------------------- -Dependency : github.com/go-openapi/jsonpointer -Version: v0.19.5 +Dependency : github.com/Flaque/filet +Version: v0.0.0-20201012163910-45f684403088 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/go-openapi/jsonpointer@v0.19.5/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/!flaque/filet@v0.0.0-20201012163910-45f684403088/LICENSE.txt: - Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -17201,41 +17015,14 @@ Contents of probable licence file $GOMODCACHE/github.com/go-openapi/jsonpointer@ 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 [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. - 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 : github.com/go-openapi/jsonreference -Version: v0.20.0 +Dependency : github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp +Version: v1.23.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/go-openapi/jsonreference@v0.20.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/!google!cloud!platform/opentelemetry-operations-go/detectors/gcp@v1.23.0/LICENSE: Apache License @@ -17442,12 +17229,334 @@ Contents of probable licence file $GOMODCACHE/github.com/go-openapi/jsonreferenc -------------------------------------------------------------------------------- -Dependency : github.com/go-openapi/swag -Version: v0.22.3 +Dependency : github.com/Jeffail/gabs/v2 +Version: v2.6.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/!jeffail/gabs/v2@v2.6.0/LICENSE: + +Copyright (c) 2019 Ashley Jeffs + +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 : github.com/Microsoft/hcsshim +Version: v0.11.4 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/!microsoft/hcsshim@v0.11.4/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Microsoft + +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 : github.com/Showmax/go-fqdn +Version: v1.0.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/go-openapi/swag@v0.22.3/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/!showmax/go-fqdn@v1.0.0/LICENSE: + +Copyright since 2015 Showmax s.r.o. + +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 : github.com/StackExchange/wmi +Version: v1.2.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/!stack!exchange/wmi@v1.2.1/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2013 Stack Exchange + +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 : github.com/akavel/rsrc +Version: v0.8.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/akavel/rsrc@v0.8.0/LICENSE.txt: + +The MIT License (MIT) + +Copyright (c) 2013-2017 The rsrc Authors. + +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 : github.com/alecthomas/assert/v2 +Version: v2.3.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/alecthomas/assert/v2@v2.3.0/COPYING: + +Copyright (C) 2021 Alec Thomas + +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 : github.com/alecthomas/participle/v2 +Version: v2.1.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/alecthomas/participle/v2@v2.1.1/COPYING: + +Copyright (C) 2017-2022 Alec Thomas + +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 : github.com/alecthomas/repr +Version: v0.2.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/alecthomas/repr@v0.2.0/COPYING: + +The MIT License (MIT) + +Copyright (c) 2016 Alec Thomas + +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 : github.com/armon/go-metrics +Version: v0.4.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/armon/go-metrics@v0.4.1/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2013 Armon Dadgar + +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 : github.com/armon/go-radix +Version: v1.0.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/armon/go-radix@v1.0.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Armon Dadgar + +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 : github.com/armon/go-socks5 +Version: v0.0.0-20160902184237-e75332964ef5 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/armon/go-socks5@v0.0.0-20160902184237-e75332964ef5/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Armon Dadgar + +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 : github.com/aws/aws-sdk-go +Version: v1.53.11 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/aws/aws-sdk-go@v1.53.11/LICENSE.txt: Apache License @@ -17654,45 +17763,46 @@ Contents of probable licence file $GOMODCACHE/github.com/go-openapi/swag@v0.22.3 -------------------------------------------------------------------------------- -Dependency : github.com/go-task/slim-sprig -Version: v0.0.0-20210107165309-348f09dbbbc0 +Dependency : github.com/beorn7/perks +Version: v1.0.1 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/go-task/slim-sprig@v0.0.0-20210107165309-348f09dbbbc0/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/beorn7/perks@v1.0.1/LICENSE: -Copyright (C) 2013-2020 Masterminds +Copyright (C) 2013 Blake Mizerany -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: +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 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. +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 : github.com/go-viper/mapstructure/v2 -Version: v2.0.0-alpha.1 +Dependency : github.com/bmatcuk/doublestar/v4 +Version: v4.6.1 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/go-viper/mapstructure/v2@v2.0.0-alpha.1/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/bmatcuk/doublestar/v4@v4.6.1/LICENSE: The MIT License (MIT) -Copyright (c) 2013 Mitchell Hashimoto +Copyright (c) 2014 Bob Matcuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -17701,422 +17811,101 @@ 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 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + -------------------------------------------------------------------------------- -Dependency : github.com/gobuffalo/here -Version: v0.6.0 +Dependency : github.com/cavaliercoder/badio +Version: v0.0.0-20160213150051-ce5280129e9e Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/gobuffalo/here@v0.6.0/LICENSE: - -The MIT License (MIT) +Contents of probable licence file $GOMODCACHE/github.com/cavaliercoder/badio@v0.0.0-20160213150051-ce5280129e9e/LICENSE: -Copyright (c) 2019 Mark Bates +Copyright (c) 2015 Ryan Armstrong -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: +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. +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 : github.com/gobwas/glob -Version: v0.2.3 +Dependency : github.com/cespare/xxhash/v2 +Version: v2.3.0 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/gobwas/glob@v0.2.3/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/cespare/xxhash/v2@v2.3.0/LICENSE.txt: -The MIT License (MIT) +Copyright (c) 2016 Caleb Spare -Copyright (c) 2016 Sergey Kamardin +MIT License -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: +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 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. -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 : github.com/gogo/protobuf -Version: v1.3.2 -Licence type (autodetected): BSD-3-Clause +Dependency : github.com/containerd/containerd +Version: v1.7.15 +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/gogo/protobuf@v1.3.2/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/containerd/containerd@v1.7.15/LICENSE: -Copyright (c) 2013, The GoGo Authors. All rights reserved. -Protocol Buffers for Go with Gadgets + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ -Go support for Protocol Buffers - Google's data interchange format + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -Copyright 2010 The Go Authors. All rights reserved. -https://github.com/golang/protobuf + 1. Definitions. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - --------------------------------------------------------------------------------- -Dependency : github.com/golang/groupcache -Version: v0.0.0-20210331224755-41bb18bfe9da -Licence type (autodetected): Apache-2.0 --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/golang/groupcache@v0.0.0-20210331224755-41bb18bfe9da/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: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -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 -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 [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. - 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 : github.com/golang/protobuf -Version: v1.5.3 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/golang/protobuf@v1.5.3/LICENSE: - -Copyright 2010 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - --------------------------------------------------------------------------------- -Dependency : github.com/golang/snappy -Version: v0.0.4 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/golang/snappy@v0.0.4/LICENSE: - -Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/google/gnostic -Version: v0.6.9 -Licence type (autodetected): Apache-2.0 --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/google/gnostic@v0.6.9/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. + "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 @@ -18281,24 +18070,13 @@ Contents of probable licence file $GOMODCACHE/github.com/google/gnostic@v0.6.9/L 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 [yyyy] [name of copyright owner] + Copyright The containerd Authors 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 + https://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, @@ -18307,19 +18085,18 @@ Contents of probable licence file $GOMODCACHE/github.com/google/gnostic@v0.6.9/L limitations under the License. - -------------------------------------------------------------------------------- -Dependency : github.com/google/gofuzz -Version: v1.2.0 +Dependency : github.com/containerd/log +Version: v0.1.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/google/gofuzz@v1.2.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/containerd/log@v0.1.0/LICENSE: Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -18494,24 +18271,13 @@ Contents of probable licence file $GOMODCACHE/github.com/google/gofuzz@v1.2.0/LI 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 [yyyy] [name of copyright owner] + Copyright The containerd Authors 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 + https://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, @@ -18521,15 +18287,107 @@ Contents of probable licence file $GOMODCACHE/github.com/google/gofuzz@v1.2.0/LI -------------------------------------------------------------------------------- -Dependency : github.com/google/licenseclassifier -Version: v0.0.0-20221004142553-c1ed8fcf4bab -Licence type (autodetected): Apache-2.0 +Dependency : github.com/cpuguy83/dockercfg +Version: v0.3.1 +Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/google/licenseclassifier@v0.0.0-20221004142553-c1ed8fcf4bab/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/cpuguy83/dockercfg@v0.3.1/LICENSE: +MIT License - Apache License +Copyright (c) 2020 Brian Goff + +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 : github.com/cyphar/filepath-securejoin +Version: v0.2.4 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/cyphar/filepath-securejoin@v0.2.4/LICENSE: + +Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. +Copyright (C) 2017 SUSE LLC. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/davecgh/go-spew +Version: v1.1.2-0.20180830191138-d8f796af33cc +Licence type (autodetected): ISC +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/davecgh/go-spew@v1.1.2-0.20180830191138-d8f796af33cc/LICENSE: + +ISC License + +Copyright (c) 2012-2016 Dave Collins + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/distribution/reference +Version: v0.5.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/distribution/reference@v0.5.0/LICENSE: + +Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -18709,7 +18567,7 @@ Contents of probable licence file $GOMODCACHE/github.com/google/licenseclassifie 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 "[]" + 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 @@ -18717,7 +18575,7 @@ Contents of probable licence file $GOMODCACHE/github.com/google/licenseclassifie same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + 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. @@ -18732,18 +18590,57 @@ Contents of probable licence file $GOMODCACHE/github.com/google/licenseclassifie limitations under the License. + -------------------------------------------------------------------------------- -Dependency : github.com/google/shlex -Version: v0.0.0-20191202100458-e7afc7fbc510 +Dependency : github.com/dnephin/pflag +Version: v1.0.7 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/dnephin/pflag@v1.0.7/LICENSE: + +Copyright (c) 2012 Alex Ogier. All rights reserved. +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/docker/docker +Version: v25.0.5+incompatible Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/google/shlex@v0.0.0-20191202100458-e7afc7fbc510/COPYING: +Contents of probable licence file $GOMODCACHE/github.com/docker/docker@v25.0.5+incompatible/LICENSE: Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -18918,24 +18815,13 @@ Contents of probable licence file $GOMODCACHE/github.com/google/shlex@v0.0.0-201 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 [yyyy] [name of copyright owner] + Copyright 2013-2018 Docker, Inc. 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 + https://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, @@ -18945,16 +18831,17 @@ Contents of probable licence file $GOMODCACHE/github.com/google/shlex@v0.0.0-201 -------------------------------------------------------------------------------- -Dependency : github.com/grpc-ecosystem/go-grpc-middleware -Version: v1.3.0 +Dependency : github.com/docker/go-connections +Version: v0.5.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/docker/go-connections@v0.5.0/LICENSE: - Apache License + + Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -19129,24 +19016,13 @@ Contents of probable licence file $GOMODCACHE/github.com/grpc-ecosystem/go-grpc- 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 [yyyy] [name of copyright owner] + Copyright 2015 Docker, Inc. 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 + https://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, @@ -19154,1198 +19030,13472 @@ Contents of probable licence file $GOMODCACHE/github.com/grpc-ecosystem/go-grpc- See the License for the specific language governing permissions and limitations under the License. + -------------------------------------------------------------------------------- -Dependency : github.com/grpc-ecosystem/grpc-gateway/v2 -Version: v2.19.0 -Licence type (autodetected): BSD-3-Clause +Dependency : github.com/elastic/go-docappender/v2 +Version: v2.1.4 +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/grpc-ecosystem/grpc-gateway/v2@v2.19.0/LICENSE: - -Copyright (c) 2015, Gengo, Inc. -All rights reserved. +Contents of probable licence file $GOMODCACHE/github.com/elastic/go-docappender/v2@v2.1.4/LICENSE: -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + 1. Definitions. - * Neither the name of Gengo, Inc. nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + "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. --------------------------------------------------------------------------------- -Dependency : github.com/haimrubinstein/go-syslog/v3 -Version: v3.0.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. -Contents of probable licence file $GOMODCACHE/github.com/haimrubinstein/go-syslog/v3@v3.0.0/LICENSE: + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -The MIT License + "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. -Copyright (c) 2018, InfluxData Inc. + "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). -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: + "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. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + "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." -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. + "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. --------------------------------------------------------------------------------- -Dependency : github.com/hashicorp/errwrap -Version: v1.1.0 -Licence type (autodetected): MPL-2.0 --------------------------------------------------------------------------------- + 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. -Contents of probable licence file $GOMODCACHE/github.com/hashicorp/errwrap@v1.1.0/LICENSE: + 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. -Mozilla Public License, version 2.0 + 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: -1. Definitions + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and -1.1. “Contributor” + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. + (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 -1.2. “Contributor Version” + (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. - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. + 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. -1.3. “Contribution” + 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. - means Covered Software of a particular Contributor. + 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. -1.4. “Covered Software” + 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. - 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. + 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. -1.5. “Incompatible With Secondary Licenses” - means + 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. - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or + END OF TERMS AND CONDITIONS - 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. + APPENDIX: How to apply the Apache License to your work. -1.6. “Executable Form” + 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. - means any form of the work other than Source Code Form. + Copyright 2018 Elasticsearch BV -1.7. “Larger Work” + 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 - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. + http://www.apache.org/licenses/LICENSE-2.0 -1.8. “License” + 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. - means this document. -1.9. “Licensable” +-------------------------------------------------------------------------------- +Dependency : github.com/elastic/go-elasticsearch/v7 +Version: v7.17.10 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- - 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. +Contents of probable licence file $GOMODCACHE/github.com/elastic/go-elasticsearch/v7@v7.17.10/LICENSE: -1.10. “Modifications” + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ - means any of the following: + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or + 1. Definitions. - b. any new file in Source Code Form that contains any Covered Software. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -1.11. “Patent Claims” of a Contributor + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. - 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. + "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. -1.12. “Secondary License” + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this 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. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -1.13. “Source Code Form” + "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. - means the form of the work preferred for making modifications. + "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). -1.14. “You” (or “Your”) + "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. - 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. + "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. License Grants and Conditions + 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. -2.1. Grants + 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. - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: + 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. 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 + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; 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. + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and -2.2. Effective Date + (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 - 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. + (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. -2.3. Limitations on Grant Scope + 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. - 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: + 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. - a. for any code that a Contributor has removed from Covered Software; or + 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. - 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 + 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. - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. + 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. - 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). + 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. -2.4. Subsequent Licenses + END OF TERMS AND CONDITIONS - 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). + APPENDIX: How to apply the Apache License to your work. -2.5. Representation + 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. - 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. + Copyright 2018 Elasticsearch BV -2.6. Fair Use + 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 - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. + http://www.apache.org/licenses/LICENSE-2.0 -2.7. Conditions + 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. - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. +-------------------------------------------------------------------------------- +Dependency : github.com/elastic/go-structform +Version: v0.0.10 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- -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 +Contents of probable licence file $GOMODCACHE/github.com/elastic/go-structform@v0.0.10/LICENSE: - 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. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -3.5. Application of Additional Terms + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - 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. + 1. Definitions. -4. Inability to Comply Due to Statute or Regulation + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. - 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. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. -5. Termination + "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. -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. + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. -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. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -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. + "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. -6. Disclaimer of Warranty + "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). - 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. + "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. -7. Limitation of Liability + "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." - 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. + "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. -8. Litigation + 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. - 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. + 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. -9. Miscellaneous + 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: - 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. + (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 -10. Versions of the License + (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 -10.1. New Versions + (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. - 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. + 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. -10.2. Effect of New Versions + 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. - 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. + 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. -10.3. Modified Versions + 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. - 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). + 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. -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. + 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. -Exhibit A - Source Code Form License Notice + END OF TERMS AND CONDITIONS - 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/. + APPENDIX: How to apply the Apache License to your work. -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. + 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. -You may add additional accurate notices of copyright ownership. + Copyright 2012–2018 Elastic -Exhibit B - “Incompatible With Secondary Licenses” Notice + 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 - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. + 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 : github.com/hashicorp/go-version -Version: v1.6.0 -Licence type (autodetected): MPL-2.0 +Dependency : github.com/elastic/go-windows +Version: v1.0.1 +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-version@v1.6.0/LICENSE: - -Mozilla Public License, version 2.0 +Contents of probable licence file $GOMODCACHE/github.com/elastic/go-windows@v1.0.1/LICENSE.txt: -1. Definitions -1.1. “Contributor” + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -1.2. “Contributor Version” + 1. Definitions. - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -1.3. “Contribution” + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. - means Covered Software of a particular Contributor. + "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. -1.4. “Covered Software” + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. - 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. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -1.5. “Incompatible With Secondary Licenses” - means + "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. - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or + "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). - 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. + "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. -1.6. “Executable Form” + "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." - means any form of the work other than Source Code Form. + "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. -1.7. “Larger 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. - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. + 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. -1.8. “License” + 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: - means this document. + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and -1.9. “Licensable” + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and - 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. + (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 -1.10. “Modifications” + (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. - means any of the following: + 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. - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or + 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. - b. any new file in Source Code Form that contains any Covered Software. + 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. -1.11. “Patent Claims” of a Contributor + 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. - 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. + 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. -1.12. “Secondary License” + 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. - 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. + END OF TERMS AND CONDITIONS -1.13. “Source Code Form” + APPENDIX: How to apply the Apache License to your work. - means the form of the work preferred for making modifications. + 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. -1.14. “You” (or “Your”) + Copyright [yyyy] [name of copyright owner] - 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. + 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 -2. License Grants and Conditions + 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. -2.1. Grants - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: +-------------------------------------------------------------------------------- +Dependency : github.com/elastic/gosigar +Version: v0.14.3 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- - 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 +Contents of probable licence file $GOMODCACHE/github.com/elastic/gosigar@v0.14.3/LICENSE: - 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. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -2.2. Effective Date +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - 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. +1. Definitions. -2.3. Limitations on Grant Scope + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. - 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: + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. - a. for any code that a Contributor has removed from Covered Software; or + "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. - 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 + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. - 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). + "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. -2.4. Subsequent Licenses + "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). - 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). + "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. -2.5. Representation + "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." - 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. + "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.6. Fair Use +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. - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. +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. -2.7. Conditions +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: - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. + (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 -3. Responsibilities + (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 -3.1. Distribution of Source Form + (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. - 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. + 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. -3.2. Distribution of Executable Form +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. - If You distribute Covered Software in Executable Form then: +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. - 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 +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. - 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. +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. -3.3. Distribution of a Larger Work +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. - 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). +END OF TERMS AND CONDITIONS -3.4. Notices +APPENDIX: How to apply the Apache License to your work. - 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. + 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. -3.5. Application of Additional Terms +Copyright [yyyy] [name of copyright owner] - 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. +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 -4. Inability to Comply Due to Statute or Regulation + http://www.apache.org/licenses/LICENSE-2.0 - 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. +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. -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. +-------------------------------------------------------------------------------- +Dependency : github.com/elastic/opentelemetry-lib +Version: v0.3.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- -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. +Contents of probable licence file $GOMODCACHE/github.com/elastic/opentelemetry-lib@v0.3.0/LICENSE: -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. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -6. Disclaimer of Warranty + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - 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. + 1. Definitions. -7. Limitation of Liability + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. - 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. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. -8. Litigation + "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. - 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. + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. -9. Miscellaneous + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. - 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. + "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). -10. Versions of the License + "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. -10.1. New Versions + "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." - 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. + "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. -10.2. Effect of New Versions + 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. - 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. + 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. -10.3. Modified Versions + 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: - 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). + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and -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. + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and -Exhibit A - Source Code Form License Notice + (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 - 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/. + (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 : github.com/elastic/pkcs8 +Version: v1.0.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/elastic/pkcs8@v1.0.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 youmark + +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 : github.com/emicklei/go-restful/v3 +Version: v3.11.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/emicklei/go-restful/v3@v3.11.0/LICENSE: + +Copyright (c) 2012,2013 Ernest Micklei + +MIT License + +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 : github.com/evanphx/json-patch +Version: v5.6.0+incompatible +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/evanphx/json-patch@v5.6.0+incompatible/LICENSE: + +Copyright (c) 2014, Evan Phoenix +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the Evan Phoenix nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/expr-lang/expr +Version: v1.16.9 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/expr-lang/expr@v1.16.9/LICENSE: + +MIT License + +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 +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 : github.com/felixge/httpsnoop +Version: v1.0.4 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/felixge/httpsnoop@v1.0.4/LICENSE.txt: + +Copyright (c) 2016 Felix Geisendörfer (felix@debuggable.com) + + 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 : github.com/ghodss/yaml +Version: v1.0.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/ghodss/yaml@v1.0.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Sam Ghods + +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. + + +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/go-logr/logr +Version: v1.4.1 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/go-logr/logr@v1.4.1/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 {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. + 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 : github.com/go-logr/stdr +Version: v1.2.2 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/go-logr/stdr@v1.2.2/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 [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. + 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 : github.com/go-ole/go-ole +Version: v1.2.6 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/go-ole/go-ole@v1.2.6/LICENSE: + +The MIT License (MIT) + +Copyright © 2013-2017 Yasuhiro Matsumoto, + +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 : github.com/go-openapi/jsonpointer +Version: v0.19.6 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/go-openapi/jsonpointer@v0.19.6/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 [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. + 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 : github.com/go-openapi/jsonreference +Version: v0.20.2 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/go-openapi/jsonreference@v0.20.2/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 [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. + 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 : github.com/go-openapi/swag +Version: v0.22.3 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/go-openapi/swag@v0.22.3/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 [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. + 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 : github.com/go-task/slim-sprig +Version: v0.0.0-20230315185526-52ccab3ef572 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/go-task/slim-sprig@v0.0.0-20230315185526-52ccab3ef572/LICENSE.txt: + +Copyright (C) 2013-2020 Masterminds + +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 : github.com/go-viper/mapstructure/v2 +Version: v2.0.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/go-viper/mapstructure/v2@v2.0.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2013 Mitchell Hashimoto + +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 : github.com/gobuffalo/here +Version: v0.6.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/gobuffalo/here@v0.6.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2019 Mark Bates + +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 : github.com/gobwas/glob +Version: v0.2.3 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/gobwas/glob@v0.2.3/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2016 Sergey Kamardin + +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 : github.com/gogo/protobuf +Version: v1.3.2 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/gogo/protobuf@v1.3.2/LICENSE: + +Copyright (c) 2013, The GoGo Authors. All rights reserved. + +Protocol Buffers for Go with Gadgets + +Go support for Protocol Buffers - Google's data interchange format + +Copyright 2010 The Go Authors. All rights reserved. +https://github.com/golang/protobuf + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +-------------------------------------------------------------------------------- +Dependency : github.com/golang/groupcache +Version: v0.0.0-20210331224755-41bb18bfe9da +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/golang/groupcache@v0.0.0-20210331224755-41bb18bfe9da/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: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +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 +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 [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. + 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 : github.com/golang/protobuf +Version: v1.5.4 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/golang/protobuf@v1.5.4/LICENSE: + +Copyright 2010 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +-------------------------------------------------------------------------------- +Dependency : github.com/golang/snappy +Version: v0.0.4 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/golang/snappy@v0.0.4/LICENSE: + +Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/google/btree +Version: v1.1.2 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/google/btree@v1.1.2/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 [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. + 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 : github.com/google/gnostic-models +Version: v0.6.8 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/google/gnostic-models@v0.6.8/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 [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. + 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 : github.com/google/gofuzz +Version: v1.2.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/google/gofuzz@v1.2.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 [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. + 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 : github.com/google/licenseclassifier +Version: v0.0.0-20221004142553-c1ed8fcf4bab +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/google/licenseclassifier@v0.0.0-20221004142553-c1ed8fcf4bab/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 [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. + 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 : github.com/google/shlex +Version: v0.0.0-20191202100458-e7afc7fbc510 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/google/shlex@v0.0.0-20191202100458-e7afc7fbc510/COPYING: + + + 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 [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. + 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 : github.com/grpc-ecosystem/go-grpc-middleware +Version: v1.3.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/grpc-ecosystem/go-grpc-middleware@v1.3.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 [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. + 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 : github.com/grpc-ecosystem/grpc-gateway/v2 +Version: v2.20.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/grpc-ecosystem/grpc-gateway/v2@v2.20.0/LICENSE: + +Copyright (c) 2015, Gengo, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Gengo, Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/hashicorp/consul/api +Version: v1.29.1 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/consul/api@v1.29.1/LICENSE: + +Copyright (c) 2020 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/hashicorp/consul/proto-public +Version: v0.6.1 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/consul/proto-public@v0.6.1/LICENSE: + +Copyright (c) 2020 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/hashicorp/consul/sdk +Version: v0.16.1 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/consul/sdk@v0.16.1/LICENSE: + +Copyright (c) 2020 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/hashicorp/errwrap +Version: v1.1.0 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/errwrap@v1.1.0/LICENSE: + +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/hashicorp/go-cleanhttp +Version: v0.5.2 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-cleanhttp@v0.5.2/LICENSE: + +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/hashicorp/go-hclog +Version: v1.5.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-hclog@v1.5.0/LICENSE: + +Copyright (c) 2017 HashiCorp, Inc. + +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 : github.com/hashicorp/go-immutable-radix +Version: v1.3.1 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-immutable-radix@v1.3.1/LICENSE: + +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/hashicorp/go-msgpack +Version: v0.5.5 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-msgpack@v0.5.5/LICENSE: + +Copyright (c) 2012, 2013 Ugorji Nwoke. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the author nor the names of its contributors may be used + to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/hashicorp/go-rootcerts +Version: v1.0.2 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-rootcerts@v1.0.2/LICENSE: + +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/hashicorp/go-sockaddr +Version: v1.0.2 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-sockaddr@v1.0.2/LICENSE: + +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/hashicorp/go-uuid +Version: v1.0.3 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-uuid@v1.0.3/LICENSE: + +Copyright © 2015-2022 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/hashicorp/go-version +Version: v1.7.0 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-version@v1.7.0/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/hashicorp/golang-lru +Version: v1.0.2 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/golang-lru@v1.0.2/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/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/hashicorp/memberlist +Version: v0.5.0 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/memberlist@v0.5.0/LICENSE: + +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/hashicorp/serf +Version: v0.10.1 +Licence type (autodetected): MPL-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/serf@v0.10.1/LICENSE: + +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 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/hexops/gotextdiff@v1.0.3/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/iancoleman/strcase +Version: v0.3.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/iancoleman/strcase@v0.3.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Ian Coleman +Copyright (c) 2018 Ma_124, + +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 : github.com/imdario/mergo +Version: v0.3.15 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/imdario/mergo@v0.3.15/LICENSE: + +Copyright (c) 2013 Dario Castañé. All rights reserved. +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/inconshreveable/mousetrap +Version: v1.1.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/inconshreveable/mousetrap@v1.1.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 2022 Alan Shreve (@inconshreveable) + + 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 : github.com/jaypipes/pcidb +Version: v1.0.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/jaypipes/pcidb@v1.0.0/COPYING: + + + 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. + + + +-------------------------------------------------------------------------------- +Dependency : github.com/jcchavezs/porto +Version: v0.1.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/jcchavezs/porto@v0.1.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 [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. + 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 : github.com/jmespath/go-jmespath +Version: v0.4.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/jmespath/go-jmespath@v0.4.0/LICENSE: + +Copyright 2015 James Saryerwinnie + +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 : github.com/jmespath/go-jmespath/internal/testify +Version: v1.5.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/jmespath/go-jmespath/internal/testify@v1.5.1/LICENSE: + +MIT License + +Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell + +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 : github.com/josharian/intern +Version: v1.0.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/josharian/intern@v1.0.0/license.md: + +MIT License + +Copyright (c) 2019 Josh Bleecher Snyder + +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 : github.com/json-iterator/go +Version: v1.1.12 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/json-iterator/go@v1.1.12/LICENSE: + +MIT License + +Copyright (c) 2016 json-iterator + +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 : github.com/karrick/godirwalk +Version: v1.16.1 +Licence type (autodetected): BSD-2-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/karrick/godirwalk@v1.16.1/LICENSE: + +BSD 2-Clause License + +Copyright (c) 2017, Karrick McDermott +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/klauspost/compress +Version: v1.17.8 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/klauspost/compress@v1.17.8/LICENSE: + +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2019 Klaus Post. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------ + +Files: gzhttp/* + + 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 2016-2017 The New York Times Company + + 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. + +------------------ + +Files: s2/cmd/internal/readahead/* + +The MIT License (MIT) + +Copyright (c) 2015 Klaus Post + +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. + +--------------------- +Files: snappy/* +Files: internal/snapref/* + +Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +----------------- + +Files: s2/cmd/internal/filepathx/* + +Copyright 2016 The filepathx Authors + +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 : github.com/knadh/koanf/maps +Version: v0.1.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/knadh/koanf/maps@v0.1.1/LICENSE: + +The MIT License + +Copyright (c) 2019, Kailash Nadh. https://github.com/knadh + +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 : github.com/knadh/koanf/providers/confmap +Version: v0.1.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/knadh/koanf/providers/confmap@v0.1.0/LICENSE: + +The MIT License + +Copyright (c) 2019, Kailash Nadh. https://github.com/knadh + +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 : github.com/knadh/koanf/v2 +Version: v2.1.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/knadh/koanf/v2@v2.1.1/LICENSE: + +The MIT License + +Copyright (c) 2019, Kailash Nadh. https://github.com/knadh + +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 : github.com/kr/pretty +Version: v0.3.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/kr/pretty@v0.3.1/License: + +Copyright 2012 Keith Rarick + +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 : github.com/kr/text +Version: v0.2.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/kr/text@v0.2.0/License: + +Copyright 2012 Keith Rarick + +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 : github.com/leodido/go-syslog/v4 +Version: v4.1.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/leodido/go-syslog/v4@v4.1.0/LICENSE: + +The MIT License + +Copyright (c) 2018, Leonardo Di Donato + +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 : github.com/leodido/ragel-machinery +Version: v0.0.0-20190525184631-5f46317e436b +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/leodido/ragel-machinery@v0.0.0-20190525184631-5f46317e436b/LICENSE: + +MIT License + +Copyright (c) 2018 Leonardo Di Donato + +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 : github.com/leoluk/perflib_exporter +Version: v0.2.1 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/leoluk/perflib_exporter@v0.2.1/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2018 Leopold Schabel / The perflib_exporter authors + +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 : github.com/lestrrat-go/envload +Version: v0.0.0-20180220234015-a3eb8ddeffcc +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/lestrrat-go/envload@v0.0.0-20180220234015-a3eb8ddeffcc/LICENSE: + +MIT License + +Copyright (c) 2016 lestrrat + +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 : github.com/lestrrat-go/strftime +Version: v1.0.6 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/lestrrat-go/strftime@v1.0.6/LICENSE: + +MIT License + +Copyright (c) 2016 lestrrat + +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 : github.com/lightstep/go-expohisto +Version: v1.0.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/lightstep/go-expohisto@v1.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 [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. + 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 : github.com/lufia/plan9stats +Version: v0.0.0-20211012122336-39d0f177ccd0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/lufia/plan9stats@v0.0.0-20211012122336-39d0f177ccd0/LICENSE: + +BSD 3-Clause License + +Copyright (c) 2019, KADOTA, Kyohei +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/magiconair/properties +Version: v1.8.7 +Licence type (autodetected): BSD-2-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/magiconair/properties@v1.8.7/LICENSE.md: + +Copyright (c) 2013-2020, Frank Schroeder + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : github.com/mailru/easyjson +Version: v0.7.7 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mailru/easyjson@v0.7.7/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 : github.com/markbates/pkger +Version: v0.17.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/markbates/pkger@v0.17.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2019 Mark Bates + +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 : github.com/mattn/go-colorable +Version: v0.1.13 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mattn/go-colorable@v0.1.13/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2016 Yasuhiro Matsumoto + +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 : github.com/mattn/go-isatty +Version: v0.0.20 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mattn/go-isatty@v0.0.20/LICENSE: + +Copyright (c) Yasuhiro MATSUMOTO + +MIT License (Expat) + +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 : github.com/mattn/go-runewidth +Version: v0.0.15 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mattn/go-runewidth@v0.0.15/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2016 Yasuhiro Matsumoto + +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 : github.com/miekg/dns +Version: v1.1.41 +Licence type (autodetected): BSD +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/miekg/dns@v1.1.41/COPYRIGHT: + +Copyright 2009 The Go Authors. All rights reserved. Use of this source code +is governed by a BSD-style license that can be found in the LICENSE file. +Extensions of the original work are copyright (c) 2011 Miek Gieben + +Copyright 2011 Miek Gieben. All rights reserved. Use of this source code is +governed by a BSD-style license that can be found in the LICENSE file. + +Copyright 2014 CloudFlare. All rights reserved. Use of this source code is +governed by a BSD-style license that can be found in the LICENSE file. + + +-------------------------------------------------------------------------------- +Dependency : github.com/mileusna/useragent +Version: v1.3.4 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mileusna/useragent@v1.3.4/LICENSE.md: + +MIT License + +Copyright (c) 2017 Miloš Mileusnić + +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 : github.com/mitchellh/colorstring +Version: v0.0.0-20190213212951-d06e56a500db +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mitchellh/colorstring@v0.0.0-20190213212951-d06e56a500db/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Mitchell Hashimoto + +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 : github.com/mitchellh/copystructure +Version: v1.2.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mitchellh/copystructure@v1.2.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Mitchell Hashimoto + +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 : github.com/mitchellh/go-homedir +Version: v1.1.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mitchellh/go-homedir@v1.1.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2013 Mitchell Hashimoto + +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 : github.com/mitchellh/iochan +Version: v1.0.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mitchellh/iochan@v1.0.0/LICENSE.md: + +The MIT License (MIT) + +Copyright (c) 2015 Mitchell Hashimoto + +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 : github.com/mitchellh/reflectwalk +Version: v1.0.2 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/mitchellh/reflectwalk@v1.0.2/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2013 Mitchell Hashimoto + +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 : github.com/moby/patternmatcher +Version: v0.6.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/moby/patternmatcher@v0.6.0/LICENSE: + + + Apache License + Version 2.0, January 2004 + https://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 + + Copyright 2013-2018 Docker, Inc. + + 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 + + https://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 : github.com/moby/spdystream +Version: v0.2.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/moby/spdystream@v0.2.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 [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. + 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 : github.com/moby/sys/sequential +Version: v0.5.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/moby/sys/sequential@v0.5.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 [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. + 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 : github.com/moby/sys/user +Version: v0.1.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/moby/sys/user@v0.1.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. -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 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. -You may add additional accurate notices of copyright ownership. + 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. -Exhibit B - “Incompatible With Secondary Licenses” Notice + 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. - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. + 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 [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. + 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 : github.com/hashicorp/golang-lru/v2 -Version: v2.0.7 -Licence type (autodetected): MPL-2.0 +Dependency : github.com/moby/term +Version: v0.5.0 +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/hashicorp/golang-lru/v2@v2.0.7/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/moby/term@v0.5.0/LICENSE: -Copyright (c) 2014 HashiCorp, Inc. -Mozilla Public License, version 2.0 + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ -1. Definitions + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -1.1. "Contributor" + 1. Definitions. - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -1.2. "Contributor Version" + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. + "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. -1.3. "Contribution" + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. - means Covered Software of a particular Contributor. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -1.4. "Covered Software" + "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. - 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. + "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 + + Copyright 2013-2018 Docker, Inc. + + 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 + + https://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 : github.com/modern-go/concurrent +Version: v0.0.0-20180306012644-bacd9c7ef1dd +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/modern-go/concurrent@v0.0.0-20180306012644-bacd9c7ef1dd/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 [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. + 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. -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 +-------------------------------------------------------------------------------- +Dependency : github.com/modern-go/reflect2 +Version: v1.0.2 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- - 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. +Contents of probable licence file $GOMODCACHE/github.com/modern-go/reflect2@v1.0.2/LICENSE: -1.6. "Executable Form" + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ - means any form of the work other than Source Code Form. + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -1.7. "Larger Work" + 1. Definitions. - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -1.8. "License" + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. - means this document. + "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. -1.9. "Licensable" + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. - 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. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -1.10. "Modifications" + "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. - means any of the following: + "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). - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or + "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. - b. any new file in Source Code Form that contains any Covered Software. + "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." -1.11. "Patent Claims" of a Contributor + "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. - 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. + 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. -1.12. "Secondary License" + 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. - 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. + 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: -1.13. "Source Code Form" + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and - means the form of the work preferred for making modifications. + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and -1.14. "You" (or "Your") + (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 - 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. + (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. -2. License Grants and Conditions + 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. -2.1. Grants + 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. - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: + 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. - 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 + 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. - 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. + 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. -2.2. Effective Date + END OF TERMS AND CONDITIONS - 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. + APPENDIX: How to apply the Apache License to your work. -2.3. Limitations on Grant Scope + 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. - 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: + Copyright [yyyy] [name of copyright owner] - a. for any code that a Contributor has removed from Covered Software; or + 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 - 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 + http://www.apache.org/licenses/LICENSE-2.0 - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. + 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. - 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 +-------------------------------------------------------------------------------- +Dependency : github.com/morikuni/aec +Version: v1.0.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- - 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). +Contents of probable licence file $GOMODCACHE/github.com/morikuni/aec@v1.0.0/LICENSE: -2.5. Representation +The MIT License (MIT) - 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. +Copyright (c) 2016 Taihei Morikuni -2.6. Fair Use +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: - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -2.7. Conditions +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. - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. +-------------------------------------------------------------------------------- +Dependency : github.com/mostynb/go-grpc-compression +Version: v1.2.3 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- -3. Responsibilities +Contents of probable licence file $GOMODCACHE/github.com/mostynb/go-grpc-compression@v1.2.3/LICENSE: -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. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -3.2. Distribution of Executable Form + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - If You distribute Covered Software in Executable Form then: + 1. Definitions. - 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 + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. - 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. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. -3.3. Distribution of a Larger Work + "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 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). + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. -3.4. Notices + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. - 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. + "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. -3.5. Application of Additional Terms + "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). - 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. + "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. -4. Inability to Comply Due to Statute or Regulation + "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." - 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. + "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. -5. Termination + 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. -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. + 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. -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. + 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: -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. + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and -6. Disclaimer of Warranty + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and - 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. + (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 -7. Limitation of Liability + (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. - 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. + 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. -8. Litigation + 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. - 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. + 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. -9. Miscellaneous + 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. - 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. + 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 -10. Versions of the License + APPENDIX: How to apply the Apache License to your work. -10.1. New Versions + 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. - 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. + Copyright [yyyy] [name of copyright owner] -10.2. Effect of New Versions + 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 - 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. + http://www.apache.org/licenses/LICENSE-2.0 -10.3. Modified Versions + 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. - 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. +-------------------------------------------------------------------------------- +Dependency : github.com/munnerz/goautoneg +Version: v0.0.0-20191010083416-a7dc8b61c822 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- -Exhibit A - Source Code Form License Notice +Contents of probable licence file $GOMODCACHE/github.com/munnerz/goautoneg@v0.0.0-20191010083416-a7dc8b61c822/LICENSE: - 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/. +Copyright (c) 2011, Open Knowledge Foundation Ltd. +All rights reserved. -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. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -You may add additional accurate notices of copyright ownership. + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. -Exhibit B - "Incompatible With Secondary Licenses" Notice + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. + Neither the name of the Open Knowledge Foundation Ltd. nor the + names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -Dependency : github.com/hexops/gotextdiff -Version: v1.0.3 +Dependency : github.com/mxk/go-flowrate +Version: v0.0.0-20140419014527-cca7078d478f Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/hexops/gotextdiff@v1.0.3/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/mxk/go-flowrate@v0.0.0-20140419014527-cca7078d478f/LICENSE: -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright (c) 2014 The Go-FlowRate Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + + * Neither the name of the go-flowrate project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -20361,82 +32511,102 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -Dependency : github.com/iancoleman/strcase -Version: v0.3.0 +Dependency : github.com/onsi/ginkgo +Version: v1.16.4 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/iancoleman/strcase@v0.3.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/onsi/ginkgo@v1.16.4/LICENSE: -The MIT License (MIT) +Copyright (c) 2013-2014 Onsi Fakhouri -Copyright (c) 2015 Ian Coleman -Copyright (c) 2018 Ma_124, +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: -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 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. -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 : github.com/onsi/ginkgo/v2 +Version: v2.13.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/onsi/ginkgo/v2@v2.13.0/LICENSE: + +Copyright (c) 2013-2014 Onsi Fakhouri + +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 : github.com/imdario/mergo -Version: v0.3.13 -Licence type (autodetected): BSD-3-Clause +Dependency : github.com/onsi/gomega +Version: v1.29.0 +Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/imdario/mergo@v0.3.13/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/onsi/gomega@v1.29.0/LICENSE: -Copyright (c) 2013 Dario Castañé. All rights reserved. -Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2013-2014 Onsi Fakhouri -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +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: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +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 : github.com/inconshreveable/mousetrap -Version: v1.1.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/inconshreveable/mousetrap@v1.1.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -20626,7 +32796,7 @@ Contents of probable licence file $GOMODCACHE/github.com/inconshreveable/mousetr same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 Alan Shreve (@inconshreveable) + 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. @@ -20642,43 +32812,223 @@ Contents of probable licence file $GOMODCACHE/github.com/inconshreveable/mousetr -------------------------------------------------------------------------------- -Dependency : github.com/influxdata/go-syslog/v3 -Version: v3.0.1-0.20230911200830-875f5bc594a4 -Licence type (autodetected): MIT +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension +Version: v0.103.0 +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/influxdata/go-syslog/v3@v3.0.1-0.20230911200830-875f5bc594a4/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension@v0.103.0/LICENSE: -The MIT License + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Copyright (c) 2018, InfluxData Inc. + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -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: + 1. Definitions. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + "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 [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. + 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. -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 : github.com/jaypipes/pcidb -Version: v1.0.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/jaypipes/pcidb@v1.0.0/COPYING: - +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -20855,15 +33205,41 @@ Contents of probable licence file $GOMODCACHE/github.com/jaypipes/pcidb@v1.0.0/C 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 [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. + 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 : github.com/jcchavezs/porto -Version: v0.1.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/jcchavezs/porto@v0.1.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -21069,142 +33445,12 @@ Contents of probable licence file $GOMODCACHE/github.com/jcchavezs/porto@v0.1.0/ -------------------------------------------------------------------------------- -Dependency : github.com/josharian/intern -Version: v1.0.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/josharian/intern@v1.0.0/license.md: - -MIT License - -Copyright (c) 2019 Josh Bleecher Snyder - -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 : github.com/json-iterator/go -Version: v1.1.12 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/json-iterator/go@v1.1.12/LICENSE: - -MIT License - -Copyright (c) 2016 json-iterator - -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 : github.com/karrick/godirwalk -Version: v1.16.1 -Licence type (autodetected): BSD-2-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/karrick/godirwalk@v1.16.1/LICENSE: - -BSD 2-Clause License - -Copyright (c) 2017, Karrick McDermott -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/klauspost/compress -Version: v1.17.7 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/common +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/klauspost/compress@v1.17.7/LICENSE: - -Copyright (c) 2012 The Go Authors. All rights reserved. -Copyright (c) 2019 Klaus Post. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------- - -Files: gzhttp/* +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/common@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -21394,7 +33640,7 @@ Files: gzhttp/* same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2017 The New York Times Company + 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. @@ -21408,590 +33654,436 @@ Files: gzhttp/* See the License for the specific language governing permissions and limitations under the License. ------------------- - -Files: s2/cmd/internal/readahead/* - -The MIT License (MIT) - -Copyright (c) 2015 Klaus Post - -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. - ---------------------- -Files: snappy/* -Files: internal/snapref/* - -Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------ - -Files: s2/cmd/internal/filepathx/* - -Copyright 2016 The filepathx Authors - -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 : github.com/knadh/koanf/maps -Version: v0.1.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/knadh/koanf/maps@v0.1.1/LICENSE: - -The MIT License - -Copyright (c) 2019, Kailash Nadh. https://github.com/knadh - -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 : github.com/knadh/koanf/providers/confmap -Version: v0.1.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/knadh/koanf/providers/confmap@v0.1.0/LICENSE: - -The MIT License - -Copyright (c) 2019, Kailash Nadh. https://github.com/knadh - -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 : github.com/knadh/koanf/v2 -Version: v2.1.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/knadh/koanf/v2@v2.1.0/LICENSE: - -The MIT License - -Copyright (c) 2019, Kailash Nadh. https://github.com/knadh - -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 : github.com/kr/pretty -Version: v0.3.1 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/kr/pretty@v0.3.1/License: - -Copyright 2012 Keith Rarick - -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 : github.com/kr/text -Version: v0.2.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/kr/text@v0.2.0/License: - -Copyright 2012 Keith Rarick - -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 : github.com/leodido/ragel-machinery -Version: v0.0.0-20181214104525-299bdde78165 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/leodido/ragel-machinery@v0.0.0-20181214104525-299bdde78165/LICENSE: - -MIT License - -Copyright (c) 2018 Leonardo Di Donato - -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 : github.com/lufia/plan9stats -Version: v0.0.0-20211012122336-39d0f177ccd0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/lufia/plan9stats@v0.0.0-20211012122336-39d0f177ccd0/LICENSE: - -BSD 3-Clause License - -Copyright (c) 2019, KADOTA, Kyohei -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/mailru/easyjson -Version: v0.7.7 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/mailru/easyjson@v0.7.7/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 : github.com/markbates/pkger -Version: v0.17.0 -Licence type (autodetected): MIT +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal +Version: v0.103.0 +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/markbates/pkger@v0.17.0/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2019 Mark Bates - -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. +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal@v0.103.0/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. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION --------------------------------------------------------------------------------- -Dependency : github.com/mattn/go-colorable -Version: v0.1.13 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + 1. Definitions. -Contents of probable licence file $GOMODCACHE/github.com/mattn/go-colorable@v0.1.13/LICENSE: + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -The MIT License (MIT) + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. -Copyright (c) 2016 Yasuhiro Matsumoto + "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. -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: + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -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. + "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). --------------------------------------------------------------------------------- -Dependency : github.com/mattn/go-isatty -Version: v0.0.17 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + "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. -Contents of probable licence file $GOMODCACHE/github.com/mattn/go-isatty@v0.0.17/LICENSE: + "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." -Copyright (c) Yasuhiro MATSUMOTO + "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. -MIT License (Expat) + 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. -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: + 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. -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + 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: -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. + (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 --------------------------------------------------------------------------------- -Dependency : github.com/mattn/go-runewidth -Version: v0.0.15 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + (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 -Contents of probable licence file $GOMODCACHE/github.com/mattn/go-runewidth@v0.0.15/LICENSE: + (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. -The MIT License (MIT) + 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. -Copyright (c) 2016 Yasuhiro Matsumoto + 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. -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: + 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. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + 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. -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. + 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. --------------------------------------------------------------------------------- -Dependency : github.com/mitchellh/colorstring -Version: v0.0.0-20190213212951-d06e56a500db -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + END OF TERMS AND CONDITIONS -Contents of probable licence file $GOMODCACHE/github.com/mitchellh/colorstring@v0.0.0-20190213212951-d06e56a500db/LICENSE: + APPENDIX: How to apply the Apache License to your work. -The MIT License (MIT) + 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 (c) 2014 Mitchell Hashimoto + Copyright [yyyy] [name of copyright owner] -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: + 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 -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + http://www.apache.org/licenses/LICENSE-2.0 -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. + 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 : github.com/mitchellh/copystructure -Version: v1.2.0 -Licence type (autodetected): MIT +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter +Version: v0.103.0 +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/mitchellh/copystructure@v1.2.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter@v0.103.0/LICENSE: -The MIT License (MIT) + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Copyright (c) 2014 Mitchell Hashimoto + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -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: + 1. Definitions. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -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. + "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. --------------------------------------------------------------------------------- -Dependency : github.com/mitchellh/go-homedir -Version: v1.1.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. -Contents of probable licence file $GOMODCACHE/github.com/mitchellh/go-homedir@v1.1.0/LICENSE: + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -The MIT License (MIT) + "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. -Copyright (c) 2013 Mitchell Hashimoto + "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). -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: + "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. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + "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." -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. + "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. --------------------------------------------------------------------------------- -Dependency : github.com/mitchellh/iochan -Version: v1.0.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + 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. -Contents of probable licence file $GOMODCACHE/github.com/mitchellh/iochan@v1.0.0/LICENSE.md: + 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: -The MIT License (MIT) + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and -Copyright (c) 2015 Mitchell Hashimoto + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and -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: + (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 -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + (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. -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. + 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. --------------------------------------------------------------------------------- -Dependency : github.com/mitchellh/reflectwalk -Version: v1.0.2 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + 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. -Contents of probable licence file $GOMODCACHE/github.com/mitchellh/reflectwalk@v1.0.2/LICENSE: + 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. -The MIT License (MIT) + 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 (c) 2013 Mitchell Hashimoto + 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. -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: + END OF TERMS AND CONDITIONS -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + APPENDIX: How to apply the Apache License to your work. -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. + 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 [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. + 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 : github.com/moby/spdystream -Version: v0.2.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/moby/spdystream@v0.2.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -22197,17 +34289,16 @@ Contents of probable licence file $GOMODCACHE/github.com/moby/spdystream@v0.2.0/ -------------------------------------------------------------------------------- -Dependency : github.com/moby/term -Version: v0.5.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/moby/term@v0.5.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 - https://www.apache.org/licenses/ + http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -22382,13 +34473,24 @@ Contents of probable licence file $GOMODCACHE/github.com/moby/term@v0.5.0/LICENS END OF TERMS AND CONDITIONS - Copyright 2013-2018 Docker, Inc. + 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 [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. You may obtain a copy of the License at - https://www.apache.org/licenses/LICENSE-2.0 + 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, @@ -22398,12 +34500,12 @@ Contents of probable licence file $GOMODCACHE/github.com/moby/term@v0.5.0/LICENS -------------------------------------------------------------------------------- -Dependency : github.com/modern-go/concurrent -Version: v0.0.0-20180306012644-bacd9c7ef1dd +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/modern-go/concurrent@v0.0.0-20180306012644-bacd9c7ef1dd/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -22609,12 +34711,12 @@ Contents of probable licence file $GOMODCACHE/github.com/modern-go/concurrent@v0 -------------------------------------------------------------------------------- -Dependency : github.com/modern-go/reflect2 -Version: v1.0.2 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/modern-go/reflect2@v1.0.2/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -22820,44 +34922,12 @@ Contents of probable licence file $GOMODCACHE/github.com/modern-go/reflect2@v1.0 -------------------------------------------------------------------------------- -Dependency : github.com/morikuni/aec -Version: v1.0.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/morikuni/aec@v1.0.0/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2016 Taihei Morikuni - -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 : github.com/mostynb/go-grpc-compression -Version: v1.2.2 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/mostynb/go-grpc-compression@v1.2.2/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -23063,113 +35133,12 @@ Contents of probable licence file $GOMODCACHE/github.com/mostynb/go-grpc-compres -------------------------------------------------------------------------------- -Dependency : github.com/munnerz/goautoneg -Version: v0.0.0-20191010083416-a7dc8b61c822 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/munnerz/goautoneg@v0.0.0-20191010083416-a7dc8b61c822/LICENSE: - -Copyright (c) 2011, Open Knowledge Foundation Ltd. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - Neither the name of the Open Knowledge Foundation Ltd. nor the - names of its contributors may be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : github.com/onsi/ginkgo/v2 -Version: v2.9.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/onsi/ginkgo/v2@v2.9.0/LICENSE: - -Copyright (c) 2013-2014 Onsi Fakhouri - -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 : github.com/onsi/gomega -Version: v1.27.3 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/onsi/gomega@v1.27.3/LICENSE: - -Copyright (c) 2013-2014 Onsi Fakhouri - -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 : github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -23375,12 +35344,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/common -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/common@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -23586,12 +35555,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -23797,12 +35766,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -24008,12 +35977,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -24219,12 +36188,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -24430,12 +36399,12 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest -Version: v0.96.0 +Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.103.0/LICENSE: Apache License Version 2.0, January 2004 @@ -24641,16 +36610,17 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil -Version: v0.96.0 +Dependency : github.com/opencontainers/go-digest +Version: v1.0.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/opencontainers/go-digest@v1.0.0/LICENSE: + Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -24825,24 +36795,14 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele 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 [yyyy] [name of copyright owner] + Copyright 2019, 2020 OCI Contributors + Copyright 2016 Docker, Inc. 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 + https://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, @@ -24852,12 +36812,13 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza -Version: v0.96.0 +Dependency : github.com/opencontainers/image-spec +Version: v1.1.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/opencontainers/image-spec@v1.1.0/LICENSE: + Apache License Version 2.0, January 2004 @@ -25036,18 +36997,7 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele 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 [yyyy] [name of copyright owner] + Copyright 2016 The Linux Foundation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25063,17 +37013,16 @@ Contents of probable licence file $GOMODCACHE/github.com/open-telemetry/opentele -------------------------------------------------------------------------------- -Dependency : github.com/opencontainers/go-digest -Version: v1.0.0 +Dependency : github.com/openshift/api +Version: v3.9.0+incompatible Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/opencontainers/go-digest@v1.0.0/LICENSE: - +Contents of probable licence file $GOMODCACHE/github.com/openshift/api@v3.9.0+incompatible/LICENSE: Apache License Version 2.0, January 2004 - https://www.apache.org/licenses/ + http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -25248,14 +37197,24 @@ Contents of probable licence file $GOMODCACHE/github.com/opencontainers/go-diges END OF TERMS AND CONDITIONS - Copyright 2019, 2020 OCI Contributors - Copyright 2016 Docker, Inc. + 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 {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. You may obtain a copy of the License at - https://www.apache.org/licenses/LICENSE-2.0 + 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, @@ -25265,12 +37224,12 @@ Contents of probable licence file $GOMODCACHE/github.com/opencontainers/go-diges -------------------------------------------------------------------------------- -Dependency : github.com/opencontainers/image-spec -Version: v1.1.0-rc5 +Dependency : github.com/openshift/client-go +Version: v0.0.0-20210521082421-73d9475a9142 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/opencontainers/image-spec@v1.1.0-rc5/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/openshift/client-go@v0.0.0-20210521082421-73d9475a9142/LICENSE: Apache License @@ -25450,7 +37409,7 @@ Contents of probable licence file $GOMODCACHE/github.com/opencontainers/image-sp END OF TERMS AND CONDITIONS - Copyright 2016 The Linux Foundation. + Copyright 2014 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25482,13 +37441,28 @@ The above copyright notice and this permission notice shall be included in all c 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 : github.com/pascaldekloe/goe +Version: v0.1.0 +Licence type (autodetected): CC0-1.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/pascaldekloe/goe@v0.1.0/LICENSE: + +To the extent possible under law, Pascal S. de Kloe has waived all +copyright and related or neighboring rights to Go Enterprice. This +work is published from The Netherlands. + +https://creativecommons.org/publicdomain/zero/1.0/legalcode + + -------------------------------------------------------------------------------- Dependency : github.com/pmezard/go-difflib -Version: v1.0.0 +Version: v1.0.1-0.20181226105442-5d4384ee4fb2 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/pmezard/go-difflib@v1.0.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/pmezard/go-difflib@v1.0.1-0.20181226105442-5d4384ee4fb2/LICENSE: Copyright (c) 2013, Patrick Mezard All rights reserved. @@ -25554,11 +37528,11 @@ SOFTWARE. -------------------------------------------------------------------------------- Dependency : github.com/prometheus/client_golang -Version: v1.19.0 +Version: v1.19.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/prometheus/client_golang@v1.19.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/prometheus/client_golang@v1.19.1/LICENSE: Apache License Version 2.0, January 2004 @@ -25765,11 +37739,11 @@ Contents of probable licence file $GOMODCACHE/github.com/prometheus/client_golan -------------------------------------------------------------------------------- Dependency : github.com/prometheus/client_model -Version: v0.6.0 +Version: v0.6.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/prometheus/client_model@v0.6.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/prometheus/client_model@v0.6.1/LICENSE: Apache License Version 2.0, January 2004 @@ -25976,11 +37950,11 @@ Contents of probable licence file $GOMODCACHE/github.com/prometheus/client_model -------------------------------------------------------------------------------- Dependency : github.com/prometheus/common -Version: v0.48.0 +Version: v0.54.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/prometheus/common@v0.48.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/prometheus/common@v0.54.0/LICENSE: Apache License Version 2.0, January 2004 @@ -26187,11 +38161,11 @@ Contents of probable licence file $GOMODCACHE/github.com/prometheus/common@v0.48 -------------------------------------------------------------------------------- Dependency : github.com/prometheus/procfs -Version: v0.12.0 +Version: v0.15.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/prometheus/procfs@v0.12.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/prometheus/procfs@v0.15.1/LICENSE: Apache License Version 2.0, January 2004 @@ -26429,11 +38403,11 @@ SOFTWARE. -------------------------------------------------------------------------------- Dependency : github.com/rogpeppe/go-internal -Version: v1.11.0 +Version: v1.12.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/rogpeppe/go-internal@v1.11.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/rogpeppe/go-internal@v1.12.0/LICENSE: Copyright (c) 2018 The Go Authors. All rights reserved. @@ -26529,6 +38503,70 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +Dependency : github.com/sean-/seed +Version: v0.0.0-20170313163322-e2103e2c3529 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/sean-/seed@v0.0.0-20170313163322-e2103e2c3529/LICENSE: + +MIT License + +Copyright (c) 2017 Sean Chittenden +Copyright (c) 2016 Alex Dadgar + +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. + +===== + +Bits of Go-lang's `once.Do()` were cribbed and reused here, too. + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + -------------------------------------------------------------------------------- Dependency : github.com/sergi/go-diff Version: v1.2.0 @@ -26560,12 +38598,12 @@ DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- -Dependency : github.com/shirou/gopsutil -Version: v3.21.11+incompatible +Dependency : github.com/shirou/gopsutil/v4 +Version: v4.24.5 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/shirou/gopsutil@v3.21.11+incompatible/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/shirou/gopsutil/v4@v4.24.5/LICENSE: gopsutil is distributed under BSD license reproduced below. @@ -26597,7 +38635,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------- -internal/common/binary.go in the gopsutil is copied and modifid from golang/encoding/binary.go. +internal/common/binary.go in the gopsutil is copied and modified from golang/encoding/binary.go. @@ -27561,11 +39599,11 @@ Contents of probable licence file $GOMODCACHE/github.com/spf13/afero@v1.9.5/LICE -------------------------------------------------------------------------------- Dependency : github.com/stretchr/objx -Version: v0.5.0 +Version: v0.5.2 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/stretchr/objx@v0.5.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/stretchr/objx@v0.5.2/LICENSE: The MIT License @@ -27591,6 +39629,68 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +Dependency : github.com/testcontainers/testcontainers-go +Version: v0.31.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/testcontainers/testcontainers-go@v0.31.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2017-2019 Gianluca Arbezzano + +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 : github.com/tilinna/clock +Version: v1.1.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/tilinna/clock@v1.1.0/LICENSE: + +MIT License + +Copyright (c) 2018 Timo Linna + +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 : github.com/tklauser/go-sysconf Version: v0.3.12 @@ -27827,7 +39927,280 @@ Contents of probable licence file $GOMODCACHE/github.com/tklauser/numcpus@v0.6.1 same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + 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. + 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 : github.com/valyala/fastjson +Version: v1.6.4 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/valyala/fastjson@v1.6.4/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2018 Aliaksandr Valialkin + +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 : github.com/yusufpapurcu/wmi +Version: v1.2.4 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/yusufpapurcu/wmi@v1.2.4/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2013 Stack Exchange + +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.elastic.co/apm/module/apmelasticsearch +Version: v1.10.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmelasticsearch@v1.10.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. @@ -27843,95 +40216,214 @@ Contents of probable licence file $GOMODCACHE/github.com/tklauser/numcpus@v0.6.1 -------------------------------------------------------------------------------- -Dependency : github.com/valyala/fastjson -Version: v1.6.4 -Licence type (autodetected): MIT +Dependency : go.elastic.co/apm/module/apmelasticsearch/v2 +Version: v2.6.0 +Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/valyala/fastjson@v1.6.4/LICENSE: +Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmelasticsearch/v2@v2.6.0/LICENSE: -The MIT License (MIT) + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Copyright (c) 2018 Aliaksandr Valialkin + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -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: + 1. Definitions. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -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. + "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. --------------------------------------------------------------------------------- -Dependency : github.com/youmark/pkcs8 -Version: v0.0.0-20201027041543-1326539a0a0a -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -Contents of probable licence file $GOMODCACHE/github.com/youmark/pkcs8@v0.0.0-20201027041543-1326539a0a0a/LICENSE: + "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. -The MIT License (MIT) + "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). -Copyright (c) 2014 youmark + "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. -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: + "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." -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + "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. -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. + 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. --------------------------------------------------------------------------------- -Dependency : github.com/yusufpapurcu/wmi -Version: v1.2.3 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- + 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. -Contents of probable licence file $GOMODCACHE/github.com/yusufpapurcu/wmi@v1.2.3/LICENSE: + 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: -The MIT License (MIT) + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and -Copyright (c) 2013 Stack Exchange + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and -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: + (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 -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + (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. -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. + 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. -------------------------------------------------------------------------------- @@ -28147,11 +40639,11 @@ 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 +Version: v2.6.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmhttp/v2@v2.0.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmhttp/v2@v2.6.0/LICENSE: Apache License Version 2.0, January 2004 @@ -28357,12 +40849,12 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/module/apmhttp/v -------------------------------------------------------------------------------- -Dependency : go.elastic.co/apm/v2 -Version: v2.0.0 +Dependency : go.elastic.co/apm/module/apmzap/v2 +Version: v2.6.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.elastic.co/apm/module/apmzap/v2@v2.6.0/LICENSE: Apache License Version 2.0, January 2004 @@ -28568,46 +41060,12 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/apm/v2@v2.0.0/LICENS -------------------------------------------------------------------------------- -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.elastic.co/apm/v2 +Version: v2.6.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.elastic.co/apm/v2@v2.6.0/LICENSE: Apache License Version 2.0, January 2004 @@ -28797,7 +41255,7 @@ Contents of probable licence file $GOMODCACHE/go.opencensus.io@v0.24.0/LICENSE: same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + 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. @@ -28811,225 +41269,77 @@ 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.96.0 -Licence type (autodetected): Apache-2.0 +Dependency : go.elastic.co/fastjson +Version: v1.3.0 +Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector@v0.96.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: +Contents of probable licence file $GOMODCACHE/go.elastic.co/fastjson@v1.3.0/LICENSE: - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and +Copyright 2018 Elasticsearch BV - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and +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 - (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 + http://www.apache.org/licenses/LICENSE-2.0 - (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. +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. - 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. +Copyright (c) 2016 Mail.Ru Group - 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. +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: - 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. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - 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. +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. - 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 +-------------------------------------------------------------------------------- +Dependency : go.etcd.io/bbolt +Version: v1.3.10 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- - APPENDIX: How to apply the Apache License to your work. +Contents of probable licence file $GOMODCACHE/go.etcd.io/bbolt@v1.3.10/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. +The MIT License (MIT) - Copyright [yyyy] [name of copyright owner] +Copyright (c) 2013 Ben Johnson - 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.opentelemetry.io/collector/config/configauth -Version: v0.96.0 +Dependency : go.opencensus.io +Version: v0.24.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configauth@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opencensus.io@v0.24.0/LICENSE: Apache License @@ -29234,14 +41544,13 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf See the License for the specific language governing permissions and limitations under the License. - -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configcompression -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configcompression@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector@v0.103.0/LICENSE: Apache License @@ -29448,12 +41757,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configgrpc -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/config/configauth +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configgrpc@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configauth@v0.103.0/LICENSE: Apache License @@ -29660,12 +41969,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/confighttp -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/config/configcompression +Version: v1.10.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/confighttp@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configcompression@v1.10.0/LICENSE: Apache License @@ -29872,12 +42181,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/confignet -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/config/configgrpc +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/confignet@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configgrpc@v0.103.0/LICENSE: Apache License @@ -30084,12 +42393,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configopaque -Version: v1.3.0 +Dependency : go.opentelemetry.io/collector/config/confighttp +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configopaque@v1.3.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/confighttp@v0.103.0/LICENSE: Apache License @@ -30296,12 +42605,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configretry -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/config/confignet +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configretry@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/confignet@v0.103.0/LICENSE: Apache License @@ -30508,12 +42817,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configtelemetry -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/config/configopaque +Version: v1.10.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configtelemetry@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configopaque@v1.10.0/LICENSE: Apache License @@ -30720,12 +43029,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/configtls -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/config/configretry +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configtls@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configretry@v0.103.0/LICENSE: Apache License @@ -30932,12 +43241,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/config/internal -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/config/configtelemetry +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/internal@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configtelemetry@v0.103.0/LICENSE: Apache License @@ -31144,12 +43453,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conf -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/connector -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/config/configtls +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/connector@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/configtls@v0.103.0/LICENSE: Apache License @@ -31356,12 +43665,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/conn -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/consumer -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/config/internal +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/consumer@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/config/internal@v0.103.0/LICENSE: Apache License @@ -31568,12 +43877,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/cons -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/extension -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/consumer +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/consumer@v0.103.0/LICENSE: Apache License @@ -31781,11 +44090,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exte -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/extension/auth -Version: v0.96.0 +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension/auth@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension/auth@v0.103.0/LICENSE: Apache License @@ -31993,11 +44302,11 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exte -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/extension/zpagesextension -Version: v0.96.0 +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension/zpagesextension@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/extension/zpagesextension@v0.103.0/LICENSE: Apache License @@ -32204,12 +44513,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/exte -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/pdata -Version: v1.3.0 +Dependency : go.opentelemetry.io/collector/filter +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/pdata@v1.3.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/filter@v0.103.0/LICENSE: Apache License @@ -32416,12 +44725,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/pdat -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/semconv -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/pdata +Version: v1.10.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semconv@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/pdata@v1.10.0/LICENSE: Apache License @@ -32628,12 +44937,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semc -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/service -Version: v0.96.0 +Dependency : go.opentelemetry.io/collector/pdata/testdata +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/service@v0.96.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/pdata/testdata@v0.103.0/LICENSE: Apache License @@ -32840,12 +45149,13 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/serv -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/contrib -Version: v0.20.0 +Dependency : go.opentelemetry.io/collector/semconv +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib@v0.20.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semconv@v0.103.0/LICENSE: + Apache License Version 2.0, January 2004 @@ -33051,12 +45361,13 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib@v0.20. -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/contrib/config -Version: v0.4.0 +Dependency : go.opentelemetry.io/collector/service +Version: v0.103.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/config@v0.4.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/service@v0.103.0/LICENSE: + Apache License Version 2.0, January 2004 @@ -33262,12 +45573,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/config -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc -Version: v0.47.0 +Dependency : go.opentelemetry.io/contrib +Version: v0.20.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@v0.47.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib@v0.20.0/LICENSE: Apache License Version 2.0, January 2004 @@ -33473,12 +45784,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/instru -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp -Version: v0.49.0 +Dependency : go.opentelemetry.io/contrib/config +Version: v0.7.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.49.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/config@v0.7.0/LICENSE: Apache License Version 2.0, January 2004 @@ -33684,12 +45995,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/instru -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/contrib/propagators/b3 -Version: v1.24.0 +Dependency : go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc +Version: v0.52.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/propagators/b3@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@v0.52.0/LICENSE: Apache License Version 2.0, January 2004 @@ -33895,12 +46206,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/propag -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/contrib/zpages -Version: v0.49.0 +Dependency : go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp +Version: v0.52.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/zpages@v0.49.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.52.0/LICENSE: Apache License Version 2.0, January 2004 @@ -34106,12 +46417,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/zpages -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel -Version: v1.24.0 +Dependency : go.opentelemetry.io/contrib/propagators/b3 +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/propagators/b3@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -34317,12 +46628,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel@v1.24.0/L -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/bridge/opencensus -Version: v1.24.0 +Dependency : go.opentelemetry.io/contrib/zpages +Version: v0.52.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/bridge/opencensus@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/contrib/zpages@v0.52.0/LICENSE: Apache License Version 2.0, January 2004 @@ -34528,12 +46839,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/bridge/op -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -34739,12 +47050,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/bridge/opencensus +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/bridge/opencensus@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -34950,12 +47261,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/exporters/otlp/otlptrace -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlptrace@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -35161,12 +47472,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -35372,12 +47683,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/exporters/otlp/otlptrace +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlptrace@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -35583,12 +47894,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/exporters/prometheus -Version: v0.46.0 +Dependency : go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/prometheus@v0.46.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -35794,12 +48105,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/exporters/stdout/stdoutmetric -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/stdout/stdoutmetric@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -36005,12 +48316,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/exporters/stdout/stdouttrace -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/exporters/prometheus +Version: v0.49.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/stdout/stdouttrace@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/prometheus@v0.49.0/LICENSE: Apache License Version 2.0, January 2004 @@ -36216,12 +48527,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/metric -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/exporters/stdout/stdoutmetric +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/metric@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/stdout/stdoutmetric@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -36427,12 +48738,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/metric@v1 -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/sdk -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/exporters/stdout/stdouttrace +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/sdk@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/exporters/stdout/stdouttrace@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -36638,12 +48949,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/sdk@v1.24 -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/sdk/metric -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/metric +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/sdk/metric@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/metric@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -36849,12 +49160,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/sdk/metri -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/otel/trace -Version: v1.24.0 +Dependency : go.opentelemetry.io/otel/sdk +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/trace@v1.24.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/sdk@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -37060,12 +49371,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/trace@v1. -------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/proto/otlp -Version: v1.1.0 +Dependency : go.opentelemetry.io/otel/sdk/metric +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/proto/otlp@v1.1.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/sdk/metric@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -37271,216 +49582,12 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/proto/otlp@v1. -------------------------------------------------------------------------------- -Dependency : go.uber.org/goleak -Version: v1.3.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/go.uber.org/goleak@v1.3.0/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2018 Uber Technologies, Inc. - -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.uber.org/multierr -Version: v1.11.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/go.uber.org/multierr@v1.11.0/LICENSE.txt: - -Copyright (c) 2017-2021 Uber Technologies, Inc. - -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 : golang.org/x/mod -Version: v0.14.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/mod@v0.14.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/net -Version: v0.21.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/net@v0.21.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : golang.org/x/oauth2 -Version: v0.16.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/golang.org/x/oauth2@v0.16.0/LICENSE: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Dependency : gonum.org/v1/gonum -Version: v0.14.0 -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/gonum.org/v1/gonum@v0.14.0/LICENSE: - -Copyright ©2013 The Gonum Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Gonum project nor the names of its authors and - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------------------- -Dependency : google.golang.org/appengine -Version: v1.6.8 +Dependency : go.opentelemetry.io/otel/trace +Version: v1.27.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/appengine@v1.6.8/LICENSE: - +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/otel/trace@v1.27.0/LICENSE: Apache License Version 2.0, January 2004 @@ -37686,13 +49793,12 @@ Contents of probable licence file $GOMODCACHE/google.golang.org/appengine@v1.6.8 -------------------------------------------------------------------------------- -Dependency : google.golang.org/genproto -Version: v0.0.0-20240123012728-ef4313101c80 +Dependency : go.opentelemetry.io/proto/otlp +Version: v1.2.0 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/genproto@v0.0.0-20240123012728-ef4313101c80/LICENSE: - +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/proto/otlp@v1.2.0/LICENSE: Apache License Version 2.0, January 2004 @@ -37897,13 +50003,253 @@ Contents of probable licence file $GOMODCACHE/google.golang.org/genproto@v0.0.0- limitations under the License. +-------------------------------------------------------------------------------- +Dependency : go.uber.org/goleak +Version: v1.3.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/go.uber.org/goleak@v1.3.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2018 Uber Technologies, Inc. + +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.uber.org/multierr +Version: v1.11.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/go.uber.org/multierr@v1.11.0/LICENSE.txt: + +Copyright (c) 2017-2021 Uber Technologies, Inc. + +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 : golang.org/x/exp +Version: v0.0.0-20240506185415-9bf2ced13842 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/exp@v0.0.0-20240506185415-9bf2ced13842/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/mod +Version: v0.17.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/mod@v0.17.0/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/net +Version: v0.26.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/net@v0.26.0/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : golang.org/x/oauth2 +Version: v0.20.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/golang.org/x/oauth2@v0.20.0/LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Dependency : gonum.org/v1/gonum +Version: v0.15.0 +Licence type (autodetected): BSD-3-Clause +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/gonum.org/v1/gonum@v0.15.0/LICENSE: + +Copyright ©2013 The Gonum Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Gonum project nor the names of its authors and + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + -------------------------------------------------------------------------------- Dependency : google.golang.org/genproto/googleapis/api -Version: v0.0.0-20240123012728-ef4313101c80 +Version: v0.0.0-20240520151616-dc85e6b867a5 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/genproto/googleapis/api@v0.0.0-20240123012728-ef4313101c80/LICENSE: +Contents of probable licence file $GOMODCACHE/google.golang.org/genproto/googleapis/api@v0.0.0-20240520151616-dc85e6b867a5/LICENSE: Apache License @@ -38111,11 +50457,11 @@ Contents of probable licence file $GOMODCACHE/google.golang.org/genproto/googlea -------------------------------------------------------------------------------- Dependency : google.golang.org/genproto/googleapis/rpc -Version: v0.0.0-20240123012728-ef4313101c80 +Version: v0.0.0-20240610135401-a8a62080eff3 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/google.golang.org/genproto/googleapis/rpc@v0.0.0-20240123012728-ef4313101c80/LICENSE: +Contents of probable licence file $GOMODCACHE/google.golang.org/genproto/googleapis/rpc@v0.0.0-20240610135401-a8a62080eff3/LICENSE: Apache License @@ -38606,6 +50952,35 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +Dependency : gopkg.in/mcuadros/go-syslog.v2 +Version: v2.3.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/gopkg.in/mcuadros/go-syslog.v2@v2.3.0/LICENSE: + +Copyright (c) 2013 Máximo Cuadros + +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 : gopkg.in/natefinch/lumberjack.v2 Version: v2.2.1 @@ -38638,11 +51013,11 @@ SOFTWARE. -------------------------------------------------------------------------------- Dependency : gotest.tools/v3 -Version: v3.4.0 +Version: v3.5.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/gotest.tools/v3@v3.4.0/LICENSE: +Contents of probable licence file $GOMODCACHE/gotest.tools/v3@v3.5.1/LICENSE: Copyright 2018 gotest.tools authors @@ -38661,11 +51036,11 @@ limitations under the License. -------------------------------------------------------------------------------- Dependency : howett.net/plist -Version: v1.0.0 +Version: v1.0.1 Licence type (autodetected): BSD-2-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/howett.net/plist@v1.0.0/LICENSE: +Contents of probable licence file $GOMODCACHE/howett.net/plist@v1.0.1/LICENSE: Copyright (c) 2013, Dustin L. Howett. All rights reserved. @@ -38729,11 +51104,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : k8s.io/klog/v2 -Version: v2.80.1 +Version: v2.110.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/k8s.io/klog/v2@v2.80.1/LICENSE: +Contents of probable licence file $GOMODCACHE/k8s.io/klog/v2@v2.110.1/LICENSE: Apache License Version 2.0, January 2004 @@ -38930,11 +51305,223 @@ third-party archives. -------------------------------------------------------------------------------- Dependency : k8s.io/kube-openapi -Version: v0.0.0-20221207184640-f3cff1453715 +Version: v0.0.0-20231010175941-2dd684a91f00 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/k8s.io/kube-openapi@v0.0.0-20231010175941-2dd684a91f00/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 [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. + 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 : k8s.io/kubelet +Version: v0.29.3 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/k8s.io/kube-openapi@v0.0.0-20221207184640-f3cff1453715/LICENSE: +Contents of probable licence file $GOMODCACHE/k8s.io/kubelet@v0.29.3/LICENSE: Apache License @@ -39390,11 +51977,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : sigs.k8s.io/structured-merge-diff/v4 -Version: v4.2.3 +Version: v4.4.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/sigs.k8s.io/structured-merge-diff/v4@v4.2.3/LICENSE: +Contents of probable licence file $GOMODCACHE/sigs.k8s.io/structured-merge-diff/v4@v4.4.1/LICENSE: Apache License Version 2.0, January 2004 diff --git a/README.md b/README.md index aec15af017d..7bf785def31 100644 --- a/README.md +++ b/README.md @@ -3,21 +3,63 @@ [![Build status](https://badge.buildkite.com/1d35bb40427cc6833979645b61ea214fc4b686a2ffe3a68bdf.svg)](https://buildkite.com/elastic/elastic-agent) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=elastic_elastic-agent&metric=coverage)](https://sonarcloud.io/summary/new_code?id=elastic_elastic-agent) -## Architecture / internal docs +## Architecture and Internals - [Agent architecture](docs/architecture.md) - [Component spec files](docs/component-specs.md) - [Policy configuration](docs/agent-policy.md) +## Official Documentation + +See https://www.elastic.co/guide/en/fleet/current/index.html. + +The source files for the offical Elastic Agent documentation are currently stored +in the [ingest-docs](https://github.com/elastic/ingest-docs/tree/main/docs/en/ingest-management) repository. + ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md). -## Developer docs +## Developing -The source files for the general Elastic Agent documentation are currently stored -in the [ingest-docs](https://github.com/elastic/ingest-docs/tree/main/docs/en/ingest-management) repository. -The following docs are only focused on getting developers started building code for Elastic Agent. +The following are exclusively focused on getting developers started building code for Elastic Agent. + +### Development Installations + +> :warning: Development installations are not officially supported and are intended for Elastic Agent developers. + +If you are an Elastic employee, you already have an Information Security managed Elastic Agent installed on your machine for endpoint protection. +This prevents you from installing the Elastic Agent a second time for development without using a VM or Docker container. To eliminate this point +of friction, Elastic Agent has a development mode that permits installing the Elastic Agent on your machine a second time: + +```sh +# All other arguments to the install command are still supported when --develop is specified. +sudo ./elastic-agent install --develop +# The run command also supports the --develop option to allow running without installing when there is another agent on the machine. +./elastic-agent run -e --develop +``` + +Using the `--develop` option will install the agent in an isolated `Agent-Development` agent directory in the chosen base path. +Development agents enrolled in Fleet will have the `Development` tag added automatically. Using the default base path on MacOS you will see: + +```sh +sudo ls /Library/Elastic/ +Agent +Agent-Development +``` + +The `elastic-agent` command in the shell is replaced with `elastic-development-agent` to interact with the development agent: + +```sh +# For a privileged agent +sudo elastic-development-agent status +# For an unprivileged agent +sudo -u elastic-agent-user elastic-development-agent status +``` + +The primary restriction of `--develop` installations is that you cannot run Elastic Defend a second time on the same machine. Attempting to +install Defend twice will fail with resource conflicts. All other integrations should be usable provided conflicting configurations are +changed ahead of time. For example two agents cannot bind to the same `agent.monitoring.http.port` to expose their monitoring servers. ### Test Framework @@ -47,7 +89,7 @@ pr: https://github.com/elastic/elastic-agent/pull/823 Prerequisites: - installed [mage](https://github.com/magefile/mage) - [Docker](https://docs.docker.com/get-docker/) -- [X-pack](https://github.com/elastic/beats/tree/main/x-pack) to pre-exist in the parent folder of the local Git repository checkout +- [beats](https://github.com/elastic/beats) to pre-exist in the parent folder of the local Git repository checkout if, and only if, packaging with `EXTERNAL=false` to package the beats as well - [elastic-agent-changelog-tool](https://github.com/elastic/elastic-agent-changelog-tool) to add changelog fragments for changelog generation To build a local version of the agent for development, run the command below. The following platforms are supported: @@ -78,6 +120,22 @@ sudo elastic-agent install For basic use the agent binary can be run directly, with the `sudo elastic-agent run` command. +#### Packaging for other architectures +When packaging for an architecture different than the host machine, +you might face the following error: +``` +exec /crossbuild: exec format error +``` + +If that happens, enable +[`multiarch/qemu-user-static`](https://github.com/multiarch/qemu-user-static) +is to enable an execution of different multi-architecture containers +by QEMU and binfmt_misc: + +``` +docker run --rm --privileged multiarch/qemu-user-static --reset -p yes +``` + ### Docker Running Elastic Agent in a docker container is a common use case. To build the Elastic Agent and create a docker image run the following command: diff --git a/_meta/config/common.p2.yml.tmpl b/_meta/config/common.p2.yml.tmpl index 7ca36f155a1..784b538ab2d 100644 --- a/_meta/config/common.p2.yml.tmpl +++ b/_meta/config/common.p2.yml.tmpl @@ -60,12 +60,27 @@ inputs: # logs: true # # enables metrics monitoring # metrics: true +# # metrics_period defines how frequent we should sample monitoring metrics. Default is 60 seconds. +# metrics_period: 60s # # exposes /debug/pprof/ endpoints # # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost # pprof.enabled: false # # The name of the output to use for monitoring data. # use_output: monitoring # # exposes agent metrics using http, by default sockets and named pipes are used +# # +# # `http` Also exposes a /liveness endpoint that will return an HTTP code depending on agent status: +# # 200: Agent is healthy +# # 500: A component or unit is in a failed state +# # 503: The agent coordinator is unresponsive +# # +# # You can pass a `failon` parameter to the /liveness endpoint to determine what component state will result in a 500. +# # For example: `curl 'localhost:6792/liveness?failon=degraded'` will return 500 if a component is in a degraded state. +# # The possible values for `failon` are: +# # `degraded`: return an error if a component is in a degraded state or failed state, or if the agent coordinator is unresponsive. +# # `failed`: return an error if a unit is in a failed state, or if the agent coordinator is unresponsive. +# # `heartbeat`: return an error only if the agent coordinator is unresponsive. +# # If no `failon` parameter is provided, the default behavior is `failon=heartbeat` # http: # # enables http endpoint # enabled: false diff --git a/_meta/config/common.reference.p2.yml.tmpl b/_meta/config/common.reference.p2.yml.tmpl index 325cd13ab18..9a2e73fe31c 100644 --- a/_meta/config/common.reference.p2.yml.tmpl +++ b/_meta/config/common.reference.p2.yml.tmpl @@ -139,12 +139,27 @@ inputs: # logs: false # # enables metrics monitoring # metrics: false +# # metrics_period defines how frequent we should sample monitoring metrics. Default is 60 seconds. +# metrics_period: 60s # # exposes /debug/pprof/ endpoints # # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost # pprof.enabled: false # # The name of the output to use for monitoring data. # use_output: monitoring -# # exposes agent metrics using http, by default sockets and named pipes are used +# # Exposes agent metrics using http, by default sockets and named pipes are used. +# # +# # `http` Also exposes a /liveness endpoint that will return an HTTP code depending on agent status: +# # 200: Agent is healthy +# # 500: A component or unit is in a failed state +# # 503: The agent coordinator is unresponsive +# # +# # You can pass a `failon` parameter to the /liveness endpoint to determine what component state will result in a 500. +# # For example: `curl 'localhost:6792/liveness?failon=degraded'` will return 500 if a component is in a degraded state. +# # The possible values for `failon` are: +# # `degraded`: return an error if a component is in a degraded state or failed state, or if the agent coordinator is unresponsive. +# # `failed`: return an error if a unit is in a failed state, or if the agent coordinator is unresponsive. +# # `heartbeat`: return an error only if the agent coordinator is unresponsive. +# # If no `failon` parameter is provided, the default behavior is `failon=heartbeat` # http: # # enables http endpoint # enabled: false @@ -259,4 +274,52 @@ agent.logging.to_stderr: true # Set to true to log messages in JSON format. #agent.logging.json: false +#=============================== Events Logging =============================== +# Some outputs will log raw events on errors like indexing errors in the +# Elasticsearch output, to prevent logging raw events (that may contain +# sensitive information) together with other log messages, a different +# log file, only for log entries containing raw events, is used. It will +# use the same level, selectors and all other configurations from the +# default logger, but it will have it's own file configuration. +# +# Having a different log file for raw events also prevents event data +# from drowning out the regular log files. +# +# IMPORTANT: No matter the default logger output configuration, raw events +# will **always** be logged to a file configured by `agent.logging.event_data.files`. + +# agent.logging.event_data: +# Logging to rotating files. Set agent.logging.to_files to false to disable logging to +# files. +#agent.logging.event_data.to_files: true +#agent.logging.event_data: + # Configure the path where the logs are written. The default is the logs directory + # under the home path (the binary location). + #path: /var/log/filebeat + + # The name of the files where the logs are written to. + #name: filebeat-event-data + + # Configure log file size limit. If the limit is reached, log file will be + # automatically rotated. + #rotateeverybytes: 5242880 # = 5MB + + # Number of rotated log files to keep. The oldest files will be deleted first. + #keepfiles: 2 + + # The permissions mask to apply when rotating log files. The default value is 0600. + # Must be a valid Unix-style file permissions mask expressed in octal notation. + #permissions: 0600 + + # Enable log file rotation on time intervals in addition to the size-based rotation. + # Intervals must be at least 1s. Values of 1m, 1h, 24h, 7*24h, 30*24h, and 365*24h + # are boundary-aligned with minutes, hours, days, weeks, months, and years as + # reported by the local system clock. All other intervals are calculated from the + # Unix epoch. Defaults to disabled. + #interval: 0 + + # Rotate existing logs on startup rather than appending them to the existing + # file. Defaults to false. + # rotateonstartup: false + {{template "providers.yml.tmpl" .}} diff --git a/_meta/config/elastic-agent.docker.yml.tmpl b/_meta/config/elastic-agent.docker.yml.tmpl index 134aecf3249..10f9c4147c8 100644 --- a/_meta/config/elastic-agent.docker.yml.tmpl +++ b/_meta/config/elastic-agent.docker.yml.tmpl @@ -18,17 +18,17 @@ inputs: data_stream.namespace: default use_output: default streams: - - metricsets: + - metricsets: - cpu # Dataset name must conform to the naming conventions for Elasticsearch indices, cannot contain dashes (-), and cannot exceed 100 bytes data_stream.dataset: system.cpu - - metricsets: + - metricsets: - memory data_stream.dataset: system.memory - - metricsets: + - metricsets: - network data_stream.dataset: system.network - - metricsets: + - metricsets: - filesystem data_stream.dataset: system.filesystem @@ -112,10 +112,25 @@ inputs: # logs: false # # enables metrics monitoring # metrics: false +# # metrics_period defines how frequent we should sample monitoring metrics. Default is 60 seconds. +# metrics_period: 60s # # exposes /debug/pprof/ endpoints # # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost # pprof.enabled: false # # exposes agent metrics using http, by default sockets and named pipes are used +# # +# # `http` Also exposes a /liveness endpoint that will return an HTTP code depending on agent status: +# # 200: Agent is healthy +# # 500: A component or unit is in a failed state +# # 503: The agent coordinator is unresponsive +# # +# # You can pass a `failon` parameter to the /liveness endpoint to determine what component state will result in a 500. +# # For example: `curl 'localhost:6792/liveness?failon=degraded'` will return 500 if a component is in a degraded state. +# # The possible values for `failon` are: +# # `degraded`: return an error if a component is in a degraded state or failed state, or if the agent coordinator is unresponsive. +# # `failed`: return an error if a unit is in a failed state, or if the agent coordinator is unresponsive. +# # `heartbeat`: return an error only if the agent coordinator is unresponsive. +# # If no `failon` parameter is provided, the default behavior is `failon=heartbeat` # http: # # enables http endpoint # enabled: false diff --git a/_meta/elastic-agent.yml b/_meta/elastic-agent.yml index b2be165ba2f..c25bffafae3 100644 --- a/_meta/elastic-agent.yml +++ b/_meta/elastic-agent.yml @@ -103,7 +103,15 @@ inputs: # logs: false # # enables metrics monitoring # metrics: false -# # exposes agent metrics using http, by default sockets and named pipes are used +# # Exposes agent metrics using http, by default sockets and named pipes are used. +# # Also exposes a /liveness endpoint that will return an HTTP code depending on agent status: +# # 200: Agent is healthy +# # 500: A component or unit is in a failed state +# # 503: The agent coordinator is unresponsive +# # You can pass a `failon` parameter to the /liveness endpoint to determine what component state will result in a 500. +# # For example: `curl 'localhost:6792/liveness?failon=degraded'` will return 500 if a component is in a degraded state. +# # The two possible values for `failon` are `degraded` and `failed`. If no `failon` parameter is provided, the default +# # behavior is `failon=failed` # http: # # enables http endpoint # enabled: false diff --git a/catalog-info.yaml b/catalog-info.yaml index 3aaff78787e..0a15a30bd02 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -42,15 +42,56 @@ spec: pipeline_file: ".buildkite/pipeline.yml" provider_settings: build_pull_request_forks: false - build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot + build_pull_requests: true build_tags: true filter_enabled: true filter_condition: >- build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null) cancel_intermediate_builds: true - cancel_intermediate_builds_branch_filter: '!main !7.* !8.* !9.*' + cancel_intermediate_builds_branch_filter: "!main !7.* !8.* !9.*" skip_intermediate_builds: true - skip_intermediate_builds_branch_filter: '!main !7.* !8.* !9.*' + skip_intermediate_builds_branch_filter: "!main !7.* !8.* !9.*" + env: + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: "true" + SLACK_NOTIFICATIONS_CHANNEL: "#ingest-notifications" + SLACK_NOTIFICATIONS_ALL_BRANCHES: "false" + SLACK_NOTIFICATIONS_ON_SUCCESS: "false" + teams: + ingest-fp: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: READ_ONLY + +--- +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: buildkite-pipeline-elastic-agent-testing + description: Buildkite pipeline for the Elastic Agent extended testing + links: + - title: Pipeline + url: https://buildkite.com/elastic/elastic-agent-extended-testing + +spec: + type: buildkite-pipeline + owner: group:ingest-fp + system: buildkite + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: elastic-agent-extended-testing + description: Buildkite pipeline for the Elastic Agent extended testing + spec: + repository: elastic/elastic-agent + pipeline_file: ".buildkite/integration.pipeline.yml" + provider_settings: + trigger_mode: none # don't trigger jobs from github activity + cancel_intermediate_builds: true + cancel_intermediate_builds_branch_filter: "!main !7.* !8.* !9.*" + skip_intermediate_builds: true + skip_intermediate_builds_branch_filter: "!main !7.* !8.* !9.*" env: ELASTIC_SLACK_NOTIFICATIONS_ENABLED: "true" SLACK_NOTIFICATIONS_CHANNEL: "#ingest-notifications" @@ -96,9 +137,9 @@ spec: filter_condition: >- build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null) cancel_intermediate_builds: true - cancel_intermediate_builds_branch_filter: '!main !7.* !8.* !9.*' + cancel_intermediate_builds_branch_filter: "!main !7.* !8.* !9.*" skip_intermediate_builds: true - skip_intermediate_builds_branch_filter: '!main !7.* !8.* !9.*' + skip_intermediate_builds_branch_filter: "!main !7.* !8.* !9.*" teams: ingest-fp: access_level: MANAGE_BUILD_AND_READ @@ -118,7 +159,7 @@ metadata: description: Buildkite pipeline for packaging Elastic Agent core binary and publish it to DRA links: - title: Pipeline - url: https://buildkite.com/elastic/elastic-agent + url: https://buildkite.com/elastic/elastic-agent-binary-dra spec: type: buildkite-pipeline @@ -131,13 +172,14 @@ spec: name: elastic-agent-binary-dra description: Buildkite pipeline for packaging Elastic Agent core binary and publish it to DRA spec: + branch_configuration: "main 7.* 8.* v7.* v8.*" pipeline_file: ".buildkite/pipeline.elastic-agent-binary-dra.yml" provider_settings: build_pull_request_forks: false build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot publish_commit_status: false # do not update status of commits for this pipeline build_tags: false - build_branches: false + build_branches: true # enable build for branches. This relies on the filter in .buildkite/pipeline.elastic-agent-binary-dra.yml filter_enabled: true filter_condition: >- build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null) @@ -172,7 +214,7 @@ spec: kind: Pipeline metadata: name: elastic-agent-gce-cleanup - description: Buildkite pipeline for packaging Elastic Agent core binary and publish it to DRA + description: Pipeline file for cleaning up lingering GCE instances spec: pipeline_file: ".buildkite/pipeline.elastic-agent-gce-cleanup.yml" provider_settings: @@ -186,10 +228,10 @@ spec: build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null) repository: elastic/elastic-agent schedules: - Daily main: + Every 4 hours: branch: main - cronline: "@daily" - message: Daily GCE cleanup + cronline: "0 0/4 * * *" # every 4th hour + message: GCE cleanup teams: ingest-fp: access_level: MANAGE_BUILD_AND_READ diff --git a/changelog/fragments/1707781046-Agent-beats-grpc-comms-over-domain-socket-named-pipe.yaml b/changelog/fragments/1707781046-Agent-beats-grpc-comms-over-domain-socket-named-pipe.yaml new file mode 100644 index 00000000000..1059058a754 --- /dev/null +++ b/changelog/fragments/1707781046-Agent-beats-grpc-comms-over-domain-socket-named-pipe.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: Agent/beats grpc comms over domain socket/named pipe + +# 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: + +# 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/4249 + +# 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/4248 diff --git a/changelog/fragments/1708628530-add-monitoring-beats-to-metrics.yaml b/changelog/fragments/1708628530-add-monitoring-beats-to-metrics.yaml new file mode 100644 index 00000000000..58f6b85ac1a --- /dev/null +++ b/changelog/fragments/1708628530-add-monitoring-beats-to-metrics.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 monitoring beats to usage metrics reporting + +# 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: monitoring + +# 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/4326 + +# 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/4082 diff --git a/changelog/fragments/1709656001-logshints.yaml b/changelog/fragments/1709656001-logshints.yaml new file mode 100644 index 00000000000..a600168c28a --- /dev/null +++ b/changelog/fragments/1709656001-logshints.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: Introduce log message for not supported annotations for Hints based autodiscover + +# 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: 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/elastic/elastic-agent/pull/4360 + +# 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/3064 diff --git a/changelog/fragments/1710868294-ucfg-parser-fix.yaml b/changelog/fragments/1710868294-ucfg-parser-fix.yaml new file mode 100644 index 00000000000..e87bd902e71 --- /dev/null +++ b/changelog/fragments/1710868294-ucfg-parser-fix.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: ucfg-parser-fix + +# 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: Fix config unpacking when config strings contain list-like passages + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +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/elastic/elastic-agent/pull/4436 + +# 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/1711355973-Introduce-non-grouping-for-input-spec.yaml b/changelog/fragments/1711355973-Introduce-non-grouping-for-input-spec.yaml new file mode 100644 index 00000000000..371b83edbba --- /dev/null +++ b/changelog/fragments/1711355973-Introduce-non-grouping-for-input-spec.yaml @@ -0,0 +1,34 @@ +# 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: Introduce isolate units for input spec. + +# 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: | + Introduce a new flag in the spec that will allow to disable grouping of same input type inputs into a single component. + If that flag is being activated the inputs won't be grouped and we will create a separate component for each input that will run units for that particular input. + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +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/elastic/elastic-agent/pull/4476 + +# 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/security-team/issues/8669 diff --git a/changelog/fragments/1711474205-Reduce-false-positives-in-logging-an-API-switch-request-from-Fleet-server.yaml b/changelog/fragments/1711474205-Reduce-false-positives-in-logging-an-API-switch-request-from-Fleet-server.yaml new file mode 100644 index 00000000000..cffee004c9a --- /dev/null +++ b/changelog/fragments/1711474205-Reduce-false-positives-in-logging-an-API-switch-request-from-Fleet-server.yaml @@ -0,0 +1,34 @@ +# 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: Reduce false positives in logging an API switch request from Fleet server + +# 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 +pr: https://github.com/elastic/elastic-agent/pull/4481 + +# 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 +issue: https://github.com/elastic/elastic-agent/issues/4477 diff --git a/changelog/fragments/1711653910-add-liveness-endpoint.yaml b/changelog/fragments/1711653910-add-liveness-endpoint.yaml new file mode 100644 index 00000000000..058e99b088c --- /dev/null +++ b/changelog/fragments/1711653910-add-liveness-endpoint.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: Add a configurable /liveness endpoint. + +# 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: Adds a liveness endpoint suitable for use as a k8s liveness probe. + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: monitoring + +# 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/4499 + +# 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/1704304944-Upgrade-to-Go-1.21.8.yaml b/changelog/fragments/1712176768-Upgrade-to-Go-1.21.11.yaml similarity index 90% rename from changelog/fragments/1704304944-Upgrade-to-Go-1.21.8.yaml rename to changelog/fragments/1712176768-Upgrade-to-Go-1.21.11.yaml index 4ceb59d5439..bf98fd8e261 100644 --- a/changelog/fragments/1704304944-Upgrade-to-Go-1.21.8.yaml +++ b/changelog/fragments/1712176768-Upgrade-to-Go-1.21.11.yaml @@ -11,12 +11,12 @@ kind: security # Change summary; a 80ish characters long description of the change. -summary: Upgrade to Go 1.21.8 +summary: Upgrade to Go 1.21.11. # 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: Removes support for Windows 8.1. See https://tip.golang.org/doc/go1.21#windows. +#description: # Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. component: "elastic-agent" @@ -25,7 +25,7 @@ component: "elastic-agent" # 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/4361 +pr: https://github.com/elastic/elastic-agent/pull/4855 # 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. diff --git a/changelog/fragments/1712305270-fix-upgrade-cmd-fail-when-disconnected.yaml b/changelog/fragments/1712305270-fix-upgrade-cmd-fail-when-disconnected.yaml new file mode 100644 index 00000000000..6158a0c6f92 --- /dev/null +++ b/changelog/fragments/1712305270-fix-upgrade-cmd-fail-when-disconnected.yaml @@ -0,0 +1,5 @@ +kind: bug-fix +summary: Fix failing upgrade command when gRPC server interrupts connection +component: "elastic-agent" +pr: https://github.com/elastic/elastic-agent/pull/4519 +issue: https://github.com/elastic/elastic-agent/issues/3890 diff --git a/changelog/fragments/1712324173-improve-enroll-stability.yaml b/changelog/fragments/1712324173-improve-enroll-stability.yaml new file mode 100644 index 00000000000..52669b0e7ad --- /dev/null +++ b/changelog/fragments/1712324173-improve-enroll-stability.yaml @@ -0,0 +1,5 @@ +kind: enhancement +summary: Make enroll command more stable by handling temporary server errors +component: elastic-agent +pr: https://github.com/elastic/elastic-agent/pull/4523 +issue: https://github.com/elastic/elastic-agent/issues/4513 diff --git a/changelog/fragments/1712583231-leader-election-issue.yaml b/changelog/fragments/1712583231-leader-election-issue.yaml new file mode 100644 index 00000000000..d5980be668f --- /dev/null +++ b/changelog/fragments/1712583231-leader-election-issue.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 issue where kubernetes_leaderelection provider would not try to reacquire the lease once lost + +# 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: 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/elastic/elastic-agent/pull/4542 + +# 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/4543 diff --git a/changelog/fragments/1712737337-always-launch-more-recent-watcher.yaml b/changelog/fragments/1712737337-always-launch-more-recent-watcher.yaml new file mode 100644 index 00000000000..a3ee6b64019 --- /dev/null +++ b/changelog/fragments/1712737337-always-launch-more-recent-watcher.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: Always select the more recent watcher during agent upgrade/downgrade + +# 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/elastic/elastic-agent/pull/4491 + +# 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/1712935205-Log-raw-events-to-a-separate-log-file.yaml b/changelog/fragments/1712935205-Log-raw-events-to-a-separate-log-file.yaml new file mode 100644 index 00000000000..427c8cbbbba --- /dev/null +++ b/changelog/fragments/1712935205-Log-raw-events-to-a-separate-log-file.yaml @@ -0,0 +1,36 @@ +# 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: Log raw events to a separate log file + +# 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: | + Log entries from Elastic-Agent inputs containing event data are now + directed to a different file under the 'events' folder in the logs + directory. This file is not sent to the monitoring output, however + it can be retrieved by collecting a diagnostics. + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +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/elastic/elastic-agent/pull/4549 + +# 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/1712949156-Switch-to-agentbeat.yaml b/changelog/fragments/1712949156-Switch-to-agentbeat.yaml new file mode 100644 index 00000000000..5f6f7c1862c --- /dev/null +++ b/changelog/fragments/1712949156-Switch-to-agentbeat.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: Reduce the overall download and on-disk size of the Elastic Agent + +# 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/4516 + +# 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/3364 diff --git a/changelog/fragments/1713157536-upgrade-otel-collector-contrib-package.yaml b/changelog/fragments/1713157536-upgrade-otel-collector-contrib-package.yaml new file mode 100644 index 00000000000..a2462ad409f --- /dev/null +++ b/changelog/fragments/1713157536-upgrade-otel-collector-contrib-package.yaml @@ -0,0 +1,30 @@ +# 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: security + +# Change summary; a 80ish characters long description of the change. +summary: Upgraded otel-collector-contrib 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; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +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/elastic/elastic-agent/pull/4572 +# 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/1713257367-Remove-beat-state-metricset-from-elastic-agent-monitoring.yaml b/changelog/fragments/1713257367-Remove-beat-state-metricset-from-elastic-agent-monitoring.yaml new file mode 100644 index 00000000000..a76034e8571 --- /dev/null +++ b/changelog/fragments/1713257367-Remove-beat-state-metricset-from-elastic-agent-monitoring.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: Removed beat state metricset from monitoring metrics + +# 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: Removing beat state metricsets reduces the document count of indices metrics-elastic_agent.*-* by 50%, saving around 13% disk space + +# 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/elastic/elastic-agent/pull/4579 + +# 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/1713289288-Removed-cloud-defend-from-.tar.gz-archives.yaml b/changelog/fragments/1713289288-Removed-cloud-defend-from-.tar.gz-archives.yaml new file mode 100644 index 00000000000..05ea2b962fb --- /dev/null +++ b/changelog/fragments/1713289288-Removed-cloud-defend-from-.tar.gz-archives.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: Removed cloud-defend from .tar.gz archives, now it only appears in docker images + +# 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/elastic/elastic-agent/pull/4584 + +# 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/1713946896-remove-mandatory-ns-node-permissions.yaml b/changelog/fragments/1713946896-remove-mandatory-ns-node-permissions.yaml new file mode 100644 index 00000000000..39e669d972d --- /dev/null +++ b/changelog/fragments/1713946896-remove-mandatory-ns-node-permissions.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: Handle the starting of namespace and node watchers for metadata enrichment according to `add_resource_metadata` and hints configuration. + +# 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: 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/elastic/elastic-agent/pull/4618 + +# 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/1714505172-Send-fleet-server-component-output-under-bootstrap-key.yaml b/changelog/fragments/1714505172-Send-fleet-server-component-output-under-bootstrap-key.yaml new file mode 100644 index 00000000000..0e439823baa --- /dev/null +++ b/changelog/fragments/1714505172-Send-fleet-server-component-output-under-bootstrap-key.yaml @@ -0,0 +1,36 @@ +# 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: Fleet Server component now uses policy output configuration to communicate with Elasticsearch + +# 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: | + Alter how elatic-agent passes the fleet-server output component so that the policy's output is used. + In cases where fleet-server encounters an error when trying to use the policy's output it will use + the configuration specified during enrollment as a fallback. In cases where it uses the fallback + the policy's output is periodically retested and used if it's successful. + +# 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/elastic/elastic-agent/pull/4643 + +# 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/issue/2784 diff --git a/changelog/fragments/1714717717-Reduce-agent-logs-by-default.yaml b/changelog/fragments/1714717717-Reduce-agent-logs-by-default.yaml new file mode 100644 index 00000000000..99436a70a45 --- /dev/null +++ b/changelog/fragments/1714717717-Reduce-agent-logs-by-default.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: Reduce agent logs by default by dropping "Non-zero metrics..." logs before ES ingestion + +# 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/elastic/elastic-agent/pull/4633 + +# 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/4252 diff --git a/changelog/fragments/1715158488-use-snapshot-api.yaml b/changelog/fragments/1715158488-use-snapshot-api.yaml new file mode 100644 index 00000000000..41ae3d3bd0d --- /dev/null +++ b/changelog/fragments/1715158488-use-snapshot-api.yaml @@ -0,0 +1,5 @@ +kind: enhancement +summary: Use more stable snapshot API for upgrades to snapshot versions +component: "elastic-agent" +pr: https://github.com/elastic/elastic-agent/pull/4693 +issue: https://github.com/elastic/elastic-agent/issues/4458 diff --git a/changelog/fragments/1715178093-otel-mode-add-filter-processor.yaml b/changelog/fragments/1715178093-otel-mode-add-filter-processor.yaml new file mode 100644 index 00000000000..5e5213094de --- /dev/null +++ b/changelog/fragments/1715178093-otel-mode-add-filter-processor.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: Makes the `filterprocessor` available to users running Elastic Agent in `otel` mode. + +# 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: 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/elastic/elastic-agent/pull/4708 + +# 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/1715178161-otel-mode-add-elasticsearch-exporter.yaml b/changelog/fragments/1715178161-otel-mode-add-elasticsearch-exporter.yaml new file mode 100644 index 00000000000..54c0320839f --- /dev/null +++ b/changelog/fragments/1715178161-otel-mode-add-elasticsearch-exporter.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: Makes the `elasticsearchexporter` available to users running Elastic Agent in `otel` mode. + +# 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: 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/elastic/elastic-agent/pull/4707 + +# 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/1715257644-Set-log-level-from-fleet-policy.yaml b/changelog/fragments/1715257644-Set-log-level-from-fleet-policy.yaml new file mode 100644 index 00000000000..3d2376971b4 --- /dev/null +++ b/changelog/fragments/1715257644-Set-log-level-from-fleet-policy.yaml @@ -0,0 +1,45 @@ +# 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: Set log level from fleet policy + +# 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: > + Enables setting agent logging level in policy. Setting a valid + log level (same values allowed for setting log level on the specific agent) + in fleet policy under `agent.logging.level` key will cause the agent to + change its logging level, unless an override is set for the specific + elastic-agent using a `settings` action. + + The order of priority of log level for a fleet managed agent is: + + 1. log level set specifically to the agent via settings action, if any + + 2. log level specified in fleet policy, if any + + 3. default hard-coded log level for elastic-agent + +# 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/elastic/elastic-agent/pull/3090 + +# 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/2851 diff --git a/changelog/fragments/1715259944-Add-agent-info.yaml-to-diagnostics-bundle.yaml b/changelog/fragments/1715259944-Add-agent-info.yaml-to-diagnostics-bundle.yaml new file mode 100644 index 00000000000..4206a626229 --- /dev/null +++ b/changelog/fragments/1715259944-Add-agent-info.yaml-to-diagnostics-bundle.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 agent-info.yaml to diagnostics bundle + +# 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/4725 + +# 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/4439 diff --git a/changelog/fragments/1715266075-Add-unprivileged-and-privileged-switch-commands.yaml b/changelog/fragments/1715266075-Add-unprivileged-and-privileged-switch-commands.yaml new file mode 100644 index 00000000000..2ab89cc0e65 --- /dev/null +++ b/changelog/fragments/1715266075-Add-unprivileged-and-privileged-switch-commands.yaml @@ -0,0 +1,34 @@ +# 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 unprivileged and privileged switch commands + +# 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: | + Adds ability to switch between privileged and unprivileged mode using the privileged and unprivileged + subcommands respectively. + +# 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/4621 + +# 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/ingest-dev/issues/2790 diff --git a/changelog/fragments/1715266989-Make-delayed-enrollment-try-indefinitely.yaml b/changelog/fragments/1715266989-Make-delayed-enrollment-try-indefinitely.yaml new file mode 100644 index 00000000000..5c6a7000763 --- /dev/null +++ b/changelog/fragments/1715266989-Make-delayed-enrollment-try-indefinitely.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: Make delayed enrollment try indefinitely + +# 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/4727 + +# 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/4716 diff --git a/changelog/fragments/1716227441-Fix-delay-enrollment-to-work-in-unprivileged-mode-on-Windows.yaml b/changelog/fragments/1716227441-Fix-delay-enrollment-to-work-in-unprivileged-mode-on-Windows.yaml new file mode 100644 index 00000000000..f21e31907ad --- /dev/null +++ b/changelog/fragments/1716227441-Fix-delay-enrollment-to-work-in-unprivileged-mode-on-Windows.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 delay enrollment to work in unprivileged mode on Windows + +# 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/4779 + +# 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/4678 diff --git a/changelog/fragments/1716320508-add-endpoint-monitoring.yaml b/changelog/fragments/1716320508-add-endpoint-monitoring.yaml new file mode 100644 index 00000000000..fd052449064 --- /dev/null +++ b/changelog/fragments/1716320508-add-endpoint-monitoring.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: Add monitoring of endpoint usage metrics + +# 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/4789 + +# 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/4083 \ No newline at end of file diff --git a/changelog/fragments/1716490302-Load-fleet.ssl.certificate_authorities-from-agent-policy.yaml b/changelog/fragments/1716490302-Load-fleet.ssl.certificate_authorities-from-agent-policy.yaml new file mode 100644 index 00000000000..2161b5bc2b1 --- /dev/null +++ b/changelog/fragments/1716490302-Load-fleet.ssl.certificate_authorities-from-agent-policy.yaml @@ -0,0 +1,35 @@ +# 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: Load Certificate Authorities from Fleet policy + +# 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: > + Loads Certificate Authorities (CA) from Fleet policy's key `fleet.ssl.certificate_authorities` and pass it to + elastic-agent HTTP client used for connecting to Fleet server. The CAs will be used to validate server or proxy certificates + presented when connecting to `HTTPs` endpoints. + +# 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/elastic/elastic-agent/pull/4770 + +# 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/2247 diff --git a/changelog/fragments/1716490372-Load-fleet.ssl.certificate-and-fleet.ssl.key-from-agent-policy.yaml b/changelog/fragments/1716490372-Load-fleet.ssl.certificate-and-fleet.ssl.key-from-agent-policy.yaml new file mode 100644 index 00000000000..e924660a076 --- /dev/null +++ b/changelog/fragments/1716490372-Load-fleet.ssl.certificate-and-fleet.ssl.key-from-agent-policy.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: Load fleet.ssl.certificate and fleet.ssl.key from agent policy + +# 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/elastic/elastic-agent/pull/4770 + +# 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/2248 diff --git a/changelog/fragments/1716543099-add-otel-resource-detection-processor.yaml b/changelog/fragments/1716543099-add-otel-resource-detection-processor.yaml new file mode 100644 index 00000000000..1c06a3f0629 --- /dev/null +++ b/changelog/fragments/1716543099-add-otel-resource-detection-processor.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: Makes the `resourcedetection` processor available to users running Elastic Agent in `otel` mode. + +# 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: 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/changelog/fragments/1716543533-add-cloudbeat-asset-inventory-aws.yaml b/changelog/fragments/1716543533-add-cloudbeat-asset-inventory-aws.yaml new file mode 100644 index 00000000000..86e93455c4d --- /dev/null +++ b/changelog/fragments/1716543533-add-cloudbeat-asset-inventory-aws.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: Add cloudbeat asset inventory aws + +# 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: cloudbeat + +# 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/1717077736-otelcol-shortcut.yaml b/changelog/fragments/1717077736-otelcol-shortcut.yaml new file mode 100644 index 00000000000..67d623679b2 --- /dev/null +++ b/changelog/fragments/1717077736-otelcol-shortcut.yaml @@ -0,0 +1,31 @@ +# 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 otelcol shortuct to elastic-agent otel + +# 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: 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/elastic/elastic-agent/pull/4816 +# 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/1717185708-Stop-creating-a-zombie-process-on-each-restart.yaml b/changelog/fragments/1717185708-Stop-creating-a-zombie-process-on-each-restart.yaml new file mode 100644 index 00000000000..f0b79fbe097 --- /dev/null +++ b/changelog/fragments/1717185708-Stop-creating-a-zombie-process-on-each-restart.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: Stop creating a zombie process on each restart. + +# 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: "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/elastic/elastic-agent/pull/4834 + +# 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/1717516439-Capture-early-errors-on-Windows.yaml b/changelog/fragments/1717516439-Capture-early-errors-on-Windows.yaml new file mode 100644 index 00000000000..76a40a2c513 --- /dev/null +++ b/changelog/fragments/1717516439-Capture-early-errors-on-Windows.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: Capture early errors on Windows in Application eventlog. + +# 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/elastic/elastic-agent/pull/4846 + +# 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/4627 diff --git a/changelog/fragments/1717523676-Add-benchmark-input.yaml b/changelog/fragments/1717523676-Add-benchmark-input.yaml new file mode 100644 index 00000000000..49a9ad52334 --- /dev/null +++ b/changelog/fragments/1717523676-Add-benchmark-input.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 benchmark input + +# 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/elastic/beats/pull/39789 + +# 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/1717939159-add-k8sattributesprocessor.yaml b/changelog/fragments/1717939159-add-k8sattributesprocessor.yaml new file mode 100644 index 00000000000..d1fe094de00 --- /dev/null +++ b/changelog/fragments/1717939159-add-k8sattributesprocessor.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: add-k8sattributesprocessor + +# 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/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/1718138001-Fix-possible-crash-in-reading-component-logs.yaml b/changelog/fragments/1718138001-Fix-possible-crash-in-reading-component-logs.yaml new file mode 100644 index 00000000000..e62b32a0e78 --- /dev/null +++ b/changelog/fragments/1718138001-Fix-possible-crash-in-reading-component-logs.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 possible crash in reading component logs + +# 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: 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/elastic/elastic-agent/pull/4910 + +# 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/4907 diff --git a/changelog/fragments/1718200496-Add-unprivileged-mode-support.yaml b/changelog/fragments/1718200496-Add-unprivileged-mode-support.yaml new file mode 100644 index 00000000000..3fa5df5f0da --- /dev/null +++ b/changelog/fragments/1718200496-Add-unprivileged-mode-support.yaml @@ -0,0 +1,34 @@ +# 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 unprivileged mode support (beta) + +# 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 new --unprivileged installation option. This option installs the Elastic Agent as a non-root or non-Administrator + user that has limited permissions on the host. + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +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/changelog/fragments/1718226176-Ensure.yaml b/changelog/fragments/1718226176-Ensure.yaml new file mode 100644 index 00000000000..e9d105b6d54 --- /dev/null +++ b/changelog/fragments/1718226176-Ensure.yaml @@ -0,0 +1,35 @@ +# 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: Ensure socket can be created even when STATE_PATH is too long for container command + +# 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: | + When running the Elastic-Agent container command and `STATE_PATH` is + set to a value that is too long the Unix socket cannot be created, + so the Elastic-Agent will use the default state path instead. + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +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/elastic/elastic-agent/pull/4909 + +# 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/1718268915-increase-remove-timeout.yaml b/changelog/fragments/1718268915-increase-remove-timeout.yaml new file mode 100644 index 00000000000..46369d8749c --- /dev/null +++ b/changelog/fragments/1718268915-increase-remove-timeout.yaml @@ -0,0 +1,3 @@ +kind: bug-fix +summary: Increase removal timeout when uninstall +component: "elastic-agent" diff --git a/changelog/fragments/1718660806-Add-diagnostics-skip-conn-flag.yaml b/changelog/fragments/1718660806-Add-diagnostics-skip-conn-flag.yaml new file mode 100644 index 00000000000..bc4fcd73ac1 --- /dev/null +++ b/changelog/fragments/1718660806-Add-diagnostics-skip-conn-flag.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 diagnostics skip-conn flag + +# 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 --skip-conn flag to elastic-agent diagnostics subcommand to skip collecting connection request diagnostics. + +# 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/elastic/elastic-agent/pull/4946 + +# 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/1718818524-support-monitoring-metrics-interval.yaml b/changelog/fragments/1718818524-support-monitoring-metrics-interval.yaml new file mode 100644 index 00000000000..dd7c7c3557e --- /dev/null +++ b/changelog/fragments/1718818524-support-monitoring-metrics-interval.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: Allow configuring `agent.monitoring.metrics_period`. + +# 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: 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/elastic/elastic-agent/pull/4961 + +# 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/1718863753-otel-add-elastic-infra-metrics-processor.yaml b/changelog/fragments/1718863753-otel-add-elastic-infra-metrics-processor.yaml new file mode 100644 index 00000000000..0ac7bea2e83 --- /dev/null +++ b/changelog/fragments/1718863753-otel-add-elastic-infra-metrics-processor.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: Makes the `elasticinframetrics` processor available to users running Elastic Agent in `otel` mode. + +# 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: 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 60a442d48ae..547d9f7022b 100644 --- a/control_v2.proto +++ b/control_v2.proto @@ -167,6 +167,8 @@ message StateAgentInfo { bool snapshot = 5; // Current running PID. int32 pid = 6; + // True when running as unprivileged. + bool unprivileged = 7; } // StateResponse is the current state of Elastic Agent. @@ -258,6 +260,7 @@ message DiagnosticAgentRequest { // DiagnosticAgentRequestAdditional is an enum of additional diagnostic metrics that can be requested from Elastic Agent. enum AdditionalDiagnosticRequest { CPU = 0; + CONN = 1; } // DiagnosticComponentsRequest is the message to request diagnostics from individual components. diff --git a/deploy/kubernetes/Makefile b/deploy/kubernetes/Makefile index d02fc6eeb38..a88fc0dca02 100644 --- a/deploy/kubernetes/Makefile +++ b/deploy/kubernetes/Makefile @@ -54,7 +54,7 @@ endef ## ci-clone-kibana-repository : Clone Kibana Repository and copy new files for the PR .PHONY: ci-clone-kibana-repository ci-clone-kibana-repository: - git clone git@github.com:elastic/kibana.git + git clone https://github.com/elastic/kibana.git cp $(FILE_REPO) $(ELASTIC_AGENT_REPO)/$(ELASTIC_AGENT_REPO_PATH) ## ci-create-kubernetes-templates-pull-request : Create the pull request for the kubernetes templates @@ -62,9 +62,10 @@ $(eval HASDIFF =$(shell sh -c "git status | grep $(FILE_REPO) | wc -l")) .PHONY: ci-create-kubernetes-templates-pull-request ci-create-kubernetes-templates-pull-request: ifeq ($(HASDIFF),1) - echo "INFO: Create branch to update k8s templates" - git config user.name obscloudnativemonitoring - git config user.email obs-cloudnative-monitoring@elastic.co + echo "INFO: Create branch to update k8s templates" + @git config user.name "${GITHUB_USERNAME_SECRET}" + @git config user.email "${GITHUB_EMAIL_SECRET}" + @git config remote.origin.url "https://${GITHUB_USERNAME_SECRET}:${GITHUB_TOKEN_SECRET}@github.com/elastic/kibana.git" git checkout -b $(ELASTIC_AGENT_BRANCH) echo "INFO: add files if any" git add $(ELASTIC_AGENT_REPO_PATH)$(FILE_REPO) @@ -79,7 +80,7 @@ else echo "INFO: push branch" @git push --set-upstream origin $(ELASTIC_AGENT_BRANCH) echo "INFO: create pull request" - @gh pr create \ + @GITHUB_TOKEN=$(GITHUB_TOKEN_SECRET) gh pr create \ --title "Update kubernetes templates for elastic-agent" \ --body "Automated by ${BUILDKITE_BUILD_URL}" \ --label automation \ diff --git a/deploy/kubernetes/creator_k8s_manifest.sh b/deploy/kubernetes/creator_k8s_manifest.sh index e63c7a0b16b..d91ad0eb706 100755 --- a/deploy/kubernetes/creator_k8s_manifest.sh +++ b/deploy/kubernetes/creator_k8s_manifest.sh @@ -34,7 +34,7 @@ cat << EOF > $OUTPUT_FILE * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - + export const elasticAgentStandaloneManifest = \`--- EOF @@ -48,6 +48,7 @@ EOF cat $MANIFEST_PATH/$MANAGED >> $OUTPUT_FILE echo -n "\`;" >> $OUTPUT_FILE +echo "" >> $OUTPUT_FILE #Replacing all occurencies of elastic-agent-standalone sed -i -e 's/elastic-agent-standalone/elastic-agent/g' $OUTPUT_FILE diff --git a/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml b/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml index 3a9d2e6907c..8401e6a97d3 100644 --- a/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml +++ b/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml @@ -30,7 +30,7 @@ spec: dnsPolicy: ClusterFirstWithHostNet containers: - name: elastic-agent - image: docker.elastic.co/beats/elastic-agent:8.14.0 + image: docker.elastic.co/beats/elastic-agent:8.15.0 env: # Set to 1 for enrollment into Fleet server. If not set, Elastic Agent is run in standalone mode - name: FLEET_ENROLL diff --git a/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml b/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml index cb1f5802eac..e8db85281c3 100644 --- a/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml +++ b/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml @@ -692,19 +692,21 @@ spec: # Uncomment if using hints feature #initContainers: # - name: k8s-templates-downloader - # image: busybox:1.28 - # command: ['sh'] + # image: docker.elastic.co/beats/elastic-agent:8.15.0 + # command: ['bash'] # args: # - -c # - >- - # mkdir -p /etc/elastic-agent/inputs.d && - # wget -O - https://github.com/elastic/elastic-agent/archive/8.14.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-8.14/deploy/kubernetes/elastic-agent-standalone/templates.d" + # mkdir -p /usr/share/elastic-agent/state/inputs.d && + # curl -sL https://github.com/elastic/elastic-agent/archive/8.15.tar.gz | tar xz -C /usr/share/elastic-agent/state/inputs.d --strip=5 "elastic-agent-8.15/deploy/kubernetes/elastic-agent-standalone/templates.d" + # securityContext: + # runAsUser: 0 # volumeMounts: - # - name: external-inputs - # mountPath: /etc/elastic-agent/inputs.d + # - name: elastic-agent-state + # mountPath: /usr/share/elastic-agent/state containers: - name: elastic-agent-standalone - image: docker.elastic.co/beats/elastic-agent:8.14.0 + image: docker.elastic.co/beats/elastic-agent:8.15.0 args: ["-c", "/etc/elastic-agent/agent.yml", "-e"] env: # The basic authentication username used to connect to Elasticsearch @@ -725,8 +727,6 @@ spec: valueFrom: fieldRef: fieldPath: metadata.name - - name: STATE_PATH - value: "/etc/elastic-agent" # The following ELASTIC_NETINFO:false variable will disable the netinfo.enabled option of add-host-metadata processor. This will remove fields host.ip and host.mac. # For more info: https://www.elastic.co/guide/en/beats/metricbeat/current/add-host-metadata.html - name: ELASTIC_NETINFO @@ -760,9 +760,6 @@ spec: mountPath: /etc/elastic-agent/agent.yml readOnly: true subPath: agent.yml - # Uncomment if using hints feature - #- name: external-inputs - # mountPath: /etc/elastic-agent/inputs.d - name: proc mountPath: /hostfs/proc readOnly: true @@ -793,9 +790,6 @@ spec: configMap: defaultMode: 0640 name: agent-node-datastreams - # Uncomment if using hints feature - #- name: external-inputs - # emptyDir: {} - name: proc hostPath: path: /proc diff --git a/deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset.yaml b/deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset.yaml index 674ab8425dd..f5c86a0d4a0 100644 --- a/deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset.yaml +++ b/deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset.yaml @@ -28,16 +28,18 @@ spec: # Uncomment if using hints feature #initContainers: # - name: k8s-templates-downloader - # image: busybox:1.28 - # command: ['sh'] + # image: docker.elastic.co/beats/elastic-agent:%VERSION% + # command: ['bash'] # args: # - -c # - >- - # mkdir -p /etc/elastic-agent/inputs.d && - # wget -O - https://github.com/elastic/elastic-agent/archive/%BRANCH%.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-%BRANCH%/deploy/kubernetes/elastic-agent-standalone/templates.d" + # mkdir -p /usr/share/elastic-agent/state/inputs.d && + # curl -sL https://github.com/elastic/elastic-agent/archive/%BRANCH%.tar.gz | tar xz -C /usr/share/elastic-agent/state/inputs.d --strip=5 "elastic-agent-%BRANCH%/deploy/kubernetes/elastic-agent-standalone/templates.d" + # securityContext: + # runAsUser: 0 # volumeMounts: - # - name: external-inputs - # mountPath: /etc/elastic-agent/inputs.d + # - name: elastic-agent-state + # mountPath: /usr/share/elastic-agent/state containers: - name: elastic-agent-standalone image: docker.elastic.co/beats/elastic-agent:%VERSION% @@ -61,8 +63,6 @@ spec: valueFrom: fieldRef: fieldPath: metadata.name - - name: STATE_PATH - value: "/etc/elastic-agent" # The following ELASTIC_NETINFO:false variable will disable the netinfo.enabled option of add-host-metadata processor. This will remove fields host.ip and host.mac. # For more info: https://www.elastic.co/guide/en/beats/metricbeat/current/add-host-metadata.html - name: ELASTIC_NETINFO @@ -96,9 +96,6 @@ spec: mountPath: /etc/elastic-agent/agent.yml readOnly: true subPath: agent.yml - # Uncomment if using hints feature - #- name: external-inputs - # mountPath: /etc/elastic-agent/inputs.d - name: proc mountPath: /hostfs/proc readOnly: true @@ -129,9 +126,6 @@ spec: configMap: defaultMode: 0640 name: agent-node-datastreams - # Uncomment if using hints feature - #- name: external-inputs - # emptyDir: {} - name: proc hostPath: path: /proc diff --git a/dev-tools/mage/manifest/manifest.go b/dev-tools/mage/manifest/manifest.go index 002492faa3c..7cd3336d1ac 100644 --- a/dev-tools/mage/manifest/manifest.go +++ b/dev-tools/mage/manifest/manifest.go @@ -85,7 +85,7 @@ func resolveManifestPackage(project tools.Project, pkg string, reqPackage string func DownloadComponentsFromManifest(manifest string, platforms []string, platformPackages map[string]string, dropPath string) error { componentSpec := map[string][]string{ "apm-server": {"apm-server"}, - "beats": {"auditbeat", "filebeat", "heartbeat", "metricbeat", "osquerybeat", "packetbeat"}, + "beats": {"agentbeat"}, "cloud-defend": {"cloud-defend"}, "cloudbeat": {"cloudbeat"}, "elastic-agent-shipper": {"elastic-agent-shipper"}, @@ -130,7 +130,7 @@ func DownloadComponentsFromManifest(manifest string, platforms []string, platfor downloadTarget := filepath.Join(targetPath, pkgFilename) if _, err := os.Stat(downloadTarget); err != nil { errGrp.Go(func(ctx context.Context, url, target string) func() error { - return func() error { return downloadPackage(ctx, url, target) } + return func() error { return DownloadPackage(ctx, url, target) } }(downloadsCtx, p, downloadTarget)) } } @@ -150,7 +150,7 @@ func DownloadComponentsFromManifest(manifest string, platforms []string, platfor return nil } -func downloadPackage(ctx context.Context, downloadUrl string, target string) error { +func DownloadPackage(ctx context.Context, downloadUrl string, target string) error { parsedURL, errorUrl := url.Parse(downloadUrl) if errorUrl != nil { return errorInvalidManifestURL diff --git a/dev-tools/mage/pkgtypes.go b/dev-tools/mage/pkgtypes.go index 49591269140..fe2d63750ce 100644 --- a/dev-tools/mage/pkgtypes.go +++ b/dev-tools/mage/pkgtypes.go @@ -17,6 +17,7 @@ import ( "reflect" "regexp" "runtime" + "slices" "strconv" "strings" @@ -904,15 +905,27 @@ func addFileToZip(ar *zip.Writer, baseDir string, pkgFile PackageFile) error { // addFileToTar adds a file (or directory) to a tar archive. func addFileToTar(ar *tar.Writer, baseDir string, pkgFile PackageFile) error { + excludedFiles := []string{ + "cloud-defend", + "cloud-defend.spec.yml", + } + return filepath.Walk(pkgFile.Source, func(path string, info os.FileInfo, err error) error { if err != nil { if pkgFile.SkipOnMissing && os.IsNotExist(err) { return nil } - return err } + if slices.Contains(excludedFiles, info.Name()) { + // it's a file we have to exclude + if mg.Verbose() { + log.Printf("Skipping file %q...", path) + } + return nil + } + header, err := tar.FileInfoHeader(info, info.Name()) if err != nil { return err diff --git a/dev-tools/mage/settings.go b/dev-tools/mage/settings.go index 63e70098726..a44f435fb67 100644 --- a/dev-tools/mage/settings.go +++ b/dev-tools/mage/settings.go @@ -41,9 +41,15 @@ const ( elasticAgentModulePath = "github.com/elastic/elastic-agent" + defaultName = "elastic-agent" + // Env vars // agent package version agentPackageVersionEnvVar = "AGENT_PACKAGE_VERSION" + //ManifestUrlEnvVar is the name fo the environment variable containing the Manifest URL to be used for packaging agent + ManifestUrlEnvVar = "MANIFEST_URL" + // AgentCommitHashEnvVar allows to override agent commit hash string during packaging + AgentCommitHashEnvVar // Mapped functions agentPackageVersionMappedFunc = "agent_package_version" @@ -69,7 +75,7 @@ var ( // the crossbuild images at /go/pkg/mod, read-only, when set to true. CrossBuildMountModcache = true - BeatName = EnvOr("BEAT_NAME", filepath.Base(CWD())) + BeatName = EnvOr("BEAT_NAME", defaultName) BeatServiceName = EnvOr("BEAT_SERVICE_NAME", BeatName) BeatIndexPrefix = EnvOr("BEAT_INDEX_PREFIX", BeatName) BeatDescription = EnvOr("BEAT_DESCRIPTION", "") @@ -152,7 +158,7 @@ func initGlobals() { agentPackageVersion = EnvOr(agentPackageVersionEnvVar, "") - ManifestURL = EnvOr("ManifestURL", "") + ManifestURL = EnvOr(ManifestUrlEnvVar, "") PackagingFromManifest = ManifestURL != "" } @@ -281,7 +287,12 @@ var ( func CommitHash() (string, error) { var err error commitHashOnce.Do(func() { - commitHash, err = sh.Output("git", "rev-parse", "HEAD") + // Check commit hash override first + commitHash = EnvOr(AgentCommitHashEnvVar, "") + if commitHash == "" { + // no override found, get the hash from HEAD + commitHash, err = sh.Output("git", "rev-parse", "HEAD") + } }) return commitHash, err } diff --git a/dev-tools/notice/overrides.json b/dev-tools/notice/overrides.json index 2773fcadad4..1060128993c 100644 --- a/dev-tools/notice/overrides.json +++ b/dev-tools/notice/overrides.json @@ -16,3 +16,4 @@ {"name": "kernel.org/pub/linux/libs/security/libcap/cap", "licenceType": "BSD-3-Clause", "note": "dual licensed as GPL-v2 and BSD"} {"name": "kernel.org/pub/linux/libs/security/libcap/psx", "licenceType": "BSD-3-Clause", "note": "dual licensed as GPL-v2 and BSD"} {"name": "github.com/awslabs/kinesis-aggregation/go", "licenceType": "Apache-2.0", "url": "https://github.com/awslabs/kinesis-aggregation/blob/master/LICENSE.txt"} +{"name": "github.com/pascaldekloe/goe", "licenceFile": "LICENSE", "licenceType": "CC0-1.0"} diff --git a/dev-tools/notice/rules.json b/dev-tools/notice/rules.json index c9638a9c6cf..2d60d590306 100644 --- a/dev-tools/notice/rules.json +++ b/dev-tools/notice/rules.json @@ -5,6 +5,7 @@ "BSD-2-Clause", "BSD-2-Clause-FreeBSD", "BSD-3-Clause", + "CC0-1.0", "Elastic", "ISC", "MIT", diff --git a/dev-tools/packaging/files/darwin/otelcol.sh b/dev-tools/packaging/files/darwin/otelcol.sh new file mode 100755 index 00000000000..e64176e1019 --- /dev/null +++ b/dev-tools/packaging/files/darwin/otelcol.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +BASEDIR=$(dirname "$0") + +exec "$BASEDIR/elastic-agent" otel "$@" \ No newline at end of file diff --git a/dev-tools/packaging/files/linux/filebeat.sh b/dev-tools/packaging/files/linux/filebeat.sh new file mode 100644 index 00000000000..b267492b0de --- /dev/null +++ b/dev-tools/packaging/files/linux/filebeat.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec /opt/agentbeat/agentbeat filebeat $@ diff --git a/dev-tools/packaging/files/linux/metricbeat.sh b/dev-tools/packaging/files/linux/metricbeat.sh new file mode 100644 index 00000000000..aa3c1502523 --- /dev/null +++ b/dev-tools/packaging/files/linux/metricbeat.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec /opt/agentbeat/agentbeat metricbeat $@ diff --git a/dev-tools/packaging/files/linux/otelcol.sh b/dev-tools/packaging/files/linux/otelcol.sh new file mode 100644 index 00000000000..e64176e1019 --- /dev/null +++ b/dev-tools/packaging/files/linux/otelcol.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +BASEDIR=$(dirname "$0") + +exec "$BASEDIR/elastic-agent" otel "$@" \ No newline at end of file diff --git a/dev-tools/packaging/files/windows/otelcol.ps1 b/dev-tools/packaging/files/windows/otelcol.ps1 new file mode 100644 index 00000000000..39348528b4c --- /dev/null +++ b/dev-tools/packaging/files/windows/otelcol.ps1 @@ -0,0 +1,2 @@ +$workdir = Split-Path $MyInvocation.MyCommand.Path +& "$workdir\elastic-agent" otel $args \ No newline at end of file diff --git a/dev-tools/packaging/packages.yml b/dev-tools/packaging/packages.yml index 5e168876c0c..55d0e537d9d 100644 --- a/dev-tools/packaging/packages.yml +++ b/dev-tools/packaging/packages.yml @@ -134,6 +134,14 @@ shared: mode: 0755 config_mode: 0644 skip_on_missing: true + + - &linux_otel_files + 'otelcol': + source: '{{ repo.RootDir }}/dev-tools/packaging/files/linux/otelcol.sh' + mode: 0755 + 'data/{{.BeatName}}-{{ commit_short }}/otelcol': + source: '{{ repo.RootDir }}/dev-tools/packaging/files/linux/otelcol.sh' + mode: 0755 - &agent_binary_common_files LICENSE.txt: @@ -201,6 +209,12 @@ shared: content: > {{ agent_package_version }} mode: 0644 + 'otelcol': + source: '{{ repo.RootDir }}/dev-tools/packaging/files/darwin/otelcol.sh' + mode: 0755 + 'data/{{.BeatName}}-{{ commit_short }}/otelcol': + source: '{{ repo.RootDir }}/dev-tools/packaging/files/darwin/otelcol.sh' + mode: 0755 <<: *agent_darwin_app_bundle_files <<: *agent_binary_common_files @@ -217,6 +231,7 @@ shared: files: <<: *agent_binary_files <<: *agent_components + <<: *linux_otel_files - &agent_darwin_binary_spec @@ -235,6 +250,12 @@ shared: mode: 0755 config_mode: 0644 skip_on_missing: true + 'otelcol.ps1': + source: '{{ repo.RootDir }}/dev-tools/packaging/files/windows/otelcol.ps1' + mode: 0755 + 'data/{{.BeatName}}-{{ commit_short }}/otelcol.ps1': + source: '{{ repo.RootDir }}/dev-tools/packaging/files/windows/otelcol.ps1' + mode: 0755 - &agent_docker_spec <<: *agent_binary_spec @@ -260,12 +281,6 @@ shared: content: > {{ commit }} mode: 0644 - 'data/cloud_downloads/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz': - source: '{{.AgentDropPath}}/archives/{{.GOOS}}-{{.AgentArchName}}.tar.gz/metricbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz' - mode: 0755 - 'data/cloud_downloads/filebeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz': - source: '{{.AgentDropPath}}/archives/{{.GOOS}}-{{.AgentArchName}}.tar.gz/filebeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz' - mode: 0755 - &agent_docker_arm_spec <<: *agent_docker_spec @@ -278,6 +293,16 @@ shared: extra_vars: image_name: '{{.BeatName}}-cloud' repository: 'docker.elastic.co/beats-ci' + files: + 'data/cloud_downloads/filebeat.sh': + source: '{{ elastic_beats_dir }}/dev-tools/packaging/files/linux/filebeat.sh' + mode: 0755 + 'data/cloud_downloads/metricbeat.sh': + source: '{{ elastic_beats_dir }}/dev-tools/packaging/files/linux/metricbeat.sh' + mode: 0755 + 'data/cloud_downloads/agentbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz': + source: '{{.AgentDropPath}}/archives/{{.GOOS}}-{{.AgentArchName}}.tar.gz/agentbeat-{{ beat_version }}{{if .Snapshot}}-SNAPSHOT{{end}}-{{.GOOS}}-{{.AgentArchName}}.tar.gz' + mode: 0755 - &agent_docker_complete_spec <<: *agent_docker_spec diff --git a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl index 9d659fe9cd7..679e73d411b 100644 --- a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl +++ b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl @@ -34,11 +34,14 @@ RUN true && \ chmod 0775 {{ $beatHome}}/{{ $modulesd }} && \ {{- end }} {{- if contains .image_name "-cloud" }} - mkdir -p /opt/filebeat /opt/metricbeat && \ - tar xf {{ $beatHome }}/data/cloud_downloads/metricbeat-*.tar.gz -C /opt/metricbeat --strip-components=1 && \ - tar xf {{ $beatHome }}/data/cloud_downloads/filebeat-*.tar.gz -C /opt/filebeat --strip-components=1 && \ -{{- end }} + mkdir -p /opt/agentbeat /opt/filebeat /opt/metricbeat && \ + cp -f {{ $beatHome }}/data/cloud_downloads/filebeat.sh /opt/filebeat/filebeat && \ + chmod +x /opt/filebeat/filebeat && \ + cp -f {{ $beatHome }}/data/cloud_downloads/metricbeat.sh /opt/metricbeat/metricbeat && \ + chmod +x /opt/metricbeat/metricbeat && \ + tar xf {{ $beatHome }}/data/cloud_downloads/agentbeat-*.tar.gz -C /opt/agentbeat --strip-components=1 && \ rm -rf {{ $beatHome }}/data/cloud_downloads && \ +{{- end }} true FROM {{ .from }} @@ -192,7 +195,7 @@ RUN cd {{$beatHome}}/.node \ && chmod ugo+rwX -R $NODE_PATH \ # Install synthetics as a regular user, installing npm deps as root odesn't work # fix .node .npm and .synthetics - && chown -R {{ .user }}:{{ .user }} $NODE_PATH + && chown -R {{ .user }}:{{ .user }} $NODE_PATH USER {{ .user }} # If this fails dump the NPM logs RUN (npm i -g --loglevel verbose --engine-strict @elastic/synthetics@stack_release || sh -c 'tail -n +1 /root/.npm/_logs/* && exit 1') && \ diff --git a/dev-tools/packaging/templates/ironbank/Dockerfile.tmpl b/dev-tools/packaging/templates/ironbank/Dockerfile.tmpl index 26838f70b3a..45756c35f42 100644 --- a/dev-tools/packaging/templates/ironbank/Dockerfile.tmpl +++ b/dev-tools/packaging/templates/ironbank/Dockerfile.tmpl @@ -4,7 +4,7 @@ ################################################################################ ARG BASE_REGISTRY=registry1.dsop.io ARG BASE_IMAGE=redhat/ubi/ubi9 -ARG BASE_TAG=9.3 +ARG BASE_TAG=9.4 FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} as prep_files diff --git a/docs/component-specs.md b/docs/component-specs.md index 47c5b094db4..e5e265096e3 100644 --- a/docs/component-specs.md +++ b/docs/component-specs.md @@ -90,7 +90,7 @@ The variables that can be accessed by a condition are: - `runtime.native_arch`: the machine CPU architecture, either `"amd64"` or `"arm64"`. - `runtime.platform`: a string combining the OS and architecture, e.g. `"windows/amd64"`, `"darwin/arm64"`. - `runtime.family`: OS family, e.g. `"debian"`, `"redhat"`, `"windows"`, `"darwin"` -- `runtime.major`, `runtime.minor`: the operating system version. Note that these are strings not integers, so they must be converted in order to use numeric comparison. For example to check if the OS major version is at most 12, use `number(runtime.major) <= 12`. +- `runtime.major`, `runtime.minor`: the operating system version. - `user.root`: true if Agent is being run with root / administrator permissions. - `install.in_default`: true if the Agent is installed in the default location or has been installed via deb or rpm. diff --git a/docs/elastic-agent-logging.md b/docs/elastic-agent-logging.md index 0aa8db8af13..1505db23092 100644 --- a/docs/elastic-agent-logging.md +++ b/docs/elastic-agent-logging.md @@ -44,6 +44,16 @@ configuration is: - ECS/JSON encoded - UTC timestamps +There is also a second file output for events that is configured via +`agent.logging.event_data`. It shares the same log level as the main +logger and can only be configured for standalone agents. For +Fleet-Managed agents it will always use the default values: + - 5Mb per log file + - Maximum of 2 log files + - Do not rotate on startup + - ECS/JSON encoded + - UTC timestamps + ## Default logging The default logger is the easiest to discover because it's user configurable, logs to the Agent's root directory and can output to diff --git a/docs/fleet-server-bootstrap.asciidoc b/docs/fleet-server-bootstrap.asciidoc index 1dc818f38d2..239122953ff 100644 --- a/docs/fleet-server-bootstrap.asciidoc +++ b/docs/fleet-server-bootstrap.asciidoc @@ -88,3 +88,61 @@ its API key to use for communication. The new `fleet.yml` still includes the `fl but this time the `fleet.server.bootstrap: false` is set. . `enroll` command then either restarts the running Elatic Agent daemon if one was running from Step 2, or it stops the spawned `run` subprocess and returns. + +=== Elasticsearch output + +The options passed that are used to specify fleet-server initially connects to elasticsearch are: + +- `--fleet-server-es` +- `--fleet-server-es-ca` +- `--fleet-server-es-ca-trusted-fingerprint` +- `--fleet-server-es-insecure` +- `--fleet-server-es-cert` +- `--fleet-server-es-cert-key` +- `--fleet-server-es-service-token` +- `--fleet-server-es-service-token-path` +- `--proxy-url` +- `--proxy-disabled` +- `--proxy-header` + +These options are always passed under a `bootstrap` attribute in the output when elastic-agent is passing config to fleet-server. +When the fleet-server recieves an output block, it will inject any keys that are missing from the top level output but are specified in the `bootstrap` block +After injecting the keys from bootstrap, fleet-server will test connecting the Elasticsearch with the output. +If the test fails, the values under the `bootstrap` attribute are used as the output and fleet-server will periodically retest the output in case the error was caused by a temporary network issue. +Note that if `--fleet-server-es-insecure` is specified, and the output in the policy contains one or more CA, or a CA fingerprint, the `--fleet-server-es-insecure` flag is ignored. + +An example of this sequence is sequence is: + +1) elastic-agent starts fleet-server and sends an output block that looks similar to: +```yaml +output: + bootstrap: + service_token: VALUE + hosts: ["HOST"] +``` + +2) fleet-server injects attributes into the top level from bootstrap if they are missing, resulting in +```yaml +output: + service_token: VALUE + hosts: ["HOST"] +``` + +3) fleet-server connects to Elasticsearch with the output block +4) elastic-agent enrolls and recieves its policy +5) elastic-agent sends configuration generated from the policy to fleet-server, this may result in the output as follows: +```yaml +output: + hosts: ["HOST", "HOST2"] + bootstrap: + service_token: VALUE + hosts: ["HOST"] +``` + +6) fleet-server will inject missing values resulting in: +```yaml +output: + service_token: VALUE + hosts: ["HOST", "HOST2"] +``` + 7) fleet-server tests and uses the resulting output block. diff --git a/docs/scripts/es/elastic-agent-logs-comparison.http b/docs/scripts/es/elastic-agent-logs-comparison.http new file mode 100644 index 00000000000..8f6fd8ec4c1 --- /dev/null +++ b/docs/scripts/es/elastic-agent-logs-comparison.http @@ -0,0 +1,407 @@ +# This script is used to measure the disk size of elastic-agent logs and metrics. +# We need to run a baseline and an updated version of the agent for comparison. +# After ingesting the logs and metrics from both runs we reindex the documents based on +# agent ids and timestamp range and store them in dedicated indices so we can measure +# disk size (the new indices are creates with the same mappings as the elastic-agent +# logs and metrics datastreams) + +# In order to simplify running the script, a few variables have been defined. +# Note: The *_start_ts variables seem to not always render correctly, we may +# just replace the values as a workaround + +# Variables (with some sample values) +# +# Variable name Sample value +# +# baseline_agent_id acaf7ee8-defa-476a-bd57-2ef565809470 +# updated_agent_id e9a7c222-172e-4d39-9dbb-311be5e24a75 +# baseline_start_ts 2024-04-29T06:40:39 +# updated_start_ts 2024-04-29T08:53:23 +# time_interval +1h + + + +# Cleanup + +# Test log indices and templates +DELETE /_data_stream/logs-elastic_agent-disksize.baseline +DELETE /_data_stream/logs-elastic_agent-disksize.updated +DELETE /_data_stream/logs-elastic_agent.filebeat-disksize.baseline +DELETE /_data_stream/logs-elastic_agent.filebeat-disksize.updated +DELETE /_data_stream/logs-elastic_agent.metricbeat-disksize.baseline +DELETE /_data_stream/logs-elastic_agent.metricbeat-disksize.updated + +# Test metrics indices and templates +DELETE /metrics-elastic_agent.elastic_agent-disksize.baseline +DELETE /metrics-elastic_agent.elastic_agent-disksize.updated +DELETE /_index_template/metrics-elastic_agent.elastic_agent-disksize + +DELETE /metrics-elastic_agent.filebeat-disksize.baseline +DELETE /metrics-elastic_agent.filebeat-disksize.updated +DELETE /_index_template/metrics-elastic_agent.filebeat-disksize + +DELETE /metrics-elastic_agent.metricbeat-disksize.baseline +DELETE /metrics-elastic_agent.metricbeat-disksize.updated +DELETE /_index_template/metrics-elastic_agent.metricbeat-disksize + + +# Recreate index templates + +# Mappings we want to use in our test index templates +# GET /_index_template/logs-elastic_agent +# GET /_index_template/metrics-elastic_agent.elastic_agent +# GET /_index_template/metrics-elastic_agent.filebeat +# GET /_index_template/metrics-elastic_agent.metricbeat + + +PUT /_index_template/metrics-elastic_agent.elastic_agent-disksize +{ + "index_patterns": [ + "metrics-elastic_agent.elastic_agent-disksize*" + ], + "template": { + "settings": { + "index": { + "mode": "time_series", + "routing_path": [ + "component.id", + "agent.id", + "metricset.name" + ] + } + }, + "mappings": { + } + }, + "composed_of": [ + "metrics@tsdb-settings", + "metrics-elastic_agent.elastic_agent@package", + "metrics-elastic_agent.elastic_agent@custom", + "ecs@mappings", + ".fleet_globals-1", + ".fleet_agent_id_verification-1" + ], + "priority": 201, + "ignore_missing_component_templates": [ + "metrics-elastic_agent.elastic_agent@custom" + ] +} + +PUT /_index_template/metrics-elastic_agent.filebeat-disksize +{ + "index_patterns": [ + "metrics-elastic_agent.filebeat-disksize*" + ], + "template": { + "settings": { + "index": { + "mode": "time_series", + "routing_path": [ + "component.id", + "agent.id", + "metricset.name" + ] + } + }, + "mappings": { + } + }, + "composed_of": [ + "metrics@tsdb-settings", + "metrics-elastic_agent.filebeat@package", + "metrics-elastic_agent.filebeat@custom", + "ecs@mappings", + ".fleet_globals-1", + ".fleet_agent_id_verification-1" + ], + "priority": 201, + "ignore_missing_component_templates": [ + "metrics-elastic_agent.filebeat@custom" + ] +} + +PUT /_index_template/metrics-elastic_agent.metricbeat-disksize +{ + "index_patterns": [ + "metrics-elastic_agent.metricbeat-disksize*" + ], + "template": { + "settings": { + "index": { + "mode": "time_series", + "routing_path": [ + "component.id", + "agent.id", + "metricset.name" + ] + } + }, + "mappings": { + } + }, + "composed_of": [ + "metrics@tsdb-settings", + "metrics-elastic_agent.metricbeat@package", + "metrics-elastic_agent.metricbeat@custom", + "ecs@mappings", + ".fleet_globals-1", + ".fleet_agent_id_verification-1" + ], + "priority": 201, + "ignore_missing_component_templates": [ + "metrics-elastic_agent.metricbeat@custom" + ] +} + +# Reindex a subset of the elastic-agent logs in the new indices +POST _reindex +{ + "source": { + "index": "logs-elastic_agent-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${baseline_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${baseline_start_ts}", "lte": "${baseline_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "logs-elastic_agent-disksize.baseline", + "op_type": "create" + } +} + +POST _reindex +{ + "source": { + "index": "logs-elastic_agent-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${updated_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${updated_start_ts}", "lte": "${updated_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "logs-elastic_agent-disksize.updated", + "op_type": "create" + } +} + +POST _reindex +{ + "source": { + "index": "logs-elastic_agent.filebeat-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${baseline_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${baseline_start_ts}", "lte": "${baseline_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "logs-elastic_agent.filebeat-disksize.baseline", + "op_type": "create" + } +} + +POST _reindex +{ + "source": { + "index": "logs-elastic_agent.filebeat-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${updated_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${updated_start_ts}", "lte": "${updated_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "logs-elastic_agent.filebeat-disksize.updated", + "op_type": "create" + } +} + +POST _reindex +{ + "source": { + "index": "logs-elastic_agent.metricbeat-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${baseline_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${baseline_start_ts}", "lte": "${baseline_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "logs-elastic_agent.metricbeat-disksize.baseline", + "op_type": "create" + } +} + +POST _reindex +{ + "source": { + "index": "logs-elastic_agent.metricbeat-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${updated_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${updated_start_ts}", "lte": "${updated_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "logs-elastic_agent.metricbeat-disksize.updated", + "op_type": "create" + } +} + +# Reindex a subset of the elastic-agent metrics in the new indices +POST _reindex +{ + "source": { + "index": "metrics-elastic_agent.elastic_agent-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${baseline_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${baseline_start_ts}", "lte": "${baseline_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "metrics-elastic_agent.elastic_agent-disksize.baseline", + "op_type": "create" + } +} + +POST _reindex +{ + "source": { + "index": "metrics-elastic_agent.elastic_agent-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${updated_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${updated_start_ts}", "lte": "${updated_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "metrics-elastic_agent.elastic_agent-disksize.updated", + "op_type": "create" + } +} + +POST _reindex +{ + "source": { + "index": "metrics-elastic_agent.filebeat-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${baseline_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${baseline_start_ts}", "lte": "${baseline_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "metrics-elastic_agent.filebeat-disksize.baseline", + "op_type": "create" + } +} + + +POST _reindex +{ + "source": { + "index": "metrics-elastic_agent.filebeat-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${updated_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${updated_start_ts}", "lte": "${updated_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "metrics-elastic_agent.filebeat-disksize.updated", + "op_type": "create" + } +} + +POST _reindex +{ + "source": { + "index": "metrics-elastic_agent.metricbeat-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${baseline_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${baseline_start_ts}", "lte": "${baseline_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "metrics-elastic_agent.metricbeat-disksize.baseline", + "op_type": "create" + } +} + +POST _reindex +{ + "source": { + "index": "metrics-elastic_agent.metricbeat-default", + "query": { + "bool": { + "filter": [ + {"term": {"agent.id":"${updated_agent_id}"}}, + {"range": {"@timestamp": {"gte": "${updated_start_ts}", "lte": "${updated_start_ts}||${time_interval}"}}} + ] + } + } + }, + "dest": { + "index": "metrics-elastic_agent.metricbeat-disksize.updated", + "op_type": "create" + } +} + +# Check indices disk usage + +## Logs +POST /logs-elastic_agent-disksize.baseline/_disk_usage?run_expensive_tasks=true +POST /logs-elastic_agent-disksize.updated/_disk_usage?run_expensive_tasks=true + +POST /logs-elastic_agent.filebeat-disksize.baseline/_disk_usage?run_expensive_tasks=true +POST /logs-elastic_agent.filebeat-disksize.updated/_disk_usage?run_expensive_tasks=true + +POST /logs-elastic_agent.metricbeat-disksize.baseline/_disk_usage?run_expensive_tasks=true +POST /logs-elastic_agent.metricbeat-disksize.updated/_disk_usage?run_expensive_tasks=true + +## Metrics +POST /metrics-elastic_agent.elastic_agent-disksize.baseline/_disk_usage?run_expensive_tasks=true +POST /metrics-elastic_agent.elastic_agent-disksize.updated/_disk_usage?run_expensive_tasks=true + +POST /metrics-elastic_agent.filebeat-disksize.baseline/_disk_usage?run_expensive_tasks=true +POST /metrics-elastic_agent.filebeat-disksize.updated/_disk_usage?run_expensive_tasks=true + +POST /metrics-elastic_agent.metricbeat-disksize.baseline/_disk_usage?run_expensive_tasks=true +POST /metrics-elastic_agent.metricbeat-disksize.updated/_disk_usage?run_expensive_tasks=true \ No newline at end of file diff --git a/elastic-agent.docker.yml b/elastic-agent.docker.yml index 87aa2cdd0cd..a0a6d5da8f6 100644 --- a/elastic-agent.docker.yml +++ b/elastic-agent.docker.yml @@ -18,17 +18,17 @@ inputs: data_stream.namespace: default use_output: default streams: - - metricsets: + - metricsets: - cpu # Dataset name must conform to the naming conventions for Elasticsearch indices, cannot contain dashes (-), and cannot exceed 100 bytes data_stream.dataset: system.cpu - - metricsets: + - metricsets: - memory data_stream.dataset: system.memory - - metricsets: + - metricsets: - network data_stream.dataset: system.network - - metricsets: + - metricsets: - filesystem data_stream.dataset: system.filesystem @@ -112,10 +112,25 @@ inputs: # logs: false # # enables metrics monitoring # metrics: false +# # metrics_period defines how frequent we should sample monitoring metrics. Default is 60 seconds. +# metrics_period: 60s # # exposes /debug/pprof/ endpoints # # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost # pprof.enabled: false # # exposes agent metrics using http, by default sockets and named pipes are used +# # +# # `http` Also exposes a /liveness endpoint that will return an HTTP code depending on agent status: +# # 200: Agent is healthy +# # 500: A component or unit is in a failed state +# # 503: The agent coordinator is unresponsive +# # +# # You can pass a `failon` parameter to the /liveness endpoint to determine what component state will result in a 500. +# # For example: `curl 'localhost:6792/liveness?failon=degraded'` will return 500 if a component is in a degraded state. +# # The possible values for `failon` are: +# # `degraded`: return an error if a component is in a degraded state or failed state, or if the agent coordinator is unresponsive. +# # `failed`: return an error if a unit is in a failed state, or if the agent coordinator is unresponsive. +# # `heartbeat`: return an error only if the agent coordinator is unresponsive. +# # If no `failon` parameter is provided, the default behavior is `failon=heartbeat` # http: # # enables http endpoint # enabled: false diff --git a/elastic-agent.reference.yml b/elastic-agent.reference.yml index 7ee19406674..fa3f2429fe5 100644 --- a/elastic-agent.reference.yml +++ b/elastic-agent.reference.yml @@ -145,12 +145,27 @@ inputs: # logs: false # # enables metrics monitoring # metrics: false +# # metrics_period defines how frequent we should sample monitoring metrics. Default is 60 seconds. +# metrics_period: 60s # # exposes /debug/pprof/ endpoints # # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost # pprof.enabled: false # # The name of the output to use for monitoring data. # use_output: monitoring -# # exposes agent metrics using http, by default sockets and named pipes are used +# # Exposes agent metrics using http, by default sockets and named pipes are used. +# # +# # `http` Also exposes a /liveness endpoint that will return an HTTP code depending on agent status: +# # 200: Agent is healthy +# # 500: A component or unit is in a failed state +# # 503: The agent coordinator is unresponsive +# # +# # You can pass a `failon` parameter to the /liveness endpoint to determine what component state will result in a 500. +# # For example: `curl 'localhost:6792/liveness?failon=degraded'` will return 500 if a component is in a degraded state. +# # The possible values for `failon` are: +# # `degraded`: return an error if a component is in a degraded state or failed state, or if the agent coordinator is unresponsive. +# # `failed`: return an error if a unit is in a failed state, or if the agent coordinator is unresponsive. +# # `heartbeat`: return an error only if the agent coordinator is unresponsive. +# # If no `failon` parameter is provided, the default behavior is `failon=heartbeat` # http: # # enables http endpoint # enabled: false @@ -265,6 +280,54 @@ agent.logging.to_stderr: true # Set to true to log messages in JSON format. #agent.logging.json: false +#=============================== Events Logging =============================== +# Some outputs will log raw events on errors like indexing errors in the +# Elasticsearch output, to prevent logging raw events (that may contain +# sensitive information) together with other log messages, a different +# log file, only for log entries containing raw events, is used. It will +# use the same level, selectors and all other configurations from the +# default logger, but it will have it's own file configuration. +# +# Having a different log file for raw events also prevents event data +# from drowning out the regular log files. +# +# IMPORTANT: No matter the default logger output configuration, raw events +# will **always** be logged to a file configured by `agent.logging.event_data.files`. + +# agent.logging.event_data: +# Logging to rotating files. Set agent.logging.to_files to false to disable logging to +# files. +#agent.logging.event_data.to_files: true +#agent.logging.event_data: + # Configure the path where the logs are written. The default is the logs directory + # under the home path (the binary location). + #path: /var/log/filebeat + + # The name of the files where the logs are written to. + #name: filebeat-event-data + + # Configure log file size limit. If the limit is reached, log file will be + # automatically rotated. + #rotateeverybytes: 5242880 # = 5MB + + # Number of rotated log files to keep. The oldest files will be deleted first. + #keepfiles: 2 + + # The permissions mask to apply when rotating log files. The default value is 0600. + # Must be a valid Unix-style file permissions mask expressed in octal notation. + #permissions: 0600 + + # Enable log file rotation on time intervals in addition to the size-based rotation. + # Intervals must be at least 1s. Values of 1m, 1h, 24h, 7*24h, 30*24h, and 365*24h + # are boundary-aligned with minutes, hours, days, weeks, months, and years as + # reported by the local system clock. All other intervals are calculated from the + # Unix epoch. Defaults to disabled. + #interval: 0 + + # Rotate existing logs on startup rather than appending them to the existing + # file. Defaults to false. + # rotateonstartup: false + # Providers # Providers supply the key/values pairs that are used for variable substitution diff --git a/elastic-agent.yml b/elastic-agent.yml index 342fd50f432..ae70df26213 100644 --- a/elastic-agent.yml +++ b/elastic-agent.yml @@ -66,12 +66,27 @@ inputs: # logs: true # # enables metrics monitoring # metrics: true +# # metrics_period defines how frequent we should sample monitoring metrics. Default is 60 seconds. +# metrics_period: 60s # # exposes /debug/pprof/ endpoints # # recommended that these endpoints are only enabled if the monitoring endpoint is set to localhost # pprof.enabled: false # # The name of the output to use for monitoring data. # use_output: monitoring # # exposes agent metrics using http, by default sockets and named pipes are used +# # +# # `http` Also exposes a /liveness endpoint that will return an HTTP code depending on agent status: +# # 200: Agent is healthy +# # 500: A component or unit is in a failed state +# # 503: The agent coordinator is unresponsive +# # +# # You can pass a `failon` parameter to the /liveness endpoint to determine what component state will result in a 500. +# # For example: `curl 'localhost:6792/liveness?failon=degraded'` will return 500 if a component is in a degraded state. +# # The possible values for `failon` are: +# # `degraded`: return an error if a component is in a degraded state or failed state, or if the agent coordinator is unresponsive. +# # `failed`: return an error if a unit is in a failed state, or if the agent coordinator is unresponsive. +# # `heartbeat`: return an error only if the agent coordinator is unresponsive. +# # If no `failon` parameter is provided, the default behavior is `failon=heartbeat` # http: # # enables http endpoint # enabled: false diff --git a/go.mod b/go.mod index c4155940c7c..d9e952b3f75 100644 --- a/go.mod +++ b/go.mod @@ -1,27 +1,29 @@ module github.com/elastic/elastic-agent -go 1.21 +go 1.21.10 require ( - github.com/Microsoft/go-winio v0.6.1 + github.com/Microsoft/go-winio v0.6.2 github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1 github.com/billgraziano/dpapi v0.4.0 github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2 github.com/cavaliercoder/go-rpm v0.0.0-20190131055624-7a9c54e3d83e - github.com/cenkalti/backoff/v4 v4.2.1 + github.com/cenkalti/backoff/v4 v4.3.0 github.com/docker/go-units v0.5.0 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.8 - github.com/elastic/elastic-agent-client/v7 v7.8.1 - github.com/elastic/elastic-agent-libs v0.8.0 - github.com/elastic/elastic-agent-system-metrics v0.9.2 - github.com/elastic/elastic-transport-go/v8 v8.4.0 - github.com/elastic/go-elasticsearch/v8 v8.12.1 - github.com/elastic/go-licenser v0.4.1 - github.com/elastic/go-sysinfo v1.13.1 + github.com/elastic/e2e-testing v1.2.1 + github.com/elastic/elastic-agent-autodiscover v0.7.0 + github.com/elastic/elastic-agent-client/v7 v7.11.0 + github.com/elastic/elastic-agent-libs v0.9.12 + github.com/elastic/elastic-agent-system-metrics v0.10.3 + github.com/elastic/elastic-transport-go/v8 v8.6.0 + github.com/elastic/go-elasticsearch/v8 v8.14.0 + github.com/elastic/go-licenser v0.4.2 + github.com/elastic/go-sysinfo v1.14.0 github.com/elastic/go-ucfg v0.8.8 - github.com/fatih/color v1.15.0 + github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f + github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor v0.2.0 + github.com/fatih/color v1.16.0 github.com/fsnotify/fsnotify v1.7.0 github.com/gofrs/flock v0.8.1 github.com/gofrs/uuid v4.4.0+incompatible @@ -41,131 +43,169 @@ require ( github.com/mitchellh/hashstructure v1.1.0 github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c github.com/oklog/ulid v1.3.1 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.96.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.96.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.96.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.96.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.96.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/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 github.com/rs/zerolog v1.27.0 github.com/sajari/regression v1.0.1 github.com/schollz/progressbar/v3 v3.13.1 - github.com/shirou/gopsutil/v3 v3.24.1 + github.com/shirou/gopsutil/v3 v3.24.5 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/tsg/go-daemon v0.0.0-20200207173439-e704b93fd89b + github.com/winlabs/gowin32 v0.0.0-20221003142512-0d265587d3c9 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.96.0 - go.opentelemetry.io/collector/confmap v0.96.0 - go.opentelemetry.io/collector/confmap/converter/expandconverter v0.96.0 - go.opentelemetry.io/collector/confmap/provider/envprovider v0.96.0 - go.opentelemetry.io/collector/confmap/provider/fileprovider v0.96.0 - go.opentelemetry.io/collector/confmap/provider/httpprovider v0.96.0 - go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.96.0 - go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.96.0 - go.opentelemetry.io/collector/exporter v0.96.0 - go.opentelemetry.io/collector/exporter/debugexporter v0.96.0 - go.opentelemetry.io/collector/exporter/otlpexporter v0.96.0 - go.opentelemetry.io/collector/featuregate v1.3.0 - go.opentelemetry.io/collector/otelcol v0.96.0 - go.opentelemetry.io/collector/processor v0.96.0 - go.opentelemetry.io/collector/processor/batchprocessor v0.96.0 - go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.96.0 - go.opentelemetry.io/collector/receiver v0.96.0 - go.opentelemetry.io/collector/receiver/otlpreceiver v0.96.0 go.uber.org/zap v1.27.0 - golang.org/x/crypto v0.19.0 - golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc + golang.org/x/crypto v0.24.0 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 - golang.org/x/sync v0.6.0 - golang.org/x/sys v0.17.0 - golang.org/x/term v0.17.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/sync v0.7.0 + golang.org/x/sys v0.21.0 + golang.org/x/term v0.21.0 + golang.org/x/text v0.16.0 + golang.org/x/time v0.5.0 + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d golang.org/x/tools/go/vcs v0.1.0-deprecated - google.golang.org/grpc v1.62.0 - google.golang.org/protobuf v1.33.0 + google.golang.org/grpc v1.64.0 + google.golang.org/protobuf v1.34.2 gopkg.in/ini.v1 v1.67.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools v2.2.0+incompatible gotest.tools/gotestsum v1.9.0 - k8s.io/api v0.26.3 - k8s.io/apimachinery v0.26.3 - k8s.io/client-go v0.26.3 - k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 + k8s.io/api v0.29.5 + k8s.io/apimachinery v0.29.5 + k8s.io/client-go v0.29.5 + k8s.io/utils v0.0.0-20230726121419-3b25d923346b ) require ( + github.com/cavaliercoder/badio v0.0.0-20160213150051-ce5280129e9e // indirect + github.com/distribution/reference v0.5.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.103.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.103.0 + go.opentelemetry.io/collector/component v0.103.0 + go.opentelemetry.io/collector/confmap v0.103.0 + go.opentelemetry.io/collector/confmap/converter/expandconverter v0.103.0 + go.opentelemetry.io/collector/confmap/provider/envprovider v0.103.0 + go.opentelemetry.io/collector/confmap/provider/fileprovider v0.103.0 + go.opentelemetry.io/collector/confmap/provider/httpprovider v0.103.0 + go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.103.0 + go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.103.0 + go.opentelemetry.io/collector/connector v0.103.0 + go.opentelemetry.io/collector/exporter v0.103.0 + go.opentelemetry.io/collector/exporter/debugexporter v0.103.0 + go.opentelemetry.io/collector/exporter/otlpexporter v0.103.0 + go.opentelemetry.io/collector/exporter/otlphttpexporter v0.103.0 + go.opentelemetry.io/collector/extension v0.103.0 + go.opentelemetry.io/collector/extension/memorylimiterextension v0.103.0 + go.opentelemetry.io/collector/featuregate v1.10.0 + go.opentelemetry.io/collector/otelcol v0.103.0 + go.opentelemetry.io/collector/processor v0.103.0 + go.opentelemetry.io/collector/processor/batchprocessor v0.103.0 + go.opentelemetry.io/collector/receiver v0.103.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.103.0 +) + +require ( + cloud.google.com/go/compute/metadata v0.3.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.23.0 // indirect github.com/Jeffail/gabs/v2 v2.6.0 // indirect + github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/akavel/rsrc v0.8.0 // indirect github.com/alecthomas/participle/v2 v2.1.1 // indirect + github.com/armon/go-metrics v0.4.1 // indirect github.com/armon/go-radix v1.0.0 // indirect + github.com/aws/aws-sdk-go v1.53.11 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect - github.com/cavaliercoder/badio v0.0.0-20160213150051-ce5280129e9e // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect 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/docker v25.0.5+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect + github.com/elastic/go-docappender/v2 v2.1.4 // indirect + github.com/elastic/go-elasticsearch/v7 v7.17.10 // 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/elastic/gosigar v0.14.3 // indirect + github.com/elastic/opentelemetry-lib v0.3.0 // indirect + github.com/elastic/pkcs8 v1.0.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/expr-lang/expr v1.16.1 // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/gobuffalo/here v0.6.0 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/gnostic v0.6.9 // indirect + github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/licenseclassifier v0.0.0-20221004142553-c1ed8fcf4bab // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect - github.com/haimrubinstein/go-syslog/v3 v3.0.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/hashicorp/consul/api v1.29.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-rootcerts v1.0.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/hashicorp/serf v0.10.1 // indirect github.com/iancoleman/strcase v0.3.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jaypipes/pcidb v1.0.0 // indirect github.com/jcchavezs/porto v0.1.0 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/karrick/godirwalk v1.16.1 // indirect - github.com/klauspost/compress v1.17.7 // indirect + github.com/klauspost/compress v1.17.8 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.0 // indirect - github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165 // indirect + github.com/knadh/koanf/v2 v2.1.1 // indirect + github.com/leodido/go-syslog/v4 v4.1.0 // indirect + github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b // indirect + github.com/leoluk/perflib_exporter v0.2.1 // indirect + github.com/lestrrat-go/strftime v1.0.6 // indirect + github.com/lightstep/go-expohisto v1.0.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/markbates/pkger v0.17.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mileusna/useragent v1.3.4 // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -174,102 +214,112 @@ require ( github.com/moby/spdystream v0.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mostynb/go-grpc-compression v1.2.2 // indirect + github.com/mostynb/go-grpc-compression v1.2.3 // 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.96.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.96.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.96.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.96.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.96.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.96.0 // indirect + github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.103.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.103.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/opencontainers/image-spec v1.1.0 // indirect + github.com/openshift/api v3.9.0+incompatible // indirect + github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.19.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.48.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.54.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rs/cors v1.10.1 // indirect github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect github.com/sergi/go-diff v1.2.0 // indirect - github.com/shirou/gopsutil v3.21.11+incompatible // indirect + github.com/shirou/gopsutil/v4 v4.24.5 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect + github.com/tilinna/clock v1.1.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/valyala/fastjson v1.6.4 // indirect - github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect - github.com/yusufpapurcu/wmi v1.2.3 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect go.elastic.co/apm/module/apmhttp v1.15.0 // indirect - go.elastic.co/apm/module/apmhttp/v2 v2.0.0 // indirect - go.elastic.co/apm/v2 v2.0.0 // indirect - go.elastic.co/fastjson v1.1.0 // indirect + go.elastic.co/apm/module/apmhttp/v2 v2.6.0 // indirect + go.elastic.co/apm/module/apmzap/v2 v2.6.0 // indirect + go.elastic.co/apm/v2 v2.6.0 // indirect + go.elastic.co/fastjson v1.3.0 // indirect + go.etcd.io/bbolt v1.3.10 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/collector v0.96.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.96.0 // indirect - go.opentelemetry.io/collector/config/configcompression v0.96.0 // indirect - go.opentelemetry.io/collector/config/configgrpc v0.96.0 // indirect - go.opentelemetry.io/collector/config/confighttp v0.96.0 // indirect - go.opentelemetry.io/collector/config/confignet v0.96.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.3.0 // indirect - go.opentelemetry.io/collector/config/configretry v0.96.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.96.0 // indirect - go.opentelemetry.io/collector/config/configtls v0.96.0 // indirect - go.opentelemetry.io/collector/config/internal v0.96.0 // indirect - go.opentelemetry.io/collector/connector v0.96.0 // indirect - go.opentelemetry.io/collector/consumer v0.96.0 // indirect - go.opentelemetry.io/collector/extension v0.96.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.96.0 // indirect - go.opentelemetry.io/collector/pdata v1.3.0 // indirect - go.opentelemetry.io/collector/semconv v0.96.0 // indirect - go.opentelemetry.io/collector/service v0.96.0 // indirect - go.opentelemetry.io/contrib/config v0.4.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect - go.opentelemetry.io/contrib/propagators/b3 v1.24.0 // indirect - go.opentelemetry.io/otel v1.24.0 // indirect - go.opentelemetry.io/otel/bridge/opencensus v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.24.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect - go.opentelemetry.io/otel/sdk v1.24.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect - go.opentelemetry.io/otel/trace v1.24.0 // indirect - go.opentelemetry.io/proto/otlp v1.1.0 // indirect + go.opentelemetry.io/collector v0.103.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.103.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.10.0 // indirect + go.opentelemetry.io/collector/config/configgrpc v0.103.0 // indirect + go.opentelemetry.io/collector/config/confighttp v0.103.0 // indirect + go.opentelemetry.io/collector/config/confignet v0.103.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.10.0 // indirect + go.opentelemetry.io/collector/config/configretry v0.103.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.103.0 // indirect + go.opentelemetry.io/collector/config/configtls v0.103.0 // indirect + go.opentelemetry.io/collector/config/internal v0.103.0 // indirect + go.opentelemetry.io/collector/consumer v0.103.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.103.0 // indirect + go.opentelemetry.io/collector/filter v0.103.0 // indirect + go.opentelemetry.io/collector/pdata v1.10.0 // indirect + go.opentelemetry.io/collector/semconv v0.103.0 // indirect + go.opentelemetry.io/collector/service v0.103.0 // indirect + go.opentelemetry.io/contrib/config v0.7.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.27.0 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/bridge/opencensus v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/sdk v1.27.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect + go.opentelemetry.io/proto/otlp v1.2.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect - gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/oauth2 v0.20.0 // indirect + gonum.org/v1/gonum v0.15.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 // indirect google.golang.org/grpc/examples v0.0.0-20220304170021-431ea809a767 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect - howett.net/plist v1.0.0 // indirect - k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 // indirect + howett.net/plist v1.0.1 // indirect + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/kubelet v0.29.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) require ( - github.com/hashicorp/go-version v1.6.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/onsi/gomega v1.27.3 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect; indirecthttps://github.com/elastic/ingest-dev/issues/3253 go.elastic.co/apm v1.15.0 go.elastic.co/apm/module/apmgrpc v1.15.0 - k8s.io/klog/v2 v2.80.1 // indirect + k8s.io/klog/v2 v2.110.1 // indirect ) replace ( diff --git a/go.sum b/go.sum index e0552b77868..8cd7a3ef001 100644 --- a/go.sum +++ b/go.sum @@ -35,7 +35,6 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= @@ -118,14 +117,12 @@ cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 h1:aRVqY1p2IJaBGStWMsQMpkAa83cPkCDLl80eOj0Rbz4= -cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68/go.mod h1:1a3eRNYX12fs5UABBIXS8HXVvQbX9hRB/RkEBPORpe8= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= @@ -390,6 +387,8 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= github.com/AlecAivazis/survey/v2 v2.3.6/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI= @@ -397,11 +396,13 @@ github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v56.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= +github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= github.com/Azure/go-autorest/autorest v0.11.24/go.mod h1:G6kyRlFnTuSbEYkQGawPfsCswgme4iYf6rfSKUDzbCc= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= @@ -422,6 +423,8 @@ github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Flaque/filet v0.0.0-20201012163910-45f684403088 h1:PnnQln5IGbhLeJOi6hVs+lCeF+B1dRfFKPGXUAez0Ww= github.com/Flaque/filet v0.0.0-20201012163910-45f684403088/go.mod h1:TK+jB3mBs+8ZMWhU5BqZKnZWJ1MrLo8etNVg51ueTBo= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.23.0 h1:yRhWveg9NbJcJYoJL4FoSauT2dxnt4N9MIAJ7tvU/mQ= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.23.0/go.mod h1:p2puVVSKjQ84Qb1gzw2XHLs34WQyHTYFZLaVxypAFYs= github.com/Jeffail/gabs/v2 v2.6.0 h1:WdCnGaDhNa4LSRTMwhLZzJ7SRDXjABNP13SOKvCpL5w= github.com/Jeffail/gabs/v2 v2.6.0/go.mod h1:xCn81vdHKxFUuWWAaD5jCTQDNPBMh5pPs9IJ+NcziBI= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= @@ -445,6 +448,8 @@ github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01 github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/Microsoft/hcsshim v0.9.5/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/Microsoft/hcsshim v0.9.6/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= +github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= +github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -465,6 +470,8 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= +github.com/Showmax/go-fqdn v1.0.0 h1:0rG5IbmVliNT5O19Mfuvna9LL7zlHyRfsSvBPZmF9tM= +github.com/Showmax/go-fqdn v1.0.0/go.mod h1:SfrFBzmDCtCGrnHhoDjuvFnKsWjEQX/Q9ARZvOrJAko= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/a8m/expect v1.0.0/go.mod h1:4IwSCMumY49ScypDnjNbYEjgVeqy1/U2cEs3Lat96eA= @@ -498,6 +505,8 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -509,6 +518,8 @@ github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:W github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.43.16/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.53.11 h1:KcmduYvX15rRqt4ZU/7jKkmDxU/G87LJ9MUI0yQJh00= +github.com/aws/aws-sdk-go v1.53.11/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aymerick/raymond v2.0.2+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -551,8 +562,8 @@ github.com/cavaliercoder/go-rpm v0.0.0-20190131055624-7a9c54e3d83e/go.mod h1:AZI github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= @@ -560,8 +571,9 @@ github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6 github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= @@ -589,8 +601,6 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= @@ -637,6 +647,8 @@ github.com/containerd/containerd v1.5.9/go.mod h1:fvQqCfadDGga5HZyn3j4+dx56qj2I9 github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= github.com/containerd/containerd v1.6.12/go.mod h1:K4Bw7gjgh4TnkmQY+py/PYQGp4e7xgnHAeg87VeWb3A= github.com/containerd/containerd v1.6.15/go.mod h1:U2NnBPIhzJDm59xF7xB2MMHnKtggpZ+phKg8o2TKj2c= +github.com/containerd/containerd v1.7.15 h1:afEHXdil9iAm03BmhjzKyXnnEBtjaLJefdU7DV0IFes= +github.com/containerd/containerd v1.7.15/go.mod h1:ISzRRTMF8EXNpJlTzyr2XMhN+j9K302C21/+cr3kUnY= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= @@ -668,6 +680,8 @@ github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5A github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= github.com/containerd/imgcrypt v1.1.4/go.mod h1:LorQnPtzL/T0IyCeftcsMEO7AqxUDbdO8j/tSUpgxvo= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= @@ -719,6 +733,8 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= +github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -745,8 +761,9 @@ github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/ github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/daviddengcn/go-colortext v1.0.0/go.mod h1:zDqEI5NVUop5QPpVJUxE9UO10hRnmkD5G4Pmri9+m4c= github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= @@ -754,6 +771,8 @@ github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11 github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= @@ -763,13 +782,11 @@ github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TT github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.11+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.21+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= -github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= +github.com/docker/docker v25.0.5+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/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= @@ -792,34 +809,37 @@ github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdf github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/elastic/e2e-testing v1.1.0 h1:Y+K215EWkf3ojAWmBK2JrxH/rITjkKM1zR8mnwIpvLw= -github.com/elastic/e2e-testing v1.1.0/go.mod h1:8q2d8dmwavJXISowwaoreHFBnbR/uK4qanfRGhC/W9A= -github.com/elastic/elastic-agent-autodiscover v0.6.8 h1:BSXz+QwjZAEt08G+T3GDGl14Bh9a6zD8luNCvZut/b8= -github.com/elastic/elastic-agent-autodiscover v0.6.8/go.mod h1:hFeFqneS2r4jD0/QzGkrNk0YVdN0JGh7lCWdsH7zcI4= -github.com/elastic/elastic-agent-client/v7 v7.8.1 h1:J9wZc/0mUvSEok0X5iR5+n60Jgb+AWooKddb3XgPWqM= -github.com/elastic/elastic-agent-client/v7 v7.8.1/go.mod h1:axl1nkdqc84YRFkeJGD9jExKNPUrOrzf3DFo2m653nY= -github.com/elastic/elastic-agent-libs v0.8.0 h1:q8N6zXWbVTRWXD0mqyLrYzh3MNpHpE2iURoDX9XCU2o= -github.com/elastic/elastic-agent-libs v0.8.0/go.mod h1:pGMj5myawdqu+xE+WKvM5FQzKQ/MonikkWOzoFTJxaU= -github.com/elastic/elastic-agent-system-metrics v0.9.2 h1:/tvTKOt55EerU0WwGFoDhBlyWLgxyv7d8xCbny0bciw= -github.com/elastic/elastic-agent-system-metrics v0.9.2/go.mod h1:VfJnKw4Jqrd9ddljXCwaGKJgN+7ADyyGk089NaXVsf0= +github.com/elastic/e2e-testing v1.2.1 h1:jIuikohPtTxtO+bfoVEyKAWmcsAl21lxiiTK8Fj+G8U= +github.com/elastic/e2e-testing v1.2.1/go.mod h1:8q2d8dmwavJXISowwaoreHFBnbR/uK4qanfRGhC/W9A= +github.com/elastic/elastic-agent-autodiscover v0.7.0 h1:FCrHXh5AZGrPlpAx8kBu/s/guw9d/EXt+GKlFCnrgsc= +github.com/elastic/elastic-agent-autodiscover v0.7.0/go.mod h1:zLf0SDdQXisVZxzXPxKXdj3Fa+H4bsu4HHbTEQImDz8= +github.com/elastic/elastic-agent-client/v7 v7.11.0 h1:YpkFQyE3qPnVai2a2NiKTMpBXXmPcHRV86AtW7LdpA8= +github.com/elastic/elastic-agent-client/v7 v7.11.0/go.mod h1:/AeiwX9zxG99eUNrLhpApTpwmE71Qwuh4ozObn7a0ss= +github.com/elastic/elastic-agent-libs v0.9.12 h1:k3U+F4RA0kUYoP1o9YfXF9aGTmNHzvppmqQfxrA9qs4= +github.com/elastic/elastic-agent-libs v0.9.12/go.mod h1:TLFd0T/e1SHmxnx9pbdm/pqOV9y+VMvHikDyPN4Owkw= +github.com/elastic/elastic-agent-system-metrics v0.10.3 h1:8pWdj8DeY8PBG/BA0DJalRpJWruDoP5QrIP/YKug5dE= +github.com/elastic/elastic-agent-system-metrics v0.10.3/go.mod h1:3JwPa3zZJjmBYN87xwdLcFpHrUkWpR863jiYdg39sSc= github.com/elastic/elastic-integration-corpus-generator-tool v0.5.0/go.mod h1:uf9N86y+UACGybdEhZLpwZ93XHWVhsYZAA4c2T2v6YM= github.com/elastic/elastic-package v0.77.0/go.mod h1:Xeqx0OOVnKBfFoSHsHmKI74RxgRGiDhU6yXEu8BkJJM= -github.com/elastic/elastic-transport-go/v8 v8.4.0 h1:EKYiH8CHd33BmMna2Bos1rDNMM89+hdgcymI+KzJCGE= -github.com/elastic/elastic-transport-go/v8 v8.4.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk= +github.com/elastic/elastic-transport-go/v8 v8.6.0 h1:Y2S/FBjx1LlCv5m6pWAF2kDJAHoSjSRSJCApolgfthA= +github.com/elastic/elastic-transport-go/v8 v8.6.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk= +github.com/elastic/go-docappender/v2 v2.1.4 h1:R6TN4udeC5pap+uA7Lrb3pzeOm03vx6K3+yQdczviH0= +github.com/elastic/go-docappender/v2 v2.1.4/go.mod h1:eixVwyxvjJJLMditD/9630jjPbN6nHtSkVjae8nqJsY= github.com/elastic/go-elasticsearch/v7 v7.17.7/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= +github.com/elastic/go-elasticsearch/v7 v7.17.10 h1:TCQ8i4PmIJuBunvBS6bwT2ybzVFxxUhhltAs3Gyu1yo= +github.com/elastic/go-elasticsearch/v7 v7.17.10/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= github.com/elastic/go-elasticsearch/v8 v8.0.0-20210317102009-a9d74cec0186/go.mod h1:xe9a/L2aeOgFKKgrO3ibQTnMdpAeL0GC+5/HpGScSa4= -github.com/elastic/go-elasticsearch/v8 v8.12.1 h1:QcuFK5LaZS0pSIj/eAEsxmJWmMo7tUs1aVBbzdIgtnE= -github.com/elastic/go-elasticsearch/v8 v8.12.1/go.mod h1:wSzJYrrKPZQ8qPuqAqc6KMR4HrBfHnZORvyL+FMFqq0= +github.com/elastic/go-elasticsearch/v8 v8.14.0 h1:1ywU8WFReLLcxE1WJqii3hTtbPUE2hc38ZK/j4mMFow= +github.com/elastic/go-elasticsearch/v8 v8.14.0/go.mod h1:WRvnlGkSuZyp83M2U8El/LGXpCjYLrvlkSgkAH4O5I4= github.com/elastic/go-licenser v0.3.1/go.mod h1:D8eNQk70FOCVBl3smCGQt/lv7meBeQno2eI1S5apiHQ= -github.com/elastic/go-licenser v0.4.0/go.mod h1:V56wHMpmdURfibNBggaSBfqgPxyT1Tldns1i87iTEvU= -github.com/elastic/go-licenser v0.4.1 h1:1xDURsc8pL5zYT9R29425J3vkHdt4RT5TNEMeRN48x4= github.com/elastic/go-licenser v0.4.1/go.mod h1:V56wHMpmdURfibNBggaSBfqgPxyT1Tldns1i87iTEvU= +github.com/elastic/go-licenser v0.4.2 h1:bPbGm8bUd8rxzSswFOqvQh1dAkKGkgAmrPxbUi+Y9+A= +github.com/elastic/go-licenser v0.4.2/go.mod h1:W8eH6FaZDR8fQGm+7FnVa7MxI1b/6dAqxz+zPB8nm5c= github.com/elastic/go-structform v0.0.10 h1:oy08o/Ih2hHTkNcRY/1HhaYvIp5z6t8si8gnCJPDo1w= github.com/elastic/go-structform v0.0.10/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4= github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= -github.com/elastic/go-sysinfo v1.7.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= -github.com/elastic/go-sysinfo v1.13.1 h1:U5Jlx6c/rLkR72O8wXXXo1abnGlWGJU/wbzNJ2AfQa4= -github.com/elastic/go-sysinfo v1.13.1/go.mod h1:GKqR8bbMK/1ITnez9NIsIfXQr25aLhRJa7AfT8HpBFQ= +github.com/elastic/go-sysinfo v1.14.0 h1:dQRtiqLycoOOla7IflZg3aN213vqJmP0lpVpKQ9lUEY= +github.com/elastic/go-sysinfo v1.14.0/go.mod h1:FKUXnZWhnYI0ueO7jhsGV3uQJ5hiz8OqM5b3oGyaRr8= github.com/elastic/go-ucfg v0.8.6/go.mod h1:4E8mPOLSUV9hQ7sgLEJ4bvt0KhMuDJa8joDT2QGAEKA= github.com/elastic/go-ucfg v0.8.8 h1:54KIF/2zFKfl0MzsSOCGOsZ3O2bnjFQJ0nDJcLhviyk= github.com/elastic/go-ucfg v0.8.8/go.mod h1:4E8mPOLSUV9hQ7sgLEJ4bvt0KhMuDJa8joDT2QGAEKA= @@ -827,17 +847,25 @@ github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6 github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= github.com/elastic/gojsonschema v1.2.1/go.mod h1:biw5eBS2Z4T02wjATMRSfecfjCmwaDPvuaqf844gLrg= -github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= -github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= +github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo= +github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= +github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f h1:qo0Nn9G+p7HbG+CmiWwSoiKJ/cyRq59TRn9Z2PRHTi8= +github.com/elastic/mock-es v0.0.0-20240605193845-b5546a703d6f/go.mod h1:mVdKBYYwt30xRFjCegbcURHh+3LWOCkQM33fgWbUiRI= +github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor v0.2.0 h1:hNc32QRR4oSpDWdB0CotjS57i0Cy22N4+TcUCCYP+Vs= +github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor v0.2.0/go.mod h1:5VmwVI4VxoS5mM16eeculPuWbjNdnCqDGvWfipi6yXs= +github.com/elastic/opentelemetry-lib v0.3.0 h1:5wmnCqEajieIae71vh4oET0P0LX6Tb+pY09D9dDv1wA= +github.com/elastic/opentelemetry-lib v0.3.0/go.mod h1:/kKvHbJLVo/NcKMPHI8/RZKL64fushmnRUzn+arQpjg= github.com/elastic/package-spec/v2 v2.6.0/go.mod h1:ks9/FaVOS+vCrGRQcDvXAd2FlmB84mrLikbRiO6ACuk= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= +github.com/elastic/pkcs8 v1.0.0 h1:HhitlUKxhN288kcNcYkjW6/ouvuwJWd9ioxpjnD9jVA= +github.com/elastic/pkcs8 v1.0.0/go.mod h1:ipsZToJfq1MxclVTwpG7U/bgeDtf+0HkUiOxebk95+0= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -850,8 +878,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= -github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -860,15 +886,16 @@ 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.16.1 h1:Na8CUcMdyGbnNpShY7kzcHCU7WqxuL+hnxgHZ4vaz/A= -github.com/expr-lang/expr v1.16.1/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= 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= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -922,6 +949,7 @@ github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= @@ -936,16 +964,19 @@ github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuA github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -956,10 +987,11 @@ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+ github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobuffalo/here v0.6.0 h1:hYrd0a6gDmWxBM4TnrGw8mQg24iSVoIkHEk7FodQcBI= github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= github.com/gobuffalo/logger v1.0.6/go.mod h1:J31TBEHR1QLV2683OXTAItYIg8pv2JMHnF/quuAbMjs= @@ -1026,8 +1058,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -1041,11 +1073,13 @@ github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUz github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/cel-go v0.12.5/go.mod h1:Jk7ljRzLBhkmiAwBoUxB1sZSCVBAzkqPF25olK/iRDw= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -1150,28 +1184,38 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= -github.com/haimrubinstein/go-syslog/v3 v3.0.0 h1:wuTrxJE60wx2pfwdERdbLNlcXEk3hk1MPagAaD2fq2g= -github.com/haimrubinstein/go-syslog/v3 v3.0.0/go.mod h1:/IKKpe5PS9pB5vJY1APQQM0ZPBrm95HWE1SQwsXWmVI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4= +github.com/hashicorp/consul/api v1.29.1 h1:UEwOjYJrd3lG1x5w7HxDRMGiAUPrb3f103EoeKuuEcc= +github.com/hashicorp/consul/api v1.29.1/go.mod h1:lumfRkY/coLuqMICkI7Fh3ylMG31mQSRZyef2c5YvJI= +github.com/hashicorp/consul/proto-public v0.6.1 h1:+uzH3olCrksXYWAYHKqK782CtK9scfqH+Unlw3UHhCg= +github.com/hashicorp/consul/proto-public v0.6.1/go.mod h1:cXXbOg74KBNGajC+o8RlA502Esf0R9prcoJgiOX/2Tg= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= +github.com/hashicorp/consul/sdk v0.16.1 h1:V8TxTnImoPD5cj0U9Spl0TUxcytjcbbJeADFF07KdHg= +github.com/hashicorp/consul/sdk v0.16.1/go.mod h1:fSXvwxB2hmh1FMZCNl6PwX0Q/1wdWtHJcZ7Ea5tns0s= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-memdb v1.3.0/go.mod h1:Mluclgwib3R93Hk5fxEfiRhB+6Dar64wWh71LpNSe3g= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= +github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= @@ -1179,21 +1223,27 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= -github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 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 v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/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= @@ -1201,8 +1251,10 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= @@ -1224,15 +1276,13 @@ github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/influxdata/go-syslog/v3 v3.0.0/go.mod h1:tulsOp+CecTAYC27u9miMgq21GqXRW6VdKbOG+QSP4Q= -github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 h1:2r2WiFeAwiJ/uyx1qIKnV1L4C9w/2V8ehlbJY4gjFaM= -github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4/go.mod h1:1yEQhaLb/cETXCqQmdh7lDjupNAReO7c83AHyK2dJ48= github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= @@ -1250,7 +1300,9 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= @@ -1295,16 +1347,16 @@ github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.13/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= -github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8= -github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= +github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= +github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1325,11 +1377,21 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165 h1:bCiVCRCs1Heq84lurVinUPy19keqGEe4jh5vtK37jcg= -github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg= +github.com/leodido/go-syslog/v4 v4.1.0 h1:Wsl194qyWXr7V6DrGWC3xmxA9Ra6XgWO+toNt2fmCaI= +github.com/leodido/go-syslog/v4 v4.1.0/go.mod h1:eJ8rUfDN5OS6dOkCOBYlg2a+hbAg6pJa99QXXgMrd98= +github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b h1:11UHH39z1RhZ5dc4y4r/4koJo6IYFgTRMe/LlwRTEw0= +github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg= +github.com/leoluk/perflib_exporter v0.2.1 h1:/3/ut1k/jFt5p4ypjLZKDHDqlXAK6ERZPVWtwdI389I= +github.com/leoluk/perflib_exporter v0.2.1/go.mod h1:MinSWm88jguXFFrGsP56PtleUb4Qtm4tNRH/wXNXRTI= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= +github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= +github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= +github.com/lightstep/go-expohisto v1.0.0 h1:UPtTS1rGdtehbbAF7o/dhkWLTDI73UifG8LbfQI7cA4= +github.com/lightstep/go-expohisto v1.0.0/go.mod h1:xDXD0++Mu2FOaItXtdDfksfgxfV0z1TMPa+e/EUd0cs= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lithammer/shortuuid/v3 v3.0.7/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts= @@ -1342,6 +1404,7 @@ github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXq github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -1374,8 +1437,9 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-oci8 v0.1.1/go.mod h1:wjDx6Xm9q7dFtHJvIlrI99JytznLw5wQ4R+9mNXJwGI= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -1399,9 +1463,12 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyex github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/mileusna/useragent v1.3.4 h1:MiuRRuvGjEie1+yZHO88UBYg8YBC/ddF6T7F56i3PCk= +github.com/mileusna/useragent v1.3.4/go.mod h1:3d8TOmwL/5I8pJjyVDteHtgDGcefrFUX4ccGOMKNYYc= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= @@ -1437,15 +1504,21 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= +github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mount v0.2.0/go.mod h1:aAivFE2LB3W4bACsUXChRHQ0qKWsetY4Y9V7sxOougM= github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= +github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= +github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg= +github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= @@ -1465,14 +1538,15 @@ github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJ github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mostynb/go-grpc-compression v1.2.2 h1:XaDbnRvt2+1vgr0b/l0qh4mJAfIxE0bKXtz2Znl3GGI= -github.com/mostynb/go-grpc-compression v1.2.2/go.mod h1:GOCr2KBxXcblCuczg3YdLQlcin1/NfyDA348ckuCH6w= +github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mLPqKctH7Uo//I= +github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/nelsam/hel/v2 v2.3.2/go.mod h1:1ZTGfU2PFTOd5mx22i5O0Lc2GY933lQ2wb/ggy+rL3w= @@ -1499,14 +1573,15 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0= github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= -github.com/onsi/ginkgo/v2 v2.9.0 h1:Tugw2BKlNHTMfG+CheOITkYvk4LAh6MFOvikhGVnhE8= -github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1522,36 +1597,76 @@ github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeR github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= 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.96.0 h1:kNUKM9kvJQcHYNB2obY3OaheNMoJCwPkzcJdSir6viE= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.96.0/go.mod h1:imAZ6i8ll7oqQ/cr9btc/lG2Fk8jHE24jDZh6Q0UzoY= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.96.0 h1:7ZLtvso1fCli8/Bhk2ib0c0/iT4OacRPcx8e6j74ClY= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.96.0/go.mod h1:hcpQL/YtUYT4XF8Q6xzhW0n1GjvT5ewRF3I8uKoxTdI= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.96.0 h1:uG8YgKM932zjruNwAicIKrGpW09bt+Ckcw5Zi4gn1qU= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.96.0/go.mod h1:/NVf7ci5xbUiSwqttXqqdsJMjH/C38cHhhBLnXrECA0= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.96.0 h1:tyNJ1qYXm1jMJV2NbskYosfo7xIyRP7YvbdcvldXAeA= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.96.0/go.mod h1:f3d2OcVhcMGgcMkyf614jPfAD8eE+zlJ6Pd5P43qWyI= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.96.0 h1:OedRxe8lJl1ltht3fWYIVqcLC1hGAVLZgwePuPeo71M= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.96.0/go.mod h1:eyzWPLQomfVZZZlRaKyFIupGTOjrpcUKVHz4rH4kGhg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.96.0 h1:i4PpId1NbxqVrtTb4VLYyIE57ZhTlgEEmUbTUyULlDk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.96.0/go.mod h1:Fa/tTxfSAMyDGcbon9CqBuMe0083BY+B4/4PBhop2Ko= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.96.0 h1:nVptseHpC27Zq7Fq9yF7WOgNHrCntwQ9syRI217C3sk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.96.0/go.mod h1:GxkZncXE27WmKiuI2TgR9+P/btT8sSPvY3zezKa5JEs= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.96.0 h1:iynLFjnG869r53AIhiavbEVMZoPqCba7Mijm+9MRdOo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.96.0/go.mod h1:FuTdjIZj7Un07dcbJs06IF1DJiYfpQkc4oklhNWE8fg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.96.0 h1:nzAR1IjPcbgLNFmJElLPyRlLOfijAkQcWo4L9CXixu4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.96.0/go.mod h1:Zn0A4V5t3uNr2FYsgnzT4t0OBqdOk8jcPjgHgy3jHG0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.96.0 h1:qDu31FoiT71TIhswpgqrfbwA+boU5a+xNWBKxl5Tkto= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.96.0/go.mod h1:wVd9yB8IEMBAdPq5iAoni3vvucIv1ahS7tFwl/n0jTA= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.96.0 h1:Xr4J7mX8QZTlsruw+9uAyZYsef5l2gVxNAqMcmjQ43c= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.96.0/go.mod h1:5u0tb6il3OC+ba7aV8gLx6NaN0A3NrR82Mxnux7JOew= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.96.0 h1:RPFt6OG5HTDFDuRdnN372BdPJCgGKO7CjX/gqQdccqI= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.96.0/go.mod h1:JWwuTmaCCAIg+578JoA3h49KKduGyzGQtd8Mr9AKzX8= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.96.0 h1:kqxZ0V2h6kv+AU4Dl2vp57/ayycJy9w3krWe9vBt/IA= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.96.0/go.mod h1:nSzmYMNiaw/CtKrmfG93D2Wpln0ZTvEPZ6oW/UECHuM= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.96.0 h1:E/I78f0v/HK8xwizVFu09cdjddR+A/Jki1h3Ucd0vQM= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.96.0/go.mod h1:tMegfbamNsJNMOpRILNyJq7Rz+QLY0m30s4Y//9JNNQ= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.103.0 h1:th1Swa6AOTpbr8Yui5/LLQjIwUZhV4wcbfvusKL9qSk= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.103.0/go.mod h1:5bCbYY4xRBBIwzUOdBcezz6iff7+LtPNZBYYxk+cFro= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter v0.103.0 h1:HIxeM8zec+qVIFwPuqM8mP3PEa9ODW/M5DKLkrNEMcI= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter v0.103.0/go.mod h1:TbovkNidI+olc1uNAV8xIqf6E/WOWNigEaN1BVZyEXU= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.103.0 h1:wC4nWmlXsM7FQseO73Ic+8MftJV7NRtqPjFY475Jo90= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.103.0/go.mod h1:rgaRhVR8qqSHK7UnFt055kY29QJzexZdg7YG5nJrHLQ= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.103.0 h1:ul4wxL7d8FH5qkdqvA8whNOEmK4/VH0/uXbgrFFHwHs= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.103.0/go.mod h1:aand41EuSgmlWvOM6Auw7SB75gvG3MffehUPMJ3kq2s= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.103.0 h1:ikR6Xz7QNQjJmaSGeIJbWGceBgzvkqhqXD08DihBHvI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.103.0/go.mod h1:AHFl/jNm5QPflc133yapl17l177ut2/MIAS2Zft5M3A= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.103.0 h1:txNSkgEEmDyrasuGO9egQ+58i+7P/mJKdHmSHg0sO4c= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.103.0/go.mod h1:XtRqfouM/9owDyCIi2TksmSc1sfLGmLRiFhyQ7KFS6w= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.103.0 h1:iEreRkHc4UI6cKeTMqFKhCusa7q8BnmJcHFNmJFaBwk= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage v0.103.0/go.mod h1:piJxxco+5cKjsAEWv5hh9YLK4FZbajXXNW5hTxptEL4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.103.0 h1:hdSxvwF/v3XJMWvYGlBrhewIW5zsbNLmwHeEJdTBJuU= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.103.0/go.mod h1:oGXp5qTdFmHgnm+J8v9wyjRAozZg11M8puiOZa0d+W8= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.103.0 h1:olbjLOuCgVCiRNzdg0I9Lv7VuUHFbEuqP31fdriyqi0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.103.0/go.mod h1:2Zksmb1fF+4ksNsOxSVrHz5IoC/2ljvtqJGzy7qe8+E= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.103.0 h1:xtU09wCMSp/VazMC4qjP69LnuUUNDj6aGNG/jmSZXTM= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.103.0/go.mod h1:arqw5KwD4HBC3PZeqsLqMWPmnkaOcrrW5bMndHwNyO4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.103.0 h1:HIhw3poxC0r5NyOOvO5m+yCnXWBaOvRfkq3XGs+Ag58= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.103.0/go.mod h1:5Y5wUGq+NNIgvkj3qNSsS3QJx3KiU4DfUFbMrlMlPsQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.103.0 h1:MZuxGGLUIMbErgwUeT9yqFXrsMYveGoPjck9OxHtT0A= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.103.0/go.mod h1:VS66oUydCMwiWl1BFmLs7iNy4lGsfVYsriXr/d1fpAk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.103.0 h1:vSHoHLveqT9NULaIdIbfPgEvJ0e+UkBitb3dnawmunc= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.103.0/go.mod h1:hCzgpzXbUUDUlETMDKYOpPaOhPjR9T6M3W3nAW5cGX4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet v0.103.0 h1:wutEqxE5r67s+aW48pwGEKdrqE4ODtcN4SOQraEQpsc= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet v0.103.0/go.mod h1:Ah/qqOaRXhujNMfPkNd5zlLkyagp5UTVGytGDOIULIE= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.103.0 h1:Q5b1ZIjQf5EGKAQSJa6XfHWt/TDaNs+qldqdpYK+ovo= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.103.0/go.mod h1:VDyjNiPEI3G3IJ7CwxU6zCTErB7KovQh6l51eePAPWc= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.103.0 h1:5PHQ2a5VsqXDZBmso84fLDzT66GV0mqDT5JCB07W8Ws= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.103.0/go.mod h1:oU1oils/dQVq3E3h7e3afFEXfCSmwniEK/NlEByaJWY= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.103.0 h1:j53/hdxxE6qphxI7S4ybo22/mT/0kDktWLgdwV5pB/Y= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.103.0/go.mod h1:3GFvGay9sySyHLAFlkkV1N+fUNvHz5LcN8/gPFBzEYw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.103.0 h1:5m52scH/ZNPGhTL37BcJBIIU8vhzl6VHUUe1zHynic8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.103.0/go.mod h1:gVTEVRs+N0ItJYfmeyBDjH+CT43DJVElVmsE7ac+myQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.103.0 h1:GMx3/P287NuWOJH22eLCtaJ1ATW8BoOZL6GjINUAVYI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.103.0/go.mod h1:xGM9aD/2Dww/WKg5ei7a43TRSWuVwgMO9NPjPbgtmT8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.103.0 h1:angDCU0CPBLu2fAi7r7yCEWxRKthhNnYnMugdiULmvw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.103.0/go.mod h1:N80rYgsjtq+G/DJQVCLCkxmpCIA/mnQTRUJxa8mMNsw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.103.0 h1:XYkQCe4UPFy7qmBs1zhknhe1wzPnAff4Rb4WtnD8aAQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.103.0/go.mod h1:hmeKPJaZjzOjcndDxpWnjt0781EMqvj3or01baNVoRI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.103.0 h1:1cZyMMLSpSWFdfITyVc9Bb+8rn175/GGwtWZQ3nClpc= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.103.0/go.mod h1:o8BPP4DM2SkdkPJxJOdmgxKz5DftGcuyUXgqf5MoWAw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.103.0 h1:1A4uUWQlV7K4ei0GDHFSU0wWH1qH+W0AOchbodjCDHs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.103.0/go.mod h1:Pg/6+QdHzFVuyTrCzXv8J8S4L6/H41sbRLcpoPQo4dE= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.103.0 h1:c5sOZWBMD/gyKxqwGgS6cwLdvkg6W8I3/0RZOm84xA0= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.103.0/go.mod h1:2CG+06d3sh+O36maAs2TPAbNRXZ0zcqY2kH5pEABrzg= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.103.0 h1:u2ZcBCuOXpD7FIm+LZrhEMhi/Ny/mhivAfuCUpPzrUg= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.103.0/go.mod h1:9n3OvWN10XXyg+o71jeuO94u8mEWOI90Vg8y3M7zpE0= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.103.0 h1:v19lfgrsflmimm0LGOZoB51eNO0305Yud6LCnhS7LPY= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.103.0/go.mod h1:Z8OvUd7UJJpyXT2O5ma8QT42NfkP/7Q0l1oxStJ/5MY= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.103.0 h1:0RKHdlCbOQA09p8BmtCjJqaYsu20bNVi6zWrpdgxxYw= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.103.0/go.mod h1:H1z0xcIHlvTlISLtrZlRF4nwDrGLu/iO2ExXacYcJM4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.103.0 h1:Gg2j3yN2iCQYwK+464RyVvmX+QyjjdXL3JpG+6BfDAQ= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.103.0/go.mod h1:4nxV+BIA4LLyjhFeuUuLlY7iza+PyySjKz4PfL44SRQ= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.103.0 h1:+JRtnmcLjvG0BESXWCQ9PECtTisWtnIT1/DutAdr38U= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.103.0/go.mod h1:0mYHrHaJZiWfEcYxJCMTs7AlXmnIsC3cDNbSq5e255Q= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.103.0 h1:QUsI2cTLs4CLk/TBll1llkzzchmqr2TRANdgMy0Nz/k= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.103.0/go.mod h1:cdJpaBiLfV16LteiKj8iP7snJ6alJy1dVa7FTcC915c= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.103.0 h1:8HZm7c/QOvrLdj3bZjoBaL1YqRme6/x3gCKJvvF6uMU= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.103.0/go.mod h1:saj0LAF7PbWIYnNjYjuM5UXjLiTnOug5r731oLkQv6Q= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver v0.103.0 h1:UnhfOFVZdN1344pT0yfTcRZwKOBlgdUz5iBLN66GgyU= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver v0.103.0/go.mod h1:928SKR44tAnAG5KfDzfY6waRRohMsgFj29TC4wdR04E= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.103.0 h1:7W4crd2OcXyZatXUgV0diOIKAdYBdmbwrvTw45UkDfA= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.103.0/go.mod h1:dY3HXexyi150ycmfpH2ymMnWagsJy2rVF4Y9nZXPLkI= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.103.0 h1:HOJ27FvPvxRV3f+wgAfdPrbFNTa1GxlnuWHt1VdhmCE= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.103.0/go.mod h1:Cbxjv58ed08t7VEcQa/NuC7mG5xZfn6rVAL0umg3yqI= 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= @@ -1564,8 +1679,8 @@ github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= -github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= -github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= @@ -1586,12 +1701,19 @@ github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3 github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opencontainers/selinux v1.10.1/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= +github.com/openshift/api v0.0.0-20210521075222-e273a339932a/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs= +github.com/openshift/api v3.9.0+incompatible h1:fJ/KsefYuZAjmrr3+5U9yZIZbTOpVkDDLDLFresAeYs= +github.com/openshift/api v3.9.0+incompatible/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY= +github.com/openshift/build-machinery-go v0.0.0-20210423112049-9415d7ebd33e/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= +github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142 h1:ZHRIMCFIJN1p9LsJt4HQ+akDrys4PrYnXzOWI5LK03I= +github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142/go.mod h1:fjS8r9mqDVsPb5td3NehsNOAWa4uiFkYEfVZioQ2gH0= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -1614,8 +1736,9 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= @@ -1635,16 +1758,16 @@ github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= 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= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1654,10 +1777,11 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= -github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= +github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1672,9 +1796,11 @@ 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.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= @@ -1685,8 +1811,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= @@ -1710,6 +1836,7 @@ github.com/schollz/progressbar/v3 v3.13.1 h1:o8rySDYiQ59Mwzy2FELeHY5ZARXZTVJC7iH github.com/schollz/progressbar/v3 v3.13.1/go.mod h1:xvrbki8kfT1fzWzBT/UZd9L6GA+jdL7HAgq2RFnO6fQ= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= @@ -1717,11 +1844,11 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -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.24.1 h1:R3t6ondCEvmARp3wxODhXMTLC/klMa87h2PHUw5m7QI= -github.com/shirou/gopsutil/v3 v3.24.1/go.mod h1:UU7a2MSBQa+kW1uuDq8DeEBS8kmrnQwsv2b5O513rwU= +github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= +github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= +github.com/shirou/gopsutil/v4 v4.24.5 h1:gGsArG5K6vmsh5hcFOHaPm87UD003CaDMkAOweSQjhM= +github.com/shirou/gopsutil/v4 v4.24.5/go.mod h1:aoebb2vxetJ/yIDZISmduFvVNPHqXQ9SEJwRXxkf0RA= 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= @@ -1788,8 +1915,9 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1798,13 +1926,14 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -1812,7 +1941,11 @@ github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/testcontainers/testcontainers-go v0.13.0/go.mod h1:z1abufU633Eb/FmSBTzV6ntZAC1eZBYPtaFsn4nPuDk= +github.com/testcontainers/testcontainers-go v0.31.0 h1:W0VwIhcEVhRflwL9as3dhY6jXjVCA27AkmbnZ+UTh3U= +github.com/testcontainers/testcontainers-go v0.31.0/go.mod h1:D2lAoA0zUFiSY+eAflqK5mcUx/A5hrrORaEQrd0SefI= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tilinna/clock v1.1.0 h1:6IQQQCo6KoBxVudv6gwtY8o4eDfhHo8ojA5dP0MfhSs= +github.com/tilinna/clock v1.1.0/go.mod h1:ZsP7BcY7sEEz7ktc0IVy8Us6boDrK8VradlKRUGfOao= github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= @@ -1846,6 +1979,8 @@ github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1 github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= +github.com/winlabs/gowin32 v0.0.0-20221003142512-0d265587d3c9 h1:U8aCPFEMnxAEyj9IonhMVV1gSL4nzelh8uvoXp0hrq0= +github.com/winlabs/gowin32 v0.0.0-20221003142512-0d265587d3c9/go.mod h1:N51TYkG9JGR5sytj0EoPl31Xg2kuB507lxEmrwSNvfQ= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -1861,8 +1996,6 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1872,8 +2005,8 @@ github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -1881,7 +2014,10 @@ go.elastic.co/apm v1.10.0/go.mod h1:qoOSi09pnzJDh5fKnfY7bPmQgl8yl2tULdOu03xhui0= go.elastic.co/apm v1.13.0/go.mod h1:dylGv2HKR0tiCV+wliJz1KHtDyuD8SPe69oV7VyK6WY= go.elastic.co/apm v1.15.0 h1:uPk2g/whK7c7XiZyz/YCUnAUBNPiyNeE3ARX3G6Gx7Q= go.elastic.co/apm v1.15.0/go.mod h1:dylGv2HKR0tiCV+wliJz1KHtDyuD8SPe69oV7VyK6WY= +go.elastic.co/apm/module/apmelasticsearch v1.10.0 h1:5Vq4uDpoS6kfTTBuNrEd3KJ4kwvD0MGp7Wfff1K04CY= go.elastic.co/apm/module/apmelasticsearch v1.10.0/go.mod h1:lwoaGDfZzfb9e6TXd3h8/KNmLAONOas7o5NLVNmv8Xk= +go.elastic.co/apm/module/apmelasticsearch/v2 v2.6.0 h1:ukMcwyMaDXsS1dRK2qRYXT2AsfwaUy74TOOYCqkWJow= +go.elastic.co/apm/module/apmelasticsearch/v2 v2.6.0/go.mod h1:YpfiTTrqX5LB/CKBwX89oDCBAxuLJTFv40gcfxJyehM= go.elastic.co/apm/module/apmgorilla v1.15.0 h1:1yTAksffgaFXYEIwlLRiQnxLfy3p3RtpDw8HDupIJfY= go.elastic.co/apm/module/apmgorilla v1.15.0/go.mod h1:+23mZudYvZ9VgxCQjseLo9EF5gkKEr0KSQBupw+rzP8= go.elastic.co/apm/module/apmgrpc v1.15.0 h1:Z7h58uuMJUoYXK6INFunlcGEXZQ18QKAhPh6NFYDNHE= @@ -1889,20 +2025,25 @@ go.elastic.co/apm/module/apmgrpc v1.15.0/go.mod h1:IEbTGJzY5Xx737PkHDT3bbzh9syov go.elastic.co/apm/module/apmhttp v1.10.0/go.mod h1:Y4timwcJ8sQWbWpcw3Y7Mat1OssNpGhpwyfUnpqIDew= go.elastic.co/apm/module/apmhttp v1.15.0 h1:Le/DhI0Cqpr9wG/NIGOkbz7+rOMqJrfE4MRG6q/+leU= go.elastic.co/apm/module/apmhttp v1.15.0/go.mod h1:NruY6Jq8ALLzWUVUQ7t4wIzn+onKoiP5woJJdTV7GMg= -go.elastic.co/apm/module/apmhttp/v2 v2.0.0 h1:GNfmK1LD4nE5fYqbLxROCpg1ucyjSFG5iwulxwAJ+3o= -go.elastic.co/apm/module/apmhttp/v2 v2.0.0/go.mod h1:5KmxcNN7hkJh8sVW3Ggl/pYgnwiNenygE46bZoUb9RE= -go.elastic.co/apm/v2 v2.0.0 h1:5BeBh+oIrVbMwPrW3uO9Uxm4w7HpKy92lYl5Rfj69Kg= -go.elastic.co/apm/v2 v2.0.0/go.mod h1:KGQn56LtRmkQjt2qw4+c1Jz8gv9rCBUU/m21uxrqcps= +go.elastic.co/apm/module/apmhttp/v2 v2.6.0 h1:s8UeNFQmVBCNd4eoz7KDD9rEFhQC0HeUFXz3z9gpAmQ= +go.elastic.co/apm/module/apmhttp/v2 v2.6.0/go.mod h1:D0GLppLuI0Ddwvtl595GUxRgn6Z8L5KaDFVMv2H3GK0= +go.elastic.co/apm/module/apmzap/v2 v2.6.0 h1:R/iVORzGu3F9uM43iEVHD0nwiRo59O0bIXdayKsgayQ= +go.elastic.co/apm/module/apmzap/v2 v2.6.0/go.mod h1:B3i/8xRkqLgi6zNuV+Bp7Pt4cutaOObvrVSa7wUTAPw= +go.elastic.co/apm/v2 v2.6.0 h1:VieBMLQFtXua2YxpYxaSdYGnmmxhLT46gosI5yErJgY= +go.elastic.co/apm/v2 v2.6.0/go.mod h1:33rOXgtHwbgZcDgi6I/GtCSMZQqgxkHC0IQT3gudKvo= go.elastic.co/ecszap v1.0.1 h1:mBxqEJAEXBlpi5+scXdzL7LTFGogbuxipJC0KTZicyA= go.elastic.co/ecszap v1.0.1/go.mod h1:SVjazT+QgNeHSGOCUHvRgN+ZRj5FkB7IXQQsncdF57A= -go.elastic.co/fastjson v1.1.0 h1:3MrGBWWVIxe/xvsbpghtkFoPciPhOCmjsR/HfwEeQR4= go.elastic.co/fastjson v1.1.0/go.mod h1:boNGISWMjQsUPy/t6yqt2/1Wx4YNPSe+mZjlyw9vKKI= +go.elastic.co/fastjson v1.3.0 h1:hJO3OsYIhiqiT4Fgu0ZxAECnKASbwgiS+LMW5oCopKs= +go.elastic.co/fastjson v1.3.0/go.mod h1:K9vDh7O0ODsVKV2B5e2XYLY277QZaCbB3tS1SnARvko= go.elastic.co/go-licence-detector v0.5.0 h1:YXPCyt9faKMdJ8uMrkcI4patk8WZ0ME5oaIhYBUsRU4= go.elastic.co/go-licence-detector v0.5.0/go.mod h1:fSJQU8au4SAgDK+UQFbgUPsXKYNBDv4E/dwWevrMpXU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= +go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.5/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= @@ -1934,161 +2075,167 @@ 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.96.0 h1:qXA3biNps8LPYYCTJwepGu58sW0XInmwnQbkkWZchIg= -go.opentelemetry.io/collector v0.96.0/go.mod h1:/i3zyRg23r7vloTLzKG/mRI2VkEt1Q4ARXbe3vKnAaE= -go.opentelemetry.io/collector/component v0.96.0 h1:O7F8F1YWOHNCqK5NH6vkGI6S1ObR4aPMFq3nHUxdWs0= -go.opentelemetry.io/collector/component v0.96.0/go.mod h1:HsiWaGHT+npm+c54iuUes1MpZJuGKZzS+ts2iaKt/Lo= -go.opentelemetry.io/collector/config/configauth v0.96.0 h1:nnRLtaPVafazVij60/Q6qL32WEWHOlPee5E+5D3pN4c= -go.opentelemetry.io/collector/config/configauth v0.96.0/go.mod h1:XABE3s1OiLzjhHv6R/eMOp8fYFweF6/Naa9NgDD+Ntg= -go.opentelemetry.io/collector/config/configcompression v0.96.0 h1:mbP0YbYTfbpovxcZE6JrBYmWg5G1Dozj7eOuLAdqcI4= -go.opentelemetry.io/collector/config/configcompression v0.96.0/go.mod h1:owL6s04LI1fPrNZvXiRm6o4B0jaxb3z/oFEcgrakFK4= -go.opentelemetry.io/collector/config/configgrpc v0.96.0 h1:FxCtsN8V4zYYq5wlSYAjBs3OEI1AbjfzmzSPkHYZKkY= -go.opentelemetry.io/collector/config/configgrpc v0.96.0/go.mod h1:uUxDCwvWvyf331boTH8/gZhUXXST2r1ps5+ZAvxZl4o= -go.opentelemetry.io/collector/config/confighttp v0.96.0 h1:/piTkhB+UhhkvHc2PmHBuZzvp0okWTGiL/kZIh+zMmQ= -go.opentelemetry.io/collector/config/confighttp v0.96.0/go.mod h1:KWac7J9mNFjtN4dQz8AUmFVBr7c2UOfo5OM7wfdPToI= -go.opentelemetry.io/collector/config/confignet v0.96.0 h1:ZUwziVVxWgcRMqukfKfdEjxfgmfhGsX6J3GEzF/Pupk= -go.opentelemetry.io/collector/config/confignet v0.96.0/go.mod h1:BVw5xkQ7TH2wH75cbph+dtOoxq1baWLuhdSYIAvuVu0= -go.opentelemetry.io/collector/config/configopaque v1.3.0 h1:J60RL/XxGmBF+OX2+Gx+yAo/p7YwjSsOOlPlo1yXotA= -go.opentelemetry.io/collector/config/configopaque v1.3.0/go.mod h1:+vgBSjB0aSA5SnYAbLlWAcfqgNsrX/65/8EjMKCBGyk= -go.opentelemetry.io/collector/config/configretry v0.96.0 h1:rdZqq/ddPCjZCYYuqDGxrC93uHzQWhX5MQ9tt5uMSpM= -go.opentelemetry.io/collector/config/configretry v0.96.0/go.mod h1:Nq7hp4nk+zeH0LYYsx348NHl02O89FnV45hcCCmqdtg= -go.opentelemetry.io/collector/config/configtelemetry v0.96.0 h1:Q9bSLPUzJUFG+P8eQ7W25Feko8yjdB7dK98V7hmUxCA= -go.opentelemetry.io/collector/config/configtelemetry v0.96.0/go.mod h1:tl8sI2RE3LSgJ0HjpadYpIwsKzw/CRA0nZUXLzMAZS0= -go.opentelemetry.io/collector/config/configtls v0.96.0 h1:SPsL0ZzmNscRtKYCECXfvEE8tB6BqNdnWAgB42KCPeE= -go.opentelemetry.io/collector/config/configtls v0.96.0/go.mod h1:/LHiDf3jMuEY+rXu3DMWBmArcf0DPIc3V0aKQeaTEdQ= -go.opentelemetry.io/collector/config/internal v0.96.0 h1:/HJtvjB9/XJRFs+g0XpRInRdUz0O7yeIbe0Av/Dg/TM= -go.opentelemetry.io/collector/config/internal v0.96.0/go.mod h1:74acJyU1E+bFidoy0tjTORZGttdjDYnKhkqGjao/bUA= -go.opentelemetry.io/collector/confmap v0.96.0 h1:415ELCfC8S3xjiNFLneDWJi6h7j7SUw8A8pZtINEQdI= -go.opentelemetry.io/collector/confmap v0.96.0/go.mod h1:q/dWHLvkk1vgvAF0l5dbgQSiPOmGwpv0FwcNaGpqsfM= -go.opentelemetry.io/collector/confmap/converter/expandconverter v0.96.0 h1:ISINaNKyTKIQQO5ijXXb2fagAmyZgndluqgF6Eccl50= -go.opentelemetry.io/collector/confmap/converter/expandconverter v0.96.0/go.mod h1:eBpkcWGSKntw8xzifdg9okqHZ0o3kIqHjfyGM3afPbc= -go.opentelemetry.io/collector/confmap/provider/envprovider v0.96.0 h1:ylJ12FL62H7liRCvxfvZQBSc0u4ggtTvjxML97jBwlE= -go.opentelemetry.io/collector/confmap/provider/envprovider v0.96.0/go.mod h1:vxIfEbehiq8JwlWqDgzWO14kl0K/g1jc/+J6LANnpj0= -go.opentelemetry.io/collector/confmap/provider/fileprovider v0.96.0 h1:1PrjESnmkJ231dCsO/n5SGGUPKc7J4qk4tYtvjoJbMs= -go.opentelemetry.io/collector/confmap/provider/fileprovider v0.96.0/go.mod h1:rJXmOz1Q9nTl3Mubxb2HvAy7KWoi3Re2ettuo0BFUVw= -go.opentelemetry.io/collector/confmap/provider/httpprovider v0.96.0 h1:ulbACw+gY1Wp9tiewDz3+w8lTfUdCT7YJ/qb//JqD7s= -go.opentelemetry.io/collector/confmap/provider/httpprovider v0.96.0/go.mod h1:QqSQiNy44Kw39cHIqCB7Zyq5f2SU1bX7AgmUhZblxRI= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.96.0 h1:Hb51q5K2F5IYPS0/fwixQr2Metzb8RnZO0lT25z0ehM= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.96.0/go.mod h1:mD+9d+cBvlAm7tgLEgfDbHBaLgr+9PIPJI8K5cMNU7o= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.96.0 h1:/uuau+nbiLvw9Zan78ySruDr9S12iLPw5d9i6h8379I= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.96.0/go.mod h1:NPK3XddOGCuNavzunXD94dP9jLU4BAMs4mI9pOW0N80= -go.opentelemetry.io/collector/connector v0.96.0 h1:wPrX7Yc70Xko7nFin5gYxe6xPCkV7mHcKeQ75Y0HsTU= -go.opentelemetry.io/collector/connector v0.96.0/go.mod h1:6laIl3khhccApCiWjPeupU9BKw6KRoqLDt0OHS2OIp0= -go.opentelemetry.io/collector/consumer v0.96.0 h1:JN4JHelp5EGMGoC2UVelTMG6hyZjgtgdLLt5eZfVynU= -go.opentelemetry.io/collector/consumer v0.96.0/go.mod h1:Vn+qzzKgekDFayCVV8peSH5Btx1xrt/bmzD9gTxgidQ= -go.opentelemetry.io/collector/exporter v0.96.0 h1:SmOSaP+zUNq0nl+BcllsCSsYePdUNIIUfW5sXKKaUlI= -go.opentelemetry.io/collector/exporter v0.96.0/go.mod h1:DcuGaxcINhOV2LgojDI56r3830cUtuCsNadINMIU23c= -go.opentelemetry.io/collector/exporter/debugexporter v0.96.0 h1:88v2GWCIuYgd3e4KdwF0JLklIgBzETBw0e3dkEJ7BbI= -go.opentelemetry.io/collector/exporter/debugexporter v0.96.0/go.mod h1:mZjJ0G6Pn6aSS7T4UeEjXSHt3pgslvaZa/4Uam8DKuo= -go.opentelemetry.io/collector/exporter/otlpexporter v0.96.0 h1:vZEd10B/zj7WkBWSVegDkGOwv7FZhUwyk60E2zkYwL4= -go.opentelemetry.io/collector/exporter/otlpexporter v0.96.0/go.mod h1:tzJFwn1fR88rdGKkpvygMawu2Prc53bFhuKFk3EnpS8= -go.opentelemetry.io/collector/extension v0.96.0 h1:b02WX/2XxDf/PlqboYwWUSmiT2BXXWSntlnDlGiJuWw= -go.opentelemetry.io/collector/extension v0.96.0/go.mod h1:RrjDbQUCPKZmR9mfZ6kVQ0J8OfrcYnf09U+6ZyToV/Q= -go.opentelemetry.io/collector/extension/auth v0.96.0 h1:10ZSoVCF0WI8IYS+kD7lbdvbvOdfUBGEQ0c4G1mVuCU= -go.opentelemetry.io/collector/extension/auth v0.96.0/go.mod h1:UX0SpWMwRvzEaVr6fxP2CNooQ2JnuTEnTGYD8kCAjWc= -go.opentelemetry.io/collector/extension/zpagesextension v0.96.0 h1:eSjSBqWIN+OiEBgZhRq8B2LDmqZMgBRMNAF1oGfp4XI= -go.opentelemetry.io/collector/extension/zpagesextension v0.96.0/go.mod h1:wWBmrP4H/gEInjtCiwZHlDj5+MuWI8bLybCSIrNXoNE= -go.opentelemetry.io/collector/featuregate v1.3.0 h1:nrFSx+zfjdisjE9oCx25Aep3nJ9RaUjeE1qFL6eovoU= -go.opentelemetry.io/collector/featuregate v1.3.0/go.mod h1:mm8+xyQfgDmqhyegZRNIQmoKsNnDTwWKFLsdMoXAb7A= -go.opentelemetry.io/collector/otelcol v0.96.0 h1:/UGDovYdOAgXgRJlTlBEGXv8oF9vDoEjp2P5lidAkTY= -go.opentelemetry.io/collector/otelcol v0.96.0/go.mod h1:Xo58hEmoZFLyOIs9Wk400ME9gEFV+ttxCGcls6NxbhI= -go.opentelemetry.io/collector/pdata v1.3.0 h1:JRYN7tVHYFwmtQhIYbxWeiKSa2L1nCohyAs8sYqKFZo= -go.opentelemetry.io/collector/pdata v1.3.0/go.mod h1:t7W0Undtes53HODPdSujPLTnfSR5fzT+WpL+RTaaayo= -go.opentelemetry.io/collector/processor v0.96.0 h1:TGo7tLbLJo9tBZ9NNoSlB7xBP5osUXThKxCmg96gSko= -go.opentelemetry.io/collector/processor v0.96.0/go.mod h1:fvTTODSFY97D6Fc/iwBOL3outreBvZBlaHT2ciEWNZQ= -go.opentelemetry.io/collector/processor/batchprocessor v0.96.0 h1:5SbJUx9q4w05QSl7p1xOEdNLOmmPZDE9SXi0OST1SbI= -go.opentelemetry.io/collector/processor/batchprocessor v0.96.0/go.mod h1:NSlJS7EQ4zR4aisHAoKZEC2KP9LcSgMw8Yap2cCAO4I= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.96.0 h1:BOAg0hhFCSsuFsCXdwAb5tGgPHRG5D9bwsWERHRc1So= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.96.0/go.mod h1:TnvJD4MgxhHX0/y9lVtfeiDP6033/VyhM8FO2TT9klE= -go.opentelemetry.io/collector/receiver v0.96.0 h1:OrlcuyFCBQpbWNb2klzTdz1ZXMk0acRDh7fbaQtP4eo= -go.opentelemetry.io/collector/receiver v0.96.0/go.mod h1:fb5Vr2+tAkzB4qE6+lNaMsZwaeE8qZvG3IBdzK5hCRY= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.96.0 h1:3tQG3+Bd5Ur/htNHTSHcwS25Cq+hLhC5+mti63x8NsY= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.96.0/go.mod h1:LgauKnCOayfutm4Y+WN3AaqK3cM+R7o+v3uXsq/be64= -go.opentelemetry.io/collector/semconv v0.96.0 h1:DrZy8BpzJDnN2zFxXRj6BhfGYxNlqpFHBqyuS9fVHRY= -go.opentelemetry.io/collector/semconv v0.96.0/go.mod h1:zOm/U3pgMIWcvrcnPbR9Xx2HinoXj46ERMK8PUV9wrs= -go.opentelemetry.io/collector/service v0.96.0 h1:CDwDJ6aOmXFaTYWuj0KB3D4MpXdNlfJ5e5uj12OqAc4= -go.opentelemetry.io/collector/service v0.96.0/go.mod h1:9El7PPhnV+2xPXLlyileLaUa5mOE+vw6sswmcZBaUlc= +go.opentelemetry.io/collector v0.103.0 h1:mssWo1y31p1F/SRsSBnVUX6YocgawCqM1blpE+hkWog= +go.opentelemetry.io/collector v0.103.0/go.mod h1:mgqdTFB7QCYiOeEdJSSEktovPqy+2fw4oTKJzyeSB0U= +go.opentelemetry.io/collector/component v0.103.0 h1:j52YAsp8EmqYUotVUwhovkqFZGuxArEkk65V4TI46NE= +go.opentelemetry.io/collector/component v0.103.0/go.mod h1:jKs19tGtCO8Hr5/YM0F+PoFcl8SVe/p4Ge30R6srkbc= +go.opentelemetry.io/collector/config/configauth v0.103.0 h1:tv2Ilj0X9T8ZsDd4mB8Sl+nXQ8CG8MJVQ1Lo4mmE0Pk= +go.opentelemetry.io/collector/config/configauth v0.103.0/go.mod h1:VIo8DpFeyOOCMUVoQsBdq3t2snUiBBECP0UxW1bwz/o= +go.opentelemetry.io/collector/config/configcompression v1.10.0 h1:ClkAY1rzaxFawmC53BUf3TjTWKOGx+2xnpqOJIkg6Tk= +go.opentelemetry.io/collector/config/configcompression v1.10.0/go.mod h1:6+m0GKCv7JKzaumn7u80A2dLNCuYf5wdR87HWreoBO0= +go.opentelemetry.io/collector/config/configgrpc v0.103.0 h1:H1TXxUwxaZINmAzuehP/8ExKhJKzuw/oBGc7juzwloo= +go.opentelemetry.io/collector/config/configgrpc v0.103.0/go.mod h1:1FG873Wpw9AWANjXBvOd59noWY3dZoU6WkMWLJDx5FQ= +go.opentelemetry.io/collector/config/confighttp v0.103.0 h1:tgCWMKuIorSr4+iQOv0A8Ya/8do73hiG5KHinWaz63Q= +go.opentelemetry.io/collector/config/confighttp v0.103.0/go.mod h1:xMXoLsTGTJlftu+VAL3iadEs4gkmqFrvuPPnpNi6ETo= +go.opentelemetry.io/collector/config/confignet v0.103.0 h1:A2/8y2oEFaJbmtl+r1JIP0y+281vmmcPp0P51xcSn5s= +go.opentelemetry.io/collector/config/confignet v0.103.0/go.mod h1:pfOrCTfSZEB6H2rKtx41/3RN4dKs+X2EKQbw3MGRh0E= +go.opentelemetry.io/collector/config/configopaque v1.10.0 h1:FAxj6ggLpJE/kFnR1ezYwjRdo6gHo2+CjlIsHVCFVnQ= +go.opentelemetry.io/collector/config/configopaque v1.10.0/go.mod h1:0xURn2sOy5j4fbaocpEYfM97HPGsiffkkVudSPyTJlM= +go.opentelemetry.io/collector/config/configretry v0.103.0 h1:AwWGdeYJvUCZfh127Jb8uj7kuoPrJ3t2iZGwQUxmb7c= +go.opentelemetry.io/collector/config/configretry v0.103.0/go.mod h1:P+RA0IA+QoxnDn4072uyeAk1RIoYiCbxYsjpKX5eFC4= +go.opentelemetry.io/collector/config/configtelemetry v0.103.0 h1:KLbhkFqdw9D31t0IhJ/rnhMRvz/s14eie0fKfm5xWns= +go.opentelemetry.io/collector/config/configtelemetry v0.103.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/config/configtls v0.103.0 h1:nbk8sJIHoYYQbpZtUkUQceTbjC4wEjoePKJ15v8cCcU= +go.opentelemetry.io/collector/config/configtls v0.103.0/go.mod h1:046dfdfHW8wWCMhzUaWJo7guRiCoSz5QzVjCSDzymdU= +go.opentelemetry.io/collector/config/internal v0.103.0 h1:pimS3uLHfOBbConZrviGoTwu+bkTNDoQBtbeWCg8U8k= +go.opentelemetry.io/collector/config/internal v0.103.0/go.mod h1:kJRkB+PgamWqPi/GWbYWvnRzVzS1rwDUh6+VSz4C7NQ= +go.opentelemetry.io/collector/confmap v0.103.0 h1:qKKZyWzropSKfgtGv12JzADOXNgThqH1Vx6qzblBE24= +go.opentelemetry.io/collector/confmap v0.103.0/go.mod h1:TlOmqe/Km3K6WgxyhEAdCb/V1Yp6eSU76fCoiluEa88= +go.opentelemetry.io/collector/confmap/converter/expandconverter v0.103.0 h1:zApcKLSosuu9I/4IRHTqlE1H6XNiZNAgd26YbzHwkto= +go.opentelemetry.io/collector/confmap/converter/expandconverter v0.103.0/go.mod h1:hoel+3CPjRhPSHzCrE1E+wCyoSLHlgW7662Ntwx2ujM= +go.opentelemetry.io/collector/confmap/provider/envprovider v0.103.0 h1:0XHQ/ffxSUx3sMbnYSf8a4jnVYLUrxo+/XwdhXkizgs= +go.opentelemetry.io/collector/confmap/provider/envprovider v0.103.0/go.mod h1:NiE4Fe42Sew1TyXuU1YEd0xZBDNI+w6IRkC2OTlJUak= +go.opentelemetry.io/collector/confmap/provider/fileprovider v0.103.0 h1:5dB2G7d6RKmWS8ptuAWvAEKGYODk2DTRm84bU9HooLQ= +go.opentelemetry.io/collector/confmap/provider/fileprovider v0.103.0/go.mod h1:GT/GBk17lDhc27762w6PNHvKYbA+TnHvNEyQHUsjKpY= +go.opentelemetry.io/collector/confmap/provider/httpprovider v0.103.0 h1:Hrp+nw4W9/jeJfi3GfJW6EYh7DeNkaC1wojOh4x8CbI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v0.103.0/go.mod h1:kUst0pGVBlKDSlvJYDclrsApbkMv7ahRDh6/pE4LsBc= +go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.103.0 h1:JUDRYsMOhkIBxZqZli0BU+64zahIUgnEPZSe9wo2T0Q= +go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.103.0/go.mod h1:+mUrWjpdGIdSKMeeplLO+qXFSBc287as2oIPVdKMTxc= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.103.0 h1:boTv+ZRkn1h5eUbt5sLSU5lCrItCCxCen/laRmsHLyg= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.103.0/go.mod h1:0pZ7RD7SPg+yklgGPN+74Zzbps4R9x5bRPZX1D1gtGM= +go.opentelemetry.io/collector/connector v0.103.0 h1:jwmrgCT6ftz3U4o8mAqP+/yaQ5KsLMFXo2+OHXhy+tE= +go.opentelemetry.io/collector/connector v0.103.0/go.mod h1:6RDaeDMiXTKEXSy1eIaO0EiM+/91NVHdBxOc9e2++2A= +go.opentelemetry.io/collector/consumer v0.103.0 h1:L/7SA/U2ua5L4yTLChnI9I+IFGKYU5ufNQ76QKYcPYs= +go.opentelemetry.io/collector/consumer v0.103.0/go.mod h1:7jdYb9kSSOsu2R618VRX0VJ+Jt3OrDvvUsDToHTEOLI= +go.opentelemetry.io/collector/exporter v0.103.0 h1:g0nF/FAwuA7tTJf5uo1PvlQl7xFqCgvfH+FYqufBSiw= +go.opentelemetry.io/collector/exporter v0.103.0/go.mod h1:PC2OvciPEew2kaA/ZMyxRqfeOW8Wgi0CYR614PEyS/w= +go.opentelemetry.io/collector/exporter/debugexporter v0.103.0 h1:jwZHoXvp3vdQ3obtnU+Vav5ChTCUBSC6mvlOZJ8doCU= +go.opentelemetry.io/collector/exporter/debugexporter v0.103.0/go.mod h1:kzmBnKxsLNVBRGS8nwu497SvHspzyeiV06+LiPHktto= +go.opentelemetry.io/collector/exporter/otlpexporter v0.103.0 h1:YKdYP3tDOQC6sOdOD1/Sun6CA4Zwpky+aRve3dx5QcE= +go.opentelemetry.io/collector/exporter/otlpexporter v0.103.0/go.mod h1:4UVHkqgL80CRVrbD85p2k4swDe27gLyQkoKlSYOkR0A= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.103.0 h1:26jP07GOjipKnFAKw0hDnCTB67tXZzHN+uxii3mnbjw= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.103.0/go.mod h1:qJGL48tf0CamMLUjO+HtxDeDZ+4pvvxxF1GDqE5VHnc= +go.opentelemetry.io/collector/extension v0.103.0 h1:vTsd+GElvT7qKk9Y9d6UKuuT2Ngx0mai8Q48hkKQMwM= +go.opentelemetry.io/collector/extension v0.103.0/go.mod h1:rp2l3xskNKWv0yBCyU69Pv34TnP1QVD1ijr0zSndnsM= +go.opentelemetry.io/collector/extension/auth v0.103.0 h1:i7cQl+Ewpve/DIN4rFMg1GiyUPE14LZsYWrJ1RqtP84= +go.opentelemetry.io/collector/extension/auth v0.103.0/go.mod h1:JdYBS/EkPAz2APAi8g7xTiSRlZTc7c4H82AQM9epzxw= +go.opentelemetry.io/collector/extension/memorylimiterextension v0.103.0 h1:uYBw7DewMQyafgDJYFHs72TC2n7ZIJtUZi/7Q7JVFpM= +go.opentelemetry.io/collector/extension/memorylimiterextension v0.103.0/go.mod h1:EaAGms9HlS29i+X0lkhPt+z2pMhZrwpOLnlprrAwmwY= +go.opentelemetry.io/collector/extension/zpagesextension v0.103.0 h1:jgSEQY++zOI6hFQygwuvS6ulJ/Yu4xXgUg+Ijoxx51I= +go.opentelemetry.io/collector/extension/zpagesextension v0.103.0/go.mod h1:2OUi0Hp+3zPUJmi7goJ6d1/kGgFAw3SDESRX7xQ0QHE= +go.opentelemetry.io/collector/featuregate v1.10.0 h1:krSqokHTp7JthgmtewysqHuOAkcuuZl7G2n91s7HygE= +go.opentelemetry.io/collector/featuregate v1.10.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= +go.opentelemetry.io/collector/filter v0.103.0 h1:5pyfcT8ZCD5xKWI4pgnMdCI8a/YtDp0zzWXn7gcqp0A= +go.opentelemetry.io/collector/filter v0.103.0/go.mod h1:SvQIh3hd3b393qVHWu2GXGt8tDacFZblYhg6vVqrRs8= +go.opentelemetry.io/collector/otelcol v0.103.0 h1:Skqnc2mxDdk3eiYioUuG7ST6ur5k83SOv7mIBt60fBw= +go.opentelemetry.io/collector/otelcol v0.103.0/go.mod h1:iJF3ghCv+nRZI6+hI7z3kGRZrgH///Fd9tNXY82X90g= +go.opentelemetry.io/collector/pdata v1.10.0 h1:oLyPLGvPTQrcRT64ZVruwvmH/u3SHTfNo01pteS4WOE= +go.opentelemetry.io/collector/pdata v1.10.0/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= +go.opentelemetry.io/collector/pdata/testdata v0.103.0 h1:iI6NOE0L2je/bxlWzAWHQ/yCtnGupgv42Hl9Al1q/g4= +go.opentelemetry.io/collector/pdata/testdata v0.103.0/go.mod h1:tLzRhb/h37/9wFRQVr+CxjKi5qmhSRpCAiOlhwRkeEk= +go.opentelemetry.io/collector/processor v0.103.0 h1:YZ+LRuHKtOam7SCeLkJAP6bS1d6XxeYP22OyMN3VP0s= +go.opentelemetry.io/collector/processor v0.103.0/go.mod h1:/mxyh0NpJgpZycm7iHDpM7i5PdtWvKKdCZf0cyADJfU= +go.opentelemetry.io/collector/processor/batchprocessor v0.103.0 h1:vunxXGq5Pzcawj4QbXKrIOoXLHpPbRbwNBFPR80X0R4= +go.opentelemetry.io/collector/processor/batchprocessor v0.103.0/go.mod h1:c5nh1LHVlBFQajCnm/5hwKqAvOLpTTOd2GQyB7lT75E= +go.opentelemetry.io/collector/receiver v0.103.0 h1:V3JBKkX+7e/NYpDDZVyeu2VQB1/lLFuoJFPfupdCcZs= +go.opentelemetry.io/collector/receiver v0.103.0/go.mod h1:Yybv4ynKFdMOYViWWPMmjkugR89FSQN0P37wP6mX6qM= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.103.0 h1:TycVVl4AWioV6kWeFcCIk2QuKfXOzn88yw989opsMdE= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.103.0/go.mod h1:jAbzL5lwOGG93YbcPZ6aFZIZq+tjYQ+BS3vKKT2nRgw= +go.opentelemetry.io/collector/semconv v0.103.0 h1:5tlVoZlo9USHAU2Bz4YrEste0Vm5AMufXkYJhAVve1Q= +go.opentelemetry.io/collector/semconv v0.103.0/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= +go.opentelemetry.io/collector/service v0.103.0 h1:e4Eri4jo+YOuEK0+/JE9SUdT/NZaJ2jz/ROJlmLn96s= +go.opentelemetry.io/collector/service v0.103.0/go.mod h1:p1mlniiC1MuPN5FANYJYgf5V5CGFP0hNqWfI8t7Aw8M= 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.4.0 h1:Xb+ncYOqseLroMuBesGNRgVQolXcXOhMj7EhGwJCdHs= -go.opentelemetry.io/contrib/config v0.4.0/go.mod h1:drNk2xRqLWW4/amk6Uh1S+sDAJTc7bcEEN1GfJzj418= +go.opentelemetry.io/contrib/config v0.7.0 h1:b1rK5tGTuhhPirJiMxOcyQfZs76j2VapY6ODn3b2Dbs= +go.opentelemetry.io/contrib/config v0.7.0/go.mod h1:8tdiFd8N5etOi3XzBmAoMxplEzI3TcL8dU5rM5/xcOQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0/go.mod h1:E5NNboN0UqSAki0Atn9kVwaN7I+l25gGxDqBueo/74E= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0/go.mod h1:h8TWwRAhQpOd0aM5nYsRD8+flnkj+526GEIVlarH7eY= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0/go.mod h1:9NiG9I2aHTKkcxqCILhjtyNA1QEiCjdBACv4IvrFQ+c= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= -go.opentelemetry.io/contrib/propagators/b3 v1.24.0 h1:n4xwCdTx3pZqZs2CjS/CUZAs03y3dZcGhC/FepKtEUY= -go.opentelemetry.io/contrib/propagators/b3 v1.24.0/go.mod h1:k5wRxKRU2uXx2F8uNJ4TaonuEO/V7/5xoz7kdsDACT8= -go.opentelemetry.io/contrib/zpages v0.49.0 h1:Wk217PkNBxcKWnIQpwtbZZE286K4ZY9uajnM5woSeLU= -go.opentelemetry.io/contrib/zpages v0.49.0/go.mod h1:6alLi5mmkZWbAtZMRPd1ffIgkTcsU9OTHQF2NbSOhrQ= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= +go.opentelemetry.io/contrib/propagators/b3 v1.27.0 h1:IjgxbomVrV9za6bRi8fWCNXENs0co37SZedQilP2hm0= +go.opentelemetry.io/contrib/propagators/b3 v1.27.0/go.mod h1:Dv9obQz25lCisDvvs4dy28UPh974CxkahRDUPsY7y9E= +go.opentelemetry.io/contrib/zpages v0.52.0 h1:MPgkMy0Cp3O5EdfVXP0ss3ujhEibysTM4eszx7E7d+E= +go.opentelemetry.io/contrib/zpages v0.52.0/go.mod h1:fqG5AFdoYru3A3DnhibVuaaEfQV2WKxE7fYE1jgDRwk= go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/bridge/opencensus v1.24.0 h1:Vlhy5ee5k5R0zASpH+9AgHiJH7xnKACI3XopO1tUZfY= -go.opentelemetry.io/otel/bridge/opencensus v1.24.0/go.mod h1:jRjVXV/X38jyrnHtvMGN8+9cejZB21JvXAAvooF2s+Q= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/bridge/opencensus v1.27.0 h1:ao9aGGHd+G4YfjBpGs6vbkvt5hoC67STlJA9fCnOAcs= +go.opentelemetry.io/otel/bridge/opencensus v1.27.0/go.mod h1:uRvWtAAXzyVOST0WMPX5JHGBaAvBws+2F8PcC5gMnTk= go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0 h1:f2jriWfOdldanBwS9jNBdeOKAQN7b4ugAMaNu1/1k9g= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0/go.mod h1:B+bcQI1yTY+N0vqMpoZbEN7+XU4tNM0DmUiOwebFJWI= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.24.0 h1:mM8nKi6/iFQ0iqst80wDHU2ge198Ye/TfN0WBS5U24Y= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.24.0/go.mod h1:0PrIIzDteLSmNyxqcGYRL4mDIo8OTuBAOI/Bn1URxac= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 h1:bFgvUr3/O4PHj3VQcFEuYKvRZJX1SJDQ+11JXuSB3/w= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0/go.mod h1:xJntEd2KL6Qdg5lwp97HMLQDVeAhrYxmzFseAMDPQ8I= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0 h1:CIHWikMsN3wO+wq1Tp5VGdVRTcON+DmOJSfDjXypKOc= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0/go.mod h1:TNupZ6cxqyFEpLXAZW7On+mLFL0/g0TE3unIYL91xWc= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.0.1/go.mod h1:Kv8liBeVNFkkkbilbgWRpV+wWuu+H5xdOT6HAgd30iw= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0/go.mod h1:Krqnjl22jUJ0HgMzw5eveuCvFDXY4nSYb4F8t5gdrag= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.0.1/go.mod h1:xOvWoTOrQjxjW61xtOmD/WKGRYb/P4NzRo3bs65U6Rk= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0/go.mod h1:OfUCyyIiDvNXHWpcWgbF+MWvqPZiNa3YDEnivcnYsV0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM= -go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ= -go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.24.0 h1:JYE2HM7pZbOt5Jhk8ndWZTUWYOVift2cHjXVMkPdmdc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.24.0/go.mod h1:yMb/8c6hVsnma0RpsBMNo0fEiQKeclawtgaIaOp2MLY= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 h1:s0PHtIkN+3xrbDOpt2M8OTG92cWqUESvzh2MxiR5xY8= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0/go.mod h1:hZlFbDbRt++MMPCCfSJfmhkGIWnX1h3XjkfxZUjLrIA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0 h1:QY7/0NeRPKlzusf40ZE4t1VlMKbqSNT7cJRYzWuja0s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0/go.mod h1:HVkSiDhTM9BoUJU8qE6j2eSWLLXvi1USXjyd2BXT8PY= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= +go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 h1:/jlt1Y8gXWiHG9FBx6cJaIC5hYx5Fe64nC8w5Cylt/0= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0/go.mod h1:bmToOGOBZ4hA9ghphIc1PAf66VA8KOtsuy3+ScStG20= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0 h1:/0YaXu3755A/cFbtXp+21lkXgI0QE5avTWA2HjU9/WE= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0/go.mod h1:m7SFxp0/7IxmJPLIY3JhOcU9CoFzDaCPL6xxQIxhA+o= go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= go.opentelemetry.io/otel/sdk v1.0.1/go.mod h1:HrdXne+BiwsOHYYkBE5ysIcv2bvdZstxzmCQhxTcZkI= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE= -go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= -go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8= -go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0= +go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.9.0/go.mod h1:1vKfU9rv61e9EVGthD1zNvUbiwPcimSsOPU9brfSHJg= go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= -go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= +go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= +go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= go.starlark.net v0.0.0-20221205180719-3fd0dac74452/go.mod h1:kIVgS18CjmEC3PqMd5kaJSGEifyV/CeB9x506ZJ1Vbk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -2128,7 +2275,6 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -2153,8 +2299,10 @@ 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.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= 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= @@ -2165,8 +2313,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-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= -golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= 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= @@ -2191,6 +2339,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -2201,8 +2350,8 @@ golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2251,6 +2400,7 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= @@ -2288,8 +2438,10 @@ 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.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= 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= @@ -2317,8 +2469,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.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= 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= @@ -2334,8 +2486,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2491,9 +2643,10 @@ 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.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.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= @@ -2508,8 +2661,11 @@ 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.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= 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= @@ -2525,8 +2681,10 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2538,8 +2696,9 @@ golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -2614,7 +2773,6 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -2622,8 +2780,8 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.4.1-0.20221208213631-3f74d914ae6d/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools/go/vcs v0.1.0-deprecated h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4= golang.org/x/tools/go/vcs v0.1.0-deprecated/go.mod h1:zUrvATBAvEI9535oC0yWYsLsHIV4Z7g63sNPVMtuBy8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2634,8 +2792,8 @@ golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= -gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= +gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= +gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -2697,8 +2855,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww 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/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= @@ -2819,12 +2975,10 @@ google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZV google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 h1:9Xyg6I9IWQZhRVfCWjKK+l6kI0jHcPesVlMnT//aHNo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -2870,8 +3024,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.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= 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= @@ -2890,8 +3044,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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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= @@ -2912,6 +3066,8 @@ gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mcuadros/go-syslog.v2 v2.3.0 h1:kcsiS+WsTKyIEPABJBJtoG0KkOS6yzvJ+/eZlhD79kk= +gopkg.in/mcuadros/go-syslog.v2 v2.3.0/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= @@ -2951,8 +3107,9 @@ gotest.tools/gotestsum v1.9.0/go.mod h1:6JHCiN6TEjA7Kaz23q1bH0e2Dc3YJjDUZ0DmctFZ gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= helm.sh/helm/v3 v3.11.2/go.mod h1:Hw+09mfpDiRRKAgAIZlFkPSeOkvv7Acl5McBvQyNPVw= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2965,24 +3122,28 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.4.3/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= howett.net/plist v0.0.0-20201203080718-1454fab16a06/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= -howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= +howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM= +howett.net/plist v1.0.1/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= +k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s= k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= -k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU= k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE= +k8s.io/api v0.29.5 h1:levS+umUigHCfI3riD36pMY1vQEbrzh4r1ivVWAhHaI= +k8s.io/api v0.29.5/go.mod h1:7b18TtPcJzdjk7w5zWyIHgoAtpGeRvGGASxlS7UZXdQ= k8s.io/apiextensions-apiserver v0.26.0/go.mod h1:7ez0LTiyW5nq3vADtK6C3kMESxadD51Bh6uz3JOlqWQ= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= +k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k= k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= +k8s.io/apimachinery v0.29.5 h1:Hofa2BmPfpoT+IyDTlcPdCHSnHtEQMoJYGVoQpRTfv4= +k8s.io/apimachinery v0.29.5/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= @@ -2993,11 +3154,14 @@ k8s.io/cli-runtime v0.26.3/go.mod h1:5YEhXLV4kLt/OSy9yQwtSSNZU2Z7aTEYta1A+Jg4VC4 k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= +k8s.io/client-go v0.21.1/go.mod h1:/kEw4RgW+3xnBGzvp9IWxKSNA+lXn3A7AuH3gdOAzLs= k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= k8s.io/client-go v0.26.0/go.mod h1:I2Sh57A79EQsDmn7F7ASpmru1cceh3ocVT9KlX2jEZg= -k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s= k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ= +k8s.io/client-go v0.29.5 h1:nlASXmPQy190qTteaVP31g3c/wi2kycznkTP7Sv1zPc= +k8s.io/client-go v0.29.5/go.mod h1:aY5CnqUUvXYccJhm47XHoPcRyX6vouHdIBHaKZGTbK4= k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= +k8s.io/code-generator v0.21.1/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/code-generator v0.26.0/go.mod h1:OMoJ5Dqx1wgaQzKgc+ZWaZPfGjdRq/Y3WubFrZmeI3I= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= @@ -3014,25 +3178,32 @@ k8s.io/cri-api v0.25.0/go.mod h1:J1rAyQkSJ2Q6I+aBMOVgg2/cbbebso6FNa0UagiR0kc= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kms v0.26.0/go.mod h1:ReC1IEGuxgfN+PDCIpR6w8+XMmDE7uJhxcCwMZFdIYc= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= +k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kube-openapi v0.0.0-20220401212409-b28bf2818661/go.mod h1:daOouuuwd9JXpv1L7Y34iV3yf6nxzipkKMWWlqlvK9M= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 h1:tBEbstoM+K0FiBV5KGAKQ0kuvf54v/hwpldiJt69w1s= k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/kubectl v0.26.0/go.mod h1:eInP0b+U9XUJWSYeU9XZnTA+cVYuWyl3iYPGtru0qhQ= +k8s.io/kubelet v0.29.3 h1:X9h0ZHzc+eUeNTaksbN0ItHyvGhQ7Z0HPjnQD2oHdwU= +k8s.io/kubelet v0.29.3/go.mod h1:jDiGuTkFOUynyBKzOoC1xRSWlgAZ9UPcTYeFyjr6vas= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/metrics v0.26.0/go.mod h1:cf5MlG4ZgWaEFZrR9+sOImhZ2ICMpIdNurA+D8snIs8= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= @@ -3041,8 +3212,9 @@ k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= oras.land/oras-go v1.2.2/go.mod h1:Apa81sKoZPpP7CDciE006tSZ0x3Q3+dOoBcMZ/aNxvw= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= @@ -3062,9 +3234,11 @@ sigs.k8s.io/kustomize/kyaml v0.13.9/go.mod h1:QsRbD0/KcU+wdk0/L0fIp2KLnohkVzs6fQ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_application.go b/internal/pkg/agent/application/actions/handlers/handler_action_application.go index bbce596b2df..d68ea21ff86 100644 --- a/internal/pkg/agent/application/actions/handlers/handler_action_application.go +++ b/internal/pkg/agent/application/actions/handlers/handler_action_application.go @@ -55,7 +55,7 @@ func (h *AppAction) Handle(ctx context.Context, a fleetapi.Action, acker acker.A // https://github.com/elastic/security-team/issues/6501 // // h.log.Debugf("handlerAppAction: validate action '%+v', for agentID %s", a, h.agentID) - // validated, err := protection.ValidateAction(*action, h.coord.Protection().SignatureValidationKey, h.agentID) + // validated, err := protection.ValidateAction(*action, h.logLevelSetter.Protection().SignatureValidationKey, h.agentID) // if err != nil { // action.StartedAt = time.Now().UTC().Format(time.RFC3339Nano) // action.CompletedAt = action.StartedAt diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_diagnostics.go b/internal/pkg/agent/application/actions/handlers/handler_action_diagnostics.go index e38b49ce66a..2cb28c3c579 100644 --- a/internal/pkg/agent/application/actions/handlers/handler_action_diagnostics.go +++ b/internal/pkg/agent/application/actions/handlers/handler_action_diagnostics.go @@ -16,6 +16,7 @@ import ( "github.com/elastic/elastic-agent/pkg/control/v2/client" "github.com/elastic/elastic-agent/pkg/control/v2/cproto" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/core/monitoring/config" "github.com/elastic/elastic-agent/internal/pkg/diagnostics" "github.com/elastic/elastic-agent/internal/pkg/fleetapi" @@ -67,15 +68,20 @@ type Diagnostics struct { diagProvider diagnosticsProvider limiter *rate.Limiter uploader Uploader + topPath string } // NewDiagnostics returns a new Diagnostics handler. -func NewDiagnostics(log abstractLogger, coord diagnosticsProvider, cfg config.Limit, uploader Uploader) *Diagnostics { +func NewDiagnostics(log abstractLogger, topPath string, coord diagnosticsProvider, cfg config.Limit, uploader Uploader) *Diagnostics { + if topPath == "" { + topPath = paths.Top() + } return &Diagnostics{ log: log, diagProvider: coord, limiter: rate.NewLimiter(rate.Every(cfg.Interval), cfg.Burst), uploader: uploader, + topPath: topPath, } } @@ -145,7 +151,7 @@ func (h *Diagnostics) collectDiag(ctx context.Context, action *fleetapi.ActionDi // attempt to create the a temporary diagnostics file on disk in order to avoid loading a // potentially large file in memory. // if on-disk creation fails an in-memory buffer is used. - f, s, err := h.diagFile(aDiag, uDiag, cDiag) + f, s, err := h.diagFile(aDiag, uDiag, cDiag, action.ExcludeEventsLog) if err != nil { var b bytes.Buffer h.log.Warnw("Diagnostics action unable to use temporary file, using buffer instead.", "error.message", err) @@ -155,7 +161,7 @@ func (h *Diagnostics) collectDiag(ctx context.Context, action *fleetapi.ActionDi h.log.Warn(str) } }() - err := diagnostics.ZipArchive(&wBuf, &b, aDiag, uDiag, cDiag) + err := diagnostics.ZipArchive(&wBuf, &b, h.topPath, aDiag, uDiag, cDiag, action.ExcludeEventsLog) if err != nil { h.log.Errorw( "diagnostics action handler failed generate zip archive", @@ -326,7 +332,12 @@ func (h *Diagnostics) diagComponents(ctx context.Context, action *fleetapi.Actio } // diagFile will write the diagnostics to a temporary file and return the file ready to be read -func (h *Diagnostics) diagFile(aDiag []client.DiagnosticFileResult, uDiag []client.DiagnosticUnitResult, cDiag []client.DiagnosticComponentResult) (*os.File, int64, error) { +func (h *Diagnostics) diagFile( + aDiag []client.DiagnosticFileResult, + uDiag []client.DiagnosticUnitResult, + cDiag []client.DiagnosticComponentResult, + excludeEvents bool) (*os.File, int64, error) { + f, err := os.CreateTemp("", "elastic-agent-diagnostics") if err != nil { return nil, 0, err @@ -339,7 +350,7 @@ func (h *Diagnostics) diagFile(aDiag []client.DiagnosticFileResult, uDiag []clie h.log.Warn(str) } }() - if err := diagnostics.ZipArchive(&wBuf, f, aDiag, uDiag, cDiag); err != nil { + if err := diagnostics.ZipArchive(&wBuf, f, h.topPath, aDiag, uDiag, cDiag, excludeEvents); err != nil { os.Remove(name) return nil, 0, err } diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_diagnostics_test.go b/internal/pkg/agent/application/actions/handlers/handler_action_diagnostics_test.go index 27e476338b3..87155616c5a 100644 --- a/internal/pkg/agent/application/actions/handlers/handler_action_diagnostics_test.go +++ b/internal/pkg/agent/application/actions/handlers/handler_action_diagnostics_test.go @@ -20,7 +20,6 @@ import ( "github.com/elastic/elastic-agent-client/v7/pkg/proto" "github.com/elastic/elastic-agent/pkg/control/v2/cproto" - "github.com/elastic/elastic-agent/internal/pkg/agent/application/actions/handlers/mocks" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" "github.com/elastic/elastic-agent/internal/pkg/core/monitoring/config" @@ -29,12 +28,10 @@ import ( "github.com/elastic/elastic-agent/pkg/component" "github.com/elastic/elastic-agent/pkg/component/runtime" "github.com/elastic/elastic-agent/pkg/core/logger" + mockhandlers "github.com/elastic/elastic-agent/testing/mocks/internal_/pkg/agent/application/actions/handlers" + mockackers "github.com/elastic/elastic-agent/testing/mocks/internal_/pkg/fleetapi/acker" ) -//go:generate mockery --name Uploader -//go:generate mockery --name diagnosticsProvider --exported -//go:generate mockery --dir ../../../../fleetapi/acker --name Acker - var defaultRateLimit config.Limit = config.Limit{ Interval: 1 * time.Millisecond, Burst: 10, @@ -78,22 +75,20 @@ var ( ) func TestDiagnosticHandlerHappyPathWithLogs(t *testing.T) { - tempAgentRoot := t.TempDir() - paths.SetTop(tempAgentRoot) err := os.MkdirAll(path.Join(tempAgentRoot, "data"), 0755) require.NoError(t, err) - mockDiagProvider := mocks.NewDiagnosticsProvider(t) - mockUploader := mocks.NewUploader(t) + mockDiagProvider := mockhandlers.NewDiagnosticsProvider(t) + mockUploader := mockhandlers.NewUploader(t) testLogger, observedLogs := logger.NewTesting("diagnostic-handler-test") - handler := NewDiagnostics(testLogger, mockDiagProvider, defaultRateLimit, mockUploader) + handler := NewDiagnostics(testLogger, tempAgentRoot, mockDiagProvider, defaultRateLimit, mockUploader) mockDiagProvider.EXPECT().DiagnosticHooks().Return([]diagnostics.Hook{hook1}) mockDiagProvider.EXPECT().PerformDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentUnitDiagnostic{mockUnitDiagnostic}) mockDiagProvider.EXPECT().PerformComponentDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentDiagnostic{}, nil) - mockAcker := mocks.NewAcker(t) + mockAcker := mockackers.NewAcker(t) mockAcker.EXPECT().Ack(mock.Anything, mock.Anything).RunAndReturn(func(ctx context.Context, a fleetapi.Action) error { require.IsType(t, new(fleetapi.ActionDiagnostics), a) assert.NoError(t, a.(*fleetapi.ActionDiagnostics).Err) @@ -165,10 +160,10 @@ func TestDiagnosticHandlerUploaderErrorWithLogs(t *testing.T) { err := os.MkdirAll(path.Join(tempAgentRoot, "data"), 0755) require.NoError(t, err) - mockDiagProvider := mocks.NewDiagnosticsProvider(t) - mockUploader := mocks.NewUploader(t) + mockDiagProvider := mockhandlers.NewDiagnosticsProvider(t) + mockUploader := mockhandlers.NewUploader(t) testLogger, observedLogs := logger.NewTesting("diagnostic-handler-test") - handler := NewDiagnostics(testLogger, mockDiagProvider, defaultRateLimit, mockUploader) + handler := NewDiagnostics(testLogger, tempAgentRoot, mockDiagProvider, defaultRateLimit, mockUploader) mockDiagProvider.EXPECT().DiagnosticHooks().Return([]diagnostics.Hook{}) mockDiagProvider.EXPECT().PerformDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentUnitDiagnostic{}) @@ -178,7 +173,7 @@ func TestDiagnosticHandlerUploaderErrorWithLogs(t *testing.T) { uploaderError := errors.New("upload went wrong!") mockUploader.EXPECT().UploadDiagnostics(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return("", uploaderError) - mockAcker := mocks.NewAcker(t) + mockAcker := mockackers.NewAcker(t) mockAcker.EXPECT().Ack(mock.Anything, mock.Anything).RunAndReturn(func(ctx context.Context, a fleetapi.Action) error { require.IsType(t, new(fleetapi.ActionDiagnostics), a) // verify that we are acking the action with the correct error set @@ -206,16 +201,16 @@ func TestDiagnosticHandlerZipArchiveErrorWithLogs(t *testing.T) { // we don't set a 'data' subdirectory in order to make the zip process return an error // this is the only way/trick to do it with the current implementation, sadly :( - mockDiagProvider := mocks.NewDiagnosticsProvider(t) - mockUploader := mocks.NewUploader(t) + mockDiagProvider := mockhandlers.NewDiagnosticsProvider(t) + mockUploader := mockhandlers.NewUploader(t) testLogger, observedLogs := logger.NewTesting("diagnostic-handler-test") - handler := NewDiagnostics(testLogger, mockDiagProvider, defaultRateLimit, mockUploader) + handler := NewDiagnostics(testLogger, tempAgentRoot, mockDiagProvider, defaultRateLimit, mockUploader) mockDiagProvider.EXPECT().DiagnosticHooks().Return([]diagnostics.Hook{}) mockDiagProvider.EXPECT().PerformDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentUnitDiagnostic{}) mockDiagProvider.EXPECT().PerformComponentDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentDiagnostic{}, nil) - mockAcker := mocks.NewAcker(t) + mockAcker := mockackers.NewAcker(t) mockAcker.EXPECT().Ack(mock.Anything, mock.Anything).RunAndReturn(func(ctx context.Context, a fleetapi.Action) error { require.IsType(t, new(fleetapi.ActionDiagnostics), a) assert.Error(t, a.(*fleetapi.ActionDiagnostics).Err) @@ -242,16 +237,16 @@ func TestDiagnosticHandlerAckErrorWithLogs(t *testing.T) { err := os.MkdirAll(path.Join(tempAgentRoot, "data"), 0755) require.NoError(t, err) - mockDiagProvider := mocks.NewDiagnosticsProvider(t) - mockUploader := mocks.NewUploader(t) + mockDiagProvider := mockhandlers.NewDiagnosticsProvider(t) + mockUploader := mockhandlers.NewUploader(t) testLogger, observedLogs := logger.NewTesting("diagnostic-handler-test") - handler := NewDiagnostics(testLogger, mockDiagProvider, defaultRateLimit, mockUploader) + handler := NewDiagnostics(testLogger, tempAgentRoot, mockDiagProvider, defaultRateLimit, mockUploader) mockDiagProvider.EXPECT().DiagnosticHooks().Return([]diagnostics.Hook{}) mockDiagProvider.EXPECT().PerformDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentUnitDiagnostic{}) mockDiagProvider.EXPECT().PerformComponentDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentDiagnostic{}, nil) - mockAcker := mocks.NewAcker(t) + mockAcker := mockackers.NewAcker(t) ackError := errors.New("acking went wrong") mockAcker.EXPECT().Ack(mock.Anything, mock.Anything).RunAndReturn(func(ctx context.Context, a fleetapi.Action) error { require.IsType(t, new(fleetapi.ActionDiagnostics), a) @@ -281,16 +276,16 @@ func TestDiagnosticHandlerCommitErrorWithLogs(t *testing.T) { err := os.MkdirAll(path.Join(tempAgentRoot, "data"), 0755) require.NoError(t, err) - mockDiagProvider := mocks.NewDiagnosticsProvider(t) - mockUploader := mocks.NewUploader(t) + mockDiagProvider := mockhandlers.NewDiagnosticsProvider(t) + mockUploader := mockhandlers.NewUploader(t) testLogger, observedLogs := logger.NewTesting("diagnostic-handler-test") - handler := NewDiagnostics(testLogger, mockDiagProvider, defaultRateLimit, mockUploader) + handler := NewDiagnostics(testLogger, tempAgentRoot, mockDiagProvider, defaultRateLimit, mockUploader) mockDiagProvider.EXPECT().DiagnosticHooks().Return([]diagnostics.Hook{}) mockDiagProvider.EXPECT().PerformDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentUnitDiagnostic{}) mockDiagProvider.EXPECT().PerformComponentDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentDiagnostic{}, nil) - mockAcker := mocks.NewAcker(t) + mockAcker := mockackers.NewAcker(t) mockAcker.EXPECT().Ack(mock.Anything, mock.Anything).RunAndReturn(func(ctx context.Context, a fleetapi.Action) error { require.IsType(t, new(fleetapi.ActionDiagnostics), a) assert.NoError(t, a.(*fleetapi.ActionDiagnostics).Err) @@ -321,14 +316,14 @@ func TestDiagnosticHandlerContexteExpiredErrorWithLogs(t *testing.T) { err := os.MkdirAll(path.Join(tempAgentRoot, "data"), 0755) require.NoError(t, err) - mockDiagProvider := mocks.NewDiagnosticsProvider(t) - mockUploader := mocks.NewUploader(t) + mockDiagProvider := mockhandlers.NewDiagnosticsProvider(t) + mockUploader := mockhandlers.NewUploader(t) testLogger, observedLogs := logger.NewTesting("diagnostic-handler-test") - handler := NewDiagnostics(testLogger, mockDiagProvider, defaultRateLimit, mockUploader) + handler := NewDiagnostics(testLogger, tempAgentRoot, mockDiagProvider, defaultRateLimit, mockUploader) mockDiagProvider.EXPECT().DiagnosticHooks().Return([]diagnostics.Hook{}) - mockAcker := mocks.NewAcker(t) + mockAcker := mockackers.NewAcker(t) mockAcker.EXPECT().Ack(mock.Anything, mock.Anything).RunAndReturn(func(ctx context.Context, a fleetapi.Action) error { require.IsType(t, new(fleetapi.ActionDiagnostics), a) assert.ErrorIs(t, a.(*fleetapi.ActionDiagnostics).Err, context.Canceled) @@ -365,10 +360,10 @@ func TestDiagnosticHandlerWithCPUProfile(t *testing.T) { return []byte(`hello, world!`), nil } - mockDiagProvider := mocks.NewDiagnosticsProvider(t) - mockUploader := mocks.NewUploader(t) + mockDiagProvider := mockhandlers.NewDiagnosticsProvider(t) + mockUploader := mockhandlers.NewUploader(t) testLogger, _ := logger.NewTesting("diagnostic-handler-test") - handler := NewDiagnostics(testLogger, mockDiagProvider, defaultRateLimit, mockUploader) + handler := NewDiagnostics(testLogger, tempAgentRoot, mockDiagProvider, defaultRateLimit, mockUploader) mockDiagProvider.EXPECT().DiagnosticHooks().Return([]diagnostics.Hook{hook1}) mockDiagProvider.EXPECT().PerformDiagnostics(mock.Anything, mock.Anything).Return([]runtime.ComponentUnitDiagnostic{mockUnitDiagnostic}) @@ -383,7 +378,7 @@ func TestDiagnosticHandlerWithCPUProfile(t *testing.T) { return false })).Return([]runtime.ComponentDiagnostic{}, nil) - mockAcker := mocks.NewAcker(t) + mockAcker := mockackers.NewAcker(t) mockAcker.EXPECT().Ack(mock.Anything, mock.Anything).RunAndReturn(func(ctx context.Context, a fleetapi.Action) error { require.IsType(t, new(fleetapi.ActionDiagnostics), a) assert.NoError(t, a.(*fleetapi.ActionDiagnostics).Err) 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 af76e83f6d1..6e1e2a1e6d3 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 @@ -7,6 +7,7 @@ package handlers import ( "bytes" "context" + goerrors "errors" "fmt" "io" "net/http" @@ -15,7 +16,9 @@ import ( "gopkg.in/yaml.v2" + "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/transport/httpcommon" + "github.com/elastic/elastic-agent-libs/transport/tlscommon" "github.com/elastic/elastic-agent/internal/pkg/agent/application/actions" "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" "github.com/elastic/elastic-agent/internal/pkg/agent/application/info" @@ -36,13 +39,13 @@ const ( // PolicyChangeHandler is a handler for POLICY_CHANGE action. type PolicyChangeHandler struct { - log *logger.Logger - agentInfo info.Agent - config *configuration.Configuration - store storage.Store - ch chan coordinator.ConfigChange - setters []actions.ClientSetter - + log *logger.Logger + agentInfo info.Agent + config *configuration.Configuration + store storage.Store + ch chan coordinator.ConfigChange + setters []actions.ClientSetter + policyLogLevelSetter logLevelSetter // Disabled for 8.8.0 release in order to limit the surface // https://github.com/elastic/security-team/issues/6501 // // Last known valid signature validation key @@ -56,15 +59,17 @@ func NewPolicyChangeHandler( config *configuration.Configuration, store storage.Store, ch chan coordinator.ConfigChange, + policyLogLevelSetter logLevelSetter, setters ...actions.ClientSetter, ) *PolicyChangeHandler { return &PolicyChangeHandler{ - log: log, - agentInfo: agentInfo, - config: config, - store: store, - ch: ch, - setters: setters, + log: log, + agentInfo: agentInfo, + config: config, + store: store, + ch: ch, + setters: setters, + policyLogLevelSetter: policyLogLevelSetter, } } @@ -104,7 +109,7 @@ func (h *PolicyChangeHandler) Handle(ctx context.Context, a fleetapi.Action, ack } h.log.Debugf("handlerPolicyChange: emit configuration for action %+v", a) - err = h.handleFleetServerHosts(ctx, c) + err = h.handlePolicyChange(ctx, c) if err != nil { return err } @@ -118,104 +123,267 @@ func (h *PolicyChangeHandler) Watch() <-chan coordinator.ConfigChange { return h.ch } -func (h *PolicyChangeHandler) handleFleetServerHosts(ctx context.Context, c *config.Config) (err error) { +func (h *PolicyChangeHandler) validateFleetServerHosts(ctx context.Context, cfg *config.Config) (*remote.Config, error) { // do not update fleet-server host from policy; no setters provided with local Fleet Server if len(h.setters) == 0 { - return nil + return nil, nil } - data, err := c.ToMapStr() + + parsedConfig, err := configuration.NewPartialFromConfigNoDefaults(cfg) if err != nil { - return errors.New(err, "could not convert the configuration from the policy", errors.TypeConfig) - } - if _, ok := data["fleet"]; !ok { - // no fleet information in the configuration (skip checking client) - return nil + return nil, fmt.Errorf("parsing fleet config: %w", err) } - cfg, err := configuration.NewFromConfig(c) - if err != nil { - return errors.New(err, "could not parse the configuration from the policy", errors.TypeConfig) + if parsedConfig.Fleet == nil { + // there is no client config (weird) + return nil, nil } - if clientEqual(h.config.Fleet.Client, cfg.Fleet.Client) { + if clientEqual(h.config.Fleet.Client, parsedConfig.Fleet.Client) { // already the same hosts - return nil + return nil, nil } - // only set protocol/hosts as that is all Fleet currently sends - prevProtocol := h.config.Fleet.Client.Protocol - prevPath := h.config.Fleet.Client.Path - prevHost := h.config.Fleet.Client.Host - prevHosts := h.config.Fleet.Client.Hosts - prevProxy := h.config.Fleet.Client.Transport.Proxy - h.config.Fleet.Client.Protocol = cfg.Fleet.Client.Protocol - h.config.Fleet.Client.Path = cfg.Fleet.Client.Path - h.config.Fleet.Client.Host = cfg.Fleet.Client.Host - h.config.Fleet.Client.Hosts = cfg.Fleet.Client.Hosts + // make a copy the current client config and apply the changes on this copy + newFleetClientConfig := h.config.Fleet.Client + updateFleetConfig(h.log, parsedConfig.Fleet.Client, &newFleetClientConfig) - // Empty proxies from fleet are ignored. That way a proxy set by --proxy-url - // it won't be overridden by an absent or empty proxy from fleet-server. - // However, if there is a proxy sent by fleet-server, it'll take precedence. - // Therefore, it's not possible to remove a proxy once it's set. - if cfg.Fleet.Client.Transport.Proxy.URL == nil || - cfg.Fleet.Client.Transport.Proxy.URL.String() == "" { - h.log.Debug("proxy from fleet is empty or null, the proxy will not be changed") - } else { - h.config.Fleet.Client.Transport.Proxy = cfg.Fleet.Client.Transport.Proxy - h.log.Debug("received proxy from fleet, applying it") - } - - // rollback on failure - defer func() { - if err != nil { - h.config.Fleet.Client.Protocol = prevProtocol - h.config.Fleet.Client.Path = prevPath - h.config.Fleet.Client.Host = prevHost - h.config.Fleet.Client.Hosts = prevHosts - h.config.Fleet.Client.Transport.Proxy = prevProxy - } - }() + // Test new config + err = testFleetConfig(ctx, h.log, newFleetClientConfig, h.config.Fleet.AccessAPIKey) + if err != nil { + return nil, fmt.Errorf("validating fleet client config: %w", err) + } + + return &newFleetClientConfig, nil +} - client, err := client.NewAuthWithConfig( - h.log, h.config.Fleet.AccessAPIKey, h.config.Fleet.Client) +func testFleetConfig(ctx context.Context, log *logger.Logger, clientConfig remote.Config, apiKey string) error { + fleetClient, err := client.NewAuthWithConfig( + log, apiKey, clientConfig) if err != nil { return errors.New( err, "fail to create API client with updated config", errors.TypeConfig, errors.M("hosts", append( - h.config.Fleet.Client.Hosts, h.config.Fleet.Client.Host))) + clientConfig.Hosts, clientConfig.Host))) } ctx, cancel := context.WithTimeout(ctx, apiStatusTimeout) defer cancel() - resp, err := client.Send(ctx, http.MethodGet, "/api/status", nil, nil, nil) + // TODO: a HEAD should be enough as we need to test only the connectivity part + resp, err := fleetClient.Send(ctx, http.MethodGet, "/api/status", nil, nil, nil) if err != nil { return errors.New( err, "fail to communicate with Fleet Server API client hosts", - errors.TypeNetwork, errors.M("hosts", h.config.Fleet.Client.Hosts)) + errors.TypeNetwork, errors.M("hosts", clientConfig.Hosts)) } // discard body for proper cancellation and connection reuse _, _ = io.Copy(io.Discard, resp.Body) resp.Body.Close() - reader, err := fleetToReader(h.agentInfo, h.config) + return nil +} + +// updateFleetConfig copies the relevant Fleet client settings from policyConfig on agentConfig. The destination struct is modified in-place +func updateFleetConfig(log *logger.Logger, policyConfig remote.Config, agentConfig *remote.Config) { + + // Hosts is the only connectivity field sent Fleet, let's clear everything else aside from Hosts + if len(policyConfig.Hosts) > 0 { + agentConfig.Hosts = make([]string, len(policyConfig.Hosts)) + copy(agentConfig.Hosts, policyConfig.Hosts) + + agentConfig.Host = "" + agentConfig.Protocol = "" + agentConfig.Path = "" + } + + // Empty proxies from fleet are ignored. That way a proxy set by --proxy-url + // it won't be overridden by an absent or empty proxy from fleet-server. + // However, if there is a proxy sent by fleet-server, it'll take precedence. + // Therefore, it's not possible to remove a proxy once it's set. + + if policyConfig.Transport.Proxy.URL == nil || + policyConfig.Transport.Proxy.URL.String() == "" { + log.Debugw("proxy from fleet is empty or null, the proxy will not be changed", "current_proxy", agentConfig.Transport.Proxy.URL) + } else { + log.Debugw("received proxy from fleet, applying it", "old_proxy", agentConfig.Transport.Proxy.URL, "new_proxy", policyConfig.Transport.Proxy.URL) + // copy the proxy struct + agentConfig.Transport.Proxy = policyConfig.Transport.Proxy + + // replace in agentConfig the attributes that are passed by reference within the proxy struct + + // Headers map + agentConfig.Transport.Proxy.Headers = map[string]string{} + for k, v := range policyConfig.Transport.Proxy.Headers { + agentConfig.Transport.Proxy.Headers[k] = v + } + + // Proxy URL + urlCopy := *policyConfig.Transport.Proxy.URL + agentConfig.Transport.Proxy.URL = &urlCopy + } + + if policyConfig.Transport.TLS != nil { + + tlsCopy := tlscommon.Config{} + if agentConfig.Transport.TLS != nil { + // copy the TLS struct + tlsCopy = *agentConfig.Transport.TLS + } + + if policyConfig.Transport.TLS.Certificate == emptyCertificateConfig() { + log.Debug("TLS certificates from fleet are empty or null, the TLS config will not be changed") + } else { + tlsCopy.Certificate = policyConfig.Transport.TLS.Certificate + log.Debug("received TLS certificate/key from fleet, applying it") + } + + if len(policyConfig.Transport.TLS.CAs) == 0 { + log.Debug("TLS CAs from fleet are empty or null, the TLS config will not be changed") + } else { + tlsCopy.CAs = make([]string, len(policyConfig.Transport.TLS.CAs)) + copy(tlsCopy.CAs, policyConfig.Transport.TLS.CAs) + log.Debug("received TLS CAs from fleet, applying it") + } + + agentConfig.Transport.TLS = &tlsCopy + } +} + +func emptyCertificateConfig() tlscommon.CertificateConfig { + return tlscommon.CertificateConfig{} +} + +func (h *PolicyChangeHandler) handlePolicyChange(ctx context.Context, c *config.Config) (err error) { + var validationErr error + + // validate Fleet connectivity with the new configuration + var validatedConfig *remote.Config + validatedConfig, err = h.validateFleetServerHosts(ctx, c) if err != nil { - return errors.New( - err, "fail to persist new Fleet Server API client hosts", - errors.TypeUnexpected, errors.M("hosts", h.config.Fleet.Client.Hosts)) + validationErr = goerrors.Join(validationErr, fmt.Errorf("validating Fleet client config: %w", err)) } - err = h.store.Save(reader) + // validate agent settings + + // agent logging + + loggingConfig, err := validateLoggingConfig(c) + if err != nil { + validationErr = goerrors.Join(validationErr, fmt.Errorf("validating logging config: %w", err)) + } + + if validationErr != nil { + return validationErr + } + + // apply logging configuration + err = h.applyLoggingConfig(ctx, loggingConfig) + if err != nil { + return fmt.Errorf("applying logging config: %w", err) + } + + if validatedConfig != nil { + // there's a change in the fleet client settings + backupFleetClientCfg := h.config.Fleet.Client + // rollback in case of error + defer func() { + if err != nil { + h.config.Fleet.Client = backupFleetClientCfg + } + }() + + // modify runtime handler config before saving + h.config.Fleet.Client = *validatedConfig + } + + // persist configuration + err = saveConfig(h.agentInfo, h.config, h.store) + if err != nil { + return fmt.Errorf("saving config: %w", err) + } + + // apply the new Fleet client configuration to the current clients + err = h.applyFleetClientConfig(validatedConfig) + if err != nil { + return fmt.Errorf("applying FleetClientConfig: %w", err) + } + + return nil +} + +func validateLoggingConfig(cfg *config.Config) (*logger.Config, error) { + + parsedConfig, err := configuration.NewPartialFromConfigNoDefaults(cfg) + if err != nil { + return nil, fmt.Errorf("parsing fleet config: %w", err) + } + + if parsedConfig == nil || parsedConfig.Settings == nil || parsedConfig.Settings.LoggingConfig == nil { + // no logging config, nothing to do + return nil, nil + } + + loggingConfig := parsedConfig.Settings.LoggingConfig + logLevel := loggingConfig.Level + if logLevel < logp.DebugLevel || logLevel > logp.CriticalLevel { + return nil, fmt.Errorf("unrecognized log level %d", logLevel) + } + + return loggingConfig, nil + +} + +func (h *PolicyChangeHandler) applyFleetClientConfig(validatedConfig *remote.Config) error { + if validatedConfig == nil || len(h.setters) == 0 { + // nothing to do for fleet hosts + return nil + } + + // the config has already been validated, no need for error handling + fleetClient, err := client.NewAuthWithConfig( + h.log, h.config.Fleet.AccessAPIKey, *validatedConfig) + if err != nil { + return fmt.Errorf("creating new fleet client with updated config: %w", err) + } + for _, setter := range h.setters { + setter.SetClient(fleetClient) + } + + return nil +} + +func (h *PolicyChangeHandler) applyLoggingConfig(ctx context.Context, loggingConfig *logger.Config) error { + + var policyLogLevel *logger.Level + if loggingConfig != nil { + // we have logging config to set + policyLogLevel = &loggingConfig.Level + } + + h.log.Infof("Setting fallback log level %v from policy", policyLogLevel) + return h.policyLogLevelSetter.SetLogLevel(ctx, policyLogLevel) +} + +func saveConfig(agentInfo info.Agent, validatedConfig *configuration.Configuration, store storage.Store) error { + if validatedConfig == nil { + // nothing to do for fleet hosts + return nil + } + reader, err := fleetToReader(agentInfo.AgentID(), agentInfo.Headers(), validatedConfig) if err != nil { return errors.New( err, "fail to persist new Fleet Server API client hosts", - errors.TypeFilesystem, errors.M("hosts", h.config.Fleet.Client.Hosts)) + errors.TypeUnexpected, errors.M("hosts", validatedConfig.Fleet.Client.Hosts)) } - for _, setter := range h.setters { - setter.SetClient(client) + err = store.Save(reader) + if err != nil { + return errors.New( + err, "fail to persist new Fleet Server API client hosts", + errors.TypeFilesystem, errors.M("hosts", validatedConfig.Fleet.Client.Hosts)) } return nil } @@ -228,6 +396,10 @@ func clientEqual(k1 remote.Config, k2 remote.Config) bool { return false } + if k1.Host != k2.Host { + return false + } + sort.Strings(k1.Hosts) sort.Strings(k2.Hosts) if len(k1.Hosts) != len(k2.Hosts) { @@ -264,12 +436,12 @@ func clientEqual(k1 remote.Config, k2 remote.Config) bool { return true } -func fleetToReader(agentInfo info.Agent, cfg *configuration.Configuration) (io.Reader, error) { +func fleetToReader(agentID string, headers map[string]string, cfg *configuration.Configuration) (io.Reader, error) { configToStore := map[string]interface{}{ "fleet": cfg.Fleet, "agent": map[string]interface{}{ - "id": agentInfo.AgentID(), - "headers": agentInfo.Headers(), + "id": agentID, + "headers": headers, "logging.level": cfg.Settings.LoggingConfig.Level, "monitoring.http": cfg.Settings.MonitoringConfig.HTTP, "monitoring.pprof": cfg.Settings.MonitoringConfig.Pprof, diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_policy_change_test.go b/internal/pkg/agent/application/actions/handlers/handler_action_policy_change_test.go index b56bb1a1ba4..341ef9771ab 100644 --- a/internal/pkg/agent/application/actions/handlers/handler_action_policy_change_test.go +++ b/internal/pkg/agent/application/actions/handlers/handler_action_policy_change_test.go @@ -6,17 +6,28 @@ package handlers import ( "context" + "crypto/rand" + "crypto/tls" + "crypto/x509" + "encoding/pem" + "fmt" "net/http" "net/http/httptest" "net/url" + "os" + "path/filepath" "strconv" "sync" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/elastic-agent-libs/testing/certutil" "github.com/elastic/elastic-agent-libs/transport/httpcommon" + "github.com/elastic/elastic-agent-libs/transport/tlscommon" "github.com/elastic/elastic-agent/internal/pkg/agent/application/actions" "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" "github.com/elastic/elastic-agent/internal/pkg/agent/application/info" @@ -28,6 +39,7 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/fleetapi/client" "github.com/elastic/elastic-agent/internal/pkg/remote" "github.com/elastic/elastic-agent/pkg/core/logger" + mockhandlers "github.com/elastic/elastic-agent/testing/mocks/internal_/pkg/agent/application/actions/handlers" ) func TestPolicyChange(t *testing.T) { @@ -48,7 +60,8 @@ func TestPolicyChange(t *testing.T) { } cfg := configuration.DefaultConfiguration() - handler := NewPolicyChangeHandler(log, agentInfo, cfg, nullStore, ch) + + handler := NewPolicyChangeHandler(log, agentInfo, cfg, nullStore, ch, nilLogLevelSet(t)) err := handler.Handle(context.Background(), action, ack) require.NoError(t, err) @@ -77,7 +90,7 @@ func TestPolicyAcked(t *testing.T) { } cfg := configuration.DefaultConfiguration() - handler := NewPolicyChangeHandler(log, agentInfo, cfg, nullStore, ch) + handler := NewPolicyChangeHandler(log, agentInfo, cfg, nullStore, ch, nilLogLevelSet(t)) err := handler.Handle(context.Background(), action, tacker) require.NoError(t, err) @@ -91,7 +104,7 @@ func TestPolicyAcked(t *testing.T) { }) } -func TestPolicyChangeHandler_handleFleetServerHosts(t *testing.T) { +func TestPolicyChangeHandler_handlePolicyChange_FleetClientSettings(t *testing.T) { mockProxy := httptest.NewServer( http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { _, err := w.Write(nil) @@ -118,8 +131,121 @@ func TestPolicyChangeHandler_handleFleetServerHosts(t *testing.T) { fleetServerPort, err := strconv.Atoi(fleetServerURL.Port()) require.NoError(t, err) - t.Run("Rollback client changes when cannot create client", - func(t *testing.T) { + t.Run("policy with proxy config", func(t *testing.T) { + t.Run("rollback client changes when cannot create client", + func(t *testing.T) { + log, _ := logger.NewTesting("TestPolicyChangeHandler") + var setterCalledCount int + setter := testSetter{SetClientFn: func(c client.Sender) { + setterCalledCount++ + }} + + originalCfg := &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Server: &configuration.FleetServerConfig{ + Host: fleetServerHost, + Port: uint16(fleetServerPort), + }, + Client: remote.Config{ + Host: "http://example.co", + Hosts: []string{"http://hosts1.com", "http://hosts2.com"}, + Transport: httpcommon.HTTPTransportSettings{ + Proxy: httpcommon.HTTPClientProxySettings{ + URL: &httpcommon.ProxyURI{ + Host: "original.proxy", + }, + }}}, + }, + Settings: configuration.DefaultSettingsConfig()} + + h := PolicyChangeHandler{ + agentInfo: &info.AgentInfo{}, + config: originalCfg, + store: &storage.NullStore{}, + setters: []actions.ClientSetter{&setter}, + log: log, + policyLogLevelSetter: mockhandlers.NewLogLevelSetter(t), + } + + cfg := config.MustNewConfigFrom( + map[string]interface{}{ + "fleet.host": "http://some.url", + "fleet.proxy_url": "http://some.proxy", + }) + + err := h.handlePolicyChange(context.Background(), cfg) + require.Error(t, err) // it needs to fail to rollback + + assert.Equal(t, 0, setterCalledCount) + assert.Equal(t, + originalCfg.Fleet.Client.Host, + h.config.Fleet.Client.Host) + assert.Equal(t, + originalCfg.Fleet.Client.Hosts, + h.config.Fleet.Client.Hosts) + assert.Equal(t, + originalCfg.Fleet.Client.Transport.Proxy.URL, + h.config.Fleet.Client.Transport.Proxy.URL) + }) + + t.Run("rollback client changes when cannot reach fleet-server", + func(t *testing.T) { + log, _ := logger.NewTesting("TestPolicyChangeHandler") + var setterCalledCount int + setter := testSetter{SetClientFn: func(c client.Sender) { + setterCalledCount++ + }} + + originalCfg := &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Server: &configuration.FleetServerConfig{ + Host: fleetServerHost, + Port: uint16(fleetServerPort), + }, + AccessAPIKey: "ignore", + Client: remote.Config{ + Host: "http://example.co", + Hosts: []string{"http://hosts1.com", "http://hosts2.com"}, + Transport: httpcommon.HTTPTransportSettings{ + Proxy: httpcommon.HTTPClientProxySettings{ + URL: &httpcommon.ProxyURI{ + Host: "original.proxy", + }, + }}}, + }, + Settings: configuration.DefaultSettingsConfig()} + + h := PolicyChangeHandler{ + agentInfo: &info.AgentInfo{}, + config: originalCfg, + store: &storage.NullStore{}, + setters: []actions.ClientSetter{&setter}, + log: log, + policyLogLevelSetter: mockhandlers.NewLogLevelSetter(t), + } + + cfg := config.MustNewConfigFrom( + map[string]interface{}{ + "fleet.host": "http://some.url", + "fleet.proxy_url": "http://some.proxy", + }) + + err := h.handlePolicyChange(context.Background(), cfg) + require.Error(t, err) // it needs to fail to rollback + + assert.Equal(t, 0, setterCalledCount) + assert.Equal(t, + originalCfg.Fleet.Client.Host, + h.config.Fleet.Client.Host) + assert.Equal(t, + originalCfg.Fleet.Client.Hosts, + h.config.Fleet.Client.Hosts) + assert.Equal(t, + originalCfg.Fleet.Client.Transport.Proxy.URL, + h.config.Fleet.Client.Transport.Proxy.URL) + }) + + t.Run("a new Hosts and no proxy changes the remote config", func(t *testing.T) { log, _ := logger.NewTesting("TestPolicyChangeHandler") var setterCalledCount int setter := testSetter{SetClientFn: func(c client.Sender) { @@ -132,49 +258,38 @@ func TestPolicyChangeHandler_handleFleetServerHosts(t *testing.T) { Host: fleetServerHost, Port: uint16(fleetServerPort), }, + AccessAPIKey: "ignore", Client: remote.Config{ - Host: "http://example.co", - Hosts: []string{"http://hosts1.com", "http://hosts2.com"}, - Transport: httpcommon.HTTPTransportSettings{ - Proxy: httpcommon.HTTPClientProxySettings{ - URL: &httpcommon.ProxyURI{ - Host: "original.proxy", - }, - }}}, + Host: "http://example.co", + }, }, Settings: configuration.DefaultSettingsConfig()} h := PolicyChangeHandler{ - agentInfo: &info.AgentInfo{}, - config: originalCfg, - store: &storage.NullStore{}, - setters: []actions.ClientSetter{&setter}, - log: log, + agentInfo: &info.AgentInfo{}, + config: originalCfg, + store: &storage.NullStore{}, + setters: []actions.ClientSetter{&setter}, + log: log, + policyLogLevelSetter: nilLogLevelSet(t), } cfg := config.MustNewConfigFrom( map[string]interface{}{ - "fleet.host": "http://some.url", - "fleet.proxy_url": "http://some.proxy", - }) + "fleet.hosts": fleetServer.URL}) - err := h.handleFleetServerHosts(context.Background(), cfg) - require.Error(t, err) // it needs to fail to rollback + err := h.handlePolicyChange(context.Background(), cfg) + require.NoError(t, err) - assert.Equal(t, 0, setterCalledCount) - assert.Equal(t, - originalCfg.Fleet.Client.Host, - h.config.Fleet.Client.Host) - assert.Equal(t, - originalCfg.Fleet.Client.Hosts, - h.config.Fleet.Client.Hosts) - assert.Equal(t, - originalCfg.Fleet.Client.Transport.Proxy.URL, - h.config.Fleet.Client.Transport.Proxy.URL) + assert.Equal(t, 1, setterCalledCount) + assert.Empty(t, h.config.Fleet.Client.Host) + assert.Empty(t, h.config.Fleet.Client.Protocol) + assert.Empty(t, h.config.Fleet.Client.Path) + assert.Equal(t, []string{fleetServer.URL}, h.config.Fleet.Client.Hosts) + assert.Empty(t, h.config.Fleet.Client.Transport.Proxy.URL) }) - t.Run("Rollback client changes when cannot reach fleet-server", - func(t *testing.T) { + t.Run("a proxy changes the fleet client", func(t *testing.T) { log, _ := logger.NewTesting("TestPolicyChangeHandler") var setterCalledCount int setter := testSetter{SetClientFn: func(c client.Sender) { @@ -189,8 +304,6 @@ func TestPolicyChangeHandler_handleFleetServerHosts(t *testing.T) { }, AccessAPIKey: "ignore", Client: remote.Config{ - Host: "http://example.co", - Hosts: []string{"http://hosts1.com", "http://hosts2.com"}, Transport: httpcommon.HTTPTransportSettings{ Proxy: httpcommon.HTTPClientProxySettings{ URL: &httpcommon.ProxyURI{ @@ -201,213 +314,536 @@ func TestPolicyChangeHandler_handleFleetServerHosts(t *testing.T) { Settings: configuration.DefaultSettingsConfig()} h := PolicyChangeHandler{ - agentInfo: &info.AgentInfo{}, - config: originalCfg, - store: &storage.NullStore{}, - setters: []actions.ClientSetter{&setter}, - log: log, + agentInfo: &info.AgentInfo{}, + config: originalCfg, + store: &storage.NullStore{}, + setters: []actions.ClientSetter{&setter}, + log: log, + policyLogLevelSetter: nilLogLevelSet(t), } cfg := config.MustNewConfigFrom( map[string]interface{}{ - "fleet.host": "http://some.url", - "fleet.proxy_url": "http://some.proxy", - }) + "fleet.proxy_url": mockProxy.URL, + "fleet.host": fleetServer.URL}) - err := h.handleFleetServerHosts(context.Background(), cfg) - require.Error(t, err) // it needs to fail to rollback + err := h.handlePolicyChange(context.Background(), cfg) + require.NoError(t, err) - assert.Equal(t, 0, setterCalledCount) - assert.Equal(t, - originalCfg.Fleet.Client.Host, - h.config.Fleet.Client.Host) - assert.Equal(t, - originalCfg.Fleet.Client.Hosts, - h.config.Fleet.Client.Hosts) + assert.Equal(t, 1, setterCalledCount) assert.Equal(t, - originalCfg.Fleet.Client.Transport.Proxy.URL, - h.config.Fleet.Client.Transport.Proxy.URL) + mockProxy.URL, + h.config.Fleet.Client.Transport.Proxy.URL.String()) }) - t.Run("A policy with a new Host and no proxy changes the Host", func(t *testing.T) { - log, _ := logger.NewTesting("TestPolicyChangeHandler") - var setterCalledCount int - setter := testSetter{SetClientFn: func(c client.Sender) { - setterCalledCount++ - }} - - originalCfg := &configuration.Configuration{ - Fleet: &configuration.FleetAgentConfig{ - Server: &configuration.FleetServerConfig{ - Host: fleetServerHost, - Port: uint16(fleetServerPort), - }, - AccessAPIKey: "ignore", - Client: remote.Config{ - Host: "http://example.co"}, - }, - Settings: configuration.DefaultSettingsConfig()} - - h := PolicyChangeHandler{ - agentInfo: &info.AgentInfo{}, - config: originalCfg, - store: &storage.NullStore{}, - setters: []actions.ClientSetter{&setter}, - log: log, - } - - cfg := config.MustNewConfigFrom( - map[string]interface{}{ - "fleet.host": fleetServer.URL}) - - err := h.handleFleetServerHosts(context.Background(), cfg) - require.NoError(t, err) - - assert.Equal(t, 1, setterCalledCount) - assert.Equal(t, fleetServer.URL, h.config.Fleet.Client.Host) - assert.Empty(t, - h.config.Fleet.Client.Transport.Proxy.URL) + t.Run("empty proxy don't change the fleet client", + func(t *testing.T) { + wantProxy := mockProxy.URL + + log, _ := logger.NewTesting("TestPolicyChangeHandler") + var setterCalledCount int + setter := testSetter{SetClientFn: func(c client.Sender) { + setterCalledCount++ + }} + + mockProxyURL, err := url.Parse(mockProxy.URL) + require.NoError(t, err) + + tmpMockProxyURI := httpcommon.ProxyURI(*mockProxyURL) + mockProxyURI := &tmpMockProxyURI + originalCfg := &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Server: &configuration.FleetServerConfig{ + Host: fleetServerHost, + Port: uint16(fleetServerPort), + }, + AccessAPIKey: "ignore", + Client: remote.Config{ + Host: fleetServerHost, + Transport: httpcommon.HTTPTransportSettings{ + Proxy: httpcommon.HTTPClientProxySettings{ + URL: mockProxyURI, + }}}, + }, + Settings: configuration.DefaultSettingsConfig()} + + h := PolicyChangeHandler{ + agentInfo: &info.AgentInfo{}, + config: originalCfg, + store: &storage.NullStore{}, + setters: []actions.ClientSetter{&setter}, + log: log, + policyLogLevelSetter: nilLogLevelSet(t), + } + + cfg := config.MustNewConfigFrom( + map[string]interface{}{ + "fleet.proxy_url": "", + "fleet.host": fleetServer.URL}) + + err = h.handlePolicyChange(context.Background(), cfg) + require.NoError(t, err) + + assert.Equal(t, 1, setterCalledCount) + assert.Equal(t, + wantProxy, + h.config.Fleet.Client.Transport.Proxy.URL.String()) + }) }) - t.Run("A policy with new Hosts and no proxy changes the Hosts", func(t *testing.T) { - log, _ := logger.NewTesting("TestPolicyChangeHandler") - var setterCalledCount int - setter := testSetter{SetClientFn: func(c client.Sender) { - setterCalledCount++ - }} - - originalCfg := &configuration.Configuration{ - Fleet: &configuration.FleetAgentConfig{ - Server: &configuration.FleetServerConfig{ - Host: fleetServerHost, - Port: uint16(fleetServerPort), - }, - AccessAPIKey: "ignore", - Client: remote.Config{ - Host: "http://example.co"}, - }, - Settings: configuration.DefaultSettingsConfig()} - - h := PolicyChangeHandler{ - agentInfo: &info.AgentInfo{}, - config: originalCfg, - store: &storage.NullStore{}, - setters: []actions.ClientSetter{&setter}, - log: log, + t.Run("policy with SSL config", func(t *testing.T) { + agentChildEncPassphrase := `reallySecurePassword` + passphrasePath := filepath.Join(t.TempDir(), "passphrase") + err = os.WriteFile( + passphrasePath, + []byte(agentChildEncPassphrase), + 0400) + require.NoError(t, err, + "could not write agent child certificate key passphrase to temp directory") + + fleetRootPair, fleetChildPair, err := certutil.NewRootAndChildCerts() + require.NoError(t, err, "failed creating fleet root and child certs") + + agentRootPair, agentChildPair, err := certutil.NewRootAndChildCerts() + require.NoError(t, err, "failed creating root and child certs") + + agentChildDERKey, _ := pem.Decode(agentChildPair.Key) + require.NoError(t, err, "could not create tls.Certificates from child certificate") + + encPem, err := x509.EncryptPEMBlock( //nolint:staticcheck // we need to drop support for this, but while we don't, it needs to be tested. + rand.Reader, + "EC PRIVATE KEY", + agentChildDERKey.Bytes, + []byte(agentChildEncPassphrase), + x509.PEMCipherAES128) + require.NoError(t, err, "failed encrypting agent child certificate key block") + agentChildEncPair := certutil.Pair{ + Cert: agentChildPair.Cert, + Key: pem.EncodeToMemory(encPem), } - wantHosts := []string{fleetServer.URL, fleetServer.URL} - cfg := config.MustNewConfigFrom( - map[string]interface{}{ - "fleet.hosts": wantHosts}) + wrongRootPair, wrongChildPair, err := certutil.NewRootAndChildCerts() + require.NoError(t, err, "failed creating root and child certs") - err := h.handleFleetServerHosts(context.Background(), cfg) - require.NoError(t, err) - - assert.Equal(t, 1, setterCalledCount) - assert.Equal(t, wantHosts, h.config.Fleet.Client.Hosts) - assert.Empty(t, - h.config.Fleet.Client.Transport.Proxy.URL) - }) - - t.Run("A policy with proxy changes the fleet client", func(t *testing.T) { - log, _ := logger.NewTesting("TestPolicyChangeHandler") - var setterCalledCount int - setter := testSetter{SetClientFn: func(c client.Sender) { - setterCalledCount++ - }} - - originalCfg := &configuration.Configuration{ - Fleet: &configuration.FleetAgentConfig{ - Server: &configuration.FleetServerConfig{ - Host: fleetServerHost, - Port: uint16(fleetServerPort), - }, - AccessAPIKey: "ignore", - Client: remote.Config{ - Transport: httpcommon.HTTPTransportSettings{ - Proxy: httpcommon.HTTPClientProxySettings{ - URL: &httpcommon.ProxyURI{ - Host: "original.proxy", - }, - }}}, - }, - Settings: configuration.DefaultSettingsConfig()} - - h := PolicyChangeHandler{ - agentInfo: &info.AgentInfo{}, - config: originalCfg, - store: &storage.NullStore{}, - setters: []actions.ClientSetter{&setter}, - log: log, + statusHandler := func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "api/status" { + w.WriteHeader(http.StatusNotFound) + _, err := w.Write(nil) + require.NoError(t, err) + } + _, err := w.Write(nil) + require.NoError(t, err) } + fleetmTLSServer := httptest.NewUnstartedServer( + http.HandlerFunc(statusHandler)) - cfg := config.MustNewConfigFrom( - map[string]interface{}{ - "fleet.proxy_url": mockProxy.URL, - "fleet.host": fleetServer.URL}) + fleetNomTLSServer := httptest.NewUnstartedServer( + http.HandlerFunc(statusHandler)) - err := h.handleFleetServerHosts(context.Background(), cfg) - require.NoError(t, err) - - assert.Equal(t, 1, setterCalledCount) - assert.Equal(t, - mockProxy.URL, - h.config.Fleet.Client.Transport.Proxy.URL.String()) - }) + fleetRootCertPool := x509.NewCertPool() + fleetRootCertPool.AppendCertsFromPEM(fleetRootPair.Cert) + cert, err := tls.X509KeyPair(fleetChildPair.Cert, fleetChildPair.Key) + require.NoError(t, err, "could not create tls.Certificates from child certificate") - t.Run("A policy with empty proxy don't change the fleet client", - func(t *testing.T) { - wantProxy := mockProxy.URL + agentRootCertPool := x509.NewCertPool() + agentRootCertPool.AppendCertsFromPEM(agentRootPair.Cert) - log, _ := logger.NewTesting("TestPolicyChangeHandler") - var setterCalledCount int - setter := testSetter{SetClientFn: func(c client.Sender) { - setterCalledCount++ - }} + fleetmTLSServer.TLS = &tls.Config{ //nolint:gosec // it's just a test + RootCAs: fleetRootCertPool, + Certificates: []tls.Certificate{cert}, + ClientCAs: agentRootCertPool, + ClientAuth: tls.RequireAndVerifyClientCert, + } - mockProxyURL, err := url.Parse(mockProxy.URL) - require.NoError(t, err) + fleetNomTLSServer.TLS = &tls.Config{ //nolint:gosec // it's just a test + RootCAs: fleetRootCertPool, + Certificates: []tls.Certificate{cert}, + } - tmpMockProxyURI := httpcommon.ProxyURI(*mockProxyURL) - mockProxyURI := &tmpMockProxyURI - originalCfg := &configuration.Configuration{ - Fleet: &configuration.FleetAgentConfig{ - Server: &configuration.FleetServerConfig{ - Host: fleetServerHost, - Port: uint16(fleetServerPort), + fleetmTLSServer.StartTLS() + defer fleetmTLSServer.Close() + fleetNomTLSServer.StartTLS() + defer fleetNomTLSServer.Close() + + trueVar := true + tcs := []struct { + name string + originalCfg *configuration.Configuration + newCfg map[string]interface{} + setterCalledCount int + wantCAs []string + wantCertificateConfig tlscommon.CertificateConfig + assertErr func(t *testing.T, err error) + customLogLevelSetterMock func(t *testing.T) *mockhandlers.LogLevelSetter + }{ + { + name: "certificate_authorities is applied when present", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + Host: fleetNomTLSServer.URL, + }, + AccessAPIKey: "ignore", }, - AccessAPIKey: "ignore", - Client: remote.Config{ - Host: fleetServerHost, - Transport: httpcommon.HTTPTransportSettings{ - Proxy: httpcommon.HTTPClientProxySettings{ - URL: mockProxyURI, - }}}, + Settings: configuration.DefaultSettingsConfig(), }, - Settings: configuration.DefaultSettingsConfig()} - - h := PolicyChangeHandler{ - agentInfo: &info.AgentInfo{}, - config: originalCfg, - store: &storage.NullStore{}, - setters: []actions.ClientSetter{&setter}, - log: log, - } - - cfg := config.MustNewConfigFrom( - map[string]interface{}{ - "fleet.proxy_url": "", - "fleet.host": fleetServer.URL}) - - err = h.handleFleetServerHosts(context.Background(), cfg) - require.NoError(t, err) + newCfg: map[string]interface{}{ + "fleet.ssl.enabled": true, + "fleet.ssl.certificate_authorities": []string{string(fleetRootPair.Cert)}, + }, + setterCalledCount: 1, + wantCAs: []string{string(fleetRootPair.Cert)}, + assertErr: func(t *testing.T, err error) { + assert.NoError(t, err, + "unexpected error when applying fleet.ssl.certificate_authorities") + }, + }, + { + name: "certificate_authorities is ignored if empty", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + // To the reviewers: this testcase was using the mTLS fleet server in the original PR + // https://github.com/elastic/elastic-agent/pull/4398/files#diff-09ced2f2269134a71e037d9fb1bd4a2f4a157c472f45c601b74b71ce5179d04fR491 + // but there is no way for it to work without a certificate, switched it to TLS fleet server ¯\_(ツ)_/¯ + Host: fleetNomTLSServer.URL, + Transport: httpcommon.HTTPTransportSettings{ + TLS: &tlscommon.Config{CAs: []string{string(fleetRootPair.Cert)}}, + }, + }, + AccessAPIKey: "ignore", + }, + Settings: configuration.DefaultSettingsConfig(), + }, + newCfg: map[string]interface{}{ + // changing the URL for a server without TLS, so it'll + // work without the CA. + "fleet.host": fleetServer.URL, + "fleet.ssl.enabled": true, + "fleet.ssl.certificate_authorities": []string{}, + }, + setterCalledCount: 1, + wantCAs: []string{string(fleetRootPair.Cert)}, + assertErr: func(t *testing.T, err error) { + assert.NoError(t, err, + "unexpected error when applying fleet.ssl.certificate_authorities") + }, + }, + { + name: "certificate_authorities is ignored if absent", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + Host: fleetNomTLSServer.URL, + Transport: httpcommon.HTTPTransportSettings{ + TLS: &tlscommon.Config{CAs: []string{string(fleetRootPair.Cert)}}, + }, + }, + AccessAPIKey: "ignore", + }, + Settings: configuration.DefaultSettingsConfig(), + }, + newCfg: map[string]interface{}{ + "fleet.ssl.enabled": true, + }, + setterCalledCount: 1, // it should not exit early + wantCAs: []string{string(fleetRootPair.Cert)}, + assertErr: func(t *testing.T, err error) { + assert.NoError(t, err, + "unexpected error when applying fleet.ssl.certificate_authorities") + }, + }, + { + name: "certificate_authorities isn't applied if wrong", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + Host: fleetNomTLSServer.URL, + Transport: httpcommon.HTTPTransportSettings{ + TLS: &tlscommon.Config{ + Enabled: &trueVar, + CAs: []string{string(fleetRootPair.Cert)}}, + }, + }, + AccessAPIKey: "ignore", + }, + Settings: configuration.DefaultSettingsConfig(), + }, + newCfg: map[string]interface{}{ + "fleet.ssl.enabled": true, + "fleet.ssl.certificate_authorities": []string{string(wrongRootPair.Cert)}, + }, + setterCalledCount: 0, + wantCAs: []string{string(fleetRootPair.Cert)}, + assertErr: func(t *testing.T, err error) { + assert.Error(t, err, + "bad fleet.ssl.certificate_authorities provided, it should have returned an error") + }, + customLogLevelSetterMock: func(t *testing.T) *mockhandlers.LogLevelSetter { + // We don't expect any log level to be set if config is wrong + return mockhandlers.NewLogLevelSetter(t) + }, + }, + { + name: "certificate and key is applied when present", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + Host: fleetmTLSServer.URL, + Transport: httpcommon.HTTPTransportSettings{ + TLS: &tlscommon.Config{ + CAs: []string{string(fleetRootPair.Cert)}, + }, + }, + }, + AccessAPIKey: "ignore", + }, + Settings: configuration.DefaultSettingsConfig(), + }, + newCfg: map[string]interface{}{ + "fleet.ssl.enabled": true, + "fleet.ssl.certificate": string(agentChildPair.Cert), + "fleet.ssl.key": string(agentChildPair.Key), + }, + setterCalledCount: 1, + wantCAs: []string{string(fleetRootPair.Cert)}, + wantCertificateConfig: tlscommon.CertificateConfig{ + Certificate: string(agentChildPair.Cert), + Key: string(agentChildPair.Key), + }, + assertErr: func(t *testing.T, err error) { + assert.NoError(t, err, + "unexpected error when applying fleet.ssl.certificate and key") + }, + }, + { + name: "certificate and key with passphrase is applied when present", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + Host: fleetmTLSServer.URL, + Transport: httpcommon.HTTPTransportSettings{ + TLS: &tlscommon.Config{ + CAs: []string{string(fleetRootPair.Cert)}, + }, + }, + }, + AccessAPIKey: "ignore", + }, + Settings: configuration.DefaultSettingsConfig(), + }, + newCfg: map[string]interface{}{ + "fleet.ssl.enabled": true, + "fleet.ssl.certificate": string(agentChildEncPair.Cert), + "fleet.ssl.key": string(agentChildEncPair.Key), + "fleet.ssl.key_passphrase": agentChildEncPassphrase, + }, + setterCalledCount: 1, + wantCAs: []string{string(fleetRootPair.Cert)}, + wantCertificateConfig: tlscommon.CertificateConfig{ + Certificate: string(agentChildEncPair.Cert), + Key: string(agentChildEncPair.Key), + Passphrase: agentChildEncPassphrase, + }, + assertErr: func(t *testing.T, err error) { + assert.NoError(t, err, + "unexpected error when applying fleet.ssl.certificate and key") + }, + }, + { + name: "certificate and key with passphrase_path is applied when present", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + Host: fleetmTLSServer.URL, + Transport: httpcommon.HTTPTransportSettings{ + TLS: &tlscommon.Config{ + CAs: []string{string(fleetRootPair.Cert)}, + }, + }, + }, + AccessAPIKey: "ignore", + }, + Settings: configuration.DefaultSettingsConfig(), + }, + newCfg: map[string]interface{}{ + "fleet.ssl.enabled": true, + "fleet.ssl.certificate": string(agentChildEncPair.Cert), + "fleet.ssl.key": string(agentChildEncPair.Key), + "fleet.ssl.key_passphrase_path": passphrasePath, + }, + setterCalledCount: 1, + wantCAs: []string{string(fleetRootPair.Cert)}, + wantCertificateConfig: tlscommon.CertificateConfig{ + Certificate: string(agentChildEncPair.Cert), + Key: string(agentChildEncPair.Key), + PassphrasePath: passphrasePath, + }, + assertErr: func(t *testing.T, err error) { + assert.NoError(t, err, + "unexpected error when applying fleet.ssl.certificate and key") + }, + }, + { + name: "certificate and key is ignored if empty", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + Host: fleetmTLSServer.URL, + Transport: httpcommon.HTTPTransportSettings{ + TLS: &tlscommon.Config{ + CAs: []string{string(fleetRootPair.Cert)}, + Certificate: tlscommon.CertificateConfig{ + Certificate: string(agentChildPair.Cert), + Key: string(agentChildPair.Key), + }, + }, + }, + }, + AccessAPIKey: "ignore", + }, + Settings: configuration.DefaultSettingsConfig(), + }, + newCfg: map[string]interface{}{ + "fleet.ssl.enabled": true, + "fleet.ssl.certificate": "", + "fleet.ssl.key": "", + }, + setterCalledCount: 1, + wantCAs: []string{string(fleetRootPair.Cert)}, + wantCertificateConfig: tlscommon.CertificateConfig{ + Certificate: string(agentChildPair.Cert), + Key: string(agentChildPair.Key), + }, + assertErr: func(t *testing.T, err error) { + assert.NoError(t, err, + "unexpected error when applying fleet.ssl.certificate and key") + }, + }, + { + name: "certificate and key is ignored if absent", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + Host: fleetmTLSServer.URL, + Transport: httpcommon.HTTPTransportSettings{ + TLS: &tlscommon.Config{ + CAs: []string{string(fleetRootPair.Cert)}, + Certificate: tlscommon.CertificateConfig{ + Certificate: string(agentChildPair.Cert), + Key: string(agentChildPair.Key), + }, + }, + }, + }, + AccessAPIKey: "ignore", + }, + Settings: configuration.DefaultSettingsConfig(), + }, + newCfg: map[string]interface{}{}, + setterCalledCount: 0, + wantCAs: []string{string(fleetRootPair.Cert)}, + wantCertificateConfig: tlscommon.CertificateConfig{ + Certificate: string(agentChildPair.Cert), + Key: string(agentChildPair.Key), + }, + assertErr: func(t *testing.T, err error) { + assert.NoError(t, err, + "unexpected error when applying fleet.ssl.certificate and key") + }, + }, + { + name: "certificate and key isn't applied if wrong", + originalCfg: &configuration.Configuration{ + Fleet: &configuration.FleetAgentConfig{ + Client: remote.Config{ + Host: fleetmTLSServer.URL, + Transport: httpcommon.HTTPTransportSettings{ + TLS: &tlscommon.Config{ + CAs: []string{string(fleetRootPair.Cert)}, + Certificate: tlscommon.CertificateConfig{ + Certificate: string(agentChildPair.Cert), + Key: string(agentChildPair.Key), + }, + }, + }, + }, + AccessAPIKey: "ignore", + }, + Settings: configuration.DefaultSettingsConfig(), + }, + newCfg: map[string]interface{}{ + "fleet.ssl.enabled": true, + "fleet.ssl.certificate": string(wrongChildPair.Cert), + "fleet.ssl.key": string(wrongChildPair.Key), + }, + setterCalledCount: 0, + wantCAs: []string{string(fleetRootPair.Cert)}, + wantCertificateConfig: tlscommon.CertificateConfig{ + Certificate: string(agentChildPair.Cert), + Key: string(agentChildPair.Key), + }, + assertErr: func(t *testing.T, err error) { + assert.Error(t, err, + "wrong fleet.ssl.certificate and key should cause an error") + }, + customLogLevelSetterMock: func(t *testing.T) *mockhandlers.LogLevelSetter { + // We don't expect any log level to be set if config is wrong + return mockhandlers.NewLogLevelSetter(t) + }, + }, + } - assert.Equal(t, 1, setterCalledCount) - assert.Equal(t, - wantProxy, - h.config.Fleet.Client.Transport.Proxy.URL.String()) - }) + for _, tc := range tcs { + t.Run(tc.name, func(t *testing.T) { + log, logs := logger.NewTesting(tc.name) + defer func() { + if t.Failed() { + t.Log("test failed, see handler logs below:") + for _, l := range logs.TakeAll() { + t.Log(l) + } + } + }() + + var setterCalledCount int + setter := testSetter{SetClientFn: func(c client.Sender) { + setterCalledCount++ + }} + + var logLevelSetterMock *mockhandlers.LogLevelSetter + if tc.customLogLevelSetterMock != nil { + logLevelSetterMock = tc.customLogLevelSetterMock(t) + } else { + logLevelSetterMock = nilLogLevelSet(t) + } + h := PolicyChangeHandler{ + agentInfo: &info.AgentInfo{}, + config: tc.originalCfg, + store: &storage.NullStore{}, + setters: []actions.ClientSetter{&setter}, + log: log, + policyLogLevelSetter: logLevelSetterMock, + } + + cfg := config.MustNewConfigFrom(tc.newCfg) + + err := h.handlePolicyChange(context.Background(), cfg) + tc.assertErr(t, err) + + assert.Equal(t, tc.setterCalledCount, setterCalledCount, + "setter was not called") + if assert.NotNil(t, h.config.Fleet.Client.Transport.TLS, "TLS settings in fleet client config should not be null") { + assert.Equal(t, + tc.wantCAs, h.config.Fleet.Client.Transport.TLS.CAs, + "unexpected CAs") + assert.Equal(t, + tc.wantCertificateConfig, h.config.Fleet.Client.Transport.TLS.Certificate, + "unexpected certificate/key pair") + } + }) + } + }) } type testAcker struct { @@ -451,3 +887,135 @@ type testSetter struct { func (s *testSetter) SetClient(c client.Sender) { s.SetClientFn(c) } + +func TestPolicyChangeHandler_handlePolicyChange_LogLevelSet(t *testing.T) { + + matchLogLevel := func(expectedLevel logger.Level) func(*logger.Level) bool { + return func(level *logger.Level) bool { + if level == nil { + return false + } + return expectedLevel == *level + } + } + + type args struct { + c map[string]any + } + tests := []struct { + name string + args args + setupExpectations func(setter *mockhandlers.LogLevelSetter) + wantErr assert.ErrorAssertionFunc + }{ + { + name: "set debug log level from policy", + args: args{ + c: map[string]interface{}{ + "agent.logging.level": "debug", + }, + }, + setupExpectations: func(setter *mockhandlers.LogLevelSetter) { + setter.EXPECT().SetLogLevel(mock.Anything, mock.MatchedBy(matchLogLevel(logp.DebugLevel))).Return(nil).Once() + }, + wantErr: assert.NoError, + }, + { + name: "set info log level from policy", + args: args{ + c: map[string]interface{}{ + "agent.logging.level": "info", + }, + }, + setupExpectations: func(setter *mockhandlers.LogLevelSetter) { + setter.EXPECT(). + SetLogLevel(mock.Anything, mock.MatchedBy(matchLogLevel(logp.InfoLevel))). + Return(nil).Once() + }, + wantErr: assert.NoError, + }, + { + name: "set warning log level from policy", + args: args{ + c: map[string]interface{}{ + "agent.logging.level": "warning", + }, + }, + setupExpectations: func(setter *mockhandlers.LogLevelSetter) { + setter.EXPECT(). + SetLogLevel(mock.Anything, mock.MatchedBy(matchLogLevel(logp.WarnLevel))). + Return(nil).Once() + }, + wantErr: assert.NoError, + }, + { + name: "set error log level from policy", + args: args{ + c: map[string]interface{}{ + "agent.logging.level": "error", + }, + }, + setupExpectations: func(setter *mockhandlers.LogLevelSetter) { + setter.EXPECT(). + SetLogLevel(mock.Anything, mock.MatchedBy(matchLogLevel(logp.ErrorLevel))). + Return(nil).Once() + }, + wantErr: assert.NoError, + }, + { + name: "set critical log level from policy", + args: args{ + c: map[string]interface{}{ + "agent.logging.level": "critical", + }, + }, + setupExpectations: func(setter *mockhandlers.LogLevelSetter) { + setter.EXPECT(). + SetLogLevel(mock.Anything, mock.MatchedBy(matchLogLevel(logp.CriticalLevel))). + Return(nil).Once() + }, + wantErr: assert.NoError, + }, + { + name: "Error: Wrong log level error in policy", + args: args{ + c: map[string]interface{}{ + "agent.logging.level": "asdasd", + }, + }, + // don't set any expectations on the LogLevelSetter mock because we don't expect any calls + setupExpectations: nil, + wantErr: assert.Error, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + + log, _ := logger.NewTesting(tt.name) + mockLogLevelSetter := mockhandlers.NewLogLevelSetter(t) + + if tt.setupExpectations != nil { + tt.setupExpectations(mockLogLevelSetter) + } + + h := &PolicyChangeHandler{ + log: log, + agentInfo: &info.AgentInfo{}, + config: configuration.DefaultConfiguration(), + store: &storage.NullStore{}, + policyLogLevelSetter: mockLogLevelSetter, + } + + tt.wantErr(t, h.handlePolicyChange(context.Background(), config.MustNewConfigFrom(tt.args.c)), fmt.Sprintf("handlePolicyChange(ctx, %v)", tt.args.c)) + }) + } +} + +func nilLogLevelSet(t *testing.T) *mockhandlers.LogLevelSetter { + // nilLogLevel is a variable used to match nil policy log level being set + var nilLogLevel *logger.Level = nil + + logLevelSetter := mockhandlers.NewLogLevelSetter(t) + logLevelSetter.EXPECT().SetLogLevel(mock.Anything, nilLogLevel).Return(nil).Once() + return logLevelSetter +} diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_settings.go b/internal/pkg/agent/application/actions/handlers/handler_action_settings.go index 68be5715dab..4c4c4c6a827 100644 --- a/internal/pkg/agent/application/actions/handlers/handler_action_settings.go +++ b/internal/pkg/agent/application/actions/handlers/handler_action_settings.go @@ -10,30 +10,32 @@ import ( "github.com/elastic/elastic-agent-libs/logp" - "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" "github.com/elastic/elastic-agent/internal/pkg/agent/application/info" "github.com/elastic/elastic-agent/internal/pkg/fleetapi" "github.com/elastic/elastic-agent/internal/pkg/fleetapi/acker" "github.com/elastic/elastic-agent/pkg/core/logger" ) +const clearLogLevelValue = "" + // Settings handles settings change coming from fleet and updates log level. type Settings struct { - log *logger.Logger - agentInfo info.Agent - coord *coordinator.Coordinator + log *logger.Logger + agentInfo info.Agent + fallbackLogLevel *logp.Level + logLevelSetter logLevelSetter } // NewSettings creates a new Settings handler. func NewSettings( log *logger.Logger, agentInfo info.Agent, - coord *coordinator.Coordinator, + logLevelSetter logLevelSetter, ) *Settings { return &Settings{ - log: log, - agentInfo: agentInfo, - coord: coord, + log: log, + agentInfo: agentInfo, + logLevelSetter: logLevelSetter, } } @@ -45,28 +47,68 @@ func (h *Settings) Handle(ctx context.Context, a fleetapi.Action, acker acker.Ac return fmt.Errorf("invalid type, expected ActionSettings and received %T", a) } - if !isSupportedLogLevel(action.LogLevel) { - return fmt.Errorf("invalid log level, expected debug|info|warning|error and received '%s'", action.LogLevel) - } + logLevel := action.LogLevel + return h.handleLogLevel(ctx, logLevel, acker, action) +} - lvl := logp.InfoLevel - err := lvl.Unpack(action.LogLevel) - if err != nil { - return fmt.Errorf("failed to unpack log level: %w", err) - } +func (h *Settings) handleLogLevel(ctx context.Context, logLevel string, acker acker.Acker, action *fleetapi.ActionSettings) error { + var lvl *logp.Level + if logLevel != clearLogLevelValue { + if !isSupportedLogLevel(logLevel) { + return fmt.Errorf("invalid log level, expected debug|info|warning|error and received '%s'", logLevel) + } - if err := h.agentInfo.SetLogLevel(ctx, action.LogLevel); err != nil { + // parse loglvl from the string + parsedLvl := logp.InfoLevel + err := parsedLvl.Unpack(logLevel) + if err != nil { + return fmt.Errorf("failed to unpack log level: %w", err) + } + lvl = &parsedLvl + } + if err := h.agentInfo.SetLogLevel(ctx, logLevel); err != nil { return fmt.Errorf("failed to update log level: %w", err) } - if err := acker.Ack(ctx, a); err != nil { + if err := acker.Ack(ctx, action); err != nil { h.log.Errorf("failed to acknowledge SETTINGS action with id '%s'", action.ActionID) } else if err := acker.Commit(ctx); err != nil { h.log.Errorf("failed to commit acker after acknowledging action with id '%s'", action.ActionID) } - h.log.Infof("Settings action done, setting agent log level to %s", lvl.String()) - return h.coord.SetLogLevel(ctx, lvl) + if lvl != nil { + h.log.Infof("Settings action done, setting agent log level to %s", logLevel) + return h.logLevelSetter.SetLogLevel(ctx, lvl) + } + + if h.fallbackLogLevel != nil { + h.log.Infof("Settings action done, setting agent log level to policy default %s", h.fallbackLogLevel) + // use fallback log level + return h.logLevelSetter.SetLogLevel(ctx, h.fallbackLogLevel) + } + + // use default log level + defaultLogLevel := logger.DefaultLogLevel + h.log.Infof("Settings action done, setting agent log level to default %s", defaultLogLevel) + return h.logLevelSetter.SetLogLevel(ctx, &defaultLogLevel) +} + +// SetLogLevel is used to set the fallback log level +// It propagates this log level in case there's no log level set for this specific agent +func (h *Settings) SetLogLevel(ctx context.Context, lvl *logp.Level) error { + if lvl != nil && !isSupportedLogLevel(lvl.String()) { + return fmt.Errorf("invalid log level, expected debug|info|warning|error and received '%s'", lvl.String()) + } + + h.fallbackLogLevel = lvl + rawLogLevel := h.agentInfo.RawLogLevel() + h.log.Debugf("received fallback loglevel %s, raw loglevel %s", lvl, rawLogLevel) + if rawLogLevel == "" && lvl != nil { + h.log.Debugf("setting log level %s", lvl) + // set the runtime log level only if we don't have one set for the specific agent + return h.logLevelSetter.SetLogLevel(ctx, lvl) + } + return nil } func isSupportedLogLevel(level string) bool { diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_settings_test.go b/internal/pkg/agent/application/actions/handlers/handler_action_settings_test.go new file mode 100644 index 00000000000..0d8fee3b61b --- /dev/null +++ b/internal/pkg/agent/application/actions/handlers/handler_action_settings_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 handlers + +import ( + "context" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/elastic-agent/internal/pkg/fleetapi" + "github.com/elastic/elastic-agent/pkg/core/logger" + mockhandlers "github.com/elastic/elastic-agent/testing/mocks/internal_/pkg/agent/application/actions/handlers" + mockinfo "github.com/elastic/elastic-agent/testing/mocks/internal_/pkg/agent/application/info" + mockfleetacker "github.com/elastic/elastic-agent/testing/mocks/internal_/pkg/fleetapi/acker" +) + +func TestSettings_SetLogLevel(t *testing.T) { + + // test log level we use in testcases + testWarnLevel := logp.WarnLevel + + type fields struct { + fallbackLogLevel *logp.Level + } + type args struct { + lvl *logp.Level + } + tests := []struct { + name string + fields fields + args args + setupMocks func(*testing.T, *mockhandlers.LogLevelSetter, *mockinfo.Agent) + wantErr assert.ErrorAssertionFunc + wantFallbackLogLevel *logp.Level + }{ + { + name: "fallbackLogLevel set without an override at agent level", + fields: fields{}, + args: args{ + lvl: &testWarnLevel, + }, + setupMocks: func(t *testing.T, setter *mockhandlers.LogLevelSetter, agent *mockinfo.Agent) { + agent.EXPECT().RawLogLevel().Return("").Once() + setter.EXPECT().SetLogLevel(mock.Anything, &testWarnLevel).Return(nil).Once() + }, + wantErr: assert.NoError, + wantFallbackLogLevel: &testWarnLevel, + }, + { + name: "Nil fallbackLogLevel without an override at agent level is not propagated", + fields: fields{}, + args: args{ + lvl: nil, + }, + setupMocks: func(t *testing.T, setter *mockhandlers.LogLevelSetter, agent *mockinfo.Agent) { + agent.EXPECT().RawLogLevel().Return("").Once() + // we should never call the SetLogLevel with nil, for simplicity remove the expectation altogether + // setter.EXPECT().SetLogLevel(mock.Anything, nil).Return(nil).Times(0) + }, + wantErr: assert.NoError, + wantFallbackLogLevel: nil, + }, + { + name: "fallbackLogLevel set while there's an override at agent level", + fields: fields{}, + args: args{ + lvl: &testWarnLevel, + }, + setupMocks: func(t *testing.T, setter *mockhandlers.LogLevelSetter, agent *mockinfo.Agent) { + agent.EXPECT().RawLogLevel().Return("info").Once() + }, + wantErr: assert.NoError, + wantFallbackLogLevel: &testWarnLevel, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockAgentInfo := mockinfo.NewAgent(t) + mockLogLevelSetter := mockhandlers.NewLogLevelSetter(t) + + if tt.setupMocks != nil { + tt.setupMocks(t, mockLogLevelSetter, mockAgentInfo) + } + + log, _ := logger.NewTesting(tt.name) + + ctx := context.Background() + + h := &Settings{ + log: log, + agentInfo: mockAgentInfo, + fallbackLogLevel: tt.fields.fallbackLogLevel, + logLevelSetter: mockLogLevelSetter, + } + tt.wantErr(t, h.SetLogLevel(ctx, tt.args.lvl), fmt.Sprintf("SetLogLevel(%v, %v)", ctx, tt.args.lvl)) + assert.Equal(t, tt.wantFallbackLogLevel, h.fallbackLogLevel) + }) + } +} + +func TestSettings_handleLogLevel(t *testing.T) { + + testWarnLogLevel := logp.WarnLevel + testDebugLogLevel := logp.DebugLevel + testDefaultLogLevel := logger.DefaultLogLevel + type fields struct { + fallbackLogLevel *logp.Level + } + type args struct { + logLevel string + action *fleetapi.ActionSettings + } + tests := []struct { + name string + fields fields + args args + setupMocks func(*testing.T, *mockinfo.Agent, *mockhandlers.LogLevelSetter, *mockfleetacker.Acker) + wantErr assert.ErrorAssertionFunc + }{ + { + name: "Set debug log level, disregard fallback level warning", + fields: fields{ + fallbackLogLevel: &testWarnLogLevel, + }, + args: args{ + logLevel: "debug", + action: &fleetapi.ActionSettings{ + ActionID: "someactionid", + ActionType: fleetapi.ActionTypeSettings, + LogLevel: "debug", + }, + }, + setupMocks: func(t *testing.T, agent *mockinfo.Agent, setter *mockhandlers.LogLevelSetter, acker *mockfleetacker.Acker) { + agent.EXPECT().SetLogLevel(mock.Anything, "debug").Return(nil) + setter.EXPECT().SetLogLevel(mock.Anything, &testDebugLogLevel).Return(nil) + acker.EXPECT().Ack(mock.Anything, mock.Anything).Return(nil) + acker.EXPECT().Commit(mock.Anything).Return(nil) + }, + wantErr: assert.NoError, + }, + { + name: "Clear log level, switch to fallback level warning", + fields: fields{ + fallbackLogLevel: &testWarnLogLevel, + }, + args: args{ + logLevel: clearLogLevelValue, + action: &fleetapi.ActionSettings{ + ActionID: "someactionid", + ActionType: fleetapi.ActionTypeSettings, + LogLevel: clearLogLevelValue, + }, + }, + setupMocks: func(t *testing.T, agent *mockinfo.Agent, setter *mockhandlers.LogLevelSetter, acker *mockfleetacker.Acker) { + agent.EXPECT().SetLogLevel(mock.Anything, "").Return(nil) + setter.EXPECT().SetLogLevel(mock.Anything, &testWarnLogLevel).Return(nil) + acker.EXPECT().Ack(mock.Anything, mock.Anything).Return(nil) + acker.EXPECT().Commit(mock.Anything).Return(nil) + }, + wantErr: assert.NoError, + }, + { + name: "Clear log level, no fallback level, go with default log level", + fields: fields{ + fallbackLogLevel: nil, + }, + args: args{ + logLevel: clearLogLevelValue, + action: &fleetapi.ActionSettings{ + ActionID: "someactionid", + ActionType: fleetapi.ActionTypeSettings, + LogLevel: clearLogLevelValue, + }, + }, + setupMocks: func(t *testing.T, agent *mockinfo.Agent, setter *mockhandlers.LogLevelSetter, acker *mockfleetacker.Acker) { + agent.EXPECT().SetLogLevel(mock.Anything, "").Return(nil) + setter.EXPECT().SetLogLevel(mock.Anything, &testDefaultLogLevel).Return(nil) + acker.EXPECT().Ack(mock.Anything, mock.Anything).Return(nil) + acker.EXPECT().Commit(mock.Anything).Return(nil) + }, + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + log, _ := logger.NewTesting(tt.name) + mockAgentInfo := mockinfo.NewAgent(t) + mockLogLevelSetter := mockhandlers.NewLogLevelSetter(t) + mockAcker := mockfleetacker.NewAcker(t) + + if tt.setupMocks != nil { + tt.setupMocks(t, mockAgentInfo, mockLogLevelSetter, mockAcker) + } + + ctx := context.Background() + + h := &Settings{ + log: log, + agentInfo: mockAgentInfo, + fallbackLogLevel: tt.fields.fallbackLogLevel, + logLevelSetter: mockLogLevelSetter, + } + tt.wantErr(t, h.handleLogLevel(ctx, tt.args.logLevel, mockAcker, tt.args.action), fmt.Sprintf("handleLogLevel(%v, %v, %v, %v)", ctx, tt.args.logLevel, mockAcker, tt.args.action)) + }) + } +} diff --git a/internal/pkg/agent/application/actions/handlers/handler_action_unenroll_test.go b/internal/pkg/agent/application/actions/handlers/handler_action_unenroll_test.go index e28612e9502..79ab501d829 100644 --- a/internal/pkg/agent/application/actions/handlers/handler_action_unenroll_test.go +++ b/internal/pkg/agent/application/actions/handlers/handler_action_unenroll_test.go @@ -6,10 +6,9 @@ package handlers import ( "context" + "sync/atomic" "testing" - "github.com/elastic/elastic-agent-libs/atomic" - "github.com/elastic/elastic-agent-client/v7/pkg/client" "github.com/elastic/elastic-agent-client/v7/pkg/proto" "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" @@ -43,7 +42,7 @@ func makeComponentState(name string, proxiedActions []string) runtime.ComponentC type MockActionCoordinator struct { st coordinator.State - performedActions atomic.Int + performedActions atomic.Int64 } func (c *MockActionCoordinator) State() coordinator.State { @@ -51,7 +50,7 @@ func (c *MockActionCoordinator) State() coordinator.State { } func (c *MockActionCoordinator) PerformAction(ctx context.Context, comp component.Component, unit component.Unit, name string, params map[string]interface{}) (map[string]interface{}, error) { - c.performedActions.Inc() + c.performedActions.Add(1) return nil, nil } @@ -118,7 +117,7 @@ func TestActionUnenrollHandler(t *testing.T) { name string st coordinator.State wantErr error // Handler error - wantPerformedActions int + wantPerformedActions int64 tamperProtectionFn func() bool }{ { diff --git a/internal/pkg/agent/application/actions/handlers/loglevelsetter.go b/internal/pkg/agent/application/actions/handlers/loglevelsetter.go new file mode 100644 index 00000000000..15e6141ae4b --- /dev/null +++ b/internal/pkg/agent/application/actions/handlers/loglevelsetter.go @@ -0,0 +1,16 @@ +// 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 handlers + +import ( + "context" + + "github.com/elastic/elastic-agent-libs/logp" +) + +// logLevelSetter interface represents an actor able to set the global log level in agent +type logLevelSetter interface { + SetLogLevel(ctx context.Context, lvl *logp.Level) error +} diff --git a/internal/pkg/agent/application/application.go b/internal/pkg/agent/application/application.go index e28aa8bf29c..c117c136593 100644 --- a/internal/pkg/agent/application/application.go +++ b/internal/pkg/agent/application/application.go @@ -92,7 +92,13 @@ func New( log.Infof("Loading baseline config from %v", pathConfigFile) rawConfig, err = config.LoadFile(pathConfigFile) if err != nil { - return nil, nil, nil, fmt.Errorf("failed to load configuration: %w", err) + if !runAsOtel { + return nil, nil, nil, fmt.Errorf("failed to load configuration: %w", err) + } + + // initialize with empty config, configuration file is not necessary in otel mode, + // best effort is fine + rawConfig = config.New() } } if err := info.InjectAgentConfig(rawConfig); err != nil { @@ -114,7 +120,6 @@ func New( runtime, err := runtime.NewManager( log, baseLogger, - cfg.Settings.GRPC.String(), agentInfo, tracer, monitor, @@ -171,7 +176,8 @@ func New( EndpointSignedComponentModifier(), ) - managed, err = newManagedConfigManager(ctx, log, agentInfo, cfg, store, runtime, fleetInitTimeout, upgrader) + // TODO: stop using global state + managed, err = newManagedConfigManager(ctx, log, agentInfo, cfg, store, runtime, fleetInitTimeout, paths.Top(), upgrader) if err != nil { return nil, nil, nil, err } @@ -179,12 +185,16 @@ func New( } } - composable, err := composable.New(log, rawConfig, composableManaged) - if err != nil { - return nil, nil, nil, errors.New(err, "failed to initialize composable controller") + var varsManager composable.Controller + if !runAsOtel { + // no need for vars in otel mode + varsManager, err = composable.New(log, rawConfig, composableManaged) + if err != nil { + return nil, nil, nil, errors.New(err, "failed to initialize composable controller") + } } - coord := coordinator.New(log, cfg, logLevel, agentInfo, specs, reexec, upgrader, runtime, configMgr, composable, caps, monitor, isManaged, compModifiers...) + coord := coordinator.New(log, cfg, logLevel, agentInfo, specs, reexec, upgrader, runtime, configMgr, varsManager, caps, monitor, isManaged, compModifiers...) if managed != nil { // the coordinator requires the config manager as well as in managed-mode the config manager requires the // coordinator, so it must be set here once the coordinator is created @@ -206,7 +216,7 @@ func New( return nil, nil, nil, fmt.Errorf("could not parse and apply feature flags config: %w", err) } - return coord, configMgr, composable, nil + return coord, configMgr, varsManager, nil } func mergeFleetConfig(ctx context.Context, rawConfig *config.Config) (storage.Store, *configuration.Configuration, error) { diff --git a/internal/pkg/agent/application/coordinator/coordinator.go b/internal/pkg/agent/application/coordinator/coordinator.go index 10be2cc2aa8..c967b51b732 100644 --- a/internal/pkg/agent/application/coordinator/coordinator.go +++ b/internal/pkg/agent/application/coordinator/coordinator.go @@ -10,6 +10,7 @@ import ( "fmt" "reflect" "strings" + "sync/atomic" "time" "github.com/hashicorp/go-multierror" @@ -82,7 +83,12 @@ type MonitorManager interface { Reload(rawConfig *config.Config) error // MonitoringConfig injects monitoring configuration into resolved ast tree. - MonitoringConfig(map[string]interface{}, []component.Component, map[string]string) (map[string]interface{}, error) + // args: + // - the existing config policy + // - a list of the expected running components + // - a map of component IDs to binary names + // - a map of component IDs to the PIDs of the running components. + MonitoringConfig(map[string]interface{}, []component.Component, map[string]string, map[string]uint64) (map[string]interface{}, error) } // Runner provides interface to run a manager and receive running errors. @@ -279,6 +285,19 @@ type Coordinator struct { // mx sync.RWMutex // protection protection.Config + + // a sync channel that can be called by other components to check if the main coordinator + // loop in runLoopIteration() is active and listening. + // Should only be interacted with via CoordinatorActive() or runLoopIteration() + heartbeatChan chan struct{} + + // if a component (mostly endpoint) has a new PID, we need to update + // the monitoring components so they have a PID to monitor + // however, if endpoint is in some kind of restart loop, + // we could DOS the config system. Instead, + // run a ticker that checks to see if we have a new PID. + componentPIDTicker *time.Ticker + componentPidRequiresUpdate *atomic.Bool } // The channels Coordinator reads to receive updates from the various managers. @@ -369,9 +388,12 @@ func New(logger *logger.Logger, cfg *configuration.Configuration, logLevel logp. // synchronization in the subscriber API, just set the input buffer to 0. stateBroadcaster: broadcaster.New(state, 64, 32), - logLevelCh: make(chan logp.Level), - overrideStateChan: make(chan *coordinatorOverrideState), - upgradeDetailsChan: make(chan *details.Details), + logLevelCh: make(chan logp.Level), + overrideStateChan: make(chan *coordinatorOverrideState), + upgradeDetailsChan: make(chan *details.Details), + heartbeatChan: make(chan struct{}), + componentPIDTicker: time.NewTicker(time.Second * 30), + componentPidRequiresUpdate: &atomic.Bool{}, } // Setup communication channels for any non-nil components. This pattern // lets us transparently accept nil managers / simulated events during @@ -412,6 +434,22 @@ func (c *Coordinator) State() State { return c.stateBroadcaster.Get() } +// IsActive is a blocking method that waits for a channel response +// from the coordinator loop. This can be used to as a basic health check, +// as we'll timeout and return false if the coordinator run loop doesn't +// respond to our channel. +func (c *Coordinator) IsActive(timeout time.Duration) bool { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + select { + case <-c.heartbeatChan: + return true + case <-ctx.Done(): + return false + } +} + func (c *Coordinator) RegisterMonitoringServer(s configReloader) { c.monitoringServerReloader = s } @@ -548,13 +586,16 @@ func (c *Coordinator) PerformComponentDiagnostics(ctx context.Context, additiona // SetLogLevel changes the entire log level for the running Elastic Agent. // Called from external goroutines. -func (c *Coordinator) SetLogLevel(ctx context.Context, lvl logp.Level) error { +func (c *Coordinator) SetLogLevel(ctx context.Context, lvl *logp.Level) error { + if lvl == nil { + return fmt.Errorf("logp.Level passed to Coordinator.SetLogLevel() must be not nil") + } select { case <-ctx.Done(): return ctx.Err() - case c.logLevelCh <- lvl: + case c.logLevelCh <- *lvl: // set global once the level change has been taken by the channel - logger.SetLevel(lvl) + logger.SetLevel(*lvl) return nil } } @@ -658,10 +699,16 @@ func (c *Coordinator) Run(ctx context.Context) error { // shutdown state. defer close(c.stateBroadcaster.InputChan) + if c.varsMgr != nil { + c.setCoordinatorState(agentclient.Starting, "Waiting for initial configuration and composable variables") + } else { + // vars not initialized, go directly to running + c.setCoordinatorState(agentclient.Healthy, "Running") + } + // The usual state refresh happens in the main run loop in Coordinator.runner, // so before/after the runner call we need to trigger state change broadcasts // manually with refreshState. - c.setCoordinatorState(agentclient.Starting, "Waiting for initial configuration and composable variables") c.refreshState() err := c.runner(ctx) @@ -692,6 +739,34 @@ func (c *Coordinator) Run(ctx context.Context) error { // Called by external goroutines. func (c *Coordinator) DiagnosticHooks() diagnostics.Hooks { return diagnostics.Hooks{ + { + Name: "agent-info", + Filename: "agent-info.yaml", + Description: "current state of the agent information of the running Elastic Agent", + ContentType: "application/yaml", + Hook: func(_ context.Context) []byte { + output := struct { + AgentID string `yaml:"agent_id"` + Headers map[string]string `yaml:"headers"` + LogLevel string `yaml:"log_level"` + Snapshot bool `yaml:"snapshot"` + Version string `yaml:"version"` + Unprivileged bool `yaml:"unprivileged"` + }{ + AgentID: c.agentInfo.AgentID(), + Headers: c.agentInfo.Headers(), + LogLevel: c.agentInfo.LogLevel(), + Snapshot: c.agentInfo.Snapshot(), + Version: c.agentInfo.Version(), + Unprivileged: c.agentInfo.Unprivileged(), + } + o, err := yaml.Marshal(output) + if err != nil { + return []byte(fmt.Sprintf("error: %q", err)) + } + return o + }, + }, { Name: "local-config", Filename: "local-config.yaml", @@ -867,6 +942,8 @@ func (c *Coordinator) runner(ctx context.Context) error { ctx, cancel := context.WithCancel(ctx) defer cancel() + defer c.componentPIDTicker.Stop() + // We run nil checks before starting the various managers so that unit tests // only have to initialize / mock the specific components they're testing. // If a manager is nil, we prebuffer its return channel with nil also so @@ -977,6 +1054,20 @@ func (c *Coordinator) runLoopIteration(ctx context.Context) { case upgradeDetails := <-c.upgradeDetailsChan: c.setUpgradeDetails(upgradeDetails) + case c.heartbeatChan <- struct{}{}: + + case <-c.componentPIDTicker.C: + // if we hit the ticker and we've got a new PID, + // reload the component model + if c.componentPidRequiresUpdate.Swap(false) { + err := c.refreshComponentModel(ctx) + if err != nil { + err = fmt.Errorf("error refreshing component model for PID update: %w", err) + c.setConfigManagerError(err) + c.logger.Errorf("%s", err) + } + } + case componentState := <-c.managerChans.runtimeManagerUpdate: // New component change reported by the runtime manager via // Coordinator.watchRuntimeComponents(), merge it with the @@ -1216,11 +1307,17 @@ func (c *Coordinator) generateComponentModel() (err error) { configInjector = c.monitorMgr.MonitoringConfig } + var existingCompState = make(map[string]uint64, len(c.state.Components)) + for _, comp := range c.state.Components { + existingCompState[comp.Component.ID] = comp.State.Pid + } + comps, err := c.specs.ToComponents( cfg, configInjector, c.state.LogLevel, c.agentInfo, + existingCompState, ) if err != nil { return fmt.Errorf("failed to render components: %w", err) diff --git a/internal/pkg/agent/application/coordinator/coordinator_state.go b/internal/pkg/agent/application/coordinator/coordinator_state.go index 0d6ba22bddd..6e388d961f1 100644 --- a/internal/pkg/agent/application/coordinator/coordinator_state.go +++ b/internal/pkg/agent/application/coordinator/coordinator_state.go @@ -135,9 +135,14 @@ func (c *Coordinator) refreshState() { // Coordinator state and sets stateNeedsRefresh. // Must be called on the main Coordinator goroutine. func (c *Coordinator) applyComponentState(state runtime.ComponentComponentState) { + + // check for any component updates to the known PID, so we can update the component monitoring found := false for i, other := range c.state.Components { if other.Component.ID == state.Component.ID { + if other.State.Pid != state.State.Pid { + c.componentPidRequiresUpdate.Store(true) + } c.state.Components[i] = state found = true break @@ -145,6 +150,9 @@ func (c *Coordinator) applyComponentState(state runtime.ComponentComponentState) } if !found { c.state.Components = append(c.state.Components, state) + if state.State.Pid != 0 { + c.componentPidRequiresUpdate.Store(true) + } } // In the case that the component has stopped, it is now removed. @@ -160,6 +168,7 @@ func (c *Coordinator) applyComponentState(state runtime.ComponentComponentState) } c.stateNeedsRefresh = true + } // generateReportableState aggregates the internal state of the Coordinator diff --git a/internal/pkg/agent/application/coordinator/coordinator_test.go b/internal/pkg/agent/application/coordinator/coordinator_test.go index 3cfeddb32af..d522638a2c4 100644 --- a/internal/pkg/agent/application/coordinator/coordinator_test.go +++ b/internal/pkg/agent/application/coordinator/coordinator_test.go @@ -61,6 +61,19 @@ var ( }, }, } + fakeIsolatedUnitsInputSpec = component.InputSpec{ + Name: "fake-isolated-units", + Platforms: []string{fmt.Sprintf("%s/%s", goruntime.GOOS, goruntime.GOARCH)}, + Shippers: []string{"fake-shipper"}, + Command: &component.CommandSpec{ + Timeouts: component.CommandTimeoutSpec{ + Checkin: 30 * time.Second, + Restart: 10 * time.Millisecond, // quick restart during tests + Stop: 30 * time.Second, + }, + }, + IsolateUnits: true, + } fakeShipperSpec = component.ShipperSpec{ Name: "fake-shipper", Platforms: []string{fmt.Sprintf("%s/%s", goruntime.GOOS, goruntime.GOARCH)}, @@ -547,6 +560,98 @@ func TestCoordinator_StateSubscribe(t *testing.T) { require.NoError(t, err) } +func TestCoordinator_StateSubscribeIsolatedUnits(t *testing.T) { + coordCh := make(chan error) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + coord, cfgMgr, varsMgr := createCoordinator(t, ctx, WithComponentInputSpec(fakeIsolatedUnitsInputSpec)) + go func() { + err := coord.Run(ctx) + if errors.Is(err, context.Canceled) { + // allowed error + err = nil + } + coordCh <- err + }() + + resultChan := make(chan error) + go func() { + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + + subChan := coord.StateSubscribe(ctx, 32) + for { + select { + case <-ctx.Done(): + resultChan <- ctx.Err() + return + case state := <-subChan: + if len(state.Components) == 3 { + compState0 := getComponentState(state.Components, "fake-isolated-units-default-fake-isolated-units-0") + compState1 := getComponentState(state.Components, "fake-isolated-units-default-fake-isolated-units-1") + if compState0 != nil && compState1 != nil { + unit0, ok0 := compState0.State.Units[runtime.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units-0-unit"}] + unit1, ok1 := compState1.State.Units[runtime.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units-1-unit"}] + if ok0 && ok1 { + if (unit0.State == client.UnitStateHealthy && unit0.Message == "Healthy From Fake Isolated Units 0 Config") && + (unit1.State == client.UnitStateHealthy && unit1.Message == "Healthy From Fake Isolated Units 1 Config") { + resultChan <- nil + return + } else if unit0.State == client.UnitStateFailed && unit1.State == client.UnitStateFailed { + // if you get a really strange failed state, check to make sure the mock binaries in + // elastic-agent/pkg/component/fake/ are updated + t.Fail() + t.Logf("got units with failed state: %#v / %#v", unit1, unit0) + } + } + } + } + } + } + }() + + // no vars used by the config + varsMgr.Vars(ctx, []*transpiler.Vars{{}}) + + // set the configuration to run a fake input + cfg, err := config.NewConfigFrom(map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "fake-action-output", + "shipper": map[string]interface{}{ + "enabled": true, + }, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "id": "fake-isolated-units-0", + "type": "fake-isolated-units", + "use_output": "default", + "state": client.UnitStateHealthy, + "message": "Healthy From Fake Isolated Units 0 Config", + }, + map[string]interface{}{ + "id": "fake-isolated-units-1", + "type": "fake-isolated-units", + "use_output": "default", + "state": client.UnitStateHealthy, + "message": "Healthy From Fake Isolated Units 1 Config", + }, + }, + }) + require.NoError(t, err) + cfgMgr.Config(ctx, cfg) + + err = <-resultChan + require.NoError(t, err) + cancel() + + err = <-coordCh + require.NoError(t, err) +} + func TestCollectManagerErrorsTimeout(t *testing.T) { handlerChan, _, _, _, _ := setupManagerShutdownChannels(time.Millisecond) // Don't send anything to the shutdown channels, causing a timeout @@ -757,6 +862,7 @@ func TestCoordinator_UpgradeDetails(t *testing.T) { type createCoordinatorOpts struct { managed bool upgradeManager UpgradeManager + compInputSpec component.InputSpec } type CoordinatorOpt func(o *createCoordinatorOpts) @@ -773,13 +879,21 @@ func WithUpgradeManager(upgradeManager UpgradeManager) CoordinatorOpt { } } +func WithComponentInputSpec(spec component.InputSpec) CoordinatorOpt { + return func(o *createCoordinatorOpts) { + o.compInputSpec = spec + } +} + // createCoordinator creates a coordinator that using a fake config manager and a fake vars manager. // // The runtime specifications is set up to use both the fake component and fake shipper. func createCoordinator(t *testing.T, ctx context.Context, opts ...CoordinatorOpt) (*Coordinator, *fakeConfigManager, *fakeVarsManager) { t.Helper() - o := &createCoordinatorOpts{} + o := &createCoordinatorOpts{ + compInputSpec: fakeInputSpec, + } for _, opt := range opts { opt(o) } @@ -793,7 +907,7 @@ func createCoordinator(t *testing.T, ctx context.Context, opts ...CoordinatorOpt InputType: "fake", BinaryName: "", BinaryPath: testBinary(t, "component"), - Spec: fakeInputSpec, + Spec: o.compInputSpec, } shipperSpec := component.ShipperRuntimeSpec{ ShipperType: "fake-shipper", @@ -808,7 +922,7 @@ func createCoordinator(t *testing.T, ctx context.Context, opts ...CoordinatorOpt require.NoError(t, err) monitoringMgr := newTestMonitoringMgr() - rm, err := runtime.NewManager(l, l, "localhost:0", ai, apmtest.DiscardTracer, monitoringMgr, configuration.DefaultGRPCConfig()) + rm, err := runtime.NewManager(l, l, ai, apmtest.DiscardTracer, monitoringMgr, configuration.DefaultGRPCConfig()) require.NoError(t, err) caps, err := capabilities.LoadFile(paths.AgentCapabilitiesPath(), l) @@ -841,7 +955,10 @@ func newErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + eventLoggerCfg := logger.DefaultEventLoggingConfig() + eventLoggerCfg.Level = loggerCfg.Level + + log, err := logger.NewFromConfig("", loggerCfg, eventLoggerCfg, false) require.NoError(t, err) return log } @@ -894,7 +1011,7 @@ func (*testMonitoringManager) Prepare(_ string) error func (*testMonitoringManager) Cleanup(string) error { return nil } func (*testMonitoringManager) Enabled() bool { return false } func (*testMonitoringManager) Reload(rawConfig *config.Config) error { return nil } -func (*testMonitoringManager) MonitoringConfig(_ map[string]interface{}, _ []component.Component, _ map[string]string) (map[string]interface{}, error) { +func (*testMonitoringManager) MonitoringConfig(_ map[string]interface{}, _ []component.Component, _ map[string]string, _ map[string]uint64) (map[string]interface{}, error) { return nil, nil } diff --git a/internal/pkg/agent/application/coordinator/coordinator_unit_test.go b/internal/pkg/agent/application/coordinator/coordinator_unit_test.go index 62074106e5b..5aa8e975872 100644 --- a/internal/pkg/agent/application/coordinator/coordinator_unit_test.go +++ b/internal/pkg/agent/application/coordinator/coordinator_unit_test.go @@ -14,6 +14,7 @@ import ( "context" "errors" "fmt" + "net" "testing" "time" @@ -58,6 +59,7 @@ func TestVarsManagerError(t *testing.T) { managerChans: managerChans{ varsManagerError: varsErrorChan, }, + componentPIDTicker: time.NewTicker(time.Second * 30), } // Send an error via the vars manager channel, and let Coordinator update const errorStr = "force error" @@ -109,6 +111,7 @@ func TestCoordinatorReportsUnhealthyComponents(t *testing.T) { managerChans: managerChans{ runtimeManagerUpdate: runtimeChan, }, + componentPIDTicker: time.NewTicker(time.Second * 30), } unhealthyComponent := runtime.ComponentComponentState{ @@ -185,6 +188,7 @@ func TestCoordinatorComponentStatesAreSeparate(t *testing.T) { managerChans: managerChans{ runtimeManagerUpdate: runtimeChan, }, + componentPIDTicker: time.NewTicker(time.Second * 30), } comp1 := runtime.ComponentComponentState{ @@ -255,6 +259,7 @@ func TestCoordinatorReportsUnhealthyUnits(t *testing.T) { managerChans: managerChans{ runtimeManagerUpdate: runtimeChan, }, + componentPIDTicker: time.NewTicker(time.Second * 30), } // Create a healthy component with healthy input and output units @@ -374,8 +379,9 @@ func TestCoordinatorReportsInvalidPolicy(t *testing.T) { runtimeMgr: &fakeRuntimeManager{}, // Set valid but empty initial values for ast and vars - vars: emptyVars(t), - ast: emptyAST(t), + vars: emptyVars(t), + ast: emptyAST(t), + componentPIDTicker: time.NewTicker(time.Second * 30), } // Send an invalid config update and confirm that Coordinator reports @@ -388,7 +394,6 @@ agent.download.sourceURI: cfgChange := &configChange{cfg: cfg} configChan <- cfgChange coord.runLoopIteration(ctx) - assert.True(t, cfgChange.failed, "Policy with invalid field should have reported failed config change") require.ErrorContainsf(t, cfgChange.err, @@ -419,6 +424,7 @@ agent.download.sourceURI: // (This check is based on a previous bug in which a vars update could // discard active policy errors.) varsChan <- emptyVars(t) + t.Logf("after emptyVars statement") coord.runLoopIteration(ctx) assert.Error(t, coord.configErr, "Vars update shouldn't affect configErr") @@ -488,8 +494,9 @@ func TestCoordinatorReportsComponentModelError(t *testing.T) { runtimeMgr: &fakeRuntimeManager{}, // Set valid but empty initial values for ast and vars - vars: emptyVars(t), - ast: emptyAST(t), + vars: emptyVars(t), + ast: emptyAST(t), + componentPIDTicker: time.NewTicker(time.Second * 30), } // This configuration produces a valid AST but its EQL condition is @@ -570,7 +577,7 @@ func TestCoordinatorPolicyChangeUpdatesMonitorReloader(t *testing.T) { } monitoringServer := &fakeMonitoringServer{} - newServerFn := func() (reload.ServerController, error) { + newServerFn := func(*monitoringCfg.MonitoringConfig) (reload.ServerController, error) { return monitoringServer, nil } monitoringReloader := reload.NewServerReloader(newServerFn, logger, monitoringCfg.DefaultConfig()) @@ -582,8 +589,9 @@ func TestCoordinatorPolicyChangeUpdatesMonitorReloader(t *testing.T) { managerChans: managerChans{ configManagerUpdate: configChan, }, - runtimeMgr: runtimeManager, - vars: emptyVars(t), + runtimeMgr: runtimeManager, + vars: emptyVars(t), + componentPIDTicker: time.NewTicker(time.Second * 30), } coord.RegisterMonitoringServer(monitoringReloader) @@ -710,8 +718,9 @@ func TestCoordinatorPolicyChangeUpdatesRuntimeManager(t *testing.T) { managerChans: managerChans{ configManagerUpdate: configChan, }, - runtimeMgr: runtimeManager, - vars: emptyVars(t), + runtimeMgr: runtimeManager, + vars: emptyVars(t), + componentPIDTicker: time.NewTicker(time.Second * 30), } // Create a policy with one input and one output @@ -797,8 +806,9 @@ func TestCoordinatorReportsRuntimeManagerUpdateFailure(t *testing.T) { // manager, so it receives the update result. runtimeManagerError: updateErrChan, }, - runtimeMgr: runtimeManager, - vars: emptyVars(t), + runtimeMgr: runtimeManager, + vars: emptyVars(t), + componentPIDTicker: time.NewTicker(time.Second * 30), } // Send an empty policy which should forward an empty component model to @@ -859,8 +869,9 @@ func TestCoordinatorAppliesVarsToPolicy(t *testing.T) { configManagerUpdate: configChan, varsManagerUpdate: varsChan, }, - runtimeMgr: runtimeManager, - vars: emptyVars(t), + runtimeMgr: runtimeManager, + vars: emptyVars(t), + componentPIDTicker: time.NewTicker(time.Second * 30), } // Create a policy with one input and one output @@ -935,7 +946,8 @@ func TestCoordinatorReportsOverrideState(t *testing.T) { stateBroadcaster: &broadcaster.Broadcaster[State]{ InputChan: stateChan, }, - overrideStateChan: overrideStateChan, + overrideStateChan: overrideStateChan, + componentPIDTicker: time.NewTicker(time.Second * 30), } // Send an error via the vars manager channel, and let Coordinator update overrideStateChan <- &coordinatorOverrideState{ @@ -1054,3 +1066,7 @@ func (fs *fakeMonitoringServer) Reset() { fs.stopTriggered = false fs.startTriggered = false } + +func (fs *fakeMonitoringServer) Addr() net.Addr { + return nil +} diff --git a/internal/pkg/agent/application/coordinator/diagnostics_test.go b/internal/pkg/agent/application/coordinator/diagnostics_test.go index 1e23a7e8e40..3dc45615bfa 100644 --- a/internal/pkg/agent/application/coordinator/diagnostics_test.go +++ b/internal/pkg/agent/application/coordinator/diagnostics_test.go @@ -33,6 +33,7 @@ import ( func TestCoordinatorExpectedDiagnosticHooks(t *testing.T) { expected := []string{ + "agent-info", "local-config", "pre-config", "variables", @@ -96,6 +97,7 @@ agent: http: null logs: false metrics: false + metrics_period: "" namespace: "" pprof: null traces: true @@ -128,6 +130,39 @@ fleet: assert.YAMLEq(t, expectedCfg, string(result), "local-config diagnostic returned unexpected value") } +func TestDiagnosticAgentInfo(t *testing.T) { + // Create a coordinator with an info.Agent and ensure its included in diagnostics. + + coord := &Coordinator{agentInfo: fakeAgentInfo{ + agentID: "agent-id", + headers: map[string]string{ + "header1": "value1", + "header2": "value2", + }, + logLevel: "trace", + snapshot: true, + version: "8.14.0", + unprivileged: true, + }} + + expected := ` +agent_id: agent-id +headers: + header1: value1 + header2: value2 +log_level: trace +snapshot: true +version: 8.14.0 +unprivileged: true +` + + hook, ok := diagnosticHooksMap(coord)["agent-info"] + require.True(t, ok, "diagnostic hooks should have an entry for agent-info") + + result := hook.Hook(context.Background()) + assert.YAMLEq(t, expected, string(result), "agent-info diagnostic returned unexpected value") +} + func TestDiagnosticPreConfig(t *testing.T) { // Create a coordinator with a test AST and make sure it's returned // by the pre-config diagnostic. @@ -454,6 +489,7 @@ log_level: "warning" components: - id: "comp-1" state: + pid: 0 state: 3 message: "degraded message" features_idx: 0 @@ -536,6 +572,7 @@ log_level: "warning" components: - id: "comp-1" state: + pid: 0 state: 3 message: "degraded message" features_idx: 0 @@ -589,3 +626,48 @@ func mapFromRawYAML(t *testing.T, str string) map[string]interface{} { require.NoError(t, err, "Parsing of YAML test string must succeed") return result } + +type fakeAgentInfo struct { + agentID string + headers map[string]string + logLevel string + snapshot bool + version string + unprivileged bool + isStandalone bool +} + +func (a fakeAgentInfo) AgentID() string { + return a.agentID +} + +func (a fakeAgentInfo) Headers() map[string]string { + return a.headers +} + +func (a fakeAgentInfo) LogLevel() string { + return a.logLevel +} + +func (a fakeAgentInfo) RawLogLevel() string { + return a.logLevel +} + +func (a fakeAgentInfo) Snapshot() bool { + return a.snapshot +} + +func (a fakeAgentInfo) Version() string { + return a.version +} + +func (a fakeAgentInfo) Unprivileged() bool { + return a.unprivileged +} + +func (a fakeAgentInfo) IsStandalone() bool { + return a.isStandalone +} + +func (a fakeAgentInfo) ReloadID(ctx context.Context) error { panic("implement me") } +func (a fakeAgentInfo) SetLogLevel(ctx context.Context, level string) error { panic("implement me") } diff --git a/internal/pkg/agent/application/dispatcher/dispatcher.go b/internal/pkg/agent/application/dispatcher/dispatcher.go index aef7bff5cdb..d3d19dc0a50 100644 --- a/internal/pkg/agent/application/dispatcher/dispatcher.go +++ b/internal/pkg/agent/application/dispatcher/dispatcher.go @@ -44,12 +44,13 @@ type ActionDispatcher struct { queue priorityQueue rt *retryConfig errCh chan error + topPath string lastUpgradeDetails *details.Details } // New creates a new action dispatcher. -func New(log *logger.Logger, def actions.Handler, queue priorityQueue) (*ActionDispatcher, error) { +func New(log *logger.Logger, topPath string, def actions.Handler, queue priorityQueue) (*ActionDispatcher, error) { var err error if log == nil { log, err = logger.New("action_dispatcher", false) @@ -69,6 +70,7 @@ func New(log *logger.Logger, def actions.Handler, queue priorityQueue) (*ActionD queue: queue, rt: defaultRetryConfig(), errCh: make(chan error), + topPath: topPath, }, nil } @@ -156,7 +158,7 @@ func (ad *ActionDispatcher) Dispatch(ctx context.Context, detailsSetter details. ad.scheduleRetry(ctx, rAction, acker) continue } - ad.log.Debugf("Failed to dispatch action '%+v', error: %+v", action, err) + ad.log.Errorf("Failed to dispatch action id %q of type %q, error: %+v", action.ID(), action.Type(), err) reportedErr = err continue } diff --git a/internal/pkg/agent/application/dispatcher/dispatcher_test.go b/internal/pkg/agent/application/dispatcher/dispatcher_test.go index 1e63e73e6e9..614dd536363 100644 --- a/internal/pkg/agent/application/dispatcher/dispatcher_test.go +++ b/internal/pkg/agent/application/dispatcher/dispatcher_test.go @@ -121,7 +121,7 @@ func TestActionDispatcher(t *testing.T) { queue := &mockQueue{} queue.On("Save").Return(nil).Once() queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{}).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) success1 := &mockHandler{} @@ -163,7 +163,7 @@ func TestActionDispatcher(t *testing.T) { queue := &mockQueue{} queue.On("Save").Return(nil).Once() queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{}).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) action := &mockOtherAction{} @@ -187,7 +187,7 @@ func TestActionDispatcher(t *testing.T) { def := &mockHandler{} queue := &mockQueue{} - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) err = d.Register(&mockAction{}, success1) @@ -207,7 +207,7 @@ func TestActionDispatcher(t *testing.T) { queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{}).Once() queue.On("Add", mock.Anything, mock.Anything).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) err = d.Register(&mockAction{}, def) require.NoError(t, err) @@ -242,7 +242,7 @@ func TestActionDispatcher(t *testing.T) { queue.On("Save").Return(nil).Once() queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{}).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) err = d.Register(&mockAction{}, def) require.NoError(t, err) @@ -282,7 +282,7 @@ func TestActionDispatcher(t *testing.T) { queue.On("Save").Return(nil).Once() queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{action1}).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) err = d.Register(&mockAction{}, def) require.NoError(t, err) @@ -309,7 +309,7 @@ func TestActionDispatcher(t *testing.T) { queue.On("Save").Return(nil).Once() queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{}).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) err = d.Register(&mockAction{}, def) require.NoError(t, err) @@ -335,7 +335,7 @@ func TestActionDispatcher(t *testing.T) { queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{}).Once() queue.On("Add", mock.Anything, mock.Anything).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) err = d.Register(&mockRetryableAction{}, def) require.NoError(t, err) @@ -369,7 +369,7 @@ func TestActionDispatcher(t *testing.T) { queue.On("Save").Return(nil).Once() queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{}).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) err = d.Register(&mockAction{}, def) require.NoError(t, err) @@ -412,7 +412,7 @@ func TestActionDispatcher(t *testing.T) { queue.On("Save").Return(nil).Times(2) queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{}).Times(2) - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) err = d.Register(&mockAction{}, def) require.NoError(t, err) @@ -464,7 +464,7 @@ func TestActionDispatcher(t *testing.T) { queue.On("DequeueActions").Return([]fleetapi.ScheduledAction{}).Once() queue.On("CancelType", mock.Anything).Return(1).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) var gotDetails *details.Details @@ -514,7 +514,7 @@ func TestActionDispatcher(t *testing.T) { Once() queue.On("CancelType", mock.Anything).Return(1).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) var gotDetails *details.Details @@ -556,7 +556,7 @@ func TestActionDispatcher(t *testing.T) { Once() queue.On("CancelType", mock.Anything).Return(1).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) wantDetail := &details.Details{ @@ -598,7 +598,7 @@ func TestActionDispatcher(t *testing.T) { Once() queue.On("CancelType", mock.Anything).Return(1).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) var gotDetails *details.Details @@ -628,7 +628,7 @@ func Test_ActionDispatcher_scheduleRetry(t *testing.T) { t.Run("no more attmpts", func(t *testing.T) { queue := &mockQueue{} - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) action := &mockRetryableAction{} @@ -645,7 +645,7 @@ func Test_ActionDispatcher_scheduleRetry(t *testing.T) { queue := &mockQueue{} queue.On("Save").Return(nil).Once() queue.On("Add", mock.Anything, mock.Anything).Once() - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err) action := &mockRetryableAction{} @@ -734,7 +734,7 @@ func TestReportNextScheduledUpgrade(t *testing.T) { def := &mockHandler{} queue := &mockQueue{} - d, err := New(nil, def, queue) + d, err := New(nil, t.TempDir(), def, queue) require.NoError(t, err, "could not create dispatcher") for name, test := range cases { diff --git a/internal/pkg/agent/application/fleet_server_bootstrap.go b/internal/pkg/agent/application/fleet_server_bootstrap.go index 51ac633e972..3483afa789d 100644 --- a/internal/pkg/agent/application/fleet_server_bootstrap.go +++ b/internal/pkg/agent/application/fleet_server_bootstrap.go @@ -65,10 +65,13 @@ func FleetServerComponentModifier(serverCfg *configuration.FleetServerConfig) co } else { for j, unit := range comp.Units { if unit.Type == client.UnitTypeOutput && unit.Config.Type == elasticsearch { - unitCfgMap, err := toMapStr(unit.Config.Source.AsMap(), &serverCfg.Output.Elasticsearch) + unitCfgMap, err := toMapStr(unit.Config.Source.AsMap()) if err != nil { return nil, err } + if err := addBootstrapCfg(unitCfgMap, &serverCfg.Output.Elasticsearch); err != nil { + return nil, err + } fixOutputMap(unitCfgMap) unitCfg, err := component.ExpectedConfig(unitCfgMap) if err != nil { @@ -100,6 +103,19 @@ func FleetServerComponentModifier(serverCfg *configuration.FleetServerConfig) co } } +// addBootrapCfg will transform the passed configuration.Elasticsearch to a map and add it to dst under the bootstrap key. +func addBootstrapCfg(dst map[string]interface{}, es *configuration.Elasticsearch) error { + if es == nil { + return fmt.Errorf("fleet-server bootstrap output config is undefined") + } + mp, err := toMapStr(es) + if err != nil { + return err + } + dst["bootstrap"] = mp + return nil +} + // InjectFleetConfigComponentModifier The modifier that injects the fleet configuration for the components // that need to be able to connect to fleet server. func InjectFleetConfigComponentModifier(fleetCfg *configuration.FleetAgentConfig, agentInfo info.Agent) coordinator.ComponentsModifier { diff --git a/internal/pkg/agent/application/fleet_server_bootstrap_test.go b/internal/pkg/agent/application/fleet_server_bootstrap_test.go index 1870b3dada7..c0b23a13830 100644 --- a/internal/pkg/agent/application/fleet_server_bootstrap_test.go +++ b/internal/pkg/agent/application/fleet_server_bootstrap_test.go @@ -74,6 +74,87 @@ func TestFleetServerComponentModifier_NoServerConfig(t *testing.T) { } } +func TestFleetServerComponentModifier(t *testing.T) { + tests := []struct { + name string + source map[string]interface{} + expect map[string]interface{} + }{{ + name: "empty output component", + source: map[string]interface{}{}, + expect: map[string]interface{}{ + "bootstrap": map[string]interface{}{ + "protocol": "https", + "hosts": []interface{}{"elasticsearch:9200"}, + "service_token": "example-token", + }, + }, + }, { + name: "output component provided", + source: map[string]interface{}{ + "protocol": "http", + "hosts": []interface{}{"elasticsearch:9200", "host:9200"}, + }, + expect: map[string]interface{}{ + "protocol": "http", + "hosts": []interface{}{"elasticsearch:9200", "host:9200"}, + "bootstrap": map[string]interface{}{ + "protocol": "https", + "hosts": []interface{}{"elasticsearch:9200"}, + "service_token": "example-token", + }, + }, + }} + cfg := &configuration.FleetServerConfig{ + Output: configuration.FleetServerOutputConfig{ + Elasticsearch: configuration.Elasticsearch{ + Protocol: "https", + Hosts: []string{"elasticsearch:9200"}, + ServiceToken: "example-token", + }, + }, + } + modifier := FleetServerComponentModifier(cfg) + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + src, err := structpb.NewStruct(tc.source) + require.NoError(t, err) + comps, err := modifier([]component.Component{{ + InputSpec: &component.InputRuntimeSpec{ + InputType: "fleet-server", + }, + Units: []component.Unit{{ + Type: client.UnitTypeOutput, + Config: &proto.UnitExpectedConfig{ + Type: "elasticsearch", + Source: src, + }, + }}, + }}, nil) + require.NoError(t, err) + + require.Len(t, comps, 1) + require.Len(t, comps[0].Units, 1) + res := comps[0].Units[0].Config.Source.AsMap() + for k, v := range tc.expect { + val, ok := res[k] + require.Truef(t, ok, "expected %q to be in output unit config", k) + if mp, ok := v.(map[string]interface{}); ok { + rMap, ok := val.(map[string]interface{}) + require.Truef(t, ok, "expected %q to be map[string]interface{} was %T", k, val) + for kk, vv := range mp { + assert.Contains(t, rMap, kk) + assert.Equal(t, rMap[kk], vv) + } + } else { + assert.Equal(t, v, val) + } + } + }) + } +} + func TestInjectFleetConfigComponentModifier(t *testing.T) { fleetConfig := &configuration.FleetAgentConfig{ Enabled: true, diff --git a/internal/pkg/agent/application/gateway/fleet/fleet_gateway.go b/internal/pkg/agent/application/gateway/fleet/fleet_gateway.go index 109ece58be9..536ec33b61b 100644 --- a/internal/pkg/agent/application/gateway/fleet/fleet_gateway.go +++ b/internal/pkg/agent/application/gateway/fleet/fleet_gateway.go @@ -329,6 +329,10 @@ func (f *FleetGateway) execute(ctx context.Context) (*fleetapi.CheckinResponse, // convert components into checkin components structure components := f.convertToCheckinComponents(state.Components) + f.log.Debugf("correcting agent loglevel from %s to %s using coordinator state", ecsMeta.Elastic.Agent.LogLevel, state.LogLevel.String()) + // Fix loglevel with the current log level used by coordinator + ecsMeta.Elastic.Agent.LogLevel = state.LogLevel.String() + // checkin cmd := fleetapi.NewCheckinCmd(f.agentInfo, f.client) req := &fleetapi.CheckinRequest{ diff --git a/internal/pkg/agent/application/info/agent_id.go b/internal/pkg/agent/application/info/agent_id.go index 81c6e981c91..48b7c30c4d4 100644 --- a/internal/pkg/agent/application/info/agent_id.go +++ b/internal/pkg/agent/application/info/agent_id.go @@ -42,7 +42,7 @@ type ioStore interface { // updateLogLevel updates log level and persists it to disk. func updateLogLevel(ctx context.Context, level string) error { - ai, err := loadAgentInfoWithBackoff(ctx, false, defaultLogLevel, false) + ai, _, err := loadAgentInfoWithBackoff(ctx, false, defaultLogLevel, false) if err != nil { return err } @@ -71,17 +71,19 @@ func generateAgentID() (string, error) { return uid.String(), nil } -func getInfoFromStore(s ioStore, logLevel string) (*persistentAgentInfo, error) { +// getInfoFromStore uses the IO store to return the config from agent.* fields in the config, +// as well as a bool indicating if agent is running in standalone mode. +func getInfoFromStore(s ioStore, logLevel string) (*persistentAgentInfo, bool, error) { agentConfigFile := paths.AgentConfigFile() reader, err := s.Load() if err != nil { - return nil, fmt.Errorf("failed to load from ioStore: %w", err) + return nil, false, fmt.Errorf("failed to load from ioStore: %w", err) } // reader is closed by this function cfg, err := config.NewConfigFrom(reader) if err != nil { - return nil, errors.New(err, + return nil, false, errors.New(err, fmt.Sprintf("fail to read configuration %s for the agent", agentConfigFile), errors.TypeFilesystem, errors.M(errors.MetaKeyPath, agentConfigFile)) @@ -89,22 +91,34 @@ func getInfoFromStore(s ioStore, logLevel string) (*persistentAgentInfo, error) configMap, err := cfg.ToMapStr() if err != nil { - return nil, errors.New(err, + return nil, false, errors.New(err, "failed to unpack stored config to map", errors.TypeFilesystem) } + // check fleet config. This behavior emulates configuration.IsStandalone + fleetmode, fleetExists := configMap["fleet"] + isStandalone := true + if fleetExists { + fleetCfg, ok := fleetmode.(map[string]interface{}) + if ok { + if fleetCfg["enabled"] == true { + isStandalone = false + } + } + } + agentInfoSubMap, found := configMap[agentInfoKey] if !found { return &persistentAgentInfo{ LogLevel: logLevel, MonitoringHTTP: monitoringConfig.DefaultConfig().HTTP, - }, nil + }, isStandalone, nil } cc, err := config.NewConfigFrom(agentInfoSubMap) if err != nil { - return nil, errors.New(err, "failed to create config from agent info submap") + return nil, false, errors.New(err, "failed to create config from agent info submap") } pid := &persistentAgentInfo{ @@ -112,10 +126,10 @@ func getInfoFromStore(s ioStore, logLevel string) (*persistentAgentInfo, error) MonitoringHTTP: monitoringConfig.DefaultConfig().HTTP, } if err := cc.Unpack(&pid); err != nil { - return nil, errors.New(err, "failed to unpack stored config to map") + return nil, false, errors.New(err, "failed to unpack stored config to map") } - return pid, nil + return pid, isStandalone, nil } func updateAgentInfo(s ioStore, agentInfo *persistentAgentInfo) error { @@ -177,29 +191,30 @@ func yamlToReader(in interface{}) (io.Reader, error) { return bytes.NewReader(data), nil } -func loadAgentInfoWithBackoff(ctx context.Context, forceUpdate bool, logLevel string, createAgentID bool) (*persistentAgentInfo, error) { +func loadAgentInfoWithBackoff(ctx context.Context, forceUpdate bool, logLevel string, createAgentID bool) (*persistentAgentInfo, bool, error) { var err error var ai *persistentAgentInfo + var isStandalone bool signal := make(chan struct{}) backExp := backoff.NewExpBackoff(signal, 100*time.Millisecond, 3*time.Second) for i := 0; i <= maxRetriesloadAgentInfo; i++ { backExp.Wait() - ai, err = loadAgentInfo(ctx, forceUpdate, logLevel, createAgentID) + ai, isStandalone, err = loadAgentInfo(ctx, forceUpdate, logLevel, createAgentID) if !errors.Is(err, filelock.ErrAppAlreadyRunning) { break } } close(signal) - return ai, err + return ai, isStandalone, err } -func loadAgentInfo(ctx context.Context, forceUpdate bool, logLevel string, createAgentID bool) (*persistentAgentInfo, error) { +func loadAgentInfo(ctx context.Context, forceUpdate bool, logLevel string, createAgentID bool) (*persistentAgentInfo, bool, error) { idLock := paths.AgentConfigFileLock() if err := idLock.TryLock(); err != nil { - return nil, err + return nil, false, err } //nolint:errcheck // keeping the same behavior, and making linter happy defer idLock.Unlock() @@ -207,23 +222,23 @@ func loadAgentInfo(ctx context.Context, forceUpdate bool, logLevel string, creat agentConfigFile := paths.AgentConfigFile() diskStore, err := storage.NewEncryptedDiskStore(ctx, agentConfigFile) if err != nil { - return nil, fmt.Errorf("error instantiating encrypted disk store: %w", err) + return nil, false, fmt.Errorf("error instantiating encrypted disk store: %w", err) } - agentInfo, err := getInfoFromStore(diskStore, logLevel) + agentInfo, isStandalone, err := getInfoFromStore(diskStore, logLevel) if err != nil { - return nil, fmt.Errorf("could not get agent info from store: %w", err) + return nil, false, fmt.Errorf("could not get agent info from store: %w", err) } if agentInfo != nil && !forceUpdate && (agentInfo.ID != "" || !createAgentID) { - return agentInfo, nil + return agentInfo, isStandalone, nil } if err := updateID(agentInfo, diskStore); err != nil { - return nil, fmt.Errorf("could not update agent ID on disk store: %w", err) + return nil, false, fmt.Errorf("could not update agent ID on disk store: %w", err) } - return agentInfo, nil + return agentInfo, isStandalone, nil } func updateID(agentInfo *persistentAgentInfo, s ioStore) error { diff --git a/internal/pkg/agent/application/info/agent_id_test.go b/internal/pkg/agent/application/info/agent_id_test.go new file mode 100644 index 00000000000..d691049f4d9 --- /dev/null +++ b/internal/pkg/agent/application/info/agent_id_test.go @@ -0,0 +1,91 @@ +// 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 info + +import ( + "bytes" + "context" + "path/filepath" + "runtime" + "testing" + "time" + + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v3" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/secret" + "github.com/elastic/elastic-agent/internal/pkg/agent/storage" + "github.com/elastic/elastic-agent/internal/pkg/agent/vault" +) + +func TestAgentIDStandaloneWorks(t *testing.T) { + if runtime.GOOS == "darwin" { + // vault requres extra perms on mac + t.Skip() + } + // create a new encrypted disk store + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + tmpPath := t.TempDir() + paths.SetConfig(tmpPath) + + vaultPath := filepath.Join(tmpPath, "vault") + err := secret.CreateAgentSecret(ctx, vault.WithVaultPath(vaultPath)) + require.NoError(t, err) + + setID := "test-id" + testCfg := map[string]interface{}{ + "agent": map[string]interface{}{ + "id": setID, + }, + } + saveToStateStore(t, tmpPath, testCfg) + + got, err := NewAgentInfo(ctx, false) + require.NoError(t, err) + t.Logf("got: %#v", got) + + // check the ID to make sure we've opened the fleet config properly + require.Equal(t, setID, got.agentID) + + // no fleet config, should be standalone + require.True(t, got.isStandalone) + + // update fleet config, this time in managed mode + testCfg = map[string]interface{}{ + "agent": map[string]interface{}{ + "id": setID, + }, + "fleet": map[string]interface{}{ + "enabled": true, + }, + } + saveToStateStore(t, tmpPath, testCfg) + + got, err = NewAgentInfo(ctx, false) + require.NoError(t, err) + t.Logf("got: %#v", got) + require.False(t, got.isStandalone) + +} + +func saveToStateStore(t *testing.T, tmpPath string, in map[string]interface{}) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + encPath := filepath.Join(tmpPath, "fleet.enc") + store, err := storage.NewEncryptedDiskStore(ctx, encPath) + require.NoError(t, err) + + rawYml, err := yaml.Marshal(in) + require.NoError(t, err) + + reader := bytes.NewReader(rawYml) + + err = store.Save(reader) + require.NoError(t, err) +} diff --git a/internal/pkg/agent/application/info/agent_info.go b/internal/pkg/agent/application/info/agent_info.go index 5e6b07f0ef8..5f907878937 100644 --- a/internal/pkg/agent/application/info/agent_info.go +++ b/internal/pkg/agent/application/info/agent_info.go @@ -6,9 +6,11 @@ package info import ( "context" + "fmt" "github.com/elastic/elastic-agent/internal/pkg/release" "github.com/elastic/elastic-agent/pkg/core/logger" + "github.com/elastic/elastic-agent/pkg/utils" ) type Agent interface { @@ -18,9 +20,12 @@ type Agent interface { // Headers returns custom headers used to communicate with elasticsearch. Headers() map[string]string - // LogLevel retrieves a log level. + // LogLevel retrieves a log level, returning a default if none is set LogLevel() string + // RawLogLevel returns the set log level, no defaults + RawLogLevel() string + // ReloadID reloads agent info ID from configuration file. ReloadID(ctx context.Context) error @@ -32,12 +37,20 @@ type Agent interface { // Version returns the version for this Agent. Version() string + + // Unprivileged returns true when this Agent is running unprivileged. + Unprivileged() bool + + // IsStandalone returns true is the agent is running in standalone mode, i.e, without fleet + IsStandalone() bool } // AgentInfo is a collection of information about agent. type AgentInfo struct { - agentID string - logLevel string + agentID string + logLevel string + unprivileged bool + isStandalone bool // esHeaders will be injected into the headers field of any elasticsearch // output created by this agent (see component.toIntermediate). @@ -51,15 +64,21 @@ type AgentInfo struct { // If agent config file does not exist it gets created. // Initiates log level to predefined value. func NewAgentInfoWithLog(ctx context.Context, level string, createAgentID bool) (*AgentInfo, error) { - agentInfo, err := loadAgentInfoWithBackoff(ctx, false, level, createAgentID) + agentInfo, isStandalone, err := loadAgentInfoWithBackoff(ctx, false, level, createAgentID) if err != nil { return nil, err } + isRoot, err := utils.HasRoot() + if err != nil { + return nil, fmt.Errorf("failed to determine root/Administrator: %w", err) + } return &AgentInfo{ - agentID: agentInfo.ID, - logLevel: agentInfo.LogLevel, - esHeaders: agentInfo.Headers, + agentID: agentInfo.ID, + logLevel: agentInfo.LogLevel, + unprivileged: !isRoot, + esHeaders: agentInfo.Headers, + isStandalone: isStandalone, }, nil } @@ -74,9 +93,15 @@ func NewAgentInfo(ctx context.Context, createAgentID bool) (*AgentInfo, error) { // LogLevel retrieves a log level. func (i *AgentInfo) LogLevel() string { - if i.logLevel == "" { + rawLogLevel := i.RawLogLevel() + if rawLogLevel == "" { return logger.DefaultLogLevel.String() } + return rawLogLevel +} + +// RawLogLevel retrieves a log level. +func (i *AgentInfo) RawLogLevel() string { return i.logLevel } @@ -119,3 +144,12 @@ func (*AgentInfo) Snapshot() bool { func (i *AgentInfo) Headers() map[string]string { return i.esHeaders } + +// Unprivileged returns true when this Agent is running unprivileged. +func (i *AgentInfo) Unprivileged() bool { + return i.unprivileged +} + +func (i *AgentInfo) IsStandalone() bool { + return i.isStandalone +} diff --git a/internal/pkg/agent/application/info/agent_metadata.go b/internal/pkg/agent/application/info/agent_metadata.go index 35ec9897e96..3a26944c446 100644 --- a/internal/pkg/agent/application/info/agent_metadata.go +++ b/internal/pkg/agent/application/info/agent_metadata.go @@ -52,6 +52,8 @@ type AgentECSMeta struct { LogLevel string `json:"log_level"` // Complete is a flag specifying that the agent used is a complete image. Complete bool `json:"complete"` + // Unprivileged is a flag specifying that the agent is running in unprivileged mode. + Unprivileged bool `json:"unprivileged"` } // SystemECSMeta is a collection of operating system metadata in ECS compliant object form. @@ -163,8 +165,9 @@ func (i *AgentInfo) ECSMetadata(l *logger.Logger) (*ECSMeta, error) { BuildOriginal: release.Info().String(), // only upgradeable if running from Agent installer and running under the // control of the system supervisor (or built specifically with upgrading enabled) - Upgradeable: release.Upgradeable() || (paths.RunningInstalled() && RunningUnderSupervisor()), - LogLevel: i.LogLevel(), + Upgradeable: release.Upgradeable() || (paths.RunningInstalled() && RunningUnderSupervisor()), + LogLevel: i.LogLevel(), + Unprivileged: i.unprivileged, }, }, Host: &HostECSMeta{ diff --git a/internal/pkg/agent/application/info/agent_metadata_test.go b/internal/pkg/agent/application/info/agent_metadata_test.go new file mode 100644 index 00000000000..11e182f1b82 --- /dev/null +++ b/internal/pkg/agent/application/info/agent_metadata_test.go @@ -0,0 +1,64 @@ +// 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 info + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/elastic/go-sysinfo" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/internal/pkg/release" + "github.com/elastic/elastic-agent/internal/pkg/testutils" + "github.com/elastic/elastic-agent/internal/pkg/util" + "github.com/elastic/elastic-agent/pkg/features" +) + +func TestECSMetadata(t *testing.T) { + agentInfo := new(AgentInfo) + agentInfo.agentID = "fake-agent-id" + agentInfo.logLevel = "trace" + agentInfo.unprivileged = true + + l := testutils.NewErrorLogger(t) + metadata, err := agentInfo.ECSMetadata(l) + require.NoError(t, err) + + if assert.NotNil(t, metadata.Elastic, "metadata.Elastic must not be nil") { + assert.NotNil(t, metadata.Elastic.Agent, "metadata.Elastic.Agent must not be nil") + } + + sysInfo, err := sysinfo.Host() + require.NoError(t, err) + + info := sysInfo.Info() + hostname := util.GetHostName(features.FQDN(), info, sysInfo, l) + + assert.Equal(t, agentInfo.agentID, metadata.Elastic.Agent.ID) + assert.Equal(t, release.Version(), metadata.Elastic.Agent.Version) + assert.Equal(t, release.Snapshot(), metadata.Elastic.Agent.Snapshot) + assert.Equal(t, release.Complete(), metadata.Elastic.Agent.Complete) + assert.Equal(t, release.Info().String(), metadata.Elastic.Agent.BuildOriginal) + assert.Equal(t, release.Upgradeable() || (paths.RunningInstalled() && RunningUnderSupervisor()), metadata.Elastic.Agent.Upgradeable) + assert.Equal(t, agentInfo.logLevel, metadata.Elastic.Agent.LogLevel) + assert.Equal(t, agentInfo.unprivileged, metadata.Elastic.Agent.Unprivileged) + + assert.Equal(t, info.Architecture, metadata.Host.Arch) + assert.Equal(t, hostname, metadata.Host.Hostname) + assert.Equal(t, hostname, metadata.Host.Name) + assert.Equal(t, info.UniqueID, metadata.Host.ID) + assert.Equal(t, info.IPs, metadata.Host.IP) + assert.Equal(t, info.MACs, metadata.Host.MAC) + + assert.Equal(t, info.OS.Family, metadata.OS.Family) + assert.Equal(t, info.KernelVersion, metadata.OS.Kernel) + assert.Equal(t, info.OS.Platform, metadata.OS.Platform) + assert.Equal(t, info.OS.Version, metadata.OS.Version) + assert.Equal(t, info.OS.Name, metadata.OS.Name) + assert.Equal(t, getFullOSName(info), metadata.OS.FullName) +} diff --git a/internal/pkg/agent/application/info/svc_windows.go b/internal/pkg/agent/application/info/svc_windows.go index 91c26656581..ba35f2d14d6 100644 --- a/internal/pkg/agent/application/info/svc_windows.go +++ b/internal/pkg/agent/application/info/svc_windows.go @@ -7,44 +7,78 @@ package info import ( - "golang.org/x/sys/windows" -) + "fmt" -const ( - ML_SYSTEM_RID = 0x4000 + "golang.org/x/sys/windows" ) // RunningUnderSupervisor returns true when executing Agent is running under // the supervisor processes of the OS. +// +// Checks in the following order: +// 1. Has SECURITY_LOCAL_SYSTEM_RID (aka. running as LOCAL SYSTEM) +// 2. Has SECURITY_SERVICE_RID (aka. running as service as non LOCAL SYSTEM user) func RunningUnderSupervisor() bool { - serviceSid, err := allocSid(ML_SYSTEM_RID) + localSystem, _ := hasLocalSystemSID() + if localSystem { + return true + } + isService, _ := hasServiceSID() + return isService +} + +func hasLocalSystemSID() (bool, error) { + // local system RID is given to processes that are running as a service + // with local system rights. + sid, err := allocSid(windows.SECURITY_LOCAL_SYSTEM_RID) if err != nil { - return false + return false, fmt.Errorf("allocate sid error: %w", err) } - defer windows.FreeSid(serviceSid) + defer func() { + _ = windows.FreeSid(sid) + }() - t, err := windows.OpenCurrentProcessToken() + // Internally uses CheckTokenMembership where `windows.Token(0)` represents a NULL + // token which uses the current process token. + // https://learn.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-checktokenmembership + token := windows.Token(0) + member, err := token.IsMember(sid) if err != nil { - return false + return false, fmt.Errorf("token membership error: %w", err) } - defer t.Close() - gs, err := t.GetTokenGroups() + return member, nil +} + +func hasServiceSID() (bool, error) { + // service RID is given to processes that are running as a service + // but do not have local system rights. + sid, err := allocSid(windows.SECURITY_SERVICE_RID) if err != nil { - return false + return false, fmt.Errorf("allocate sid error: %w", err) } + defer func() { + _ = windows.FreeSid(sid) + }() - for _, g := range gs.AllGroups() { - if windows.EqualSid(g.Sid, serviceSid) { - return true - } + // Internally uses CheckTokenMembership where `windows.Token(0)` represents a NULL + // token which uses the current process token. + // https://learn.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-checktokenmembership + token := windows.Token(0) + member, err := token.IsMember(sid) + if err != nil { + return false, fmt.Errorf("token membership error: %w", err) } - return false + + return member, nil } +// allocSID creates a SID from the provided subAuth0. +// +// allocated SID must be freed with `windows.FreeSid`. func allocSid(subAuth0 uint32) (*windows.SID, error) { var sid *windows.SID - err := windows.AllocateAndInitializeSid(&windows.SECURITY_MANDATORY_LABEL_AUTHORITY, + err := windows.AllocateAndInitializeSid(&windows.SECURITY_NT_AUTHORITY, 1, subAuth0, 0, 0, 0, 0, 0, 0, 0, &sid) if err != nil { return nil, err diff --git a/internal/pkg/agent/application/managed_mode.go b/internal/pkg/agent/application/managed_mode.go index 7f8d22a16ca..a29c89c8ee3 100644 --- a/internal/pkg/agent/application/managed_mode.go +++ b/internal/pkg/agent/application/managed_mode.go @@ -65,6 +65,7 @@ func newManagedConfigManager( storeSaver storage.Store, runtime *runtime.Manager, fleetInitTimeout time.Duration, + topPath string, clientSetters ...actions.ClientSetter, ) (*managedConfigManager, error) { client, err := fleetclient.NewAuthWithConfig(log, cfg.Fleet.AccessAPIKey, cfg.Fleet.Client) @@ -86,7 +87,7 @@ func newManagedConfigManager( return nil, fmt.Errorf("unable to initialize action queue: %w", err) } - actionDispatcher, err := dispatcher.New(log, handlers.NewDefault(log), actionQueue) + actionDispatcher, err := dispatcher.New(log, topPath, handlers.NewDefault(log), actionQueue) if err != nil { return nil, fmt.Errorf("unable to initialize action dispatcher: %w", err) } @@ -334,12 +335,19 @@ func fleetServerRunning(state runtime.ComponentState) bool { } func (m *managedConfigManager) initDispatcher(canceller context.CancelFunc) *handlers.PolicyChangeHandler { + settingsHandler := handlers.NewSettings( + m.log, + m.agentInfo, + m.coord, + ) + policyChanger := handlers.NewPolicyChangeHandler( m.log, m.agentInfo, m.cfg, m.store, m.ch, + settingsHandler, ) m.dispatcher.MustRegister( @@ -370,11 +378,7 @@ func (m *managedConfigManager) initDispatcher(canceller context.CancelFunc) *han m.dispatcher.MustRegister( &fleetapi.ActionSettings{}, - handlers.NewSettings( - m.log, - m.agentInfo, - m.coord, - ), + settingsHandler, ) m.dispatcher.MustRegister( @@ -389,6 +393,7 @@ func (m *managedConfigManager) initDispatcher(canceller context.CancelFunc) *han &fleetapi.ActionDiagnostics{}, handlers.NewDiagnostics( m.log, + paths.Top(), // TODO: stop using global state m.coord, m.cfg.Settings.MonitoringConfig.Diagnostics.Limit, uploader.New(m.agentInfo.AgentID(), m.client, m.cfg.Settings.MonitoringConfig.Diagnostics.Uploader), diff --git a/internal/pkg/agent/application/monitoring/handler.go b/internal/pkg/agent/application/monitoring/handler.go index 6bec3eb37f2..0e1db1d4367 100644 --- a/internal/pkg/agent/application/monitoring/handler.go +++ b/internal/pkg/agent/application/monitoring/handler.go @@ -8,6 +8,9 @@ import ( "encoding/json" "fmt" "net/http" + "time" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" ) const errTypeUnexpected = "UNEXPECTED" @@ -16,6 +19,13 @@ type apiError interface { Status() int } +// CoordinatorState is used by the HTTP handlers that take a coordinator object. +// This interface exists to help make testing easier. +type CoordinatorState interface { + State() coordinator.State + IsActive(timeout time.Duration) bool +} + func createHandler(fn func(w http.ResponseWriter, r *http.Request) error) *apiHandler { return &apiHandler{ innerFn: fn, @@ -30,7 +40,7 @@ type apiHandler struct { func (h *apiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { err := h.innerFn(w, r) if err != nil { - switch e := err.(type) { // nolint:errorlint // Will need refactor. + switch e := err.(type) { //nolint:errorlint // Will need refactor. case apiError: w.WriteHeader(e.Status()) default: diff --git a/internal/pkg/agent/application/monitoring/liveness.go b/internal/pkg/agent/application/monitoring/liveness.go new file mode 100644 index 00000000000..bba240447c0 --- /dev/null +++ b/internal/pkg/agent/application/monitoring/liveness.go @@ -0,0 +1,88 @@ +// 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 monitoring + +import ( + "fmt" + "net/http" + "time" + + "github.com/elastic/elastic-agent-client/v7/pkg/client" +) + +const formValueKey = "failon" + +type LivenessFailConfig struct { + Degraded bool `yaml:"degraded" config:"degraded"` + Failed bool `yaml:"failed" config:"failed"` + Heartbeat bool `yaml:"heartbeat" config:"heartbeat"` +} + +// process the form values we get via HTTP +func handleFormValues(req *http.Request) (LivenessFailConfig, error) { + err := req.ParseForm() + if err != nil { + return LivenessFailConfig{}, fmt.Errorf("Error parsing form: %w", err) + } + + defaultUserCfg := LivenessFailConfig{Degraded: false, Failed: false, Heartbeat: true} + + for formKey := range req.Form { + if formKey != formValueKey { + return defaultUserCfg, fmt.Errorf("got invalid HTTP form key: '%s'", formKey) + } + } + + userConfig := req.Form.Get(formValueKey) + switch userConfig { + case "failed": + return LivenessFailConfig{Degraded: false, Failed: true, Heartbeat: true}, nil + case "degraded": + return LivenessFailConfig{Failed: true, Degraded: true, Heartbeat: true}, nil + case "heartbeat", "": + return defaultUserCfg, nil + default: + return defaultUserCfg, fmt.Errorf("got unexpected value for `%s` attribute: %s", formValueKey, userConfig) + } +} + +func livenessHandler(coord CoordinatorState) func(http.ResponseWriter, *http.Request) error { + return func(w http.ResponseWriter, r *http.Request) error { + w.Header().Set("Content-Type", "application/json; charset=utf-8") + + state := coord.State() + isUp := coord.IsActive(time.Second * 10) + // the coordinator check is always on, so if that fails, always return false + if !isUp { + w.WriteHeader(http.StatusServiceUnavailable) + return nil + } + + failConfig, err := handleFormValues(r) + if err != nil { + return fmt.Errorf("error handling form values: %w", err) + } + + // if user has requested `coordinator` mode, just revert to that, skip everything else + if !failConfig.Degraded && !failConfig.Failed && failConfig.Heartbeat { + if !isUp { + w.WriteHeader(http.StatusServiceUnavailable) + return nil + } + } + + unhealthyComponent := false + for _, comp := range state.Components { + if (failConfig.Failed && comp.State.State == client.UnitStateFailed) || (failConfig.Degraded && comp.State.State == client.UnitStateDegraded) { + unhealthyComponent = true + } + } + // bias towards the coordinator check, since it can be otherwise harder to diagnose + if unhealthyComponent { + w.WriteHeader(http.StatusInternalServerError) + } + return nil + } +} diff --git a/internal/pkg/agent/application/monitoring/liveness_test.go b/internal/pkg/agent/application/monitoring/liveness_test.go new file mode 100644 index 00000000000..75d56f09ff0 --- /dev/null +++ b/internal/pkg/agent/application/monitoring/liveness_test.go @@ -0,0 +1,373 @@ +// 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 monitoring + +import ( + "context" + "fmt" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/elastic/elastic-agent-client/v7/pkg/client" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" + "github.com/elastic/elastic-agent/pkg/component" + "github.com/elastic/elastic-agent/pkg/component/runtime" +) + +type mockCoordinator struct { + state coordinator.State + isUp bool +} + +func (mc mockCoordinator) State() coordinator.State { + return mc.state +} + +func (mc mockCoordinator) IsActive(_ time.Duration) bool { + return mc.isUp +} + +func TestProcessHTTPHandler(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + defer cancel() + testCases := []struct { + name string + coord mockCoordinator + expectedCode int + liveness bool + failon string + }{ + { + name: "default-failed", + coord: mockCoordinator{ + isUp: true, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "2", + State: runtime.ComponentState{State: client.UnitStateFailed}, + Component: component.Component{ + ID: "test-component", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 200, + liveness: true, + failon: "heartbeat", + }, + { + name: "default-healthy", + coord: mockCoordinator{ + isUp: true, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "2", + State: runtime.ComponentState{State: client.UnitStateHealthy}, + Component: component.Component{ + ID: "test-component", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 200, + liveness: true, + failon: "heartbeat", + }, + { + name: "degraded", + coord: mockCoordinator{ + isUp: true, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "2", + State: runtime.ComponentState{State: client.UnitStateDegraded}, + Component: component.Component{ + ID: "test-component", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 500, + liveness: true, + failon: "degraded", + }, + { + name: "degraded-check-off", + coord: mockCoordinator{ + isUp: true, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "2", + State: runtime.ComponentState{State: client.UnitStateDegraded}, + Component: component.Component{ + ID: "test-component", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 200, + liveness: true, + failon: "failed", + }, + { + name: "degraded-liveness-off", + coord: mockCoordinator{ + isUp: true, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "2", + State: runtime.ComponentState{State: client.UnitStateDegraded}, + Component: component.Component{ + ID: "test-component", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 200, + liveness: false, + failon: "degraded", + }, + { + name: "healthy", + coord: mockCoordinator{ + isUp: true, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "5", + State: runtime.ComponentState{State: client.UnitStateHealthy}, + Component: component.Component{ + ID: "test-component3", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 200, + liveness: true, + failon: "degraded", + }, + { + name: "coord-fail-only-healthy", + coord: mockCoordinator{ + isUp: false, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "5", + State: runtime.ComponentState{State: client.UnitStateHealthy}, + Component: component.Component{ + ID: "test-component3", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 503, + liveness: true, + failon: "heartbeat", + }, + { + name: "coord-fail-only-failed", + coord: mockCoordinator{ + isUp: false, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "5", + State: runtime.ComponentState{State: client.UnitStateFailed}, + Component: component.Component{ + ID: "test-component3", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 503, + liveness: true, + failon: "heartbeat", + }, + { + name: "degraded-coordinator-down", + coord: mockCoordinator{ + isUp: false, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "5", + State: runtime.ComponentState{State: client.UnitStateDegraded}, + Component: component.Component{ + ID: "test-component3", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 503, + liveness: true, + failon: "degraded", + }, + { + name: "unhealthy-coordinator-down", + coord: mockCoordinator{ + isUp: false, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "5", + State: runtime.ComponentState{State: client.UnitStateFailed}, + Component: component.Component{ + ID: "test-component3", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 503, + liveness: true, + failon: "degraded", + }, + { + name: "healthy-coordinator-down", + coord: mockCoordinator{ + isUp: false, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "5", + State: runtime.ComponentState{State: client.UnitStateHealthy}, + Component: component.Component{ + ID: "test-component3", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 503, + liveness: true, + failon: "degraded", + }, + { + name: "healthy-liveness-off", + coord: mockCoordinator{ + isUp: true, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "5", + State: runtime.ComponentState{State: client.UnitStateHealthy}, + Component: component.Component{ + ID: "test-component3", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 200, + liveness: false, + failon: "degraded", + }, + { + name: "degraded-and-healthy", + coord: mockCoordinator{ + isUp: true, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "2", + State: runtime.ComponentState{State: client.UnitStateDegraded}, + Component: component.Component{ + ID: "test-component", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + { + LegacyPID: "3", + State: runtime.ComponentState{State: client.UnitStateHealthy}, + Component: component.Component{ + ID: "test-component2", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, + }, + expectedCode: 500, + liveness: true, + failon: "degraded", + }, + } + + // test with processesHandler + for _, test := range testCases { + t.Run(test.name, func(t *testing.T) { + testSrv := httptest.NewServer(createHandler(livenessHandler(test.coord))) + defer testSrv.Close() + + path := fmt.Sprintf("%s?failon=%s", testSrv.URL, test.failon) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, path, nil) + require.NoError(t, err) + res, err := http.DefaultClient.Do(req) + require.NoError(t, err) + res.Body.Close() + + }) + } + +} diff --git a/internal/pkg/agent/application/monitoring/process.go b/internal/pkg/agent/application/monitoring/process.go index dc969553d09..78267479c60 100644 --- a/internal/pkg/agent/application/monitoring/process.go +++ b/internal/pkg/agent/application/monitoring/process.go @@ -16,7 +16,6 @@ import ( "github.com/gorilla/mux" - "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" "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/utils" @@ -44,7 +43,7 @@ var redirectableProcesses = []string{ profilingServicePrefix, } -func processHandler(coord *coordinator.Coordinator, statsHandler func(http.ResponseWriter, *http.Request) error, operatingSystem string) func(http.ResponseWriter, *http.Request) error { +func processHandler(coord CoordinatorState, statsHandler func(http.ResponseWriter, *http.Request) error, operatingSystem string) func(http.ResponseWriter, *http.Request) error { return func(w http.ResponseWriter, r *http.Request) error { w.Header().Set("Content-Type", "application/json; charset=utf-8") @@ -82,8 +81,9 @@ func processHandler(coord *coordinator.Coordinator, statsHandler func(http.Respo state := coord.State() - for _, c := range state.Components { - if matchesCloudProcessID(&c.Component, componentID) { + for iter, c := range state.Components { + // access the components array manually to avoid a memory aliasing error. This is fixed in go 1.22 + if matchesCloudProcessID(&state.Components[iter].Component, componentID) { data := struct { State string `json:"state"` Message string `json:"message"` diff --git a/internal/pkg/agent/application/monitoring/processes.go b/internal/pkg/agent/application/monitoring/processes.go index c0628a40277..1a254a70b7c 100644 --- a/internal/pkg/agent/application/monitoring/processes.go +++ b/internal/pkg/agent/application/monitoring/processes.go @@ -9,8 +9,6 @@ import ( "fmt" "net/http" "strings" - - "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" ) type source struct { @@ -40,7 +38,7 @@ func sourceFromComponentID(procID string) source { return s } -func processesHandler(coord *coordinator.Coordinator) func(http.ResponseWriter, *http.Request) error { +func processesHandler(coord CoordinatorState) func(http.ResponseWriter, *http.Request) error { return func(w http.ResponseWriter, r *http.Request) error { w.Header().Set("Content-Type", "application/json; charset=utf-8") @@ -48,12 +46,13 @@ func processesHandler(coord *coordinator.Coordinator) func(http.ResponseWriter, state := coord.State() - for _, c := range state.Components { + for iter, c := range state.Components { if c.Component.InputSpec != nil { procs = append(procs, process{ - ID: expectedCloudProcessID(&c.Component), + // access the components array manually to avoid a memory aliasing error. This is fixed in go 1.22 + ID: expectedCloudProcessID(&state.Components[iter].Component), PID: c.LegacyPID, - Binary: c.Component.InputSpec.BinaryName, + Binary: c.Component.BinaryName(), Source: sourceFromComponentID(c.Component.ID), }) } diff --git a/internal/pkg/agent/application/monitoring/processes_cloud.go b/internal/pkg/agent/application/monitoring/processes_cloud.go index c4ba36a1d35..a303151ee85 100644 --- a/internal/pkg/agent/application/monitoring/processes_cloud.go +++ b/internal/pkg/agent/application/monitoring/processes_cloud.go @@ -23,7 +23,7 @@ func expectedCloudProcessID(c *component.Component) string { // Ensure that this is the ID we use, in agent v2 the ID is usually "apm-default". // Otherwise apm-server won't be routable/accessible in cloud. // https://github.com/elastic/elastic-agent/issues/1731#issuecomment-1325862913 - if strings.Contains(c.InputSpec.BinaryName, "apm-server") { + if strings.Contains(c.BinaryName(), "apm-server") { // cloud understands `apm-server-default` and does not understand `apm-default` return strings.Replace(c.ID, "apm-", "apm-server-", 1) } @@ -36,7 +36,7 @@ func matchesCloudProcessID(c *component.Component, id string) bool { // to find the APM server address. Rather than change all of the monitoring in cloud, // it is easier to just make sure the existing ID maps to the APM server component. if strings.Contains(id, "apm-server") { - if strings.Contains(c.InputSpec.BinaryName, "apm-server") { + if strings.Contains(c.BinaryName(), "apm-server") { return true } } diff --git a/internal/pkg/agent/application/monitoring/reload/reload.go b/internal/pkg/agent/application/monitoring/reload/reload.go index 430b425d6c6..35b1143ec9e 100644 --- a/internal/pkg/agent/application/monitoring/reload/reload.go +++ b/internal/pkg/agent/application/monitoring/reload/reload.go @@ -5,6 +5,8 @@ package reload import ( + "fmt" + "net" "sync/atomic" "github.com/elastic/elastic-agent/internal/pkg/agent/configuration" @@ -18,83 +20,112 @@ import ( type ServerController interface { Start() Stop() error + Addr() net.Addr } -type serverConstructor func() (ServerController, error) +type serverConstructor func(*monitoringCfg.MonitoringConfig) (ServerController, error) type ServerReloader struct { - s ServerController - log *logger.Logger - newServerFn serverConstructor + srvController ServerController + log *logger.Logger + newServerFn serverConstructor config *monitoringCfg.MonitoringConfig isServerRunning atomic.Bool + // the state of HTTP.Enabled when we call NewServerReloader + originalHTTPState *monitoringCfg.MonitoringHTTPConfig } func NewServerReloader(newServerFn serverConstructor, log *logger.Logger, mcfg *monitoringCfg.MonitoringConfig) *ServerReloader { sr := &ServerReloader{ - log: log, - config: mcfg, - newServerFn: newServerFn, + log: log, + config: mcfg, + newServerFn: newServerFn, + originalHTTPState: mcfg.HTTP, } - return sr } func (sr *ServerReloader) Start() { - if sr.s != nil && sr.isServerRunning.Load() { + if sr.srvController != nil && sr.isServerRunning.Load() { // server is already running return } - sr.log.Info("Starting server") + sr.log.Infof("Starting monitoring server with cfg %#v", sr.config) var err error - sr.s, err = sr.newServerFn() + sr.srvController, err = sr.newServerFn(sr.config) if err != nil { sr.log.Errorf("Failed creating a server: %v", err) return } - sr.s.Start() - sr.log.Debugf("Server started") + sr.srvController.Start() + sr.log.Debugf("Monitoring server started") sr.isServerRunning.Store(true) + } func (sr *ServerReloader) Stop() error { - if sr.s == nil { + if sr.srvController == nil { // stopping not started server sr.isServerRunning.Store(false) return nil } - sr.log.Info("Stopping server") + sr.log.Info("Stopping monitoring server") sr.isServerRunning.Store(false) - if err := sr.s.Stop(); err != nil { + if err := sr.srvController.Stop(); err != nil { return err } - sr.log.Debugf("Server stopped") - sr.s = nil + sr.log.Debugf("Monitoring server stopped") + sr.srvController = nil return nil } +// Addr returns the address interface used by the underlying network listener +func (sr *ServerReloader) Addr() net.Addr { + if sr.srvController != nil { + return sr.srvController.Addr() + } + // just return a "bare" Addr so we don't have to return a nil + return &net.TCPAddr{Port: 0, IP: net.IP{}} +} + func (sr *ServerReloader) Reload(rawConfig *aConfig.Config) error { newConfig := configuration.DefaultConfiguration() if err := rawConfig.Unpack(&newConfig); err != nil { return errors.New(err, "failed to unpack monitoring config during reload") } + // see https://github.com/elastic/elastic-agent/issues/4582 + // currently, fleet does not expect the monitoring to be reloadable. + // If it was set in the original init config (which includes overrides), and it wasn't explicitly disabled + // then pretend the HTTP monitoring is enabled + if sr.originalHTTPState != nil && sr.originalHTTPState.Enabled && + newConfig.Settings.MonitoringConfig != nil && !newConfig.Settings.MonitoringConfig.HTTP.EnabledIsSet { + sr.log.Infof("http monitoring server is enabled in hard-coded config, but HTTP config is unset. Leaving enabled.") + newConfig.Settings.MonitoringConfig.HTTP = sr.originalHTTPState + } + sr.config = newConfig.Settings.MonitoringConfig + var err error + + if sr.config != nil && sr.config.Enabled { + if sr.isServerRunning.Load() { + err = sr.Stop() + if err != nil { + return fmt.Errorf("error stopping monitoring server: %w", err) + } + } - shouldRunMetrics := sr.config.Enabled - if shouldRunMetrics && !sr.isServerRunning.Load() { sr.Start() - sr.isServerRunning.Store(true) return nil } - if !shouldRunMetrics && sr.isServerRunning.Load() { - sr.isServerRunning.Store(false) + if sr.config != nil && !sr.config.Enabled && sr.isServerRunning.Load() { + return sr.Stop() } diff --git a/internal/pkg/agent/application/monitoring/reload/reload_test.go b/internal/pkg/agent/application/monitoring/reload/reload_test.go index e45eae4d006..7a42a64cca6 100644 --- a/internal/pkg/agent/application/monitoring/reload/reload_test.go +++ b/internal/pkg/agent/application/monitoring/reload/reload_test.go @@ -5,6 +5,7 @@ package reload import ( + "net" "testing" "github.com/stretchr/testify/require" @@ -58,14 +59,6 @@ agent.monitoring.enabled: false `, false, false, true, }, - { - "do not stop when running, monitoring.metrics disabled", - true, true, true, - ` -agent.monitoring.metrics: false -`, - true, false, false, - }, { "stop stopped server", false, false, false, @@ -75,12 +68,10 @@ agent.monitoring.enabled: false false, false, false, }, { - "start started server", + "remain-running-with-blank-config", + true, true, true, + ``, true, true, true, - ` -agent.monitoring.enabled: true -`, - true, false, false, }, } @@ -93,7 +84,7 @@ agent.monitoring.enabled: true MonitorMetrics: tc.currMetrics, } r := NewServerReloader( - func() (ServerController, error) { + func(mcfg *monitoringCfg.MonitoringConfig) (ServerController, error) { return fsc, nil }, log, @@ -101,7 +92,7 @@ agent.monitoring.enabled: true ) r.isServerRunning.Store(tc.currRunning) if tc.currRunning { - r.s = fsc + r.srvController = fsc } newCfg := aConfig.MustNewConfigFrom(tc.newConfig) @@ -128,3 +119,7 @@ func (fsc *fakeServerController) Reset() { fsc.startTriggered = false fsc.stopTriggered = false } + +func (fsc *fakeServerController) Addr() net.Addr { + return nil +} diff --git a/internal/pkg/agent/application/monitoring/server.go b/internal/pkg/agent/application/monitoring/server.go index bd809e83a3f..feb1eeacb77 100644 --- a/internal/pkg/agent/application/monitoring/server.go +++ b/internal/pkg/agent/application/monitoring/server.go @@ -17,9 +17,7 @@ import ( "go.elastic.co/apm/module/apmgorilla" "github.com/elastic/elastic-agent-libs/api" - "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/monitoring" - "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" "github.com/elastic/elastic-agent/internal/pkg/agent/application/monitoring/reload" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" monitoringCfg "github.com/elastic/elastic-agent/internal/pkg/core/monitoring/config" @@ -32,8 +30,7 @@ func NewServer( endpointConfig api.Config, ns func(string) *monitoring.Namespace, tracer *apm.Tracer, - coord *coordinator.Coordinator, - enableProcessStats bool, + coord CoordinatorState, operatingSystem string, mcfg *monitoringCfg.MonitoringConfig, ) (*reload.ServerReloader, error) { @@ -42,47 +39,56 @@ func NewServer( log.Warnf("failed to create monitoring drop: %v", err) } - if strings.TrimSpace(endpointConfig.Host) == "" { - endpointConfig.Host = monitoringCfg.DefaultHost - } - - cfg, err := config.NewConfigFrom(endpointConfig) - if err != nil { - return nil, err - } - - return exposeMetricsEndpoint(log, cfg, ns, tracer, coord, enableProcessStats, operatingSystem, mcfg) + return exposeMetricsEndpoint(log, ns, tracer, coord, operatingSystem, mcfg) } func exposeMetricsEndpoint( log *logger.Logger, - config *config.C, ns func(string) *monitoring.Namespace, tracer *apm.Tracer, - coord *coordinator.Coordinator, - enableProcessStats bool, + coord CoordinatorState, operatingSystem string, mcfg *monitoringCfg.MonitoringConfig, ) (*reload.ServerReloader, error) { - r := mux.NewRouter() - if tracer != nil { - r.Use(apmgorilla.Middleware(apmgorilla.WithTracer(tracer))) - } - statsHandler := statsHandler(ns("stats")) - r.Handle("/stats", createHandler(statsHandler)) - - if enableProcessStats { - r.Handle("/processes", createHandler(processesHandler(coord))) - r.Handle("/processes/{componentID}", createHandler(processHandler(coord, statsHandler, operatingSystem))) - r.Handle("/processes/{componentID}/", createHandler(processHandler(coord, statsHandler, operatingSystem))) - r.Handle("/processes/{componentID}/{metricsPath}", createHandler(processHandler(coord, statsHandler, operatingSystem))) - } - mux := http.NewServeMux() - mux.Handle("/", r) + newServerFn := func(cfg *monitoringCfg.MonitoringConfig) (reload.ServerController, error) { + r := mux.NewRouter() + if tracer != nil { + r.Use(apmgorilla.Middleware(apmgorilla.WithTracer(tracer))) + } + + // This will probably only be nil in tests. + statNs := &monitoring.Namespace{} + if ns != nil { + statNs = ns("stats") + } - newServerFn := func() (reload.ServerController, error) { - apiServer, err := api.New(log, mux, config) + statsHandler := statsHandler(statNs) + r.Handle("/stats", createHandler(statsHandler)) + + if isProcessStatsEnabled(cfg) { + log.Infof("process monitoring is enabled, creating monitoring endpoints") + r.Handle("/processes", createHandler(processesHandler(coord))) + r.Handle("/processes/{componentID}", createHandler(processHandler(coord, statsHandler, operatingSystem))) + r.Handle("/processes/{componentID}/", createHandler(processHandler(coord, statsHandler, operatingSystem))) + r.Handle("/processes/{componentID}/{metricsPath}", createHandler(processHandler(coord, statsHandler, operatingSystem))) + + r.Handle("/liveness", createHandler(livenessHandler(coord))) + } + + mux := http.NewServeMux() + mux.Handle("/", r) + + if strings.TrimSpace(cfg.HTTP.Host) == "" { + cfg.HTTP.Host = monitoringCfg.DefaultHost + } + + srvCfg := api.DefaultConfig() + srvCfg.Enabled = cfg.Enabled + srvCfg.Host = AgentMonitoringEndpoint(operatingSystem, cfg) + srvCfg.Port = cfg.HTTP.Port + log.Infof("creating monitoring API with cfg %#v", srvCfg) + apiServer, err := api.NewFromConfig(log, mux, srvCfg) if err != nil { return nil, errors.New(err, "failed to create api server") } @@ -121,3 +127,7 @@ func isHttpUrl(s string) bool { u, err := url.Parse(strings.TrimSpace(s)) return err == nil && (u.Scheme == "http" || u.Scheme == "https") && u.Host != "" } + +func isProcessStatsEnabled(cfg *monitoringCfg.MonitoringConfig) bool { + return cfg != nil && cfg.HTTP.Enabled +} diff --git a/internal/pkg/agent/application/monitoring/server_test.go b/internal/pkg/agent/application/monitoring/server_test.go index 3c2f1c5aa92..4fea8c4107d 100644 --- a/internal/pkg/agent/application/monitoring/server_test.go +++ b/internal/pkg/agent/application/monitoring/server_test.go @@ -5,11 +5,164 @@ package monitoring import ( + "context" + "fmt" + "net/http" "testing" + "time" "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" + + "github.com/elastic/elastic-agent-client/v7/pkg/client" + "github.com/elastic/elastic-agent-libs/api" + "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/monitoring/reload" + aConfig "github.com/elastic/elastic-agent/internal/pkg/config" + "github.com/elastic/elastic-agent/internal/pkg/core/monitoring/config" + "github.com/elastic/elastic-agent/pkg/component" + "github.com/elastic/elastic-agent/pkg/component/runtime" ) +var fakeCoordCfg = mockCoordinator{ + isUp: true, + state: coordinator.State{ + Components: []runtime.ComponentComponentState{ + { + LegacyPID: "2", + State: runtime.ComponentState{State: client.UnitStateDegraded}, + Component: component.Component{ + ID: "test-component", + InputSpec: &component.InputRuntimeSpec{ + BinaryName: "testbeat", + }, + }, + }, + }, + }, +} + +func TestHTTPReloadEnableBehavior(t *testing.T) { + // see https://github.com/elastic/elastic-agent/issues/4582 + // This tests how the reloader behaves depending on what config values are set. + type reloadCase struct { + name string + initConfig *config.MonitoringConfig + secondConfig *aConfig.Config + httpOnAtInit bool + httpOnAfterReload bool + } + + cases := []reloadCase{ + { + name: "enabled-with-reload-empty", + initConfig: &config.MonitoringConfig{Enabled: true, HTTP: &config.MonitoringHTTPConfig{Enabled: true}}, + // use a map so we can specify port 0 with out setting `enabled` + secondConfig: aConfig.MustNewConfigFrom(map[string]interface{}{"agent": map[string]interface{}{ + "monitoring": map[string]interface{}{"enabled": true, "http": map[string]interface{}{"port": 0}}}}), + httpOnAtInit: true, + httpOnAfterReload: true, + }, + { + name: "disabled-with-reload-empty", + initConfig: &config.MonitoringConfig{Enabled: true, HTTP: &config.MonitoringHTTPConfig{Enabled: false}}, + secondConfig: aConfig.MustNewConfigFrom(map[string]interface{}{"agent": map[string]interface{}{ + "monitoring": map[string]interface{}{"enabled": true, "http": map[string]interface{}{"port": 0}}}}), + httpOnAtInit: false, + httpOnAfterReload: false, + }, + { + name: "disabled-with-reload-disabled", + initConfig: &config.MonitoringConfig{Enabled: true, HTTP: &config.MonitoringHTTPConfig{Enabled: false}}, + secondConfig: aConfig.MustNewConfigFrom(map[string]interface{}{"agent": map[string]interface{}{ + "monitoring": map[string]interface{}{"enabled": true, "http": map[string]interface{}{"port": 0, "enabled": false}}}}), + httpOnAtInit: false, + httpOnAfterReload: false, + }, + { + name: "enabled-with-reload-disabled", + initConfig: &config.MonitoringConfig{Enabled: true, HTTP: &config.MonitoringHTTPConfig{Enabled: true}}, + secondConfig: aConfig.MustNewConfigFrom(map[string]interface{}{"agent": map[string]interface{}{ + "monitoring": map[string]interface{}{"enabled": true, "http": map[string]interface{}{"port": 0, "enabled": false}}}}), + httpOnAtInit: true, + httpOnAfterReload: false, + }, + } + + for _, testCase := range cases { + t.Run(testCase.name, func(t *testing.T) { + serverReloader, err := NewServer(logp.L(), api.Config{}, nil, nil, fakeCoordCfg, "linux", testCase.initConfig) + require.NoError(t, err) + + t.Logf("starting server...") + serverReloader.Start() + if testCase.httpOnAtInit { + waitOnReturnCode(t, http.StatusOK, "?failon=failed", serverReloader) + } else { + waitOnReturnCode(t, http.StatusNotFound, "?failon=failed", serverReloader) + } + + err = serverReloader.Reload(testCase.secondConfig) + require.NoError(t, err) + + if testCase.httpOnAfterReload { + waitOnReturnCode(t, http.StatusOK, "?failon=failed", serverReloader) + } else { + waitOnReturnCode(t, http.StatusNotFound, "?failon=failed", serverReloader) + } + + }) + } +} + +func TestBasicLivenessConfig(t *testing.T) { + _ = logp.DevelopmentSetup() + testAPIConfig := api.Config{} + testConfig := config.MonitoringConfig{ + Enabled: true, + HTTP: &config.MonitoringHTTPConfig{ + Enabled: true, + Port: 0, + }, + } + serverReloader, err := NewServer(logp.L(), testAPIConfig, nil, nil, fakeCoordCfg, "linux", &testConfig) + require.NoError(t, err) + + t.Logf("starting server...") + serverReloader.Start() + + waitOnReturnCode(t, http.StatusInternalServerError, "?failon=degraded", serverReloader) + + waitOnReturnCode(t, http.StatusOK, "?failon=failed", serverReloader) + + t.Logf("stopping server...") + err = serverReloader.Stop() + require.NoError(t, err) + +} + +func waitOnReturnCode(t *testing.T, expectedReturnCode int, formValue string, rel *reload.ServerReloader) { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) + defer cancel() + client := &http.Client{} + require.Eventually(t, func() bool { + path := fmt.Sprintf("http://%s/liveness%s", rel.Addr().String(), formValue) + t.Logf("checking %s", path) + req, err := http.NewRequestWithContext(ctx, "GET", path, nil) + require.NoError(t, err) + + resp, err := client.Do(req) + if err != nil { + t.Logf("error fetching endpoint: %s", err) + return false + } + defer resp.Body.Close() + // should return 500 as we have one component set to UnitStateDegraded + return resp.StatusCode == expectedReturnCode + }, time.Second*30, time.Second*3) +} + func TestIsHTTPUrl(t *testing.T) { tests := []struct { diff --git a/internal/pkg/agent/application/monitoring/v1_monitor.go b/internal/pkg/agent/application/monitoring/v1_monitor.go index 485595eda19..d2947d84521 100644 --- a/internal/pkg/agent/application/monitoring/v1_monitor.go +++ b/internal/pkg/agent/application/monitoring/v1_monitor.go @@ -47,15 +47,19 @@ const ( agentKey = "agent" monitoringKey = "monitoring" useOutputKey = "use_output" + monitoringMetricsPeriodKey = "metrics_period" monitoringOutput = "monitoring" defaultMonitoringNamespace = "default" agentName = "elastic-agent" + monitoringMetricsUnitID = "metrics-monitoring" + monitoringFilesUnitsID = "filestream-monitoring" + windowsOS = "windows" // metricset execution period used for the monitoring metrics inputs // we set this to 60s to reduce the load/data volume on the monitoring cluster - metricsCollectionInterval = 60 * time.Second + defaultMetricsCollectionInterval = 60 * time.Second ) var ( @@ -64,7 +68,8 @@ var ( supportedBeatsComponents = []string{"filebeat", "metricbeat", "apm-server", "fleet-server", "auditbeat", "cloudbeat", "heartbeat", "osquerybeat", "packetbeat", "pf-elastic-collector", "pf-elastic-symbolizer"} ) -// BeatsMonitor is providing V1 monitoring support for metrics and logs for endpoint-security only. +// BeatsMonitor provides config values for monitoring of agent clients (beats, endpoint, etc) +// by injecting the monitoring config into an existing fleet config type BeatsMonitor struct { enabled bool // feature flag disabling whole v1 monitoring story config *monitoringConfig @@ -107,10 +112,16 @@ func (b *BeatsMonitor) Reload(rawConfig *config.Config) error { } // MonitoringConfig adds monitoring inputs to a configuration based on retrieved list of components to run. +// args: +// policy: the existing config policy +// components: a list of the expected running components +// componentIDToBinary: a map of component IDs to binary names +// componentIDPidMap: a map of component IDs to the PIDs of the running components. func (b *BeatsMonitor) MonitoringConfig( policy map[string]interface{}, components []component.Component, componentIDToBinary map[string]string, + componentIDPidMap map[string]uint64, ) (map[string]interface{}, error) { if !b.Enabled() { return nil, nil @@ -119,6 +130,7 @@ func (b *BeatsMonitor) MonitoringConfig( cfg := make(map[string]interface{}) monitoringOutputName := defaultOutputName + metricsCollectionIntervalString := b.config.C.MetricsPeriod if agentCfg, found := policy[agentKey]; found { // The agent section is required for feature flags cfg[agentKey] = agentCfg @@ -133,6 +145,12 @@ func (b *BeatsMonitor) MonitoringConfig( monitoringOutputName = useStr } } + + if metricsPeriod, found := monitoringMap[monitoringMetricsPeriodKey]; found { + if metricsPeriodStr, ok := metricsPeriod.(string); ok { + metricsCollectionIntervalString = metricsPeriodStr + } + } } } } @@ -155,7 +173,7 @@ func (b *BeatsMonitor) MonitoringConfig( } if b.config.C.MonitorMetrics { - if err := b.injectMetricsInput(cfg, componentIDToBinary, monitoringOutput, components); err != nil { + if err := b.injectMetricsInput(cfg, componentIDToBinary, components, componentIDPidMap, metricsCollectionIntervalString); err != nil { return nil, errors.New(err, "failed to inject monitoring output") } } @@ -295,13 +313,14 @@ func (b *BeatsMonitor) injectMonitoringOutput(source, dest map[string]interface{ return nil } +// injectLogsInput adds logging configs for component monitoring to the `cfg` map func (b *BeatsMonitor) injectLogsInput(cfg map[string]interface{}, components []component.Component, monitoringOutput string) error { monitoringNamespace := b.monitoringNamespace() logsDrop := filepath.Dir(loggingPath("unit", b.operatingSystem)) streams := []interface{}{ map[string]interface{}{ - idKey: "filestream-monitoring-agent", + idKey: fmt.Sprintf("%s-agent", monitoringFilesUnitsID), "type": "filestream", "paths": []interface{}{ filepath.Join(logsDrop, agentName+"-*.ndjson"), @@ -346,6 +365,16 @@ func (b *BeatsMonitor) injectLogsInput(cfg map[string]interface{}, components [] }, }, }, + // drop periodic metrics logs (those are useful mostly in diagnostic dumps where we collect log files) + map[string]interface{}{ + "drop_event": map[string]interface{}{ + "when": map[string]interface{}{ + "regexp": map[string]interface{}{ + "message": "^Non-zero metrics in the last", + }, + }, + }, + }, // copy original dataset so we can drop the dataset field map[string]interface{}{ "copy_fields": map[string]interface{}{ @@ -435,11 +464,10 @@ func (b *BeatsMonitor) injectLogsInput(cfg map[string]interface{}, components [] // only monitor service inputs that define a log path continue } - - fixedBinaryName := strings.ReplaceAll(strings.ReplaceAll(comp.InputSpec.BinaryName, "-", "_"), "/", "_") // conform with index naming policy + fixedBinaryName := strings.ReplaceAll(strings.ReplaceAll(comp.BinaryName(), "-", "_"), "/", "_") // conform with index naming policy dataset := fmt.Sprintf("elastic_agent.%s", fixedBinaryName) streams = append(streams, map[string]interface{}{ - idKey: fmt.Sprintf("filestream-monitoring-%s", comp.ID), + idKey: fmt.Sprintf("%s-%s", monitoringFilesUnitsID, comp.ID), "type": "filestream", "paths": []interface{}{ comp.InputSpec.Spec.Service.Log.Path, @@ -472,7 +500,7 @@ func (b *BeatsMonitor) injectLogsInput(cfg map[string]interface{}, components [] "fields": map[string]interface{}{ "id": comp.ID, "type": comp.InputSpec.InputType, - "binary": comp.InputSpec.BinaryName, + "binary": comp.BinaryName(), "dataset": dataset, }, }, @@ -492,8 +520,8 @@ func (b *BeatsMonitor) injectLogsInput(cfg map[string]interface{}, components [] inputs := []interface{}{ map[string]interface{}{ - idKey: "filestream-monitoring-agent", - "name": "filestream-monitoring-agent", + idKey: fmt.Sprintf("%s-agent", monitoringFilesUnitsID), + "name": fmt.Sprintf("%s-agent", monitoringFilesUnitsID), "type": "filestream", useOutputKey: monitoringOutput, "streams": streams, @@ -521,15 +549,23 @@ func (b *BeatsMonitor) monitoringNamespace() string { return defaultMonitoringNamespace } -func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentIDToBinary map[string]string, monitoringOutputName string, componentList []component.Component) error { - - metricsCollectionIntervalString := metricsCollectionInterval.String() +// injectMetricsInput injects monitoring config for agent monitoring to the `cfg` object. +func (b *BeatsMonitor) injectMetricsInput( + cfg map[string]interface{}, + componentIDToBinary map[string]string, + componentList []component.Component, + existingStateServicePids map[string]uint64, + metricsCollectionIntervalString string, +) error { + if metricsCollectionIntervalString == "" { + metricsCollectionIntervalString = defaultMetricsCollectionInterval.String() + } monitoringNamespace := b.monitoringNamespace() fixedAgentName := strings.ReplaceAll(agentName, "-", "_") beatsStreams := make([]interface{}, 0, len(componentIDToBinary)) streams := []interface{}{ map[string]interface{}{ - idKey: "metrics-monitoring-agent", + idKey: fmt.Sprintf("%s-agent", monitoringMetricsUnitID), "data_stream": map[string]interface{}{ "type": "metrics", "dataset": fmt.Sprintf("elastic_agent.%s", fixedAgentName), @@ -606,7 +642,18 @@ func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentI }, }, } - for unit, binaryName := range componentIDToBinary { + + //create a new map with the monitoring beats included + componentListWithMonitoring := map[string]string{ + fmt.Sprintf("beat/%s", monitoringMetricsUnitID): "metricbeat", + fmt.Sprintf("http/%s", monitoringMetricsUnitID): "metricbeat", + monitoringFilesUnitsID: "filebeat", + } + for k, v := range componentIDToBinary { + componentListWithMonitoring[k] = v + } + + for unit, binaryName := range componentListWithMonitoring { if !isSupportedMetricsBinary(binaryName) { continue } @@ -616,13 +663,13 @@ func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentI if isSupportedBeatsBinary(binaryName) { beatsStreams = append(beatsStreams, map[string]interface{}{ - idKey: "metrics-monitoring-" + name, + idKey: fmt.Sprintf("%s-", monitoringMetricsUnitID) + name, "data_stream": map[string]interface{}{ "type": "metrics", "dataset": fmt.Sprintf("elastic_agent.%s", name), "namespace": monitoringNamespace, }, - "metricsets": []interface{}{"stats", "state"}, + "metricsets": []interface{}{"stats"}, "hosts": endpoints, "period": metricsCollectionIntervalString, "index": fmt.Sprintf("metrics-elastic_agent.%s-%s", name, monitoringNamespace), @@ -678,7 +725,7 @@ func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentI } streams = append(streams, map[string]interface{}{ - idKey: "metrics-monitoring-" + name + "-1", + idKey: fmt.Sprintf("%s-%s-1", monitoringMetricsUnitID, name), "data_stream": map[string]interface{}{ "type": "metrics", "dataset": fmt.Sprintf("elastic_agent.%s", fixedAgentName), @@ -748,7 +795,7 @@ func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentI if strings.EqualFold(name, "filebeat") { fbDataStreamName := "filebeat_input" streams = append(streams, map[string]interface{}{ - idKey: "metrics-monitoring-" + name + "-1", + idKey: fmt.Sprintf("%s-%s-1", monitoringMetricsUnitID, name), "data_stream": map[string]interface{}{ "type": "metrics", "dataset": fmt.Sprintf("elastic_agent.%s", fbDataStreamName), @@ -832,7 +879,7 @@ func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentI // note: this doesn't fetch anything from the /state endpoint, as it doesn't report much beyond name/version, // the equivalent of the beat /state metrics end up in /shipper shipperHTTPStreams = append(shipperHTTPStreams, map[string]interface{}{ - idKey: "metrics-monitoring-shipper", + idKey: fmt.Sprintf("%s-shipper", monitoringMetricsUnitID), "data_stream": map[string]interface{}{ "type": "metrics", "dataset": fmt.Sprintf("elastic_agent.%s", name), @@ -846,7 +893,7 @@ func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentI "processors": createProcessorsForJSONInput(name, comp.ID, monitoringNamespace, b.agentInfo), }, map[string]interface{}{ - idKey: "metrics-monitoring-shipper-stats", + idKey: fmt.Sprintf("%s-shipper-stats", monitoringMetricsUnitID), "data_stream": map[string]interface{}{ "type": "metrics", "dataset": fmt.Sprintf("elastic_agent.%s", name), @@ -864,8 +911,8 @@ func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentI inputs := []interface{}{ map[string]interface{}{ - idKey: "metrics-monitoring-beats", - "name": "metrics-monitoring-beats", + idKey: fmt.Sprintf("%s-beats", monitoringMetricsUnitID), + "name": fmt.Sprintf("%s-beats", monitoringMetricsUnitID), "type": "beat/metrics", useOutputKey: monitoringOutput, "data_stream": map[string]interface{}{ @@ -874,8 +921,8 @@ func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentI "streams": beatsStreams, }, map[string]interface{}{ - idKey: "metrics-monitoring-agent", - "name": "metrics-monitoring-agent", + idKey: fmt.Sprintf("%s-agent", monitoringMetricsUnitID), + "name": fmt.Sprintf("%s-agent", monitoringMetricsUnitID), "type": "http/metrics", useOutputKey: monitoringOutput, "data_stream": map[string]interface{}{ @@ -885,11 +932,94 @@ func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentI }, } + // add system/process metrics for services that can't be monitored via json/beats metrics + // If there's a checkin PID and the corresponding component has a service spec section, add a system/process config + for _, compState := range componentList { + if compState.InputSpec != nil && compState.InputSpec.Spec.Service != nil { + if comp, ok := existingStateServicePids[compState.ID]; ok && comp != 0 { + name := strings.ReplaceAll(strings.ReplaceAll(compState.BinaryName(), "-", "_"), "/", "_") + inputs = append(inputs, map[string]interface{}{ + idKey: fmt.Sprintf("%s-%s", monitoringMetricsUnitID, name), + "name": fmt.Sprintf("%s-%s", monitoringMetricsUnitID, name), + "type": "system/metrics", + useOutputKey: monitoringOutput, + "data_stream": map[string]interface{}{ + "namespace": monitoringNamespace, + }, + "streams": []interface{}{ + map[string]interface{}{ + idKey: fmt.Sprintf("%s-%s", monitoringMetricsUnitID, name), + "data_stream": map[string]interface{}{ + "type": "metrics", + "dataset": fmt.Sprintf("elastic_agent.%s", name), + "namespace": monitoringNamespace, + }, + "metricsets": []interface{}{"process"}, + "period": metricsCollectionIntervalString, + "index": fmt.Sprintf("metrics-elastic_agent.%s-%s", name, monitoringNamespace), + "process.pid": comp, + "process.cgroups.enabled": false, + "processors": []interface{}{ + map[string]interface{}{ + "add_fields": map[string]interface{}{ + "target": "data_stream", + "fields": map[string]interface{}{ + "type": "metrics", + "dataset": fmt.Sprintf("elastic_agent.%s", name), + "namespace": monitoringNamespace, + }, + }, + }, + map[string]interface{}{ + "add_fields": map[string]interface{}{ + "target": "event", + "fields": map[string]interface{}{ + "dataset": fmt.Sprintf("elastic_agent.%s", name), + }, + }, + }, + map[string]interface{}{ + "add_fields": map[string]interface{}{ + "target": "elastic_agent", + "fields": map[string]interface{}{ + "id": b.agentInfo.AgentID(), + "version": b.agentInfo.Version(), + "snapshot": b.agentInfo.Snapshot(), + "process": name, + }, + }, + }, + map[string]interface{}{ + "add_fields": map[string]interface{}{ + "target": "agent", + "fields": map[string]interface{}{ + "id": b.agentInfo.AgentID(), + }, + }, + }, + map[string]interface{}{ + "add_fields": map[string]interface{}{ + "target": "component", + "fields": map[string]interface{}{ + "binary": name, + "id": compState.ID, + }, + }, + }, + }, + }, + }, + }) + } + + } + } + // if we have shipper data, inject the extra inputs if len(shipperHTTPStreams) > 0 { inputs = append(inputs, map[string]interface{}{ - idKey: "metrics-monitoring-shipper", - "name": "metrics-monitoring-shipper", + idKey: fmt.Sprintf("%s-shipper", monitoringMetricsUnitID), + "name": fmt.Sprintf("%s-shipper", monitoringMetricsUnitID), "type": "http/metrics", useOutputKey: monitoringOutput, "data_stream": map[string]interface{}{ diff --git a/internal/pkg/agent/application/monitoring/v1_monitor_test.go b/internal/pkg/agent/application/monitoring/v1_monitor_test.go index 3f852d44200..210271dc3d7 100644 --- a/internal/pkg/agent/application/monitoring/v1_monitor_test.go +++ b/internal/pkg/agent/application/monitoring/v1_monitor_test.go @@ -22,19 +22,23 @@ import ( "github.com/elastic/elastic-agent/pkg/component" ) -func TestMonitoringConfigMetricsInterval(t *testing.T) { - +func TestMonitoringWithEndpoint(t *testing.T) { agentInfo, err := info.NewAgentInfo(context.Background(), false) require.NoError(t, err, "Error creating agent info") - mCfg := &monitoringConfig{ - C: &monitoringcfg.MonitoringConfig{ - Enabled: true, - MonitorMetrics: true, - HTTP: &monitoringcfg.MonitoringHTTPConfig{ - Enabled: false, + testMon := BeatsMonitor{ + enabled: true, + config: &monitoringConfig{ + C: &monitoringcfg.MonitoringConfig{ + Enabled: true, + MonitorMetrics: true, + HTTP: &monitoringcfg.MonitoringHTTPConfig{ + + Enabled: true, + }, }, }, + agentInfo: agentInfo, } policy := map[string]any{ @@ -50,52 +54,207 @@ func TestMonitoringConfigMetricsInterval(t *testing.T) { "default": map[string]any{}, }, } - b := &BeatsMonitor{ - enabled: true, - config: mCfg, - operatingSystem: runtime.GOOS, - agentInfo: agentInfo, + + // manually declaring all the MonitoringConfig() args since there's a lot of them, and this makes + // the test a little more self-describing + + compList := []component.Component{ + { + ID: "endpoint-default", + InputSpec: &component.InputRuntimeSpec{ + Spec: component.InputSpec{ + Command: &component.CommandSpec{ + Name: "endpoint-security", + }, + Service: &component.ServiceSpec{ + CPort: 7688, + }, + }, + }, + }, } - got, err := b.MonitoringConfig(policy, nil, map[string]string{"foobeat": "filebeat"}) // put a componentID/binary mapping to have something in the beats monitoring input - assert.NoError(t, err) - - rawInputs, ok := got["inputs"] - require.True(t, ok, "monitoring config contains no input") - inputs, ok := rawInputs.([]any) - require.True(t, ok, "monitoring inputs are not a list") - marshaledInputs, err := yaml.Marshal(inputs) - if assert.NoError(t, err, "error marshaling monitoring inputs") { - t.Logf("marshaled monitoring inputs:\n%s\n", marshaledInputs) + + compIdToBinary := map[string]string{ + "endpoint-default": "endpoint-security", + "filebeat-default": "filebeat", + } + existingPidStateMap := map[string]uint64{ + "endpoint-default": 1234, } - // loop over the created inputs - for _, i := range inputs { - input, ok := i.(map[string]any) - if assert.Truef(t, ok, "input is not represented as a map: %v", i) { - inputID := input["id"] - t.Logf("input %q", inputID) - // check the streams created for the input, should be a list of objects - if assert.Contains(t, input, "streams", "input %q does not contain any stream", inputID) && - assert.IsTypef(t, []any{}, input["streams"], "streams for input %q are not a list of objects", inputID) { - // loop over streams and cast to map[string]any to access keys - for _, rawStream := range input["streams"].([]any) { - if assert.IsTypef(t, map[string]any{}, rawStream, "stream %v for input %q is not a map", rawStream, inputID) { - stream := rawStream.(map[string]any) - // check period and assert its value - streamID := stream["id"] - if assert.Containsf(t, stream, "period", "stream %q for input %q does not contain a period", streamID, inputID) && - assert.IsType(t, "", stream["period"], "period for stream %q of input %q is not represented as a string", streamID, inputID) { - periodString := stream["period"].(string) - duration, err := time.ParseDuration(periodString) - if assert.NoErrorf(t, err, "Unparseable period duration %s for stream %q of input %q", periodString, streamID, inputID) { - assert.Equalf(t, duration, 60*time.Second, "unexpected duration for stream %q of input %q", streamID, inputID) - } - } + outCfg, err := testMon.MonitoringConfig(policy, compList, compIdToBinary, existingPidStateMap) + require.NoError(t, err) + + inputCfg := outCfg["inputs"].([]interface{}) + + foundConfig := false + + for _, cfg := range inputCfg { + unwrappedCfg := cfg.(map[string]interface{}) + if idName, ok := unwrappedCfg["id"]; ok && idName == "metrics-monitoring-endpoint_security" { + foundConfig = true + for compName, compCfg := range unwrappedCfg { + if compName == "streams" { + streamCfgUnwrapped := compCfg.([]interface{}) + for _, streamCfg := range streamCfgUnwrapped { + streamValues := streamCfg.(map[string]interface{}) + require.Equal(t, []interface{}{"process"}, streamValues["metricsets"]) + require.Equal(t, "metrics-elastic_agent.endpoint_security-default", streamValues["index"]) + require.Equal(t, uint64(1234), streamValues["process.pid"]) } } + } } + } + + require.True(t, foundConfig) +} +func TestMonitoringConfigMetricsInterval(t *testing.T) { + + agentInfo, err := info.NewAgentInfo(context.Background(), false) + require.NoError(t, err, "Error creating agent info") + + tcs := []struct { + name string + monitoringCfg *monitoringConfig + policy map[string]any + expectedInterval time.Duration + }{ + { + name: "default metrics interval", + monitoringCfg: &monitoringConfig{ + C: &monitoringcfg.MonitoringConfig{ + Enabled: true, + MonitorMetrics: true, + HTTP: &monitoringcfg.MonitoringHTTPConfig{ + Enabled: false, + }, + }, + }, + policy: map[string]any{ + "agent": map[string]any{ + "monitoring": map[string]any{ + "metrics": true, + "http": map[string]any{ + "enabled": false, + }, + }, + }, + "outputs": map[string]any{ + "default": map[string]any{}, + }, + }, + expectedInterval: defaultMetricsCollectionInterval, + }, + { + name: "agent config metrics interval", + monitoringCfg: &monitoringConfig{ + C: &monitoringcfg.MonitoringConfig{ + Enabled: true, + MonitorMetrics: true, + HTTP: &monitoringcfg.MonitoringHTTPConfig{ + Enabled: false, + }, + MetricsPeriod: "20s", + }, + }, + policy: map[string]any{ + "agent": map[string]any{ + "monitoring": map[string]any{ + "metrics": true, + "http": map[string]any{ + "enabled": false, + }, + }, + }, + "outputs": map[string]any{ + "default": map[string]any{}, + }, + }, + expectedInterval: 20 * time.Second, + }, + { + name: "policy metrics interval", + monitoringCfg: &monitoringConfig{ + C: &monitoringcfg.MonitoringConfig{ + Enabled: true, + MonitorMetrics: true, + HTTP: &monitoringcfg.MonitoringHTTPConfig{ + Enabled: false, + }, + MetricsPeriod: "20s", + }, + }, + policy: map[string]any{ + "agent": map[string]any{ + "monitoring": map[string]any{ + "metrics": true, + "http": map[string]any{ + "enabled": false, + }, + "metrics_period": "10s", + }, + }, + "outputs": map[string]any{ + "default": map[string]any{}, + }, + }, + expectedInterval: 10 * time.Second, + }, + } + + for _, tc := range tcs { + + t.Run(tc.name, func(t *testing.T) { + b := &BeatsMonitor{ + enabled: true, + config: tc.monitoringCfg, + operatingSystem: runtime.GOOS, + agentInfo: agentInfo, + } + got, err := b.MonitoringConfig(tc.policy, nil, map[string]string{"foobeat": "filebeat"}, map[string]uint64{}) // put a componentID/binary mapping to have something in the beats monitoring input + assert.NoError(t, err) + + rawInputs, ok := got["inputs"] + require.True(t, ok, "monitoring config contains no input") + inputs, ok := rawInputs.([]any) + require.True(t, ok, "monitoring inputs are not a list") + marshaledInputs, err := yaml.Marshal(inputs) + if assert.NoError(t, err, "error marshaling monitoring inputs") { + t.Logf("marshaled monitoring inputs:\n%s\n", marshaledInputs) + } + + // loop over the created inputs + for _, i := range inputs { + input, ok := i.(map[string]any) + if assert.Truef(t, ok, "input is not represented as a map: %v", i) { + inputID := input["id"] + t.Logf("input %q", inputID) + // check the streams created for the input, should be a list of objects + if assert.Contains(t, input, "streams", "input %q does not contain any stream", inputID) && + assert.IsTypef(t, []any{}, input["streams"], "streams for input %q are not a list of objects", inputID) { + // loop over streams and cast to map[string]any to access keys + for _, rawStream := range input["streams"].([]any) { + if assert.IsTypef(t, map[string]any{}, rawStream, "stream %v for input %q is not a map", rawStream, inputID) { + stream := rawStream.(map[string]any) + // check period and assert its value + streamID := stream["id"] + if assert.Containsf(t, stream, "period", "stream %q for input %q does not contain a period", streamID, inputID) && + assert.IsType(t, "", stream["period"], "period for stream %q of input %q is not represented as a string", streamID, inputID) { + periodString := stream["period"].(string) + duration, err := time.ParseDuration(periodString) + if assert.NoErrorf(t, err, "Unparseable period duration %s for stream %q of input %q", periodString, streamID, inputID) { + assert.Equalf(t, duration, tc.expectedInterval, "unexpected duration for stream %q of input %q", streamID, inputID) + } + } + } + } + } + } + } + }) } } @@ -146,7 +305,7 @@ func TestMonitoringConfigComponentFields(t *testing.T) { }, }, } - monitoringConfig, err := b.MonitoringConfig(policy, components, map[string]string{"filestream-default": "filebeat"}) + monitoringConfig, err := b.MonitoringConfig(policy, components, map[string]string{"filestream-default": "filebeat"}, map[string]uint64{}) if err != nil { t.Fatalf("cannot render monitoring configuration: %s", err) } @@ -165,16 +324,16 @@ func TestMonitoringConfigComponentFields(t *testing.T) { if _, exists := processor["add_fields"]; !exists { continue } - p := Processor{} - if err := json.Unmarshal([]byte(mapstr.M(processor).String()), &p); err != nil { + streamProc := Processor{} + if err := json.Unmarshal([]byte(mapstr.M(processor).String()), &streamProc); err != nil { t.Errorf("could not decode processor config: %q, err: %s", "foo", err) } - if p.AddFields.Target != "component" { + if streamProc.AddFields.Target != "component" { continue } - binary := p.AddFields.Fields.Binary - componentID := p.AddFields.Fields.ID + binary := streamProc.AddFields.Fields.Binary + componentID := streamProc.AddFields.Fields.ID // The elastic-Agent is a special case, handle it first if strings.Contains(streamID, "monitoring-agent") { @@ -186,11 +345,20 @@ func TestMonitoringConfigComponentFields(t *testing.T) { } continue } - if binary != "filebeat" { - t.Errorf("expecting fields['binary'] = 'filebeat', got %q", binary) - } - if componentID != "filestream-default" { - t.Errorf("expecting fields['id'] = 'filestream-default', got %q", componentID) + if !strings.Contains(componentID, "monitoring") { + if binary != "filebeat" { + t.Errorf("expecting fields['binary'] = 'filebeat', got %q", binary) + } + if componentID != "filestream-default" { + t.Errorf("expecting fields['id'] = 'filestream-default', got %q", componentID) + } + } else { + if binary != "filebeat" && binary != "metricbeat" { + t.Errorf("expected monitoring compoent to be metricbeat or filebeat, got %s", binary) + } + if componentID != monitoringFilesUnitsID && componentID != "beat/metrics-monitoring" && componentID != "http/metrics-monitoring" { + t.Errorf("got unxpected monitoring component ID: %s", componentID) + } } } diff --git a/internal/pkg/agent/application/paths/common.go b/internal/pkg/agent/application/paths/common.go index 871435e65a1..8d5ac704323 100644 --- a/internal/pkg/agent/application/paths/common.go +++ b/internal/pkg/agent/application/paths/common.go @@ -119,10 +119,15 @@ func TempDir() string { // Home returns a directory where binary lives func Home() string { + return HomeFrom(topPath) +} + +func HomeFrom(topDirPath string) string { if unversionedHome { - return topPath + return topDirPath } - return VersionedHome(topPath) + + return VersionedHome(topDirPath) } // IsVersionHome returns true if the Home path is versioned based on build. @@ -316,11 +321,6 @@ func BinaryPath(baseDir, agentName string) string { return filepath.Join(binaryDir(baseDir), agentName) } -// InstallPath returns the top level directory Agent will be installed into. -func InstallPath(basePath string) string { - return filepath.Join(basePath, "Elastic", "Agent") -} - // TopBinaryPath returns the path to the Elastic Agent binary that is inside the Top directory. // // This always points to the symlink that points to the latest Elastic Agent version. diff --git a/internal/pkg/agent/application/paths/common_namespace.go b/internal/pkg/agent/application/paths/common_namespace.go new file mode 100644 index 00000000000..8b2651a30be --- /dev/null +++ b/internal/pkg/agent/application/paths/common_namespace.go @@ -0,0 +1,130 @@ +// 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. + +// This file encapsulates the common paths that need to account for installation namepsaces. +// Installation namespaces allow multiple agents on the same machine. +package paths + +import ( + "fmt" + "path/filepath" + "strings" +) + +const ( + // installDirNamespaceFmt is the format of the directory agent will be installed to within the base path when using an installation namepsace. + // It is $BasePath/Agent-$namespace. + installDir = "Agent" + installDirNamespaceSep = "-" + installDirNamespacePrefix = installDir + installDirNamespaceSep + installDirNamespaceFmt = installDirNamespacePrefix + "%s" + + // DevelopmentNamespace defines the "well known" development namespace. + DevelopmentNamespace = "Development" + + // Service display names. Must be different from the ServiceName() on Windows. + serviceDisplayName = "Elastic Agent" + serviceDisplayNameNamespaceFmt = "Elastic Agent - %s" +) + +// installNamespace is the name of the agent's current installation namepsace. +var installNamespace string + +// SetInstallNamespace sets whether the agent is currently in or is being installed in an installation namespace. +// Removes leading and trailing whitespace +func SetInstallNamespace(namespace string) { + installNamespace = strings.TrimSpace(namespace) +} + +// InstallNamespace returns the name of the current installation namespace. Returns the empty string +// for the default namespace. For installed agents, the namespace is parsed from the installation +// directory name, since a unique directory name is required to avoid collisions between installed +// agents in the same base path. Before installation, the installation namespace must be configured +// using SetInstallNamespace(). +func InstallNamespace() string { + if installNamespace != "" { + return installNamespace + } + + if RunningInstalled() { + // Parse the namespace from the directory once to ensure deterministic behavior from startup. + namespace := parseNamespaceFromDir(filepath.Base(Top())) + installNamespace = namespace + } + + return "" +} + +func parseNamespaceFromDir(dir string) string { + parts := strings.SplitAfterN(dir, "-", 2) + if len(parts) <= 1 { + return "" + } else if parts[0] != installDirNamespacePrefix { + return "" + } + + return parts[1] +} + +// InInstallNamespace returns true if the agent is being installed in an installation namespace. +func InInstallNamespace() bool { + return InstallNamespace() != "" +} + +// InstallDirNameForNamespace returns the installation directory name for a given namespace. +// The installation directory name with a namespace is $BasePath/InstallDirNameForNamespace(). +func InstallDirNameForNamespace(namespace string) string { + if namespace == "" { + return installDir + } + + return fmt.Sprintf(installDirNamespaceFmt, namespace) +} + +// InstallPath returns the top level directory Agent will be installed into, accounting for any namespace. +func InstallPath(basePath string) string { + namespace := InstallNamespace() + return filepath.Join(basePath, "Elastic", InstallDirNameForNamespace(namespace)) +} + +// ServiceName returns the service name accounting for any namespace. +func ServiceName() string { + namespace := InstallNamespace() + if namespace == "" { + return serviceName + } + + return fmt.Sprintf(serviceNameNamespaceFmt, namespace) +} + +// ServiceDisplayName returns the service display name accounting for any namespace. +func ServiceDisplayName() string { + namespace := InstallNamespace() + if namespace == "" { + return serviceDisplayName + } + + return fmt.Sprintf(serviceDisplayNameNamespaceFmt, namespace) +} + +// ShellWrapperPath returns the shell wrapper path accounting for any namespace. +// The provided namespace is always lowercased for consistency. +func ShellWrapperPath() string { + namespace := InstallNamespace() + if namespace == "" { + return shellWrapperPath + } + + return ShellWrapperPathForNamespace(namespace) +} + +// ControlSocketRunSymlink returns the shell wrapper path accounting for any namespace. +// Does not auto detect the namespace because it is used outside of agent itself in the testing framework. +func ControlSocketRunSymlink(namespace string) string { + if namespace == "" { + return controlSocketRunSymlink + } + + return controlSocketRunSymlinkForNamespace(namespace) +} diff --git a/internal/pkg/agent/application/paths/common_namespace_test.go b/internal/pkg/agent/application/paths/common_namespace_test.go new file mode 100644 index 00000000000..6be3ffa72b8 --- /dev/null +++ b/internal/pkg/agent/application/paths/common_namespace_test.go @@ -0,0 +1,76 @@ +// 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 paths + +import ( + "fmt" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestInstallNamespace(t *testing.T) { + namespace := "testing" + basePath := filepath.Join("base", "path") + + // Add whitespace to ensure it gets removed. + SetInstallNamespace(" " + namespace + "\t ") + + assert.Equal(t, namespace, InstallNamespace()) + assert.True(t, InInstallNamespace()) + assert.Equal(t, filepath.Join(basePath, "Elastic", fmt.Sprintf(installDirNamespaceFmt, namespace)), InstallPath(basePath)) + assert.Equal(t, fmt.Sprintf(serviceNameNamespaceFmt, namespace), ServiceName()) + assert.Equal(t, fmt.Sprintf(serviceDisplayNameNamespaceFmt, namespace), ServiceDisplayName()) + assert.Equal(t, ShellWrapperPathForNamespace(namespace), ShellWrapperPath()) + assert.Equal(t, controlSocketRunSymlinkForNamespace(namespace), ControlSocketRunSymlink(namespace)) +} + +func TestInstallNoNamespace(t *testing.T) { + namespace := "" + basePath := filepath.Join("base", "path") + SetInstallNamespace(namespace) + + assert.Equal(t, namespace, InstallNamespace()) + assert.False(t, InInstallNamespace()) + assert.Equal(t, filepath.Join(basePath, "Elastic", installDir), InstallPath(basePath)) + assert.Equal(t, serviceName, ServiceName()) + assert.Equal(t, serviceDisplayName, ServiceDisplayName()) + assert.Equal(t, shellWrapperPath, ShellWrapperPath()) + assert.Equal(t, controlSocketRunSymlink, ControlSocketRunSymlink(namespace)) +} + +func TestParseNamespaceFromDirName(t *testing.T) { + testcases := []struct { + name string + dir string + namespace string + }{ + {name: "empty", dir: "", namespace: ""}, + {name: "none", dir: "Agent", namespace: ""}, + {name: "develop", dir: "Agent-Development", namespace: "Development"}, + {name: "dashes", dir: "Agent-With-Dashes", namespace: "With-Dashes"}, + {name: "special", dir: "Agent-@!$%^&*()-_+=", namespace: "@!$%^&*()-_+="}, + {name: "format", dir: "Agent-%s%d%v%t", namespace: "%s%d%v%t"}, + {name: "spaces", dir: "Agent- Development \t", namespace: " Development \t"}, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + assert.Equalf(t, tc.namespace, parseNamespaceFromDir(tc.dir), "parsing %s", tc.dir) + + // Special case: if the directory is empty the install dir is the default "Agent" not "Agent-" + wantDir := tc.dir + if wantDir == "" { + wantDir = installDir + } + assert.Equal(t, wantDir, InstallDirNameForNamespace(tc.namespace)) + }) + } +} + +func TestParseNamespaceFromDirNameWithoutAgentPrefix(t *testing.T) { + assert.Equal(t, "", parseNamespaceFromDir("Beats-Development")) +} diff --git a/internal/pkg/agent/application/paths/paths_darwin.go b/internal/pkg/agent/application/paths/paths_darwin.go index 6630176660e..44ed4ba3fa1 100644 --- a/internal/pkg/agent/application/paths/paths_darwin.go +++ b/internal/pkg/agent/application/paths/paths_darwin.go @@ -14,19 +14,22 @@ const ( // for installing Elastic Agent's files. DefaultBasePath = "/Library" - // ControlSocketRunSymlink is the path to the symlink that should be + // controlSocketRunSymlink is the path to the symlink that should be // created to the control socket when Elastic Agent is running with root. - ControlSocketRunSymlink = "/var/run/elastic-agent.sock" + controlSocketRunSymlink = "/var/run/elastic-agent.sock" + controlSocketRunSymlinkNamespaceFmt = "/var/run/elastic-agent-%s.sock" - // ServiceName is the service name when installed. - ServiceName = "co.elastic.elastic-agent" + // serviceName is the service name when installed. + serviceName = "co.elastic.elastic-agent" + serviceNameNamespaceFmt = "co.elastic.elastic-agent-%s" - // ShellWrapperPath is the path to the installed shell wrapper. - ShellWrapperPath = "/usr/local/bin/elastic-agent" + // shellWrapperPath is the path to the installed shell wrapper. + shellWrapperPath = "/usr/local/bin/elastic-agent" + shellWrapperPathNamespaceFmt = "/usr/local/bin/elastic-%s-agent" // ShellWrapper is the wrapper that is installed. The %s must // be substituted with the appropriate top path. - ShellWrapper = `#!/bin/sh + ShellWrapperFmt = `#!/bin/sh exec %s/elastic-agent $@ ` ) diff --git a/internal/pkg/agent/application/paths/paths_linux.go b/internal/pkg/agent/application/paths/paths_linux.go index f5450142752..5f46602f833 100644 --- a/internal/pkg/agent/application/paths/paths_linux.go +++ b/internal/pkg/agent/application/paths/paths_linux.go @@ -14,21 +14,24 @@ const ( // for installing Elastic Agent's files. DefaultBasePath = "/opt" - // ServiceName is the service name when installed. - ServiceName = "elastic-agent" + // serviceName is the service name when installed. + serviceName = "elastic-agent" + serviceNameNamespaceFmt = "elastic-agent-%s" - // ShellWrapperPath is the path to the installed shell wrapper. - ShellWrapperPath = "/usr/bin/elastic-agent" + // shellWrapperPath is the path to the installed shell wrapper. + shellWrapperPath = "/usr/bin/elastic-agent" + shellWrapperPathNamespaceFmt = "/usr/bin/elastic-%s-agent" // ShellWrapper is the wrapper that is installed. The %s must // be substituted with the appropriate top path. - ShellWrapper = `#!/bin/sh + ShellWrapperFmt = `#!/bin/sh exec %s/elastic-agent $@ ` - // ControlSocketRunSymlink is the path to the symlink that should be + // controlSocketRunSymlink is the path to the symlink that should be // created to the control socket when Elastic Agent is running with root. - ControlSocketRunSymlink = "/run/elastic-agent.sock" + controlSocketRunSymlink = "/run/elastic-agent.sock" + controlSocketRunSymlinkNamespaceFmt = "/run/elastic-agent-%s.sock" ) // ArePathsEqual determines whether paths are equal taking case sensitivity of os into account. diff --git a/internal/pkg/agent/application/paths/paths_unix.go b/internal/pkg/agent/application/paths/paths_unix.go index 99d8cbe1ad5..164b7575b42 100644 --- a/internal/pkg/agent/application/paths/paths_unix.go +++ b/internal/pkg/agent/application/paths/paths_unix.go @@ -7,10 +7,27 @@ package paths import ( + "fmt" "path/filepath" "runtime" + "strings" ) +const () + +// shellWrapperPathForNamespace is a helper to work around not being able to use fmt.Sprintf +// unconditionally since shellWrapperPathNamespaceFmt is empty on Windows. The provided namespace is +// always lowercased for consistency. +func ShellWrapperPathForNamespace(namespace string) string { + return fmt.Sprintf(shellWrapperPathNamespaceFmt, strings.ToLower(namespace)) +} + +// controlSocketRunSymlinkForNamespace is a helper to work around not being able to use fmt.Sprintf +// unconditionally since controlSocketRunSymlinkNamespaceFmt is empty on Windows. +func controlSocketRunSymlinkForNamespace(namespace string) string { + return fmt.Sprintf(controlSocketRunSymlinkNamespaceFmt, namespace) +} + func initialControlSocketPath(topPath string) string { return ControlSocketFromPath(runtime.GOOS, topPath) } diff --git a/internal/pkg/agent/application/paths/paths_windows.go b/internal/pkg/agent/application/paths/paths_windows.go index 5c8f7008d6d..4734a34dd9f 100644 --- a/internal/pkg/agent/application/paths/paths_windows.go +++ b/internal/pkg/agent/application/paths/paths_windows.go @@ -20,19 +20,32 @@ const ( // for installing Elastic Agent's files. DefaultBasePath = `C:\Program Files` - // ControlSocketRunSymlink is not created on Windows. - ControlSocketRunSymlink = "" + // controlSocketRunSymlink is not created on Windows. + controlSocketRunSymlink = "" - // ServiceName is the service name when installed. - ServiceName = "Elastic Agent" + // serviceName is the service name when installed. + serviceName = "Elastic Agent" + serviceNameNamespaceFmt = "Elastic Agent - %s" - // ShellWrapperPath is the path to the installed shell wrapper. - ShellWrapperPath = "" // no wrapper on Windows + // shellWrapperPath is the path to the installed shell wrapper. + shellWrapperPath = "" // ShellWrapper is the wrapper that is installed. - ShellWrapper = "" // no wrapper on Windows + ShellWrapperFmt = "" // no wrapper on Windows ) +// ShellWrapperPathForNamespace is a helper to work around not being able to use fmt.Sprintf +// unconditionally since shellWrapperPath is empty on Windows. +func ShellWrapperPathForNamespace(namespace string) string { + return "" +} + +// controlSocketRunSymlinkForNamespace is a helper to work around not being able to use fmt.Sprintf +// unconditionally since controlSocketRunSymlink is empty on Windows. +func controlSocketRunSymlinkForNamespace(namespace string) string { + return "" +} + // ArePathsEqual determines whether paths are equal taking case sensitivity of os into account. func ArePathsEqual(expected, actual string) bool { return strings.EqualFold(expected, actual) diff --git a/internal/pkg/agent/application/reexec/reexec_windows.go b/internal/pkg/agent/application/reexec/reexec_windows.go index f62ad382691..530ab4dcdf4 100644 --- a/internal/pkg/agent/application/reexec/reexec_windows.go +++ b/internal/pkg/agent/application/reexec/reexec_windows.go @@ -12,10 +12,12 @@ import ( "os/exec" "path/filepath" "strconv" + "syscall" - "golang.org/x/sys/windows/svc" - "golang.org/x/sys/windows/svc/mgr" + "golang.org/x/sys/windows" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/info" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/pkg/core/logger" ) @@ -29,25 +31,35 @@ import ( // // * Sub-process - As a sub-process a new child is spawned and the current process just exits. func reexec(log *logger.Logger, executable string, argOverrides ...string) error { - svc, status, err := getService() - if err == nil { + if info.RunningUnderSupervisor() { // running as a service; spawn re-exec windows sub-process - log.Infof("Running as Windows service %s; triggering service restart", svc.Name) - args := []string{filepath.Base(executable), "reexec_windows", svc.Name, strconv.Itoa(int(status.ProcessId))} + log.Infof("Running as Windows service; triggering service restart") + + // use the same token of this process to perform the rexec_windows command + // otherwise the spawned process will not be able to connect to the service control manager + var t windows.Token + err := windows.OpenProcessToken(windows.CurrentProcess(), windows.TOKEN_QUERY, &t) + if err != nil { + return fmt.Errorf("failed to open current process token: %w", err) + } + defer func() { + _ = t.Close() + }() + + args := []string{filepath.Base(executable), "reexec_windows", paths.ServiceName(), strconv.Itoa(os.Getpid())} args = append(args, argOverrides...) cmd := exec.Cmd{ - Path: executable, - Args: args, - Stdin: os.Stdin, - Stdout: os.Stdout, - Stderr: os.Stderr, + Path: executable, + Args: args, + Stdin: os.Stdin, + Stdout: os.Stdout, + Stderr: os.Stderr, + SysProcAttr: &syscall.SysProcAttr{Token: syscall.Token(t)}, } if err := cmd.Start(); err != nil { return err } } else { - log.Debugf("Discovering Windows service result: %s", err) - // running as a sub-process of another process; just execute as a child log.Infof("Running as Windows process; spawning new child process") args := []string{filepath.Base(executable)} @@ -68,30 +80,3 @@ func reexec(log *logger.Logger, executable string, argOverrides ...string) error _ = log.Sync() return nil } - -func getService() (*mgr.Service, svc.Status, error) { - pid := uint32(os.Getpid()) - manager, err := mgr.Connect() - if err != nil { - return nil, svc.Status{}, err - } - names, err := manager.ListServices() - if err != nil { - return nil, svc.Status{}, err - } - for _, name := range names { - service, err := manager.OpenService(name) - if err != nil { - continue - } - status, err := service.Query() - if err != nil { - continue - } - if status.ProcessId == pid { - // pid match; found ourself - return service, status, nil - } - } - return nil, svc.Status{}, fmt.Errorf("failed to find service") -} diff --git a/internal/pkg/agent/application/upgrade/artifact/config_test.go b/internal/pkg/agent/application/upgrade/artifact/config_test.go index e2cb20dd67d..736c9a02d55 100644 --- a/internal/pkg/agent/application/upgrade/artifact/config_test.go +++ b/internal/pkg/agent/application/upgrade/artifact/config_test.go @@ -6,12 +6,12 @@ package artifact import ( "reflect" + "slices" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/exp/slices" agentlibsconfig "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/transport/httpcommon" diff --git a/internal/pkg/agent/application/upgrade/artifact/download/composed/verifier.go b/internal/pkg/agent/application/upgrade/artifact/download/composed/verifier.go index bfb305c8cf0..b9240cce638 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/composed/verifier.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/composed/verifier.go @@ -49,9 +49,8 @@ func (v *Verifier) Verify(a artifact.Artifact, version agtversion.ParsedSemVer, return nil } + v.log.Debugw("Verifier failed!", "verifier", verifier.Name(), "error", e) err = multierror.Append(err, e) - - v.log.Warnw("Verifier failed!", "verifier", verifier.Name(), "error", e) } return err diff --git a/internal/pkg/agent/application/upgrade/artifact/download/http/common_test.go b/internal/pkg/agent/application/upgrade/artifact/download/http/common_test.go index 9094723eedb..3ec8603f047 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/http/common_test.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/http/common_test.go @@ -24,16 +24,16 @@ import ( ) const ( - sourcePattern = "/downloads/beats/filebeat/" + sourcePattern = "/downloads/beats/agentbeat/" source = "http://artifacts.elastic.co/downloads/" ) var ( version = agtversion.NewParsedSemVer(7, 5, 1, "", "") beatSpec = artifact.Artifact{ - Name: "filebeat", - Cmd: "filebeat", - Artifact: "beats/filebeat", + Name: "agentbeat", + Cmd: "agentbeat", + Artifact: "beats/agentbeat", } ) 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 2faf2159876..c914d9d8b38 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 @@ -121,7 +121,7 @@ func TestDownloadBodyError(t *testing.T) { infoLogs := obs.FilterLevelExact(zapcore.InfoLevel).TakeAll() warnLogs := obs.FilterLevelExact(zapcore.WarnLevel).TakeAll() - expectedURL := fmt.Sprintf("%s/%s-%s-%s", srv.URL, "beats/filebeat/filebeat", version, "linux-x86_64.tar.gz") + expectedURL := fmt.Sprintf("%s/%s-%s-%s", srv.URL, "beats/agentbeat/agentbeat", version, "linux-x86_64.tar.gz") expectedMsg := fmt.Sprintf("download from %s failed at 0B @ NaNBps: unexpected EOF", expectedURL) require.GreaterOrEqual(t, len(infoLogs), 1, "download error not logged at info level") assert.True(t, containsMessage(infoLogs, expectedMsg)) @@ -173,7 +173,7 @@ func TestDownloadLogProgressWithLength(t *testing.T) { os.Remove(artifactPath) require.NoError(t, err, "Download should not have errored") - expectedURL := fmt.Sprintf("%s/%s-%s-%s", srv.URL, "beats/filebeat/filebeat", version, "linux-x86_64.tar.gz") + expectedURL := fmt.Sprintf("%s/%s-%s-%s", srv.URL, "beats/agentbeat/agentbeat", version, "linux-x86_64.tar.gz") expectedProgressRegexp := regexp.MustCompile( `^download progress from ` + expectedURL + `(.sha512)? is \S+/\S+ \(\d+\.\d{2}% complete\) @ \S+$`, ) @@ -256,7 +256,7 @@ func TestDownloadLogProgressWithoutLength(t *testing.T) { os.Remove(artifactPath) require.NoError(t, err, "Download should not have errored") - expectedURL := fmt.Sprintf("%s/%s-%s-%s", srv.URL, "beats/filebeat/filebeat", version, "linux-x86_64.tar.gz") + expectedURL := fmt.Sprintf("%s/%s-%s-%s", srv.URL, "beats/agentbeat/agentbeat", version, "linux-x86_64.tar.gz") expectedProgressRegexp := regexp.MustCompile( `^download progress from ` + expectedURL + `(.sha512)? has fetched \S+ @ \S+$`, ) diff --git a/internal/pkg/agent/application/upgrade/artifact/download/http/progress_reporter.go b/internal/pkg/agent/application/upgrade/artifact/download/http/progress_reporter.go index 491646b3ab5..c94292c0752 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/http/progress_reporter.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/http/progress_reporter.go @@ -6,9 +6,8 @@ package http import ( "context" + "sync/atomic" "time" - - "github.com/elastic/elastic-agent-libs/atomic" ) type downloadProgressReporter struct { @@ -17,7 +16,7 @@ type downloadProgressReporter struct { warnTimeout time.Duration length float64 - downloaded atomic.Int + downloaded atomic.Int64 started time.Time progressObservers []progressObserver @@ -42,7 +41,7 @@ func newDownloadProgressReporter(sourceURI string, timeout time.Duration, length func (dp *downloadProgressReporter) Write(b []byte) (int, error) { n := len(b) - dp.downloaded.Add(n) + dp.downloaded.Add(int64(n)) return n, nil } diff --git a/internal/pkg/agent/application/upgrade/artifact/download/http/verifier_test.go b/internal/pkg/agent/application/upgrade/artifact/download/http/verifier_test.go index 7e2b888debc..663147ba0a3 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/http/verifier_test.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/http/verifier_test.go @@ -59,7 +59,9 @@ func TestVerify(t *testing.T) { u.Host = serverURL.Host }), proxytest.WithRequestLog("proxy", func(_ string, _ ...any) {})) - + err = proxy.Start() + require.NoError(t, err, "error starting proxytest") + defer proxy.Close() proxyURL, err := url.Parse(proxy.LocalhostURL) require.NoError(t, err, "could not parse server URL \"%s\"", server.URL) diff --git a/internal/pkg/agent/application/upgrade/artifact/download/snapshot/downloader.go b/internal/pkg/agent/application/upgrade/artifact/download/snapshot/downloader.go index 5c417531304..34d38bb5749 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/snapshot/downloader.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/snapshot/downloader.go @@ -124,60 +124,50 @@ func snapshotURI(ctx context.Context, client *gohttp.Client, versionOverride *ag version = versionOverride.CoreVersion() } - artifactsURI := fmt.Sprintf("https://artifacts-api.elastic.co/v1/search/%s-SNAPSHOT/elastic-agent", version) - request, err := gohttp.NewRequestWithContext(ctx, gohttp.MethodGet, artifactsURI, nil) + // otherwise, if we don't know the exact build and we're trying to find the latest snapshot build + buildID, err := findLatestSnapshot(ctx, client, version) if err != nil { - return "", fmt.Errorf("creating request to artifact api: %w", err) + return "", fmt.Errorf("failed to find snapshot information for version %q: %w", version, err) } - resp, err := client.Do(request) + return fmt.Sprintf(snapshotURIFormat, version, buildID), nil +} + +func findLatestSnapshot(ctx context.Context, client *gohttp.Client, version string) (buildID string, err error) { + latestSnapshotURI := fmt.Sprintf("https://snapshots.elastic.co/latest/%s-SNAPSHOT.json", version) + request, err := gohttp.NewRequestWithContext(ctx, gohttp.MethodGet, latestSnapshotURI, nil) if err != nil { - return "", err + return "", fmt.Errorf("failed to create request to the snapshot API: %w", err) } - defer resp.Body.Close() - - body := struct { - Packages map[string]interface{} `json:"packages"` - }{} - dec := json.NewDecoder(resp.Body) - if err := dec.Decode(&body); err != nil { + resp, err := client.Do(request) + if err != nil { return "", err } + defer resp.Body.Close() - if len(body.Packages) == 0 { - return "", fmt.Errorf("no packages found in snapshot repo") - } + switch resp.StatusCode { + case gohttp.StatusNotFound: + return "", fmt.Errorf("snapshot for version %q not found", version) - for k, pkg := range body.Packages { - pkgMap, ok := pkg.(map[string]interface{}) - if !ok { - return "", fmt.Errorf("content of '%s' is not a map", k) + case gohttp.StatusOK: + var info struct { + BuildID string `json:"build_id"` } - uriVal, found := pkgMap["url"] - if !found { - return "", fmt.Errorf("item '%s' does not contain url", k) + dec := json.NewDecoder(resp.Body) + if err := dec.Decode(&info); err != nil { + return "", err } - uri, ok := uriVal.(string) - if !ok { - return "", fmt.Errorf("uri is not a string") + parts := strings.Split(info.BuildID, "-") + if len(parts) != 2 { + return "", fmt.Errorf("wrong format for a build ID: %s", info.BuildID) } - // Because we're iterating over a map from the API response, - // the order is random and some elements there do not contain the - // `/beats/elastic-agent/` substring, so we need to go through the - // whole map before returning an error. - // - // One of the elements that might be there and do not contain this - // substring is the `elastic-agent-shipper`, whose URL is something like: - // https://snapshots.elastic.co/8.7.0-d050210c/downloads/elastic-agent-shipper/elastic-agent-shipper-8.7.0-SNAPSHOT-linux-x86_64.tar.gz - index := strings.Index(uri, "/beats/elastic-agent/") - if index != -1 { - return uri[:index], nil - } - } + return parts[1], nil - return "", fmt.Errorf("uri not detected") + default: + return "", fmt.Errorf("unexpected status code %d from %s", resp.StatusCode, latestSnapshotURI) + } } diff --git a/internal/pkg/agent/application/upgrade/artifact/download/snapshot/downloader_test.go b/internal/pkg/agent/application/upgrade/artifact/download/snapshot/downloader_test.go index d7dc8d433e1..7260b11f351 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/snapshot/downloader_test.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/snapshot/downloader_test.go @@ -12,6 +12,7 @@ import ( "net" "net/http" "net/http/httptest" + "os" "path/filepath" "testing" @@ -37,91 +38,30 @@ func TestNonDefaultSourceURI(t *testing.T) { } -const artifactAPIElasticAgentSearchResponse = ` -{ - "packages": { - "elastic-agent-1.2.3-SNAPSHOT-darwin-aarch64.tar.gz": { - "url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-darwin-aarch64.tar.gz", - "sha_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-darwin-aarch64.tar.gz.sha512", - "asc_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-darwin-aarch64.tar.gz.asc", - "type": "tar", - "architecture": "aarch64", - "os": [ - "darwin" - ] - }, - "elastic-agent-1.2.3-SNAPSHOT-windows-x86_64.zip": { - "url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-windows-x86_64.zip", - "sha_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-windows-x86_64.zip.sha512", - "asc_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-windows-x86_64.zip.asc", - "type": "zip", - "architecture": "x86_64", - "os": [ - "windows" - ] - }, - "elastic-agent-core-1.2.3-SNAPSHOT-linux-arm64.tar.gz": { - "url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/elastic-agent-core/elastic-agent-core-1.2.3-SNAPSHOT-linux-arm64.tar.gz", - "sha_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/elastic-agent-core/elastic-agent-core-1.2.3-SNAPSHOT-linux-arm64.tar.gz.sha512", - "asc_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/elastic-agent-core/elastic-agent-core-1.2.3-SNAPSHOT-linux-arm64.tar.gz.asc", - "type": "tar", - "architecture": "arm64", - "os": [ - "linux" - ] - }, - "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz": { - "url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz", - "sha_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz.sha512", - "asc_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz.asc", - "type": "tar", - "architecture": "x86_64", - "os": [ - "linux" - ] - }, - "elastic-agent-1.2.3-SNAPSHOT-linux-arm64.tar.gz": { - "url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-arm64.tar.gz", - "sha_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-arm64.tar.gz.sha512", - "asc_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-arm64.tar.gz.asc", - "type": "tar", - "architecture": "arm64", - "os": [ - "linux" - ] - }, - "elastic-agent-1.2.3-SNAPSHOT-darwin-x86_64.tar.gz": { - "url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-darwin-x86_64.tar.gz", - "sha_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-darwin-x86_64.tar.gz.sha512", - "asc_url": "https://snapshots.elastic.co/1.2.3-33e8d7e1/downloads/beats/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-darwin-x86_64.tar.gz.asc", - "type": "tar", - "architecture": "x86_64", - "os": [ - "darwin" - ] - } - }, - "manifests": { - "last-update-time": "Tue, 05 Dec 2023 15:47:06 UTC", - "seconds-since-last-update": 201 - } -} -` - var agentSpec = artifact.Artifact{ Name: "Elastic Agent", Cmd: "elastic-agent", Artifact: "beat/elastic-agent", } -type downloadHttpResponse struct { - statusCode int - headers http.Header - Body []byte +func readFile(t *testing.T, name string) []byte { + bytes, err := os.ReadFile(name) + require.NoError(t, err) + + return bytes } func TestDownloadVersion(t *testing.T) { - + files := map[string][]byte{ + // links for the latest snapshot + "/latest/8.14.0-SNAPSHOT.json": readFile(t, "./testdata/latest-snapshot.json"), + "/8.14.0-6d69ee76/downloads/beat/elastic-agent/elastic-agent-8.14.0-SNAPSHOT-linux-x86_64.tar.gz": {}, + "/8.14.0-6d69ee76/downloads/beat/elastic-agent/elastic-agent-8.14.0-SNAPSHOT-linux-x86_64.tar.gz.sha512": {}, + + // links for a specific build + "/8.13.3-76ce1a63/downloads/beat/elastic-agent/elastic-agent-8.13.3-SNAPSHOT-linux-x86_64.tar.gz": {}, + "/8.13.3-76ce1a63/downloads/beat/elastic-agent/elastic-agent-8.13.3-SNAPSHOT-linux-x86_64.tar.gz.sha512": {}, + } type fields struct { config *artifact.Config } @@ -131,7 +71,6 @@ func TestDownloadVersion(t *testing.T) { } tests := []struct { name string - files map[string]downloadHttpResponse fields fields args args want string @@ -139,51 +78,26 @@ func TestDownloadVersion(t *testing.T) { }{ { name: "happy path snapshot version", - files: map[string]downloadHttpResponse{ - "/1.2.3-33e8d7e1/downloads/beat/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz": { - statusCode: http.StatusOK, - Body: []byte("This is a fake linux elastic agent archive"), - }, - "/1.2.3-33e8d7e1/downloads/beat/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz.sha512": { - statusCode: http.StatusOK, - Body: []byte("somesha512 elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz"), - }, - "/v1/search/1.2.3-SNAPSHOT/elastic-agent": { - statusCode: http.StatusOK, - headers: map[string][]string{"Content-Type": {"application/json"}}, - Body: []byte(artifactAPIElasticAgentSearchResponse), - }, - }, fields: fields{ config: &artifact.Config{ OperatingSystem: "linux", Architecture: "64", }, }, - args: args{a: agentSpec, version: agtversion.NewParsedSemVer(1, 2, 3, "SNAPSHOT", "")}, - want: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz", + args: args{a: agentSpec, version: agtversion.NewParsedSemVer(8, 14, 0, "SNAPSHOT", "")}, + want: "elastic-agent-8.14.0-SNAPSHOT-linux-x86_64.tar.gz", wantErr: assert.NoError, }, { name: "happy path snapshot version with build metadata", - files: map[string]downloadHttpResponse{ - "/1.2.3-buildid/downloads/beat/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz": { - statusCode: http.StatusOK, - Body: []byte("This is a fake linux elastic agent archive"), - }, - "/1.2.3-buildid/downloads/beat/elastic-agent/elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz.sha512": { - statusCode: http.StatusOK, - Body: []byte("somesha512 elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz"), - }, - }, fields: fields{ config: &artifact.Config{ OperatingSystem: "linux", Architecture: "64", }, }, - args: args{a: agentSpec, version: agtversion.NewParsedSemVer(1, 2, 3, "SNAPSHOT", "buildid")}, - want: "elastic-agent-1.2.3-SNAPSHOT-linux-x86_64.tar.gz", + args: args{a: agentSpec, version: agtversion.NewParsedSemVer(8, 13, 3, "SNAPSHOT", "76ce1a63")}, + want: "elastic-agent-8.13.3-SNAPSHOT-linux-x86_64.tar.gz", wantErr: assert.NoError, }, } @@ -195,21 +109,15 @@ func TestDownloadVersion(t *testing.T) { handleDownload := func(rw http.ResponseWriter, req *http.Request) { path := req.URL.Path + t.Logf("incoming request for %s", path) - resp, ok := tt.files[path] + file, ok := files[path] if !ok { rw.WriteHeader(http.StatusNotFound) return } - for k, values := range resp.headers { - for _, v := range values { - rw.Header().Set(k, v) - } - } - - rw.WriteHeader(resp.statusCode) - _, err := io.Copy(rw, bytes.NewReader(resp.Body)) + _, err := io.Copy(rw, bytes.NewReader(file)) assert.NoError(t, err, "error writing out response body") } server := httptest.NewTLSServer(http.HandlerFunc(handleDownload)) diff --git a/internal/pkg/agent/application/upgrade/artifact/download/snapshot/testdata/latest-snapshot.json b/internal/pkg/agent/application/upgrade/artifact/download/snapshot/testdata/latest-snapshot.json new file mode 100644 index 00000000000..24ca34758e8 --- /dev/null +++ b/internal/pkg/agent/application/upgrade/artifact/download/snapshot/testdata/latest-snapshot.json @@ -0,0 +1,6 @@ +{ + "version": "8.14.0-SNAPSHOT", + "build_id": "8.14.0-6d69ee76", + "manifest_url": "https://snapshots.elastic.co/8.14.0-6d69ee76/manifest-8.14.0-SNAPSHOT.json", + "summary_url": "https://snapshots.elastic.co/8.14.0-6d69ee76/summary-8.14.0-SNAPSHOT.html" +} diff --git a/internal/pkg/agent/application/upgrade/artifact/download/verifier.go b/internal/pkg/agent/application/upgrade/artifact/download/verifier.go index 3b63e5295f9..5790af49db2 100644 --- a/internal/pkg/agent/application/upgrade/artifact/download/verifier.go +++ b/internal/pkg/agent/application/upgrade/artifact/download/verifier.go @@ -11,6 +11,7 @@ import ( "crypto/sha512" "encoding/hex" "fmt" + "hash" "io" "net/http" "net/url" @@ -130,8 +131,16 @@ func getHashFileName(filename string) string { // exists and that the checksum in the sidecar file matches the checksum of // the file. It returns an error if validation fails. func VerifySHA512Hash(filename string) error { + hasher := sha512.New() + checksumFileName := getHashFileName(filename) + return VerifyChecksum(hasher, filename, checksumFileName) +} + +// VerifyChecksum checks that the hash contained in checksumFileName correspond to the hash calculated for filename using +// hasher.Sum() +func VerifyChecksum(hasher hash.Hash, filename, checksumFileName string) error { // Read expected checksum. - expectedHash, err := readChecksumFile(getHashFileName(filename), filepath.Base(filename)) + expectedHash, err := readChecksumFile(checksumFileName, filepath.Base(filename)) if err != nil { return fmt.Errorf("could not read checksum file: %w", err) } @@ -143,12 +152,11 @@ func VerifySHA512Hash(filename string) error { } defer f.Close() - hash := sha512.New() - if _, err := io.Copy(hash, f); err != nil { + if _, err := io.Copy(hasher, f); err != nil { return fmt.Errorf("faled to read file to calculate hash") } - computedHash := hex.EncodeToString(hash.Sum(nil)) + computedHash := hex.EncodeToString(hasher.Sum(nil)) if computedHash != expectedHash { return &ChecksumMismatchError{ Expected: expectedHash, diff --git a/internal/pkg/agent/application/upgrade/cleanup_test.go b/internal/pkg/agent/application/upgrade/cleanup_test.go index 1170c26946d..c8314d15fb2 100644 --- a/internal/pkg/agent/application/upgrade/cleanup_test.go +++ b/internal/pkg/agent/application/upgrade/cleanup_test.go @@ -52,7 +52,10 @@ func newErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + eventLoggerCfg := logger.DefaultEventLoggingConfig() + eventLoggerCfg.Level = loggerCfg.Level + + log, err := logger.NewFromConfig("", loggerCfg, eventLoggerCfg, false) require.NoError(t, err) return log } diff --git a/internal/pkg/agent/application/upgrade/rollback.go b/internal/pkg/agent/application/upgrade/rollback.go index 37b2f414717..3fa6895bc67 100644 --- a/internal/pkg/agent/application/upgrade/rollback.go +++ b/internal/pkg/agent/application/upgrade/rollback.go @@ -146,13 +146,6 @@ func InvokeWatcher(log *logger.Logger, agentExecutable string) (*exec.Cmd, error } cmd := invokeCmd(agentExecutable) - defer func() { - if cmd.Process != nil { - log.Infof("releasing watcher %v", cmd.Process.Pid) - _ = cmd.Process.Release() - } - }() - log.Infow("Starting upgrade watcher", "path", cmd.Path, "args", cmd.Args, "env", cmd.Env, "dir", cmd.Dir) if err := cmd.Start(); err != nil { return nil, fmt.Errorf("failed to start Upgrade Watcher: %w", err) @@ -160,9 +153,17 @@ func InvokeWatcher(log *logger.Logger, agentExecutable string) (*exec.Cmd, error upgradeWatcherPID := cmd.Process.Pid agentPID := os.Getpid() + + go func() { + if err := cmd.Wait(); err != nil { + log.Infow("Upgrade Watcher exited with error", "agent.upgrade.watcher.process.pid", "agent.process.pid", agentPID, upgradeWatcherPID, "error.message", err) + } + }() + log.Infow("Upgrade Watcher invoked", "agent.upgrade.watcher.process.pid", upgradeWatcherPID, "agent.process.pid", agentPID) return cmd, nil + } func restartAgent(ctx context.Context, log *logger.Logger, c client.Client) error { diff --git a/internal/pkg/agent/application/upgrade/rollback_test.go b/internal/pkg/agent/application/upgrade/rollback_test.go index 833844cdd1f..5c77caf7953 100644 --- a/internal/pkg/agent/application/upgrade/rollback_test.go +++ b/internal/pkg/agent/application/upgrade/rollback_test.go @@ -17,8 +17,8 @@ import ( "github.com/stretchr/testify/require" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" - "github.com/elastic/elastic-agent/pkg/control/v2/client/mocks" "github.com/elastic/elastic-agent/pkg/core/logger" + mocks "github.com/elastic/elastic-agent/testing/mocks/pkg/control/v2/client" ) type hookFunc func(t *testing.T, topDir string) diff --git a/internal/pkg/agent/application/upgrade/rollback_windows.go b/internal/pkg/agent/application/upgrade/rollback_windows.go index ca715354e3b..3c1c4b400a6 100644 --- a/internal/pkg/agent/application/upgrade/rollback_windows.go +++ b/internal/pkg/agent/application/upgrade/rollback_windows.go @@ -16,7 +16,7 @@ import ( const ( // delay after agent restart is performed to allow agent to tear down all the processes // important mainly for windows, as it prevents removing files which are in use - afterRestartDelay = 15 * time.Second + afterRestartDelay = 20 * time.Second ) func invokeCmd(agentExecutable string) *exec.Cmd { diff --git a/internal/pkg/agent/application/upgrade/service_update_linux.go b/internal/pkg/agent/application/upgrade/service_update_linux.go index 618b632f93a..a09eddf4bdf 100644 --- a/internal/pkg/agent/application/upgrade/service_update_linux.go +++ b/internal/pkg/agent/application/upgrade/service_update_linux.go @@ -23,7 +23,7 @@ import ( func EnsureServiceConfigUpToDate() error { switch service.ChosenSystem().String() { case "linux-systemd": - unitFilePath := "/etc/systemd/system/" + paths.ServiceName + ".service" + unitFilePath := "/etc/systemd/system/" + paths.ServiceName() + ".service" updated, err := ensureSystemdServiceConfigUpToDate(unitFilePath) if err != nil { return err diff --git a/internal/pkg/agent/application/upgrade/service_update_linux_test.go b/internal/pkg/agent/application/upgrade/service_update_linux_test.go index fa7913a5e93..eb2563f71de 100644 --- a/internal/pkg/agent/application/upgrade/service_update_linux_test.go +++ b/internal/pkg/agent/application/upgrade/service_update_linux_test.go @@ -94,7 +94,7 @@ WantedBy=multi-user.target for name, test := range tests { t.Run(name, func(t *testing.T) { - unitFilePath := filepath.Join(t.TempDir(), paths.ServiceName+".service") + unitFilePath := filepath.Join(t.TempDir(), paths.ServiceName()+".service") err := os.WriteFile(unitFilePath, []byte(test.unitFileInitialContents), 0644) require.NoError(t, err) diff --git a/internal/pkg/agent/application/upgrade/step_download_test.go b/internal/pkg/agent/application/upgrade/step_download_test.go index 5718b082a38..ed2ef1535c3 100644 --- a/internal/pkg/agent/application/upgrade/step_download_test.go +++ b/internal/pkg/agent/application/upgrade/step_download_test.go @@ -6,6 +6,7 @@ package upgrade import ( "context" + "encoding/json" "fmt" "strings" "testing" @@ -230,8 +231,10 @@ func TestDownloadWithRetries(t *testing.T) { // Download timeout expired (before all retries are exhausted) t.Run("download_timeout_expired", func(t *testing.T) { testCaseSettings := settings - testCaseSettings.Timeout = 200 * time.Millisecond - testCaseSettings.RetrySleepInitDuration = 100 * time.Millisecond + testCaseSettings.Timeout = 500 * time.Millisecond + testCaseSettings.RetrySleepInitDuration = 10 * time.Millisecond + // exponential backoff with 10ms init and 500ms timeout should fit at least 3 attempts. + minNmExpectedAttempts := 3 mockDownloaderCtor := func(version *agtversion.ParsedSemVer, log *logger.Logger, settings *artifact.Config, upgradeDetails *details.Details) (download.Downloader, error) { return &mockDownloader{"", errors.New("download failed")}, nil @@ -250,9 +253,10 @@ func TestDownloadWithRetries(t *testing.T) { require.Equal(t, "context deadline exceeded", err.Error()) require.Equal(t, "", path) - minNmExpectedAttempts := int(testCaseSettings.Timeout / testCaseSettings.RetrySleepInitDuration) logs := obs.TakeAll() - require.GreaterOrEqual(t, len(logs), minNmExpectedAttempts*2) + logsJSON, err := json.MarshalIndent(logs, "", " ") + require.NoError(t, err) + require.GreaterOrEqualf(t, len(logs), minNmExpectedAttempts*2, "logs output: %s", logsJSON) for i := 0; i < minNmExpectedAttempts; i++ { require.Equal(t, fmt.Sprintf("download attempt %d", i+1), logs[(2*i)].Message) require.Contains(t, logs[(2*i+1)].Message, "unable to download package: download failed; retrying") diff --git a/internal/pkg/agent/application/upgrade/step_mark.go b/internal/pkg/agent/application/upgrade/step_mark.go index 44a869ee2dd..926eba39f16 100644 --- a/internal/pkg/agent/application/upgrade/step_mark.go +++ b/internal/pkg/agent/application/upgrade/step_mark.go @@ -16,6 +16,7 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/agent/errors" "github.com/elastic/elastic-agent/internal/pkg/fleetapi" "github.com/elastic/elastic-agent/pkg/core/logger" + "github.com/elastic/elastic-agent/pkg/version" ) const markerFilename = ".update-marker" @@ -116,6 +117,7 @@ func newMarkerSerializer(m *UpdateMarker) *updateMarkerSerializer { } type agentInstall struct { + parsedVersion *version.ParsedSemVer version string hash string versionedHome string diff --git a/internal/pkg/agent/application/upgrade/upgrade.go b/internal/pkg/agent/application/upgrade/upgrade.go index 05091ebe3c0..17e8050c299 100644 --- a/internal/pkg/agent/application/upgrade/upgrade.go +++ b/internal/pkg/agent/application/upgrade/upgrade.go @@ -36,6 +36,7 @@ import ( "github.com/elastic/elastic-agent/pkg/control/v2/cproto" "github.com/elastic/elastic-agent/pkg/core/logger" agtversion "github.com/elastic/elastic-agent/pkg/version" + currentagtversion "github.com/elastic/elastic-agent/version" ) const ( @@ -272,12 +273,15 @@ func (u *Upgrader) Upgrade(ctx context.Context, version string, sourceURI string // while the `previous` install is the currently executing elastic-agent that is no longer reachable via the symlink. // After the restart at the end of the function, everything lines up correctly. current := agentInstall{ + parsedVersion: parsedVersion, version: version, hash: unpackRes.Hash, versionedHome: unpackRes.VersionedHome, } + previousParsedVersion := currentagtversion.GetParsedAgentPackageVersion() previous := agentInstall{ + parsedVersion: previousParsedVersion, version: release.VersionWithSnapshot(), hash: release.Commit(), versionedHome: currentVersionedHome, @@ -293,15 +297,8 @@ func (u *Upgrader) Upgrade(ctx context.Context, version string, sourceURI string return nil, goerrors.Join(err, rollbackErr) } - minParsedVersionForNewUpdateMarker := agtversion.NewParsedSemVer(8, 13, 0, "", "") - var watcherExecutable string - if parsedVersion.Less(*minParsedVersionForNewUpdateMarker) { - // use the current agent executable for watch, if downgrading the old agent doesn't understand the current agent's path structure. - watcherExecutable = paths.BinaryPath(paths.VersionedHome(paths.Top()), agentName) - } else { - // use the new agent executable as it should be able to parse the new update marker - watcherExecutable = paths.BinaryPath(filepath.Join(paths.Top(), unpackRes.VersionedHome), agentName) - } + var watcherExecutable = selectWatcherExecutable(paths.Top(), previous, current) + var watcherCmd *exec.Cmd if watcherCmd, err = InvokeWatcher(u.log, watcherExecutable); err != nil { u.log.Errorw("Rolling back: starting watcher failed", "error.message", err) @@ -328,6 +325,17 @@ func (u *Upgrader) Upgrade(ctx context.Context, version string, sourceURI string return cb, nil } +func selectWatcherExecutable(topDir string, previous agentInstall, current agentInstall) string { + // check if the upgraded version is less than the previous (currently installed) version + if current.parsedVersion.Less(*previous.parsedVersion) { + // use the current agent executable for watch, if downgrading the old agent doesn't understand the current agent's path structure. + return paths.BinaryPath(filepath.Join(topDir, previous.versionedHome), agentName) + } else { + // use the new agent executable as it should be able to parse the new update marker + return paths.BinaryPath(filepath.Join(topDir, current.versionedHome), agentName) + } +} + func waitForWatcher(ctx context.Context, log *logger.Logger, markerFilePath string, waitTime time.Duration) error { return waitForWatcherWithTimeoutCreationFunc(ctx, log, markerFilePath, waitTime, context.WithTimeout) } @@ -417,8 +425,7 @@ func isSameVersion(log *logger.Logger, current agentVersion, metadata packageMet } else { // extract version info from the version string (we can ignore parsing errors as it would have never passed the download step) parsedVersion, _ := agtversion.ParseVersion(upgradeVersion) - newVersion.version = strings.TrimSuffix(parsedVersion.VersionWithPrerelease(), snapshotSuffix) - newVersion.snapshot = parsedVersion.IsSnapshot() + newVersion.version, newVersion.snapshot = parsedVersion.ExtractSnapshotFromVersionString() } newVersion.hash = metadata.hash diff --git a/internal/pkg/agent/application/upgrade/upgrade_test.go b/internal/pkg/agent/application/upgrade/upgrade_test.go index 54ce6b8ea69..bcb96f44cac 100644 --- a/internal/pkg/agent/application/upgrade/upgrade_test.go +++ b/internal/pkg/agent/application/upgrade/upgrade_test.go @@ -22,6 +22,7 @@ import ( "github.com/elastic/elastic-agent-libs/transport/httpcommon" "github.com/elastic/elastic-agent-libs/transport/tlscommon" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/agent/application/upgrade/artifact" "github.com/elastic/elastic-agent/internal/pkg/agent/application/upgrade/details" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" @@ -29,9 +30,10 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/release" v1 "github.com/elastic/elastic-agent/pkg/api/v1" "github.com/elastic/elastic-agent/pkg/control/v2/client" - "github.com/elastic/elastic-agent/pkg/control/v2/client/mocks" "github.com/elastic/elastic-agent/pkg/control/v2/cproto" "github.com/elastic/elastic-agent/pkg/core/logger" + agtversion "github.com/elastic/elastic-agent/pkg/version" + mocks "github.com/elastic/elastic-agent/testing/mocks/pkg/control/v2/client" ) func Test_CopyFile(t *testing.T) { @@ -693,7 +695,7 @@ func TestIsSameVersion(t *testing.T) { manifest: nil, hash: "abcdef", }, - version: "1.2.3-repackaged-SNAPSHOT", + version: "1.2.3-SNAPSHOT.repackaged", }, want: want{ same: false, @@ -903,3 +905,80 @@ func writeState(t *testing.T, path string, state details.State) { assert.NoError(t, err, "error writing out the test upgrade marker") } } + +func Test_selectWatcherExecutable(t *testing.T) { + type args struct { + previous agentInstall + current agentInstall + } + tests := []struct { + name string + args args + want string + }{ + { + name: "Simple upgrade, we should launch the new (current) watcher", + args: args{ + previous: agentInstall{ + parsedVersion: agtversion.NewParsedSemVer(1, 2, 3, "", ""), + versionedHome: filepath.Join("data", "elastic-agent-1.2.3-somehash"), + }, + current: agentInstall{ + parsedVersion: agtversion.NewParsedSemVer(4, 5, 6, "", ""), + versionedHome: filepath.Join("data", "elastic-agent-4.5.6-someotherhash"), + }, + }, + want: filepath.Join("data", "elastic-agent-4.5.6-someotherhash"), + }, + { + name: "Simple downgrade, we should launch the currently installed (previous) watcher", + args: args{ + previous: agentInstall{ + parsedVersion: agtversion.NewParsedSemVer(4, 5, 6, "", ""), + versionedHome: filepath.Join("data", "elastic-agent-4.5.6-someotherhash"), + }, + current: agentInstall{ + parsedVersion: agtversion.NewParsedSemVer(1, 2, 3, "", ""), + versionedHome: filepath.Join("data", "elastic-agent-1.2.3-somehash"), + }, + }, + want: filepath.Join("data", "elastic-agent-4.5.6-someotherhash"), + }, + { + name: "Upgrade from snapshot to released version, we should launch the new (current) watcher", + args: args{ + previous: agentInstall{ + parsedVersion: agtversion.NewParsedSemVer(1, 2, 3, "SNAPSHOT", ""), + versionedHome: filepath.Join("data", "elastic-agent-1.2.3-SNAPSHOT-somehash"), + }, + current: agentInstall{ + parsedVersion: agtversion.NewParsedSemVer(1, 2, 3, "", ""), + versionedHome: filepath.Join("data", "elastic-agent-1.2.3-someotherhash"), + }, + }, + want: filepath.Join("data", "elastic-agent-1.2.3-someotherhash"), + }, + { + name: "Downgrade from released version to SNAPSHOT, we should launch the currently installed (previous) watcher", + args: args{ + previous: agentInstall{ + parsedVersion: agtversion.NewParsedSemVer(1, 2, 3, "", ""), + versionedHome: filepath.Join("data", "elastic-agent-1.2.3-somehash"), + }, + current: agentInstall{ + parsedVersion: agtversion.NewParsedSemVer(1, 2, 3, "SNAPSHOT", ""), + versionedHome: filepath.Join("data", "elastic-agent-1.2.3-SNAPSHOT-someotherhash"), + }, + }, + + want: filepath.Join("data", "elastic-agent-1.2.3-somehash"), + }, + } + // Just need a top dir path. This test does not make any operation on the filesystem, so a temp dir path is as good as any + fakeTopDir := filepath.Join(t.TempDir(), "Elastic", "Agent") + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equalf(t, paths.BinaryPath(filepath.Join(fakeTopDir, tt.want), agentName), selectWatcherExecutable(fakeTopDir, tt.args.previous, tt.args.current), "selectWatcherExecutable(%v, %v)", tt.args.previous, tt.args.current) + }) + } +} diff --git a/internal/pkg/agent/cmd/cmd_test.go b/internal/pkg/agent/cmd/cmd_test.go index 52ab81bc0b8..df859636caf 100644 --- a/internal/pkg/agent/cmd/cmd_test.go +++ b/internal/pkg/agent/cmd/cmd_test.go @@ -6,6 +6,9 @@ package cmd import ( "testing" + + "github.com/spf13/cobra" + "github.com/stretchr/testify/require" ) func TestAgent(t *testing.T) { @@ -30,3 +33,18 @@ func TestAgent(t *testing.T) { // assert.True(t, strings.Contains(string(contents), "Hello I am running")) // }) } + +func TestAddCommandIfNotNil(t *testing.T) { + cmd := &cobra.Command{} + + parent := &cobra.Command{} + addCommandIfNotNil(parent, cmd) + require.Equal(t, 1, len(parent.Commands())) + + parent = &cobra.Command{} + addCommandIfNotNil(parent, nil) + require.Equal(t, 0, len(parent.Commands())) + + // this should not panic + addCommandIfNotNil(nil, cmd) +} diff --git a/internal/pkg/agent/cmd/common.go b/internal/pkg/agent/cmd/common.go index 11b025f6c5b..dd8d19d7f11 100644 --- a/internal/pkg/agent/cmd/common.go +++ b/internal/pkg/agent/cmd/common.go @@ -72,18 +72,21 @@ func NewCommandWithArgs(args []string, streams *cli.IOStreams) *cobra.Command { run := newRunCommandWithArgs(args, streams) cmd.AddCommand(basecmd.NewDefaultCommandsWithArgs(args, streams)...) cmd.AddCommand(run) - cmd.AddCommand(newInstallCommandWithArgs(args, streams)) - cmd.AddCommand(newUninstallCommandWithArgs(args, streams)) - cmd.AddCommand(newUpgradeCommandWithArgs(args, streams)) - cmd.AddCommand(newEnrollCommandWithArgs(args, streams)) - cmd.AddCommand(newInspectCommandWithArgs(args, streams)) - cmd.AddCommand(newWatchCommandWithArgs(args, streams)) - cmd.AddCommand(newContainerCommand(args, streams)) - cmd.AddCommand(newStatusCommand(args, streams)) - cmd.AddCommand(newDiagnosticsCommand(args, streams)) - cmd.AddCommand(newComponentCommandWithArgs(args, streams)) - cmd.AddCommand(newLogsCommandWithArgs(args, streams)) - cmd.AddCommand(newOtelCommandWithArgs(args, streams)) + + addCommandIfNotNil(cmd, newInstallCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newUninstallCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newUpgradeCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newEnrollCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newInspectCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newPrivilegedCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newUnprivilegedCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newWatchCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newContainerCommand(args, streams)) + addCommandIfNotNil(cmd, newStatusCommand(args, streams)) + addCommandIfNotNil(cmd, newDiagnosticsCommand(args, streams)) + addCommandIfNotNil(cmd, newComponentCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newLogsCommandWithArgs(args, streams)) + addCommandIfNotNil(cmd, newOtelCommandWithArgs(args, streams)) // windows special hidden sub-command (only added on Windows) reexec := newReExecWindowsCommand(args, streams) @@ -95,3 +98,11 @@ func NewCommandWithArgs(args []string, streams *cli.IOStreams) *cobra.Command { return cmd } + +func addCommandIfNotNil(parent, cmd *cobra.Command) { + if cmd == nil || parent == nil { + return + } + + parent.AddCommand(cmd) +} diff --git a/internal/pkg/agent/cmd/container.go b/internal/pkg/agent/cmd/container.go index 8ceea38c14e..db454cf5fa9 100644 --- a/internal/pkg/agent/cmd/container.go +++ b/internal/pkg/agent/cmd/container.go @@ -9,6 +9,7 @@ import ( "encoding/json" "fmt" "io" + "io/fs" "net/url" "os" "os/exec" @@ -34,6 +35,7 @@ import ( "github.com/elastic/elastic-agent/pkg/component" "github.com/elastic/elastic-agent/pkg/core/logger" "github.com/elastic/elastic-agent/pkg/core/process" + "github.com/elastic/elastic-agent/pkg/utils" "github.com/elastic/elastic-agent/version" ) @@ -774,13 +776,20 @@ func setPaths(statePath, configPath, logsPath, socketPath string, writePaths boo if statePath == "" { statePath = defaultStateDirectory } + topPath := filepath.Join(statePath, "data") configPath = envWithDefault(configPath, "CONFIG_PATH") if configPath == "" { configPath = statePath } + if _, err := os.Stat(configPath); errors.Is(err, fs.ErrNotExist) { + if err := os.MkdirAll(configPath, 0755); err != nil { + return fmt.Errorf("cannot create folders for config path '%s': %w", configPath, err) + } + } + if socketPath == "" { - socketPath = fmt.Sprintf("unix://%s", filepath.Join(topPath, paths.ControlSocketName)) + socketPath = utils.SocketURLWithFallback(statePath, topPath) } // ensure that the directory and sub-directory data exists if err := os.MkdirAll(topPath, 0755); err != nil { diff --git a/internal/pkg/agent/cmd/diagnostics.go b/internal/pkg/agent/cmd/diagnostics.go index b084366750d..7699921ae03 100644 --- a/internal/pkg/agent/cmd/diagnostics.go +++ b/internal/pkg/agent/cmd/diagnostics.go @@ -16,6 +16,7 @@ import ( "github.com/spf13/cobra" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/cli" "github.com/elastic/elastic-agent/internal/pkg/diagnostics" ) @@ -35,6 +36,8 @@ func newDiagnosticsCommand(_ []string, streams *cli.IOStreams) *cobra.Command { cmd.Flags().StringP("file", "f", "", "name of the output diagnostics zip archive") cmd.Flags().BoolP("cpu-profile", "p", false, "wait to collect a CPU profile") + cmd.Flags().BoolP("skip-conn", "", false, "Skip connection request diagnostics") + cmd.Flags().Bool("exclude-events", false, "do not collect events log file") return cmd } @@ -46,6 +49,11 @@ func diagnosticCmd(streams *cli.IOStreams, cmd *cobra.Command) error { filepath = "elastic-agent-diagnostics-" + ts.Format("2006-01-02T15-04-05Z07-00") + ".zip" // RFC3339 format that replaces : with -, so it will work on Windows } + excludeEvents, err := cmd.Flags().GetBool("exclude-events") + if err != nil { + return fmt.Errorf("cannot get 'exclude-events' flag: %w", err) + } + ctx := handleSignal(context.Background()) // 1st create the file to store the diagnostics, if it fails, anything else @@ -57,12 +65,13 @@ func diagnosticCmd(streams *cli.IOStreams, cmd *cobra.Command) error { defer f.Close() cpuProfile, _ := cmd.Flags().GetBool("cpu-profile") - agentDiag, unitDiags, compDiags, err := collectDiagnostics(ctx, streams, cpuProfile) + connSkip, _ := cmd.Flags().GetBool("skip-conn") + agentDiag, unitDiags, compDiags, err := collectDiagnostics(ctx, streams, cpuProfile, connSkip) if err != nil { return fmt.Errorf("failed collecting diagnostics: %w", err) } - if err := diagnostics.ZipArchive(streams.Err, f, agentDiag, unitDiags, compDiags); err != nil { + if err := diagnostics.ZipArchive(streams.Err, f, paths.Top(), agentDiag, unitDiags, compDiags, excludeEvents); err != nil { return fmt.Errorf("unable to create archive %q: %w", filepath, err) } fmt.Fprintf(streams.Out, "Created diagnostics archive %q\n", filepath) @@ -70,7 +79,7 @@ func diagnosticCmd(streams *cli.IOStreams, cmd *cobra.Command) error { return nil } -func collectDiagnostics(ctx context.Context, streams *cli.IOStreams, cpuProfile bool) ([]client.DiagnosticFileResult, []client.DiagnosticUnitResult, []client.DiagnosticComponentResult, error) { +func collectDiagnostics(ctx context.Context, streams *cli.IOStreams, cpuProfile, connSkip bool) ([]client.DiagnosticFileResult, []client.DiagnosticUnitResult, []client.DiagnosticComponentResult, error) { daemon := client.New() err := daemon.Connect(ctx) if err != nil { @@ -79,10 +88,13 @@ func collectDiagnostics(ctx context.Context, streams *cli.IOStreams, cpuProfile defer daemon.Disconnect() var additionalDiags []cproto.AdditionalDiagnosticRequest + if !connSkip { + additionalDiags = append(additionalDiags, cproto.AdditionalDiagnosticRequest_CONN) + } if cpuProfile { // console will just hang while we wait for the CPU profile; print something so user doesn't get confused fmt.Fprintf(streams.Out, "Creating diagnostics archive, waiting for CPU profile...\n") - additionalDiags = []cproto.AdditionalDiagnosticRequest{cproto.AdditionalDiagnosticRequest_CPU} + additionalDiags = append(additionalDiags, cproto.AdditionalDiagnosticRequest_CPU) } agentDiag, err := daemon.DiagnosticAgent(ctx, additionalDiags) diff --git a/internal/pkg/agent/cmd/enroll.go b/internal/pkg/agent/cmd/enroll.go index b6cd4071578..c6d39dc9878 100644 --- a/internal/pkg/agent/cmd/enroll.go +++ b/internal/pkg/agent/cmd/enroll.go @@ -17,12 +17,21 @@ import ( "github.com/spf13/cobra" + "github.com/elastic/elastic-agent/internal/pkg/agent/application" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/agent/configuration" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" + "github.com/elastic/elastic-agent/internal/pkg/agent/storage" "github.com/elastic/elastic-agent/internal/pkg/cli" "github.com/elastic/elastic-agent/internal/pkg/config" "github.com/elastic/elastic-agent/pkg/core/logger" + "github.com/elastic/elastic-agent/pkg/utils" +) + +const ( + fromInstallArg = "from-install" + fromInstallUserArg = "from-install-user" + fromInstallGroupArg = "from-install-group" ) func newEnrollCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command { @@ -42,8 +51,11 @@ func newEnrollCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command cmd.Flags().BoolP("force", "f", false, "Force overwrite the current and do not prompt for confirmation") // used by install command - cmd.Flags().BoolP("from-install", "", false, "Set by install command to signal this was executed from install") - cmd.Flags().MarkHidden("from-install") //nolint:errcheck //not required + cmd.Flags().BoolP(fromInstallArg, "", false, "Set by install command to signal this was executed from install") + cmd.Flags().MarkHidden(fromInstallArg) //nolint:errcheck //not required + + // platform specific flags + addPlatformFlags(cmd) return cmd } @@ -321,7 +333,7 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { return err } - fromInstall, _ := cmd.Flags().GetBool("from-install") + fromInstall, _ := cmd.Flags().GetBool(fromInstallArg) pathConfigFile := paths.ConfigFile() rawConfig, err := config.LoadFile(pathConfigFile) @@ -369,7 +381,7 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { cfg.Settings.LoggingConfig.ToFiles = false cfg.Settings.LoggingConfig.ToStderr = true - logger, err := logger.NewFromConfig("", cfg.Settings.LoggingConfig, false) + logger, err := logger.NewFromConfig("", cfg.Settings.LoggingConfig, cfg.Settings.EventLoggingConfig, false) if err != nil { return err } @@ -417,9 +429,17 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { // Error: failed to fix permissions: chown /Library/Elastic/Agent/data/elastic-agent-c13f91/elastic-agent.app: operation not permitted // This is because we are fixing permissions twice, once during installation and again during the enrollment step. // When we are enrolling as part of installation on MacOS, skip the second attempt to fix permissions. - fixPermissions := fromInstall + var fixPermissions *utils.FileOwner + if fromInstall { + perms, err := getFileOwnerFromCmd(cmd) + if err != nil { + // no context is added because the error is clear and user facing + return err + } + fixPermissions = &perms + } if runtime.GOOS == "darwin" { - fixPermissions = false + fixPermissions = nil } options := enrollCmdOption{ @@ -464,11 +484,28 @@ func enroll(streams *cli.IOStreams, cmd *cobra.Command) error { }, } + var storeOpts []storage.ReplaceOnSuccessStoreOptionFunc + var encryptOpts []storage.EncryptedOptionFunc + if fixPermissions != nil { + storeOpts = append(storeOpts, storage.ReplaceOnSuccessStoreWithOwnership(*fixPermissions)) + encryptOpts = append(encryptOpts, storage.EncryptedStoreWithOwnership(*fixPermissions)) + } + encStore, err := storage.NewEncryptedDiskStore(ctx, paths.AgentConfigFile(), encryptOpts...) + if err != nil { + return fmt.Errorf("failed to create encrypted disk store: %w", err) + } + store := storage.NewReplaceOnSuccessStore( + pathConfigFile, + application.DefaultAgentFleetConfig, + encStore, + storeOpts..., + ) + c, err := newEnrollCmd( - ctx, logger, &options, pathConfigFile, + store, ) if err != nil { diff --git a/internal/pkg/agent/cmd/enroll_cmd.go b/internal/pkg/agent/cmd/enroll_cmd.go index 41b728cc20f..edaff9ec3d3 100644 --- a/internal/pkg/agent/cmd/enroll_cmd.go +++ b/internal/pkg/agent/cmd/enroll_cmd.go @@ -20,16 +20,13 @@ import ( "github.com/elastic/elastic-agent-libs/transport/httpcommon" "github.com/elastic/elastic-agent-libs/transport/tlscommon" - - "github.com/elastic/elastic-agent/internal/pkg/agent/application" "github.com/elastic/elastic-agent/internal/pkg/agent/application/filelock" "github.com/elastic/elastic-agent/internal/pkg/agent/application/info" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/agent/application/secret" "github.com/elastic/elastic-agent/internal/pkg/agent/configuration" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" - "github.com/elastic/elastic-agent/internal/pkg/agent/install" - "github.com/elastic/elastic-agent/internal/pkg/agent/storage" + "github.com/elastic/elastic-agent/internal/pkg/agent/perms" "github.com/elastic/elastic-agent/internal/pkg/agent/vault" "github.com/elastic/elastic-agent/internal/pkg/cli" "github.com/elastic/elastic-agent/internal/pkg/config" @@ -41,6 +38,7 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/release" "github.com/elastic/elastic-agent/internal/pkg/remote" "github.com/elastic/elastic-agent/pkg/control/v2/client" + "github.com/elastic/elastic-agent/pkg/control/v2/client/wait" "github.com/elastic/elastic-agent/pkg/core/logger" "github.com/elastic/elastic-agent/pkg/core/process" "github.com/elastic/elastic-agent/pkg/utils" @@ -54,6 +52,8 @@ const ( defaultFleetServerPort = 8220 defaultFleetServerInternalHost = "localhost" defaultFleetServerInternalPort = 8221 + enrollBackoffInit = time.Second + enrollBackoffMax = 10 * time.Second ) var ( @@ -119,7 +119,7 @@ type enrollCmdOption struct { ProxyHeaders map[string]string `yaml:"proxy_headers,omitempty"` DaemonTimeout time.Duration `yaml:"daemon_timeout,omitempty"` UserProvidedMetadata map[string]interface{} `yaml:"-"` - FixPermissions bool `yaml:"-"` + FixPermissions *utils.FileOwner `yaml:"-"` DelayEnroll bool `yaml:"-"` FleetServer enrollCmdFleetServerOption `yaml:"-"` SkipCreateSecret bool `yaml:"-"` @@ -166,35 +166,8 @@ func (e *enrollCmdOption) remoteConfig() (remote.Config, error) { return cfg, nil } -// newEnrollCmd creates a new enroll command that will registers the current beats to the remote -// system. +// newEnrollCmd creates a new enrollment with the given store. func newEnrollCmd( - ctx context.Context, - log *logger.Logger, - options *enrollCmdOption, - configPath string, -) (*enrollCmd, error) { - - encryptedDiskStore, err := storage.NewEncryptedDiskStore(ctx, paths.AgentConfigFile()) - if err != nil { - return nil, fmt.Errorf("error instantiating encrypted disk store: %w", err) - } - store := storage.NewReplaceOnSuccessStore( - configPath, - application.DefaultAgentFleetConfig, - encryptedDiskStore, - ) - - return newEnrollCmdWithStore( - log, - options, - configPath, - store, - ) -} - -// newEnrollCmdWithStore creates a new enrollment and accept a custom store. -func newEnrollCmdWithStore( log *logger.Logger, options *enrollCmdOption, configPath string, @@ -227,7 +200,11 @@ func (c *enrollCmd) Execute(ctx context.Context, streams *cli.IOStreams) error { // Create encryption key from the agent before touching configuration if !c.options.SkipCreateSecret { - err = secret.CreateAgentSecret(ctx, vault.WithUnprivileged(!hasRoot)) + opts := []vault.OptionFunc{vault.WithUnprivileged(!hasRoot)} + if c.options.FixPermissions != nil { + opts = append(opts, vault.WithVaultOwnership(*c.options.FixPermissions)) + } + err = secret.CreateAgentSecret(ctx, opts...) if err != nil { return err } @@ -279,7 +256,18 @@ func (c *enrollCmd) Execute(ctx context.Context, streams *cli.IOStreams) error { if c.options.FleetServer.Host != "" { return errors.New("--delay-enroll cannot be used with --fleet-server-es", errors.TypeConfig) } - return c.writeDelayEnroll(streams) + err = c.writeDelayEnroll(streams) + if err != nil { + // context for error already provided in writeDelayEnroll + return err + } + if c.options.FixPermissions != nil { + err = perms.FixPermissions(paths.Top(), perms.WithOwnership(*c.options.FixPermissions)) + if err != nil { + return errors.New(err, "failed to fix permissions") + } + } + return nil } err = c.enrollWithBackoff(ctx, persistentConfig) @@ -287,8 +275,8 @@ func (c *enrollCmd) Execute(ctx context.Context, streams *cli.IOStreams) error { return fmt.Errorf("fail to enroll: %w", err) } - if c.options.FixPermissions { - err = install.FixPermissions(paths.Top(), utils.CurrentFileOwner()) + if c.options.FixPermissions != nil { + err = perms.FixPermissions(paths.Top(), perms.WithOwnership(*c.options.FixPermissions)) if err != nil { return errors.New(err, "failed to fix permissions") } @@ -348,7 +336,7 @@ func (c *enrollCmd) fleetServerBootstrap(ctx context.Context, persistentConfig m if err != nil { if !c.options.FleetServer.SpawnAgent { // wait longer to try and communicate with the Elastic Agent - err = waitForAgent(ctx, c.options.DaemonTimeout) + err = wait.ForAgent(ctx, c.options.DaemonTimeout) if err != nil { return "", errors.New("failed to communicate with elastic-agent daemon; is elastic-agent running?") } @@ -533,16 +521,10 @@ func (c *enrollCmd) enrollWithBackoff(ctx context.Context, persistentConfig map[ return nil } - const deadline = 10 * time.Minute - const frequency = 60 * time.Second - - c.log.Infof("1st enrollment attempt failed, retrying for %s, every %s enrolling to URL: %s", - deadline, - frequency, - c.client.URI()) + c.log.Infof("1st enrollment attempt failed, retrying enrolling to URL: %s with exponential backoff (init %s, max %s)", c.client.URI(), enrollBackoffInit, enrollBackoffMax) signal := make(chan struct{}) defer close(signal) - backExp := backoff.NewExpBackoff(signal, frequency, deadline) + backExp := backoff.NewExpBackoff(signal, enrollBackoffInit, enrollBackoffMax) for { retry := false @@ -552,6 +534,9 @@ func (c *enrollCmd) enrollWithBackoff(ctx context.Context, persistentConfig map[ } else if errors.Is(err, fleetapi.ErrConnRefused) { c.log.Warn("Remote server is not ready to accept connections, will retry in a moment.") retry = true + } else if errors.Is(err, fleetapi.ErrTemporaryServerError) { + c.log.Warn("Remote server failed to handle the request, will retry in a moment.") + retry = true } if !retry { break @@ -572,6 +557,12 @@ func (c *enrollCmd) enroll(ctx context.Context, persistentConfig map[string]inte return errors.New(err, "acquiring metadata failed") } + // Automatically add the namespace as a tag when installed into a namepsace. + // Ensures the development agent is differentiated from others when on the same host. + if namespace := paths.InstallNamespace(); namespace != "" { + c.options.Tags = append(c.options.Tags, namespace) + } + r := &fleetapi.EnrollRequest{ EnrollAPIKey: c.options.EnrollAPIKey, Type: fleetapi.PermanentEnroll, @@ -738,54 +729,6 @@ type waitResult struct { err error } -func waitForAgent(ctx context.Context, timeout time.Duration) error { - if timeout == 0 { - timeout = 1 * time.Minute - } - if timeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, timeout) - defer cancel() - } - maxBackoff := timeout - if maxBackoff <= 0 { - // indefinite timeout - maxBackoff = 10 * time.Minute - } - - resChan := make(chan waitResult) - innerCtx, innerCancel := context.WithCancel(context.Background()) - defer innerCancel() - go func() { - backOff := expBackoffWithContext(innerCtx, 1*time.Second, maxBackoff) - for { - backOff.Wait() - _, err := getDaemonState(innerCtx) - if errors.Is(err, context.Canceled) { - resChan <- waitResult{err: err} - return - } - if err == nil { - resChan <- waitResult{} - break - } - } - }() - - var res waitResult - select { - case <-ctx.Done(): - innerCancel() - res = <-resChan - case res = <-resChan: - } - - if res.err != nil { - return res.err - } - return nil -} - func waitForFleetServer(ctx context.Context, agentSubproc <-chan *os.ProcessState, log *logger.Logger, timeout time.Duration) (string, error) { if timeout == 0 { timeout = 2 * time.Minute diff --git a/internal/pkg/agent/cmd/enroll_cmd_test.go b/internal/pkg/agent/cmd/enroll_cmd_test.go index d5a3ee97656..8b7a88232f8 100644 --- a/internal/pkg/agent/cmd/enroll_cmd_test.go +++ b/internal/pkg/agent/cmd/enroll_cmd_test.go @@ -15,6 +15,7 @@ import ( "os" "runtime" "strconv" + "sync/atomic" "testing" "time" @@ -91,7 +92,7 @@ func TestEnroll(t *testing.T) { url := "https://" + host store := &mockStore{Err: errors.New("fail to save")} - cmd, err := newEnrollCmdWithStore( + cmd, err := newEnrollCmd( log, &enrollCmdOption{ URL: url, @@ -145,7 +146,7 @@ func TestEnroll(t *testing.T) { url := "https://" + host store := &mockStore{} - cmd, err := newEnrollCmdWithStore( + cmd, err := newEnrollCmd( log, &enrollCmdOption{ URL: url, @@ -206,7 +207,7 @@ func TestEnroll(t *testing.T) { }, func(t *testing.T, host string) { url := "http://" + host + "/" store := &mockStore{} - cmd, err := newEnrollCmdWithStore( + cmd, err := newEnrollCmd( log, &enrollCmdOption{ URL: url, @@ -270,7 +271,7 @@ func TestEnroll(t *testing.T) { }, func(t *testing.T, host string) { url := "http://" + host store := &mockStore{} - cmd, err := newEnrollCmdWithStore( + cmd, err := newEnrollCmd( log, &enrollCmdOption{ URL: url, @@ -315,7 +316,7 @@ func TestEnroll(t *testing.T) { }, func(t *testing.T, host string) { url := "http://" + host store := &mockStore{} - cmd, err := newEnrollCmdWithStore( + cmd, err := newEnrollCmd( log, &enrollCmdOption{ URL: url, @@ -336,6 +337,81 @@ func TestEnroll(t *testing.T) { require.False(t, store.Called) }, )) + + counter := int32(0) + + t.Run("there is a retry on a temporary server error", withServer( + func(t *testing.T) *http.ServeMux { + mux := http.NewServeMux() + mux.HandleFunc("/api/fleet/agents/enroll", func(w http.ResponseWriter, r *http.Request) { + + // first request fails with 503, retry is expected + if atomic.CompareAndSwapInt32(&counter, 0, 1) { + w.WriteHeader(http.StatusServiceUnavailable) + _, _ = w.Write([]byte(` +{ + "statusCode": 503, + "error": "Internal Server Error" +}`)) + return + } + + // second attempt is successful + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(` +{ + "action": "created", + "item": { + "id": "a9328860-ec54-11e9-93c4-d72ab8a69391", + "active": true, + "policy_id": "69f3f5a0-ec52-11e9-93c4-d72ab8a69391", + "type": "PERMANENT", + "enrolled_at": "2019-10-11T18:26:37.158Z", + "user_provided_metadata": { + "custom": "customize" + }, + "local_metadata": { + "platform": "linux", + "version": "8.0.0" + }, + "actions": [], + "access_api_key": "my-access-api-key" + } +}`)) + }) + return mux + }, func(t *testing.T, host string) { + url := "http://" + host + store := &mockStore{} + cmd, err := newEnrollCmd( + log, + &enrollCmdOption{ + URL: url, + CAs: []string{}, + EnrollAPIKey: "my-enrollment-api-key", + Insecure: true, + UserProvidedMetadata: map[string]interface{}{"custom": "customize"}, + SkipCreateSecret: skipCreateSecret, + SkipDaemonRestart: true, + }, + "", + store, + ) + require.NoError(t, err) + + streams, _, _, _ := cli.NewTestingIOStreams() + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) + defer cancel() + err = cmd.Execute(ctx, streams) + require.NoError(t, err, "enroll command should return no error") + + assert.True(t, store.Called, "the store should have been called") + config, err := readConfig(store.Content) + require.NoError(t, err) + assert.Equal(t, "my-access-api-key", config.AccessAPIKey) + assert.Equal(t, host, config.Client.Host) + }, + )) } func TestValidateArgs(t *testing.T) { diff --git a/internal/pkg/agent/cmd/enroll_unix.go b/internal/pkg/agent/cmd/enroll_unix.go new file mode 100644 index 00000000000..228b0bc624c --- /dev/null +++ b/internal/pkg/agent/cmd/enroll_unix.go @@ -0,0 +1,50 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build !windows + +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/elastic/elastic-agent/pkg/utils" +) + +func addPlatformFlags(cmd *cobra.Command) { + cmd.Flags().Int32(fromInstallUserArg, -1, "UID of the elastic-agent-user user when enrolling from installer") + _ = cmd.Flags().MarkHidden(fromInstallUserArg) + + cmd.Flags().Int32(fromInstallGroupArg, -1, "GID of the elastic-agent group when enrolling from installer") + _ = cmd.Flags().MarkHidden(fromInstallGroupArg) +} + +func getFileOwnerFromCmd(cmd *cobra.Command) (utils.FileOwner, error) { + uid, err := getIDFromCmd(cmd, fromInstallUserArg) + if err != nil { + return utils.FileOwner{}, err + } + gid, err := getIDFromCmd(cmd, fromInstallGroupArg) + if err != nil { + return utils.FileOwner{}, err + } + ownership := utils.CurrentFileOwner() + if uid != -1 { + ownership.UID = uid + } + if gid != -1 { + ownership.GID = gid + } + return ownership, nil +} + +func getIDFromCmd(cmd *cobra.Command, param string) (int, error) { + id, _ := cmd.Flags().GetInt32(param) + if id < -1 { + return -1, fmt.Errorf("--%s has an invalid value of: %d", param, id) + } + return int(id), nil +} diff --git a/internal/pkg/agent/cmd/enroll_windows.go b/internal/pkg/agent/cmd/enroll_windows.go new file mode 100644 index 00000000000..d151f990c4a --- /dev/null +++ b/internal/pkg/agent/cmd/enroll_windows.go @@ -0,0 +1,55 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build windows + +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" + "golang.org/x/sys/windows" + + "github.com/elastic/elastic-agent/pkg/utils" +) + +func addPlatformFlags(cmd *cobra.Command) { + cmd.Flags().String(fromInstallUserArg, "", "UID of the elastic-agent-user user when enrolling from installer") + _ = cmd.Flags().MarkHidden(fromInstallUserArg) + + cmd.Flags().String(fromInstallGroupArg, "", "GID of the elastic-agent group when enrolling from installer") + _ = cmd.Flags().MarkHidden(fromInstallGroupArg) +} + +func getFileOwnerFromCmd(cmd *cobra.Command) (utils.FileOwner, error) { + userSID, err := getSIDFromCmd(cmd, fromInstallUserArg) + if err != nil { + return utils.FileOwner{}, err + } + groupSID, err := getSIDFromCmd(cmd, fromInstallGroupArg) + if err != nil { + return utils.FileOwner{}, err + } + var ownership utils.FileOwner + if userSID != nil { + ownership.UID = userSID.String() + } + if groupSID != nil { + ownership.GID = groupSID.String() + } + return ownership, nil +} + +func getSIDFromCmd(cmd *cobra.Command, param string) (*windows.SID, error) { + sidStr, _ := cmd.Flags().GetString(param) + if sidStr != "" { + sid, err := windows.StringToSid(sidStr) + if err != nil { + return nil, fmt.Errorf("--%s has an invalid SID: %s", param, sidStr) + } + return sid, nil + } + return nil, nil +} diff --git a/internal/pkg/agent/cmd/inspect.go b/internal/pkg/agent/cmd/inspect.go index 0f0b063b06a..848141ecba9 100644 --- a/internal/pkg/agent/cmd/inspect.go +++ b/internal/pkg/agent/cmd/inspect.go @@ -181,20 +181,40 @@ func inspectConfig(ctx context.Context, cfgPath string, opts inspectConfigOpts, return fmt.Errorf("failed to get binary mappings: %w", err) } + // service units like endpoint are special; they require a PID to monitor. + // however, `inspect` doesn't talk to the coordinator backend, which means it can't know their actual PID from this point in the code + // instead, we look for service units and create a fake PID, so we print the monitoring config anyway. + serviceUnitExists := false + fakeServicePids := map[string]uint64{} + // The monitoring config depends on a map from component id to // binary name. binaryMapping := make(map[string]string) for _, component := range components { if spec := component.InputSpec; spec != nil { - binaryMapping[component.ID] = spec.BinaryName + binaryMapping[component.ID] = component.BinaryName() + if spec.Spec.Service != nil { + serviceUnitExists = true + fakeServicePids[component.ID] = 1234 + } } } - monitorCfg, err := monitorFn(cfg, components, binaryMapping) + monitorCfg, err := monitorFn(cfg, components, binaryMapping, fakeServicePids) if err != nil { return fmt.Errorf("failed to get monitoring config: %w", err) } if monitorCfg != nil { + + // see above comment; because we don't know endpoint's actual PID, we need to make a fake one. Warn the user. + if serviceUnitExists { + keys := make([]string, 0, len(fakeServicePids)) + for k := range fakeServicePids { + keys = append(keys, k) + } + fmt.Fprintf(streams.Err, "WARNING: the inspect command can't accurately produce monitoring configs for service units: %v. Use the diagnostics command to get the real config used for monitoring these components\n", keys) + } + rawCfg := config.MustNewConfigFrom(cfg) if err := rawCfg.Merge(monitorCfg); err != nil { @@ -205,7 +225,9 @@ func inspectConfig(ctx context.Context, cfgPath string, opts inspectConfigOpts, if err != nil { return fmt.Errorf("failed to convert monitoring config: %w", err) } + } + } return printMapStringConfig(cfg, streams) @@ -252,43 +274,12 @@ func inspectComponents(ctx context.Context, cfgPath string, opts inspectComponen return err } - // Load the requirements before trying to load the configuration. These should always load - // even if the configuration is wrong. - platform, err := component.LoadPlatformDetail() - if err != nil { - return fmt.Errorf("failed to gather system information: %w", err) - } - specs, err := component.LoadRuntimeSpecs(paths.Components(), platform) - if err != nil { - return fmt.Errorf("failed to detect inputs and outputs: %w", err) - } - - isAdmin, err := utils.HasRoot() - if err != nil { - return fmt.Errorf("error checking for root/Administrator privileges: %w", err) - } - - m, lvl, err := getConfigWithVariables(ctx, l, cfgPath, opts.variablesWait, !isAdmin) + comps, err := getComponentsFromPolicy(ctx, l, cfgPath, opts.variablesWait) if err != nil { + // error already includes the context return err } - monitorFn, err := getMonitoringFn(ctx, m) - if err != nil { - return fmt.Errorf("failed to get monitoring: %w", err) - } - - agentInfo, err := info.NewAgentInfoWithLog(ctx, "error", false) - if err != nil { - return fmt.Errorf("could not load agent info: %w", err) - } - - // Compute the components from the computed configuration. - comps, err := specs.ToComponents(m, monitorFn, lvl, agentInfo) - if err != nil { - return fmt.Errorf("failed to render components: %w", err) - } - // Hide configuration unless toggled on. if !opts.showConfig { for i, comp := range comps { @@ -349,6 +340,47 @@ func inspectComponents(ctx context.Context, cfgPath string, opts inspectComponen return printComponents(allowed, blocked, streams) } +func getComponentsFromPolicy(ctx context.Context, l *logger.Logger, cfgPath string, variablesWait time.Duration, platformModifiers ...component.PlatformModifier) ([]component.Component, error) { + // Load the requirements before trying to load the configuration. These should always load + // even if the configuration is wrong. + platform, err := component.LoadPlatformDetail(platformModifiers...) + if err != nil { + return nil, fmt.Errorf("failed to gather system information: %w", err) + } + specs, err := component.LoadRuntimeSpecs(paths.Components(), platform) + if err != nil { + return nil, fmt.Errorf("failed to detect inputs and outputs: %w", err) + } + + isAdmin, err := utils.HasRoot() + if err != nil { + return nil, fmt.Errorf("error checking for root/Administrator privileges: %w", err) + } + + m, lvl, err := getConfigWithVariables(ctx, l, cfgPath, variablesWait, !isAdmin) + if err != nil { + return nil, err + } + + monitorFn, err := getMonitoringFn(ctx, m) + if err != nil { + return nil, fmt.Errorf("failed to get monitoring: %w", err) + } + + agentInfo, err := info.NewAgentInfoWithLog(ctx, "error", false) + if err != nil { + return nil, fmt.Errorf("could not load agent info: %w", err) + } + + // Compute the components from the computed configuration. + comps, err := specs.ToComponents(m, monitorFn, lvl, agentInfo, map[string]uint64{}) + if err != nil { + return nil, fmt.Errorf("failed to render components: %w", err) + } + + return comps, nil +} + func getMonitoringFn(ctx context.Context, cfg map[string]interface{}) (component.GenerateMonitoringCfgFn, error) { config, err := config.NewConfigFrom(cfg) if err != nil { diff --git a/internal/pkg/agent/cmd/install.go b/internal/pkg/agent/cmd/install.go index 3d0179ca881..55f5f77067e 100644 --- a/internal/pkg/agent/cmd/install.go +++ b/internal/pkg/agent/cmd/install.go @@ -10,7 +10,6 @@ import ( "os" "os/exec" "path/filepath" - "runtime" "github.com/spf13/cobra" @@ -26,6 +25,8 @@ import ( const ( flagInstallBasePath = "base-path" flagInstallUnprivileged = "unprivileged" + flagInstallDevelopment = "develop" + flagInstallNamespace = "namespace" ) func newInstallCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command { @@ -48,8 +49,14 @@ would like the Agent to operate. cmd.Flags().BoolP("force", "f", false, "Force overwrite the current installation and do not prompt for confirmation") cmd.Flags().BoolP("non-interactive", "n", false, "Install Elastic Agent in non-interactive mode which will not prompt on missing parameters but fails instead.") cmd.Flags().String(flagInstallBasePath, paths.DefaultBasePath, "The path where the Elastic Agent will be installed. It must be an absolute path.") - cmd.Flags().Bool(flagInstallUnprivileged, false, "Installed Elastic Agent will create an 'elastic-agent' user and run as that user. (experimental)") - _ = cmd.Flags().MarkHidden(flagInstallUnprivileged) // Hidden until fully supported + cmd.Flags().Bool(flagInstallUnprivileged, false, "Install in unprivileged mode, limiting the access of the Elastic Agent. (beta)") + + cmd.Flags().String(flagInstallNamespace, "", "Install into an isolated namespace. Allows multiple Elastic Agents to be installed at once. (experimental)") + _ = cmd.Flags().MarkHidden(flagInstallNamespace) // For internal use only. + + cmd.Flags().Bool(flagInstallDevelopment, false, "Install into a standardized development namespace, may enable development specific options. Allows multiple Elastic Agents to be installed at once. (experimental)") + _ = cmd.Flags().MarkHidden(flagInstallDevelopment) // For internal use only. + addEnrollFlags(cmd) return cmd @@ -76,13 +83,23 @@ func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error { return fmt.Errorf("unable to perform install command, not executed with %s permissions", utils.PermissionUser) } - // only support Linux and MacOS at the moment unprivileged, _ := cmd.Flags().GetBool(flagInstallUnprivileged) - if unprivileged && (runtime.GOOS != "linux" && runtime.GOOS != "darwin") { - return fmt.Errorf("unable to perform install command, unprivileged is currently only supported on Linux and MacOSß") - } if unprivileged { - fmt.Fprintln(streams.Out, "Unprivileged installation mode enabled; this is an experimental and currently unsupported feature.") + fmt.Fprintln(streams.Out, "Unprivileged installation mode enabled; this feature is currently in beta.") + } + + isDevelopmentMode, _ := cmd.Flags().GetBool(flagInstallDevelopment) + if isDevelopmentMode { + fmt.Fprintln(streams.Out, "Installing into development namespace; this is an experimental and currently unsupported feature.") + // For now, development mode only installs agent in a well known namespace to allow two agents on the same machine. + paths.SetInstallNamespace(paths.DevelopmentNamespace) + } + + namespace, _ := cmd.Flags().GetString(flagInstallNamespace) + if namespace != "" { + fmt.Fprintf(streams.Out, "Installing into namespace '%s'; this is an experimental and currently unsupported feature.\n", namespace) + // Overrides the development namespace if namespace was specified separately. + paths.SetInstallNamespace(namespace) } topPath := paths.InstallPath(basePath) @@ -193,28 +210,13 @@ func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error { progBar := install.CreateAndStartNewSpinner(streams.Out, "Installing Elastic Agent...") - logCfg := logp.DefaultConfig(logp.DefaultEnvironment) - logCfg.Level = logp.DebugLevel - // Using in memory logger, so we don't write logs to the - // directory we are trying to delete - logp.ToObserverOutput()(&logCfg) - - err = logp.Configure(logCfg) - if err != nil { - return fmt.Errorf("error creating logging config: %w", err) - } - - log := logger.NewWithoutConfig("") - + log, logBuff := logger.NewInMemory("install", logp.ConsoleEncoderConfig()) defer func() { if err == nil { return } - oLogs := logp.ObserverLogs().TakeAll() fmt.Fprintf(os.Stderr, "Error uninstalling. Printing logs\n") - for _, oLog := range oLogs { - fmt.Fprintf(os.Stderr, "%v\n", oLog.Entry) - } + fmt.Fprint(os.Stderr, logBuff.String()) }() var ownership utils.FileOwner @@ -242,7 +244,7 @@ func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error { err = install.StartService(topPath) if err != nil { progBar.Describe("Start Service failed, exiting...") - fmt.Fprintf(streams.Out, "Installation failed to start Elastic Agent service.\n") + fmt.Fprintf(streams.Out, "Installation failed to start '%s' service.\n", paths.ServiceName()) return fmt.Errorf("error starting service: %w", err) } progBar.Describe("Service Started") @@ -250,7 +252,7 @@ func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error { defer func() { if err != nil { progBar.Describe("Stopping Service") - innerErr := install.StopService(topPath) + innerErr := install.StopService(topPath, install.DefaultStopTimeout, install.DefaultStopInterval) if innerErr != nil { progBar.Describe("Failed to Stop Service") } else { diff --git a/internal/pkg/agent/cmd/install_enroll.go b/internal/pkg/agent/cmd/install_enroll.go index 8f7677ebed6..bea58cfdb8a 100644 --- a/internal/pkg/agent/cmd/install_enroll.go +++ b/internal/pkg/agent/cmd/install_enroll.go @@ -7,13 +7,29 @@ package cmd import ( + "fmt" "os/exec" + "strconv" "syscall" "github.com/elastic/elastic-agent/pkg/utils" ) func enrollCmdExtras(cmd *exec.Cmd, ownership utils.FileOwner) error { + if ownership.UID > 0 { + cmd.Args = append( + cmd.Args, + fmt.Sprintf("--%s", fromInstallUserArg), + strconv.Itoa(ownership.UID), + ) + } + if ownership.GID > 0 { + cmd.Args = append( + cmd.Args, + fmt.Sprintf("--%s", fromInstallGroupArg), + strconv.Itoa(ownership.GID), + ) + } cmd.SysProcAttr = &syscall.SysProcAttr{ Credential: &syscall.Credential{ Uid: uint32(ownership.UID), diff --git a/internal/pkg/agent/cmd/install_enroll_windows.go b/internal/pkg/agent/cmd/install_enroll_windows.go index 8178950fc0f..c87855091ed 100644 --- a/internal/pkg/agent/cmd/install_enroll_windows.go +++ b/internal/pkg/agent/cmd/install_enroll_windows.go @@ -7,12 +7,26 @@ package cmd import ( + "fmt" "os/exec" "github.com/elastic/elastic-agent/pkg/utils" ) func enrollCmdExtras(cmd *exec.Cmd, ownership utils.FileOwner) error { - // TODO: Add ability to call enroll as non-Administrator on Windows. + if ownership.UID != "" { + cmd.Args = append( + cmd.Args, + fmt.Sprintf("--%s", fromInstallUserArg), + ownership.UID, + ) + } + if ownership.GID != "" { + cmd.Args = append( + cmd.Args, + fmt.Sprintf("--%s", fromInstallGroupArg), + ownership.GID, + ) + } return nil } diff --git a/internal/pkg/agent/cmd/logs.go b/internal/pkg/agent/cmd/logs.go index ed65b3278a2..4e8b99f4a09 100644 --- a/internal/pkg/agent/cmd/logs.go +++ b/internal/pkg/agent/cmd/logs.go @@ -36,7 +36,7 @@ const ( ) var ( - logFilePattern = regexp.MustCompile(`elastic-agent-(\d+)(-\d+)?\.ndjson$`) + logFilePattern = regexp.MustCompile(`elastic-agent(-event-log)?-(\d+)(-\d+)?\.ndjson$`) errLineFiltered = errors.New("this line was filtered out") ) @@ -161,12 +161,15 @@ func newWrappedWriter(ctx context.Context, w io.Writer, filter filterFunc, modif } func newLogsCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command { + logsDir := filepath.Join(paths.Home(), logger.DefaultLogDirectory) + eventLogsDir := filepath.Join(logsDir, "events") + cmd := &cobra.Command{ Use: "logs", Short: "Output Elastic Agent logs", Long: "This command allows to output, watch and filter Elastic Agent logs.", Run: func(c *cobra.Command, _ []string) { - if err := logsCmd(streams, c); err != nil { + if err := logsCmd(streams, c, logsDir, eventLogsDir); err != nil { fmt.Fprintf(streams.Err, "Error: %v\n%s\n", err, troubleshootMessage()) os.Exit(1) } @@ -176,17 +179,19 @@ func newLogsCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command { cmd.Flags().BoolP("follow", "f", false, "Do not stop when end of file is reached, but rather to wait for additional data to be appended to the log file.") cmd.Flags().BoolP("no-color", "", false, "Do not apply colors to different log levels.") cmd.Flags().IntP("number", "n", 10, "Maximum number of lines at the end of logs to output.") + cmd.Flags().Bool("exclude-events", false, "Excludes events log files") cmd.Flags().StringP("component", "C", "", "Filter logs and output only logs for the given component ID.") return cmd } -func logsCmd(streams *cli.IOStreams, cmd *cobra.Command) error { +func logsCmd(streams *cli.IOStreams, cmd *cobra.Command, logsDir, eventLogsDir string) error { component, _ := cmd.Flags().GetString("component") lines, _ := cmd.Flags().GetInt("number") follow, _ := cmd.Flags().GetBool("follow") noColor, _ := cmd.Flags().GetBool("no-color") + excludeEvents, _ := cmd.Flags().GetBool("exclude-events") var ( filter filterFunc @@ -201,13 +206,41 @@ func logsCmd(streams *cli.IOStreams, cmd *cobra.Command) error { modifier = addColorModifier } - logsDir := filepath.Join(paths.Home(), logger.DefaultLogDirectory) // uncomment for debugging // fmt.Fprintf(streams.Err, "logs dir: %q", logsDir) - err := printLogs(cmd.Context(), streams.Out, logsDir, lines, follow, filter, modifier) - if err != nil { - return fmt.Errorf("failed to get logs: %w", err) + errChan := make(chan error) + + go func() { + err := printLogs(cmd.Context(), streams.Out, logsDir, lines, follow, filter, modifier) + if err != nil { + errChan <- fmt.Errorf("failed to get logs: %w", err) + return + } + errChan <- nil + }() + + if !excludeEvents { + go func() { + done := false + // The event log folder might not exist, so we keep trying every five seconds + for !done { + err := printLogs(cmd.Context(), streams.Out, eventLogsDir, lines, follow, filter, modifier) + if err != nil { + if !strings.Contains(err.Error(), "logs/events: no such file or directory") { + errChan <- fmt.Errorf("failed to get event logs: %w", err) + return + } + time.Sleep(5 * time.Second) + } + + done = true + } + }() + } + + if err := <-errChan; err != nil { + return err } return nil @@ -424,20 +457,20 @@ func sortLogFilenames(filenames []string) { switch { // e.g. elastic-agent-20230515-1.ndjson vs elastic-agent-20230515-2.ndjson - case iGroups[1] == jGroups[1] && iGroups[2] != "" && jGroups[2] != "": - return iGroups[2] < jGroups[2] + case iGroups[2] == jGroups[2] && iGroups[3] != "" && jGroups[3] != "": + return iGroups[3] < jGroups[3] // e.g. elastic-agent-20230515.ndjson vs elastic-agent-20230515-1.ndjson - case iGroups[1] == jGroups[1] && iGroups[2] != "": + case iGroups[2] == jGroups[2] && iGroups[3] != "": return false // e.g. elastic-agent-20230515-1.ndjson vs elastic-agent-20230515.ndjson - case iGroups[1] == jGroups[1] && jGroups[2] != "": + case iGroups[2] == jGroups[2] && jGroups[3] != "": return true // e.g. elastic-agent-20230515.ndjson vs elastic-agent-20230516.ndjson default: - return iGroups[1] < jGroups[1] + return iGroups[2] < jGroups[2] } }) } diff --git a/internal/pkg/agent/cmd/logs_test.go b/internal/pkg/agent/cmd/logs_test.go index d91f0326eef..a1ead903b4b 100644 --- a/internal/pkg/agent/cmd/logs_test.go +++ b/internal/pkg/agent/cmd/logs_test.go @@ -5,6 +5,7 @@ package cmd import ( + "bufio" "bytes" "context" "fmt" @@ -17,6 +18,8 @@ import ( "github.com/stretchr/testify/require" "gotest.tools/assert" + + "github.com/elastic/elastic-agent/internal/pkg/cli" ) const ( @@ -673,3 +676,46 @@ func (cw *chanWriter) waitUntilMatch( } } } + +func TestCobraCmd(t *testing.T) { + expectedLines := 10 + testingStreams, _, out, _ := cli.NewTestingIOStreams() + + cmd := newLogsCommandWithArgs(nil, testingStreams) + logsDir := t.TempDir() + eventLogsDir := filepath.Join(logsDir, "events") + + if err := cmd.Flags().Set("number", "10"); err != nil { + t.Fatalf("could not set flags: %s", err) + } + + filename := fmt.Sprintf("elastic-agent-%s.ndjson", time.Now().Format("20060102")) + createFileContent(t, logsDir, filename, bytes.NewBuffer([]byte(generateLines("foo", 1, 10)))) + + if err := os.MkdirAll(eventLogsDir, 0750); err != nil { + t.Fatalf("could not create folder for event log files: %s", err) + } + + eventFilename := fmt.Sprintf("elastic-agent-event-log-%s.ndjson", time.Now().Format("20060102")) + createFileContent(t, eventLogsDir, eventFilename, bytes.NewBuffer([]byte(generateLines("event", 1, 10)))) + + if err := logsCmd(testingStreams, cmd, logsDir, eventLogsDir); err != nil { + t.Errorf("did not expect an error calling logsCmd: %s", err) + } + + s := bufio.NewScanner(out) + count := 0 + lines := []string{} + for s.Scan() { + lines = append(lines, s.Text()) + count++ + } + + // The events log file might not be read, so if we get all the lines + // from the normal log file, we consider a success. Anything extra + // is a bonus + if count < expectedLines { + t.Errorf("expecting at least %d log lines, got %d instead", expectedLines, count) + t.Logf("Log lines:\n%s", strings.Join(lines, "\n")) + } +} diff --git a/internal/pkg/agent/cmd/otel.go b/internal/pkg/agent/cmd/otel.go index c822b03bc12..c3885129f0b 100644 --- a/internal/pkg/agent/cmd/otel.go +++ b/internal/pkg/agent/cmd/otel.go @@ -2,6 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package cmd import ( @@ -18,11 +20,6 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/otel" ) -const ( - configFlagName = "config" - setFlagName = "set" -) - func newOtelCommandWithArgs(args []string, streams *cli.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "otel", diff --git a/internal/pkg/agent/cmd/otel_flags.go b/internal/pkg/agent/cmd/otel_flags.go index 6f72c521fdc..6f3905bae16 100644 --- a/internal/pkg/agent/cmd/otel_flags.go +++ b/internal/pkg/agent/cmd/otel_flags.go @@ -2,6 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package cmd import ( @@ -16,11 +18,16 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" ) +const ( + otelConfigFlagName = "config" + otelSetFlagName = "set" +) + func setupOtelFlags(flags *pflag.FlagSet) { - flags.StringArray(configFlagName, []string{}, "Locations to the config file(s), note that only a"+ + flags.StringArray(otelConfigFlagName, []string{}, "Locations to the config file(s), note that only a"+ " single location can be set per flag entry e.g. `--config=file:/path/to/first --config=file:path/to/second`.") - flags.StringArray(setFlagName, []string{}, "Set arbitrary component config property. The component has to be defined in the config file and the flag"+ + flags.StringArray(otelSetFlagName, []string{}, "Set arbitrary component config property. The component has to be defined in the config file and the flag"+ " has a higher precedence. Array config properties are overridden and maps are joined. Example --set=processors.batch.timeout=2s") goFlags := new(flag.FlagSet) @@ -30,7 +37,7 @@ func setupOtelFlags(flags *pflag.FlagSet) { } func getConfigFiles(cmd *cobra.Command, useDefault bool) ([]string, error) { - configFiles, err := cmd.Flags().GetStringArray(configFlagName) + configFiles, err := cmd.Flags().GetStringArray(otelConfigFlagName) if err != nil { return nil, fmt.Errorf("failed to retrieve config flags: %w", err) } @@ -42,7 +49,7 @@ func getConfigFiles(cmd *cobra.Command, useDefault bool) ([]string, error) { configFiles = append(configFiles, paths.OtelConfigFile()) } - setVals, err := cmd.Flags().GetStringArray(setFlagName) + setVals, err := cmd.Flags().GetStringArray(otelSetFlagName) if err != nil { return nil, fmt.Errorf("failed to retrieve set flags: %w", err) } diff --git a/internal/pkg/agent/cmd/otel_flags_test.go b/internal/pkg/agent/cmd/otel_flags_test.go index 5b31831f129..e0b2e52e5ec 100644 --- a/internal/pkg/agent/cmd/otel_flags_test.go +++ b/internal/pkg/agent/cmd/otel_flags_test.go @@ -2,6 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package cmd import ( @@ -10,6 +12,8 @@ import ( "github.com/spf13/pflag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" ) func TestOtelFlagsSetup(t *testing.T) { @@ -17,8 +21,8 @@ func TestOtelFlagsSetup(t *testing.T) { setupOtelFlags(fs) expectedFlags := []string{ - configFlagName, - setFlagName, + otelConfigFlagName, + otelSetFlagName, "feature-gates", } @@ -27,6 +31,43 @@ func TestOtelFlagsSetup(t *testing.T) { } } +func TestGetConfigFiles(t *testing.T) { + cmd := newOtelCommandWithArgs(nil, nil) + configFile := "sample.yaml" + require.NoError(t, cmd.Flag(otelConfigFlagName).Value.Set(configFile)) + + setVal := "set=val" + sets, err := getSets([]string{setVal}) + require.NoError(t, err) + require.NoError(t, cmd.Flag(otelSetFlagName).Value.Set(setVal)) + + expectedConfigFiles := append([]string{configFile}, sets...) + configFiles, err := getConfigFiles(cmd, false) + require.NoError(t, err) + require.Equal(t, expectedConfigFiles, configFiles) +} + +func TestGetConfigFilesWithDefault(t *testing.T) { + cmd := newOtelCommandWithArgs(nil, nil) + + setVal := "set=val" + sets, err := getSets([]string{setVal}) + require.NoError(t, err) + require.NoError(t, cmd.Flag(otelSetFlagName).Value.Set(setVal)) + + expectedConfigFiles := append([]string{paths.OtelConfigFile()}, sets...) + configFiles, err := getConfigFiles(cmd, true) + require.NoError(t, err) + require.Equal(t, expectedConfigFiles, configFiles) +} + +func TestGetConfigErrorWhenNoConfig(t *testing.T) { + cmd := newOtelCommandWithArgs(nil, nil) + + _, err := getConfigFiles(cmd, false) + require.Error(t, err) +} + func TestGetSets(t *testing.T) { testCases := []struct { name string diff --git a/internal/pkg/agent/cmd/otel_windows.go b/internal/pkg/agent/cmd/otel_windows.go new file mode 100644 index 00000000000..2d741852877 --- /dev/null +++ b/internal/pkg/agent/cmd/otel_windows.go @@ -0,0 +1,17 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build windows + +package cmd + +import ( + "github.com/spf13/cobra" + + "github.com/elastic/elastic-agent/internal/pkg/cli" +) + +func newOtelCommandWithArgs(args []string, streams *cli.IOStreams) *cobra.Command { + return nil +} diff --git a/testing/integration/install_windows_test.go b/internal/pkg/agent/cmd/otel_windows_test.go similarity index 60% rename from testing/integration/install_windows_test.go rename to internal/pkg/agent/cmd/otel_windows_test.go index 9d297af43a0..dd84acbe724 100644 --- a/testing/integration/install_windows_test.go +++ b/internal/pkg/agent/cmd/otel_windows_test.go @@ -2,14 +2,16 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -//go:build integration && windows +//go:build windows -package integration +package cmd import ( "testing" + + "github.com/stretchr/testify/require" ) -func checkPlatformUnprivileged(t *testing.T, topPath string) { - // TODO (blakerouse): validate once Windows is supported +func TestOtelCommandIsNil(t *testing.T) { + require.Nil(t, newOtelCommandWithArgs(nil, nil)) } diff --git a/internal/pkg/agent/cmd/privileged.go b/internal/pkg/agent/cmd/privileged.go new file mode 100644 index 00000000000..6d76cbe0cfd --- /dev/null +++ b/internal/pkg/agent/cmd/privileged.go @@ -0,0 +1,95 @@ +// 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 cmd + +import ( + "context" + "errors" + "fmt" + "os" + + "github.com/spf13/cobra" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/internal/pkg/agent/install" + "github.com/elastic/elastic-agent/internal/pkg/cli" + "github.com/elastic/elastic-agent/pkg/control/v2/client/wait" + "github.com/elastic/elastic-agent/pkg/utils" +) + +func newPrivilegedCommandWithArgs(s []string, streams *cli.IOStreams) *cobra.Command { + cmd := &cobra.Command{ + Use: "privileged", + Short: "Switch installed Elastic Agent to run as privileged", + Long: `This command converts the installed Elastic Agent from running unprivileged to running as privileged. + +By default this command will ask or a confirmation before making this change. You can bypass the confirmation request +using the -f flag. This is not a zero downtime operation and will always stop the running Elastic Agent (if running). +It is possible that loss of metrics, logs, or data could occur during this window of time. The Elastic Agent +daemon will always be started (even if it was off to start). In the case that the Elastic Agent is already running +privileged it will still perform all the same work, including stopping and starting the Elastic Agent. +`, + Args: cobra.ExactArgs(0), + Run: func(c *cobra.Command, args []string) { + if err := privilegedCmd(streams, c); err != nil { + fmt.Fprintf(streams.Err, "Error: %v\n%s\n", err, troubleshootMessage()) + os.Exit(1) + } + }, + } + + cmd.Flags().BoolP("force", "f", false, "Do not prompt for confirmation") + cmd.Flags().DurationP("daemon-timeout", "", 0, "Timeout waiting for Elastic Agent daemon restart after the change is applied (-1 = no wait)") + + return cmd +} + +func privilegedCmd(streams *cli.IOStreams, cmd *cobra.Command) (err error) { + isAdmin, err := utils.HasRoot() + if err != nil { + return fmt.Errorf("unable to perform privileged command while checking for root/Administrator rights: %w", err) + } + if !isAdmin { + return fmt.Errorf("unable to perform privileged command, not executed with %s permissions", utils.PermissionUser) + } + + topPath := paths.Top() + daemonTimeout, _ := cmd.Flags().GetDuration("daemon-timeout") + force, _ := cmd.Flags().GetBool("force") + if !force { + confirm, err := cli.Confirm("This will restart the running Elastic Agent and convert it to run in privileged mode. Do you want to continue?", true) + if err != nil { + return fmt.Errorf("problem reading prompt response") + } + if !confirm { + return fmt.Errorf("unprivileged switch was cancelled by the user") + } + } + + pt := install.CreateAndStartNewSpinner(streams.Out, "Converting Elastic Agent to privileged...") + err = install.SwitchExecutingMode(topPath, pt, "", "") + if err != nil { + // error already adds context + return err + } + + // wait for the service + if daemonTimeout >= 0 { + pt.Describe("Waiting for running service") + ctx := handleSignal(context.Background()) // allowed to be cancelled + err = wait.ForAgent(ctx, daemonTimeout) + if err != nil { + if errors.Is(err, context.Canceled) { + pt.Describe("Cancelled waiting for running service") + return nil + } + pt.Describe("Failed waiting for running service") + return err + } + pt.Describe("Service is up and running") + } + + return nil +} diff --git a/internal/pkg/agent/cmd/reexec_windows.go b/internal/pkg/agent/cmd/reexec_windows.go index 41190602231..a11ffb16c83 100644 --- a/internal/pkg/agent/cmd/reexec_windows.go +++ b/internal/pkg/agent/cmd/reexec_windows.go @@ -8,6 +8,7 @@ package cmd import ( "fmt" + "io" "os" "strconv" "time" @@ -16,10 +17,15 @@ import ( "golang.org/x/sys/windows/svc" "golang.org/x/sys/windows/svc/mgr" - "github.com/elastic/elastic-agent/internal/pkg/agent/errors" + "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/elastic-agent/internal/pkg/cli" ) +const ( + reexecName = "elastic-agent-reexec" +) + func newReExecWindowsCommand(_ []string, streams *cli.IOStreams) *cobra.Command { cmd := &cobra.Command{ Hidden: true, @@ -28,49 +34,116 @@ func newReExecWindowsCommand(_ []string, streams *cli.IOStreams) *cobra.Command Long: "This waits for the windows service to stop then restarts it to allow self-upgrading.", Args: cobra.ExactArgs(2), Run: func(c *cobra.Command, args []string) { - serviceName := args[0] - servicePid, err := strconv.Atoi(args[1]) + cfg := getConfig(streams) + log, err := configuredLogger(cfg, reexecName) if err != nil { - fmt.Fprintf(streams.Err, "%v\n", err) - os.Exit(1) + fmt.Fprintf(streams.Err, "Error configuring logger: %v\n%s\n", err, troubleshootMessage()) + os.Exit(3) } - err = reExec(serviceName, servicePid) + + // Make sure to flush any buffered logs before we're done. + defer log.Sync() //nolint:errcheck // flushing buffered logs is best effort. + + serviceName := args[0] + servicePid, err := strconv.Atoi(args[1]) if err != nil { - fmt.Fprintf(streams.Err, "Error: %v\n%s\n", err, troubleshootMessage()) + log.Errorw("reexec failed", "error.message", err) + fmt.Fprintf(streams.Err, "reexec failed: %v\n", err) os.Exit(1) } + reExec(log, serviceName, servicePid, streams.Err) }, } return cmd } -func reExec(serviceName string, servicePid int) error { +func reExec(log *logp.Logger, serviceName string, servicePid int, writer io.Writer) { + for { + ready, err := ensureAnotherProcess(log, serviceName, servicePid) + if err == nil && ready { + // all done + // success is logged in the ensureAnotherProcess with more detail + return + } + if err != nil { + log.Errorw("failed to ensure another service process was spawned; will retry in 0.3 seconds", "error.message", err) + _, _ = fmt.Fprintf(writer, "failed to ensure another service process was spawned; will retry in 0.3 seconds: %s", err) + } + time.Sleep(300 * time.Millisecond) + } +} + +func ensureAnotherProcess(log *logp.Logger, serviceName string, servicePid int) (bool, error) { + status, err := getServiceState(serviceName) + if err != nil { + return false, err + } + log.Infof("current state for service(%s); state: %d [pid: %d]", serviceName, status.State, status.ProcessId) + + if status.State == svc.Running && status.ProcessId != 0 && int(status.ProcessId) != servicePid { + // running and it's a different process + log.Infof("reexec complete; running and with a different PID (%d != %d)", servicePid, status.ProcessId) + return true, nil + } + + if status.State == svc.Stopped { + // fully stopped + log.Infof("service is completely stopped; starting the service") + err = startService(serviceName) + return false, err + } + + // not stopped and not running as a different PID, just wait + return false, nil +} + +// getServiceState gets the current state from the service manager. +// +// Connects to the manager on every check to ensure that the correct ACL's are applied at the time. +func getServiceState(serviceName string) (svc.Status, error) { manager, err := mgr.Connect() if err != nil { - return errors.New(err, "failed to connect to service manager") + return svc.Status{}, fmt.Errorf("failed to connect to service manager: %w", err) } + defer func() { + _ = manager.Disconnect() + }() + service, err := manager.OpenService(serviceName) if err != nil { - return errors.New(err, "failed to open service") + return svc.Status{}, fmt.Errorf("failed to open service: %w", err) } - for { - status, err := service.Query() - if err != nil { - return errors.New(err, "failed to query service") - } - if status.State == svc.Stopped { - err = service.Start() - if err != nil { - return errors.New(err, "failed to start service") - } - // triggered restart; done - return nil - } - if int(status.ProcessId) != servicePid { - // already restarted; has different PID, done! - return nil - } - <-time.After(300 * time.Millisecond) + defer service.Close() + + status, err := service.Query() + if err != nil { + return svc.Status{}, fmt.Errorf("failed to query service: %w", err) + } + return status, nil +} + +// startService starts the service. +// +// Connects to the manager on every check to ensure that the correct ACL's are applied at the time. +func startService(serviceName string) error { + manager, err := mgr.Connect() + if err != nil { + return fmt.Errorf("failed to connect to service manager: %w", err) + } + defer func() { + _ = manager.Disconnect() + }() + + service, err := manager.OpenService(serviceName) + if err != nil { + return fmt.Errorf("failed to open service: %w", err) + } + defer service.Close() + + err = service.Start() + if err != nil { + return fmt.Errorf("failed to start service: %w", err) } + return nil } diff --git a/internal/pkg/agent/cmd/run.go b/internal/pkg/agent/cmd/run.go index 60d72c4952c..bd855c71ad0 100644 --- a/internal/pkg/agent/cmd/run.go +++ b/internal/pkg/agent/cmd/run.go @@ -58,10 +58,13 @@ import ( const ( agentName = "elastic-agent" fleetInitTimeoutName = "FLEET_SERVER_INIT_TIMEOUT" + flagRunDevelopment = "develop" ) -type cfgOverrider func(cfg *configuration.Configuration) -type awaiters []<-chan struct{} +type ( + cfgOverrider func(cfg *configuration.Configuration) + awaiters []<-chan struct{} +) func newRunCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command { cmd := &cobra.Command{ @@ -69,16 +72,24 @@ func newRunCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command { Short: "Start the Elastic Agent", Long: "This command starts the Elastic Agent.", RunE: func(cmd *cobra.Command, _ []string) error { - // done very early so the encrypted store is never used + isDevelopmentMode, _ := cmd.Flags().GetBool(flagInstallDevelopment) + if isDevelopmentMode { + fmt.Fprintln(streams.Out, "Development installation mode enabled; this is an experimental feature.") + // For now, development mode only makes the agent behave as if it was running in a namespace to allow + // multiple agents on the same machine. + paths.SetInstallNamespace(paths.DevelopmentNamespace) + } + + // done very early so the encrypted store is never used. Always done in development mode to remove the need to be root. disableEncryptedStore, _ := cmd.Flags().GetBool("disable-encrypted-store") - if disableEncryptedStore { + if disableEncryptedStore || isDevelopmentMode { storage.DisableEncryptionDarwin() } fleetInitTimeout, _ := cmd.Flags().GetDuration("fleet-init-timeout") testingMode, _ := cmd.Flags().GetBool("testing-mode") if err := run(nil, testingMode, fleetInitTimeout); err != nil && !errors.Is(err, context.Canceled) { fmt.Fprintf(streams.Err, "Error: %v\n%s\n", err, troubleshootMessage()) - + logExternal(fmt.Sprintf("%s run failed: %s", paths.BinaryName, err)) return err } return nil @@ -103,6 +114,9 @@ func newRunCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command { cmd.Flags().Duration("fleet-init-timeout", envTimeout(fleetInitTimeoutName), " Sets the initial timeout when starting up the fleet server under agent") _ = cmd.Flags().MarkHidden("testing-mode") + cmd.Flags().Bool(flagRunDevelopment, false, "Run agent in development mode. Allows running when there is already an installed Elastic Agent. (experimental)") + _ = cmd.Flags().MarkHidden(flagRunDevelopment) // For internal use only. + return cmd } @@ -133,7 +147,7 @@ func run(override cfgOverrider, testingMode bool, fleetInitTimeout time.Duration // register as a service stop := make(chan bool) ctx, cancel := context.WithCancel(context.Background()) - var stopBeat = func() { + stopBeat := func() { close(stop) } @@ -143,6 +157,13 @@ func run(override cfgOverrider, testingMode bool, fleetInitTimeout time.Duration return runElasticAgent(ctx, cancel, override, stop, testingMode, fleetInitTimeout, false, nil, modifiers...) } +func logReturn(l *logger.Logger, err error) error { + if err != nil && !errors.Is(err, context.Canceled) { + l.Errorf("%s", err) + } + return err +} + 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 { @@ -153,7 +174,7 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf if cfg.Settings.LoggingConfig != nil { logLvl = cfg.Settings.LoggingConfig.Level } - baseLogger, err := logger.NewFromConfig("", cfg.Settings.LoggingConfig, true) + baseLogger, err := logger.NewFromConfig("", cfg.Settings.LoggingConfig, cfg.Settings.EventLoggingConfig, true) if err != nil { return err } @@ -165,19 +186,20 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf "source": agentName, }) - l.Infow("Elastic Agent started", "process.pid", os.Getpid(), "agent.version", version.GetAgentPackageVersion()) - // try early to check if running as root isRoot, err := utils.HasRoot() if err != nil { - return fmt.Errorf("failed to check for root/Administrator privileges: %w", err) + return logReturn(l, fmt.Errorf("failed to check for root/Administrator privileges: %w", err)) } + l.Infow("Elastic Agent started", + "process.pid", os.Getpid(), + "agent.version", version.GetAgentPackageVersion(), + "agent.unprivileged", !isRoot) + cfg, err = tryDelayEnroll(ctx, l, cfg, override) if err != nil { - err = errors.New(err, "failed to perform delayed enrollment") - l.Error(err) - return err + return logReturn(l, errors.New(err, "failed to perform delayed enrollment")) } pathConfigFile := paths.AgentConfigFile() @@ -193,7 +215,7 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf // that writes the agentID into fleet.enc (encrypted fleet.yml) before even loading the configuration. err = secret.CreateAgentSecret(ctx, vault.WithUnprivileged(!isRoot)) if err != nil { - return fmt.Errorf("failed to read/write secrets: %w", err) + return logReturn(l, fmt.Errorf("failed to read/write secrets: %w", err)) } // Migrate .yml files if the corresponding .enc does not exist @@ -201,21 +223,21 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf // the encrypted config does not exist but the unencrypted file does err = migration.MigrateToEncryptedConfig(ctx, l, paths.AgentConfigYmlFile(), paths.AgentConfigFile()) if err != nil { - return errors.New(err, "error migrating fleet config") + return logReturn(l, errors.New(err, "error migrating fleet config")) } // the encrypted state does not exist but the unencrypted file does err = migration.MigrateToEncryptedConfig(ctx, l, paths.AgentStateStoreYmlFile(), paths.AgentStateStoreFile()) if err != nil { - return errors.New(err, "error migrating agent state") + return logReturn(l, errors.New(err, "error migrating agent state")) } agentInfo, err := info.NewAgentInfoWithLog(ctx, defaultLogLevel(cfg, logLvl.String()), createAgentID) if err != nil { - return errors.New(err, + return logReturn(l, errors.New(err, "could not load agent info", errors.TypeFilesystem, - errors.M(errors.MetaKeyPath, pathConfigFile)) + errors.M(errors.MetaKeyPath, pathConfigFile))) } // Ensure that the log level now matches what is configured in the agentInfo. @@ -228,6 +250,9 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf logLvl = lvl logger.SetLevel(lvl) } + } else { + // Set the initial log level (either default or from config file) + logger.SetLevel(logLvl) } // initiate agent watcher @@ -238,14 +263,14 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf execPath, err := reexecPath() if err != nil { - return err + return logReturn(l, fmt.Errorf("failed to get reexec path: %w", err)) } rexLogger := l.Named("reexec") rex := reexec.NewManager(rexLogger, execPath) tracer, err := initTracer(agentName, release.Version(), cfg.Settings.MonitoringConfig) if err != nil { - return fmt.Errorf("could not initiate APM tracer: %w", err) + return logReturn(l, fmt.Errorf("could not initiate APM tracer: %w", err)) } if tracer != nil { l.Info("APM instrumentation enabled") @@ -259,13 +284,17 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf 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 + return logReturn(l, err) } - defer composable.Close() + defer func() { + if composable != nil { + composable.Close() + } + }() monitoringServer, err := setupMetrics(l, cfg.Settings.DownloadConfig.OS(), cfg.Settings.MonitoringConfig, tracer, coord) if err != nil { - return err + return logReturn(l, err) } coord.RegisterMonitoringServer(monitoringServer) defer func() { @@ -289,7 +318,7 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf // start the control listener if err := control.Start(); err != nil { - return err + return logReturn(l, err) } defer control.Stop() @@ -297,23 +326,24 @@ func runElasticAgent(ctx context.Context, cancel context.CancelFunc, override cf // this provides backwards compatibility as the control socket was moved with the addition of --unprivileged // option during installation // - // Windows `paths.ControlSocketRunSymlink` is `""` so this is always skipped on Windows. - if isRoot && paths.RunningInstalled() && paths.ControlSocketRunSymlink != "" { + // Windows `paths.ControlSocketRunSymlink()` is `""` so this is always skipped on Windows. + controlSocketRunSymlink := paths.ControlSocketRunSymlink(paths.InstallNamespace()) + if isRoot && paths.RunningInstalled() && controlSocketRunSymlink != "" { socketPath := strings.TrimPrefix(paths.ControlSocket(), "unix://") - socketLog := controlLog.With("path", socketPath).With("link", paths.ControlSocketRunSymlink) + socketLog := controlLog.With("path", socketPath).With("link", controlSocketRunSymlink) // ensure it doesn't exist before creating the symlink - if err := os.Remove(paths.ControlSocketRunSymlink); err != nil && !errors.Is(err, os.ErrNotExist) { - socketLog.Errorf("Failed to remove existing control socket symlink %s: %s", paths.ControlSocketRunSymlink, err) + if err := os.Remove(controlSocketRunSymlink); err != nil && !errors.Is(err, os.ErrNotExist) { + socketLog.Errorf("Failed to remove existing control socket symlink %s: %s", controlSocketRunSymlink, err) } - if err := os.Symlink(socketPath, paths.ControlSocketRunSymlink); err != nil { - socketLog.Errorf("Failed to create control socket symlink %s -> %s: %s", paths.ControlSocketRunSymlink, socketPath, err) + if err := os.Symlink(socketPath, controlSocketRunSymlink); err != nil { + socketLog.Errorf("Failed to create control socket symlink %s -> %s: %s", controlSocketRunSymlink, socketPath, err) } else { - socketLog.Infof("Created control socket symlink %s -> %s; allowing unix://%s connection", paths.ControlSocketRunSymlink, socketPath, paths.ControlSocketRunSymlink) + socketLog.Infof("Created control socket symlink %s -> %s; allowing unix://%s connection", controlSocketRunSymlink, socketPath, controlSocketRunSymlink) } defer func() { // delete the symlink on exit; ignore the error - if err := os.Remove(paths.ControlSocketRunSymlink); err != nil { - socketLog.Errorf("Failed to remove control socket symlink %s: %s", paths.ControlSocketRunSymlink, err) + if err := os.Remove(controlSocketRunSymlink); err != nil { + socketLog.Errorf("Failed to remove control socket symlink %s: %s", controlSocketRunSymlink, err) } }() } @@ -374,7 +404,7 @@ LOOP: if isRex { rex.ShutdownComplete() } - return err + return logReturn(l, err) } func loadConfig(ctx context.Context, override cfgOverrider, runAsOtel bool) (*configuration.Configuration, error) { @@ -485,7 +515,7 @@ func defaultLogLevel(cfg *configuration.Configuration, currentLevel string) stri return configuredLevel } - return defaultLogLevel + return "" } func tryDelayEnroll(ctx context.Context, logger *logger.Logger, cfg *configuration.Configuration, override cfgOverrider) (*configuration.Configuration, error) { @@ -518,18 +548,37 @@ func tryDelayEnroll(ctx context.Context, logger *logger.Logger, cfg *configurati // see https://github.com/elastic/elastic-agent/issues/4043 // SkipDaemonRestart to true avoids running that code. options.SkipDaemonRestart = true + pathConfigFile := paths.ConfigFile() + encStore, err := storage.NewEncryptedDiskStore(ctx, paths.AgentConfigFile()) + if err != nil { + return nil, fmt.Errorf("failed to create encrypted disk store: %w", err) + } + store := storage.NewReplaceOnSuccessStore( + pathConfigFile, + application.DefaultAgentFleetConfig, + encStore, + ) c, err := newEnrollCmd( - ctx, logger, &options, paths.ConfigFile(), + store, ) if err != nil { return nil, err } - err = c.Execute(ctx, cli.NewIOStreams()) - if err != nil { - return nil, err + // perform the enrollment in a loop, it should keep trying to enroll no matter what + // the enrollCmd has built in backoff so no need to wrap this in its own backoff as well + for { + if ctx.Err() != nil { + return nil, ctx.Err() + } + err = c.Execute(ctx, cli.NewIOStreams()) + if err == nil { + // enrollment was successful + break + } + logger.Error(fmt.Errorf("failed to perform delayed enrollment (will try again): %w", err)) } err = os.Remove(enrollPath) if err != nil { @@ -621,7 +670,7 @@ func setupMetrics( Host: monitoring.AgentMonitoringEndpoint(operatingSystem, cfg), } - s, err := monitoring.NewServer(logger, endpointConfig, monitoringLib.GetNamespace, tracer, coord, isProcessStatsEnabled(cfg), operatingSystem, cfg) + s, err := monitoring.NewServer(logger, endpointConfig, monitoringLib.GetNamespace, tracer, coord, operatingSystem, cfg) if err != nil { return nil, errors.New(err, "could not start the HTTP server for the API") } @@ -629,10 +678,6 @@ func setupMetrics( return s, nil } -func isProcessStatsEnabled(cfg *monitoringCfg.MonitoringConfig) bool { - return cfg != nil && cfg.HTTP.Enabled -} - // handleUpgrade checks if agent is being run as part of an // ongoing upgrade operation, i.e. being re-exec'd and performs // any upgrade-specific work, if needed. diff --git a/internal/pkg/agent/cmd/run_unix.go b/internal/pkg/agent/cmd/run_unix.go new file mode 100644 index 00000000000..4bbfa66f02c --- /dev/null +++ b/internal/pkg/agent/cmd/run_unix.go @@ -0,0 +1,11 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build !windows + +package cmd + +// logExternal logs the error to an external log. On non-windows systems this is a no-op. +func logExternal(msg string) { +} diff --git a/internal/pkg/agent/cmd/run_windows.go b/internal/pkg/agent/cmd/run_windows.go new file mode 100644 index 00000000000..308de4f1a57 --- /dev/null +++ b/internal/pkg/agent/cmd/run_windows.go @@ -0,0 +1,24 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build windows + +package cmd + +import ( + "golang.org/x/sys/windows/svc/eventlog" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" +) + +// logExternal logs the error to an external log. On Windows this is +// the Application EventLog. This is a best effort logger and no +// errors are returned. +func logExternal(msg string) { + eLog, err2 := eventlog.Open(paths.ServiceName()) + if err2 != nil { + return + } + _ = eLog.Error(1, msg) +} diff --git a/internal/pkg/agent/cmd/uninstall.go b/internal/pkg/agent/cmd/uninstall.go index b621a2e5e10..bbe1e329d47 100644 --- a/internal/pkg/agent/cmd/uninstall.go +++ b/internal/pkg/agent/cmd/uninstall.go @@ -11,7 +11,6 @@ import ( "github.com/spf13/cobra" "github.com/elastic/elastic-agent-libs/logp" - "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/agent/install" "github.com/elastic/elastic-agent/internal/pkg/cli" @@ -86,28 +85,13 @@ func uninstallCmd(streams *cli.IOStreams, cmd *cobra.Command) error { progBar := install.CreateAndStartNewSpinner(streams.Out, "Uninstalling Elastic Agent...") - logCfg := logp.DefaultConfig(logp.DefaultEnvironment) - logCfg.Level = logp.DebugLevel - // Using in memory logger, so we don't write logs to the - // directory we are trying to delete - logp.ToObserverOutput()(&logCfg) - - err = logp.Configure(logCfg) - if err != nil { - return fmt.Errorf("error creating logging config: %w", err) - } - - log := logger.NewWithoutConfig("") - + log, logBuff := logger.NewInMemory("uninstall", logp.ConsoleEncoderConfig()) defer func() { if err == nil { return } - oLogs := logp.ObserverLogs().TakeAll() fmt.Fprintf(os.Stderr, "Error uninstalling. Printing logs\n") - for _, oLog := range oLogs { - fmt.Fprintf(os.Stderr, "%v\n", oLog.Entry) - } + fmt.Fprint(os.Stderr, logBuff.String()) }() err = install.Uninstall(paths.ConfigFile(), paths.Top(), uninstallToken, log, progBar) diff --git a/internal/pkg/agent/cmd/unprivileged.go b/internal/pkg/agent/cmd/unprivileged.go new file mode 100644 index 00000000000..df97f029fa0 --- /dev/null +++ b/internal/pkg/agent/cmd/unprivileged.go @@ -0,0 +1,141 @@ +// 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 cmd + +import ( + "context" + "errors" + "fmt" + "os" + + "github.com/spf13/cobra" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/internal/pkg/agent/install" + "github.com/elastic/elastic-agent/internal/pkg/cli" + "github.com/elastic/elastic-agent/pkg/component" + "github.com/elastic/elastic-agent/pkg/control/v2/client/wait" + "github.com/elastic/elastic-agent/pkg/utils" +) + +func newUnprivilegedCommandWithArgs(s []string, streams *cli.IOStreams) *cobra.Command { + cmd := &cobra.Command{ + Use: "unprivileged", + Short: "Switch installed Elastic Agent to run as unprivileged", + Long: `This command converts the installed Elastic Agent from running privileged to running as unprivileged. + +By default this command will ask or a confirmation before making this change. You can bypass the confirmation request +using the -f flag. This is not a zero downtime operation and will always stop the running Elastic Agent (if running). +It is possible that loss of metrics, logs, or data could occur during this window of time. The Elastic Agent +daemon will always be started (even if it was off to start). In the case that the Elastic Agent is already running +unprivileged it will still perform all the same work, including stopping and starting the Elastic Agent. +`, + Args: cobra.ExactArgs(0), + Run: func(c *cobra.Command, args []string) { + if err := unprivilegedCmd(streams, c); err != nil { + fmt.Fprintf(streams.Err, "Error: %v\n%s\n", err, troubleshootMessage()) + os.Exit(1) + } + }, + } + + cmd.Flags().BoolP("force", "f", false, "Do not prompt for confirmation") + cmd.Flags().DurationP("daemon-timeout", "", 0, "Timeout waiting for Elastic Agent daemon restart after the change is applied (-1 = no wait)") + + return cmd +} + +func unprivilegedCmd(streams *cli.IOStreams, cmd *cobra.Command) (err error) { + isAdmin, err := utils.HasRoot() + if err != nil { + return fmt.Errorf("unable to perform unprivileged command while checking for root/Administrator rights: %w", err) + } + if !isAdmin { + return fmt.Errorf("unable to perform unprivileged command, not executed with %s permissions", utils.PermissionUser) + } + + // cannot switch to unprivileged when service components have issues + err = ensureNoServiceComponentIssues() + if err != nil { + // error already adds context + return err + } + + topPath := paths.Top() + daemonTimeout, _ := cmd.Flags().GetDuration("daemon-timeout") + force, _ := cmd.Flags().GetBool("force") + if !force { + confirm, err := cli.Confirm("This will restart the running Elastic Agent and convert it to run in unprivileged mode. Do you want to continue?", true) + if err != nil { + return fmt.Errorf("problem reading prompt response") + } + if !confirm { + return fmt.Errorf("unprivileged switch was cancelled by the user") + } + } + + pt := install.CreateAndStartNewSpinner(streams.Out, "Converting Elastic Agent to unprivileged...") + err = install.SwitchExecutingMode(topPath, pt, install.ElasticUsername, install.ElasticGroupName) + if err != nil { + // error already adds context + return err + } + + // wait for the service + if daemonTimeout >= 0 { + pt.Describe("Waiting for running service") + ctx := handleSignal(context.Background()) // allowed to be cancelled + err = wait.ForAgent(ctx, daemonTimeout) + if err != nil { + if errors.Is(err, context.Canceled) { + pt.Describe("Cancelled waiting for running service") + return nil + } + pt.Describe("Failed waiting for running service") + return err + } + pt.Describe("Service is up and running") + } + + return nil +} + +func ensureNoServiceComponentIssues() error { + ctx := context.Background() + l, err := newErrorLogger() + if err != nil { + return fmt.Errorf("failed to create error logger: %w", err) + } + // this forces the component calculation to always compute with no root + // this allows any runtime preventions to error for a component when it has a no root support + comps, err := getComponentsFromPolicy(ctx, l, paths.ConfigFile(), 0, forceNonRoot) + if err != nil { + return fmt.Errorf("failed to create component model from policy: %w", err) + } + var errs []error + for _, comp := range comps { + if comp.InputSpec == nil { + // no spec (safety net) + continue + } + if comp.InputSpec.Spec.Service == nil { + // not a service component, allowed to exist (even if it needs root) + continue + } + if comp.Err != nil { + // service component has an error (most likely because it cannot run without root) + errs = append(errs, fmt.Errorf("%s -> %w", comp.ID, comp.Err)) + } + } + if len(errs) > 0 { + return fmt.Errorf("unable to switch to unprivileged mode due to the following service based components having issues: %w", errors.Join(errs...)) + } + return nil +} + +func forceNonRoot(detail component.PlatformDetail) component.PlatformDetail { + detail.User.Root = false + return detail +} diff --git a/internal/pkg/agent/cmd/upgrade.go b/internal/pkg/agent/cmd/upgrade.go index 6c33fa43498..5b02fc9bfb9 100644 --- a/internal/pkg/agent/cmd/upgrade.go +++ b/internal/pkg/agent/cmd/upgrade.go @@ -8,8 +8,11 @@ import ( "context" "fmt" "os" + "strings" "github.com/spf13/cobra" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/elastic/elastic-agent/pkg/control" "github.com/elastic/elastic-agent/pkg/control/v2/client" @@ -55,10 +58,14 @@ func newUpgradeCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Comman } func upgradeCmd(streams *cli.IOStreams, cmd *cobra.Command, args []string) error { + c := client.New() + return upgradeCmdWithClient(streams, cmd, args, c) +} + +func upgradeCmdWithClient(streams *cli.IOStreams, cmd *cobra.Command, args []string, c client.Client) error { version := args[0] sourceURI, _ := cmd.Flags().GetString(flagSourceURI) - c := client.New() err := c.Connect(context.Background()) if err != nil { return errors.New(err, "Failed communicating to running daemon", errors.TypeNetwork, errors.M("socket", control.Address())) @@ -106,7 +113,14 @@ func upgradeCmd(streams *cli.IOStreams, cmd *cobra.Command, args []string) error skipDefaultPgp, _ := cmd.Flags().GetBool(flagSkipDefaultPgp) version, err = c.Upgrade(context.Background(), version, sourceURI, skipVerification, skipDefaultPgp, pgpChecks...) if err != nil { - return errors.New(err, "Failed trigger upgrade of daemon") + s, ok := status.FromError(err) + // Sometimes the gRPC server shuts down before replying to the command which is expected + // we can determine this state by the EOF error coming from the server. + // If the server is just unavailable/not running, we should not succeed. + isConnectionInterrupted := ok && s.Code() == codes.Unavailable && strings.Contains(s.Message(), "EOF") + if !isConnectionInterrupted { + return errors.New(err, "Failed trigger upgrade of daemon") + } } fmt.Fprintf(streams.Out, "Upgrade triggered to version %s, Elastic Agent is currently restarting\n", version) return nil diff --git a/internal/pkg/agent/cmd/upgrade_test.go b/internal/pkg/agent/cmd/upgrade_test.go new file mode 100644 index 00000000000..efdc6864802 --- /dev/null +++ b/internal/pkg/agent/cmd/upgrade_test.go @@ -0,0 +1,90 @@ +// 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 cmd + +import ( + "context" + "net" + "sync/atomic" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/grpc" + + "github.com/elastic/elastic-agent/internal/pkg/cli" + "github.com/elastic/elastic-agent/pkg/control/v2/client" + "github.com/elastic/elastic-agent/pkg/control/v2/cproto" +) + +func TestUpgradeCmd(t *testing.T) { + t.Run("no error when connection gets interrupted", func(t *testing.T) { + tcpServer, err := net.Listen("tcp", "127.0.0.1:") + require.NoError(t, err) + defer tcpServer.Close() + + s := grpc.NewServer() + defer s.Stop() + + upgradeCh := make(chan struct{}) + mock := &mockServer{upgradeStop: upgradeCh} + cproto.RegisterElasticAgentControlServer(s, mock) + go func() { + err := s.Serve(tcpServer) + assert.NoError(t, err) + }() + + clientCh := make(chan struct{}) + // use HTTP prefix for the dialer to use TCP, otherwise it's a unix socket/named pipe + c := client.New(client.WithAddress("http://" + tcpServer.Addr().String())) + args := []string{"--skip-verify", "8.13.0"} + streams := cli.NewIOStreams() + cmd := newUpgradeCommandWithArgs(args, streams) + + // the upgrade command will hang until the server shut down + go func() { + err = upgradeCmdWithClient(streams, cmd, args, c) + assert.NoError(t, err) + // verify that we actually talked to the server + counter := atomic.LoadInt32(&mock.upgrades) + assert.Equal(t, int32(1), counter, "server should have handled one upgrade") + // unblock the further test execution + close(clientCh) + }() + + // we will know that the client reached the server watching the `mock.upgrades` counter + require.Eventually(t, func() bool { + counter := atomic.LoadInt32(&mock.upgrades) + return counter > 0 + }, 5*time.Second, 100*time.Millisecond) + + // then we close the tcp server which is supposed to interrupt the connection + s.Stop() + // this stops the mock server + close(upgradeCh) + // this makes sure all client assertions are done + <-clientCh + }) +} + +type mockServer struct { + cproto.ElasticAgentControlServer + upgradeStop <-chan struct{} + upgrades int32 +} + +func (s *mockServer) Upgrade(ctx context.Context, r *cproto.UpgradeRequest) (resp *cproto.UpgradeResponse, err error) { + atomic.AddInt32(&s.upgrades, 1) + <-s.upgradeStop + return nil, nil +} + +func (s *mockServer) State(ctx context.Context, r *cproto.Empty) (resp *cproto.StateResponse, err error) { + return &cproto.StateResponse{ + State: cproto.State_HEALTHY, + Info: &cproto.StateAgentInfo{}, + }, nil +} diff --git a/internal/pkg/agent/cmd/validate.go b/internal/pkg/agent/cmd/validate.go index 5ea75e0f3ea..f87956ee5e2 100644 --- a/internal/pkg/agent/cmd/validate.go +++ b/internal/pkg/agent/cmd/validate.go @@ -2,6 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package cmd import ( diff --git a/internal/pkg/agent/cmd/validate_test.go b/internal/pkg/agent/cmd/validate_test.go index 326e809748d..b02a1d92cef 100644 --- a/internal/pkg/agent/cmd/validate_test.go +++ b/internal/pkg/agent/cmd/validate_test.go @@ -2,6 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package cmd import ( diff --git a/internal/pkg/agent/cmd/watch.go b/internal/pkg/agent/cmd/watch.go index 01d86a92dd4..87b9f79178e 100644 --- a/internal/pkg/agent/cmd/watch.go +++ b/internal/pkg/agent/cmd/watch.go @@ -44,7 +44,7 @@ func newWatchCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Command Long: `This command watches Elastic Agent for failures and initiates rollback if necessary.`, Run: func(_ *cobra.Command, _ []string) { cfg := getConfig(streams) - log, err := configuredLogger(cfg) + log, err := configuredLogger(cfg, watcherName) if err != nil { fmt.Fprintf(streams.Err, "Error configuring logger: %v\n%s\n", err, troubleshootMessage()) os.Exit(3) @@ -200,8 +200,8 @@ func gracePeriod(marker *upgrade.UpdateMarker, gracePeriodDuration time.Duration return false, gracePeriodDuration } -func configuredLogger(cfg *configuration.Configuration) (*logger.Logger, error) { - cfg.Settings.LoggingConfig.Beat = watcherName +func configuredLogger(cfg *configuration.Configuration, name string) (*logger.Logger, error) { + cfg.Settings.LoggingConfig.Beat = name cfg.Settings.LoggingConfig.Level = logp.DebugLevel internal, err := logger.MakeInternalFileOutput(cfg.Settings.LoggingConfig) if err != nil { diff --git a/internal/pkg/agent/configuration/configuration.go b/internal/pkg/agent/configuration/configuration.go index cfa7782be44..44536d2007b 100644 --- a/internal/pkg/agent/configuration/configuration.go +++ b/internal/pkg/agent/configuration/configuration.go @@ -7,6 +7,7 @@ package configuration import ( "github.com/elastic/elastic-agent/internal/pkg/agent/errors" "github.com/elastic/elastic-agent/internal/pkg/config" + "github.com/elastic/go-ucfg" ) // Configuration is a overall agent configuration @@ -33,6 +34,17 @@ func NewFromConfig(cfg *config.Config) (*Configuration, error) { return c, nil } +// NewPartialFromConfigNoDefaults creates a configuration based on common Config. +func NewPartialFromConfigNoDefaults(cfg *config.Config) (*Configuration, error) { + c := new(Configuration) + // Validator tag set to "validate_disable" is a hack to avoid validation errors on a partial config + if err := cfg.Unpack(c, ucfg.ValidatorTag("validate_disable")); err != nil { + return nil, errors.New(err, errors.TypeConfig) + } + + return c, nil +} + // AgentInfo is a set of agent information. type AgentInfo struct { ID string `json:"id" yaml:"id" config:"id"` diff --git a/internal/pkg/agent/configuration/fleet_server.go b/internal/pkg/agent/configuration/fleet_server.go index 7e1290df758..f71e753f432 100644 --- a/internal/pkg/agent/configuration/fleet_server.go +++ b/internal/pkg/agent/configuration/fleet_server.go @@ -32,7 +32,14 @@ type FleetServerOutputConfig struct { Elasticsearch Elasticsearch `config:"elasticsearch" yaml:"elasticsearch"` } -// Elasticsearch is the configuration for elasticsearch. +// Elasticsearch is the configuration for fleet-server's connection to elasticsearch. +// Note that these keys may be injected into policy output by fleet-server. +// The following TLS options may be set in bootstrap: +// - VerificationMode +// - CAs +// - CATrustedFingerprint +// - CertificateConfig.Certificate AND CertificateConfig.Key +// If an attribute is added to this struct, or another TLS attribute is passed ensure that it is handled as part of the bootstrap config handler in fleet-server/internal/pkg/server/agent.go type Elasticsearch struct { Protocol string `config:"protocol" yaml:"protocol"` Hosts []string `config:"hosts" yaml:"hosts"` diff --git a/internal/pkg/agent/configuration/grpc.go b/internal/pkg/agent/configuration/grpc.go index 652aa04f4f3..f60b7d8de1f 100644 --- a/internal/pkg/agent/configuration/grpc.go +++ b/internal/pkg/agent/configuration/grpc.go @@ -4,21 +4,38 @@ package configuration -import "fmt" +import ( + "fmt" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" +) // GRPCConfig is a configuration of GRPC server. type GRPCConfig struct { Address string `config:"address"` - Port uint16 `config:"port"` + Port uint16 `config:"port"` // [gRPC:8.15] Change to int32 instead of uint16, when Endpoint is ready for local gRPC MaxMsgSize int `config:"max_message_size"` CheckinChunkingDisabled bool `config:"checkin_chunking_disabled"` } // DefaultGRPCConfig creates a default server configuration. func DefaultGRPCConfig() *GRPCConfig { + // When in an installation namespace, bind to port zero to select a random free port to avoid + // collisions with any already installed Elastic Agent. Ideally we'd always bind to port zero, + // but this would be breaking for users that had to manually whitelist the gRPC port in local + // firewall rules. + // + // Note: this uses local TCP by default. A port of -1 switches to unix domain sockets / named + // pipes. Using domain sockets by default is preferable but is currently blocked because the + // gRPC library endpoint security uses does not support Windows named pipes. + defaultPort := uint16(6789) + if paths.InInstallNamespace() { + defaultPort = 0 + } + return &GRPCConfig{ Address: "localhost", - Port: 6789, + Port: defaultPort, MaxMsgSize: 1024 * 1024 * 100, // grpc default 4MB is unsufficient for diagnostics CheckinChunkingDisabled: false, // on by default } @@ -28,3 +45,10 @@ func DefaultGRPCConfig() *GRPCConfig { func (cfg *GRPCConfig) String() string { return fmt.Sprintf("%s:%d", cfg.Address, cfg.Port) } + +// IsLocal returns true if port value is less than 0 +func (cfg *GRPCConfig) IsLocal() bool { + // [gRPC:8.15] Use the commented implementation once Endpoint is ready for local gRPC + // return cfg.Port < 0 + return false +} diff --git a/internal/pkg/agent/configuration/settings.go b/internal/pkg/agent/configuration/settings.go index 093e12089b9..89de9ddbdc9 100644 --- a/internal/pkg/agent/configuration/settings.go +++ b/internal/pkg/agent/configuration/settings.go @@ -14,13 +14,14 @@ import ( // SettingsConfig is an collection of agent settings configuration. type SettingsConfig struct { - ID string `yaml:"id" config:"id" json:"id"` - DownloadConfig *artifact.Config `yaml:"download" config:"download" json:"download"` - ProcessConfig *process.Config `yaml:"process" config:"process" json:"process"` - GRPC *GRPCConfig `yaml:"grpc" config:"grpc" json:"grpc"` - MonitoringConfig *monitoringCfg.MonitoringConfig `yaml:"monitoring" config:"monitoring" json:"monitoring"` - LoggingConfig *logger.Config `yaml:"logging,omitempty" config:"logging,omitempty" json:"logging,omitempty"` - Upgrade *UpgradeConfig `yaml:"upgrade" config:"upgrade" json:"upgrade"` + ID string `yaml:"id" config:"id" json:"id"` + DownloadConfig *artifact.Config `yaml:"download" config:"download" json:"download"` + ProcessConfig *process.Config `yaml:"process" config:"process" json:"process"` + GRPC *GRPCConfig `yaml:"grpc" config:"grpc" json:"grpc"` + MonitoringConfig *monitoringCfg.MonitoringConfig `yaml:"monitoring" config:"monitoring" json:"monitoring"` + LoggingConfig *logger.Config `yaml:"logging,omitempty" config:"logging,omitempty" json:"logging,omitempty"` + EventLoggingConfig *logger.Config `yaml:"logging.event_data,omitempty" config:"logging.event_data,omitempty" json:"logging.event_data,omitempty"` + Upgrade *UpgradeConfig `yaml:"upgrade" config:"upgrade" json:"upgrade"` // standalone config Reload *ReloadConfig `config:"reload" yaml:"reload" json:"reload"` @@ -34,6 +35,7 @@ func DefaultSettingsConfig() *SettingsConfig { ProcessConfig: process.DefaultConfig(), DownloadConfig: artifact.DefaultConfig(), LoggingConfig: logger.DefaultLoggingConfig(), + EventLoggingConfig: logger.DefaultEventLoggingConfig(), MonitoringConfig: monitoringCfg.DefaultConfig(), GRPC: DefaultGRPCConfig(), Upgrade: DefaultUpgradeConfig(), diff --git a/internal/pkg/agent/install/install.go b/internal/pkg/agent/install/install.go index 7553c5dde5b..f6b7e10fb05 100644 --- a/internal/pkg/agent/install/install.go +++ b/internal/pkg/agent/install/install.go @@ -11,6 +11,7 @@ import ( "path/filepath" "runtime" "strings" + "time" "github.com/jaypipes/ghw" "github.com/kardianos/service" @@ -20,6 +21,7 @@ import ( "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" + "github.com/elastic/elastic-agent/internal/pkg/agent/perms" "github.com/elastic/elastic-agent/internal/pkg/cli" v1 "github.com/elastic/elastic-agent/pkg/api/v1" "github.com/elastic/elastic-agent/pkg/utils" @@ -28,8 +30,13 @@ import ( const ( darwin = "darwin" - elasticUsername = "elastic-agent" - elasticGroupName = "elastic-agent" + ElasticUsername = "elastic-agent-user" + ElasticGroupName = "elastic-agent" + + // DefaultStopTimeout is the default stop timeout that can be used to stop a running daemon. + DefaultStopTimeout = 30 * time.Second + // DefaultStopInterval is the check interval to determine if the service has stopped. + DefaultStopInterval = 250 * time.Millisecond ) // Install installs Elastic Agent persistently on the system including creating and starting its service. @@ -63,42 +70,12 @@ func Install(cfgFile, topPath string, unprivileged bool, log *logp.Logger, pt *p username := "" groupName := "" if unprivileged { - username = elasticUsername - groupName = elasticGroupName - - // ensure required group - ownership.GID, err = FindGID(groupName) - if err != nil && !errors.Is(err, ErrGroupNotFound) { - return utils.FileOwner{}, fmt.Errorf("failed finding group %s: %w", groupName, err) - } - if errors.Is(err, ErrGroupNotFound) { - pt.Describe(fmt.Sprintf("Creating group %s", groupName)) - ownership.GID, err = CreateGroup(groupName) - if err != nil { - pt.Describe(fmt.Sprintf("Failed to create group %s", groupName)) - return utils.FileOwner{}, fmt.Errorf("failed to create group %s: %w", groupName, err) - } - pt.Describe(fmt.Sprintf("Successfully created group %s", groupName)) - } - - // ensure required user - ownership.UID, err = FindUID(username) - if err != nil && !errors.Is(err, ErrUserNotFound) { - return utils.FileOwner{}, fmt.Errorf("failed finding username %s: %w", username, err) - } - if errors.Is(err, ErrUserNotFound) { - pt.Describe(fmt.Sprintf("Creating user %s", username)) - ownership.UID, err = CreateUser(username, ownership.GID) - if err != nil { - pt.Describe(fmt.Sprintf("Failed to create user %s", username)) - return utils.FileOwner{}, fmt.Errorf("failed to create user %s: %w", username, err) - } - err = AddUserToGroup(username, groupName) - if err != nil { - pt.Describe(fmt.Sprintf("Failed to add user %s to group %s", username, groupName)) - return utils.FileOwner{}, fmt.Errorf("failed to add user %s to group %s: %w", username, groupName, err) - } - pt.Describe(fmt.Sprintf("Successfully created user %s", username)) + username = ElasticUsername + groupName = ElasticGroupName + ownership, err = EnsureUserAndGroup(username, groupName, pt) + if err != nil { + // error context already added by EnsureUserAndGroup + return utils.FileOwner{}, err } } @@ -125,13 +102,13 @@ func Install(cfgFile, topPath string, unprivileged bool, log *logp.Logger, pt *p pt.Describe("Successfully copied files") // place shell wrapper, if present on platform - if paths.ShellWrapperPath != "" { - pathDir := filepath.Dir(paths.ShellWrapperPath) + if paths.ShellWrapperPath() != "" { + pathDir := filepath.Dir(paths.ShellWrapperPath()) err = os.MkdirAll(pathDir, 0755) if err != nil { return utils.FileOwner{}, errors.New( err, - fmt.Sprintf("failed to create directory (%s) for shell wrapper (%s)", pathDir, paths.ShellWrapperPath), + fmt.Sprintf("failed to create directory (%s) for shell wrapper (%s)", pathDir, paths.ShellWrapperPath()), errors.M("directory", pathDir)) } // Install symlink for darwin instead of the wrapper script. @@ -140,32 +117,32 @@ func Install(cfgFile, topPath string, unprivileged bool, log *logp.Logger, pt *p // This is specifically important for osquery FDA permissions at the moment. if runtime.GOOS == darwin { // Check if previous shell wrapper or symlink exists and remove it so it can be overwritten - if _, err := os.Lstat(paths.ShellWrapperPath); err == nil { - if err := os.Remove(paths.ShellWrapperPath); err != nil { + if _, err := os.Lstat(paths.ShellWrapperPath()); err == nil { + if err := os.Remove(paths.ShellWrapperPath()); err != nil { return utils.FileOwner{}, errors.New( err, - fmt.Sprintf("failed to remove (%s)", paths.ShellWrapperPath), - errors.M("destination", paths.ShellWrapperPath)) + fmt.Sprintf("failed to remove (%s)", paths.ShellWrapperPath()), + errors.M("destination", paths.ShellWrapperPath())) } } - err = os.Symlink(filepath.Join(topPath, paths.BinaryName), paths.ShellWrapperPath) + err = os.Symlink(filepath.Join(topPath, paths.BinaryName), paths.ShellWrapperPath()) if err != nil { return utils.FileOwner{}, errors.New( err, - fmt.Sprintf("failed to create elastic-agent symlink (%s)", paths.ShellWrapperPath), - errors.M("destination", paths.ShellWrapperPath)) + fmt.Sprintf("failed to create elastic-agent symlink (%s)", paths.ShellWrapperPath()), + errors.M("destination", paths.ShellWrapperPath())) } } else { // We use strings.Replace instead of fmt.Sprintf here because, with the // latter, govet throws a false positive error here: "fmt.Sprintf call has // arguments but no formatting directives". - shellWrapper := strings.Replace(paths.ShellWrapper, "%s", topPath, -1) - err = os.WriteFile(paths.ShellWrapperPath, []byte(shellWrapper), 0755) + shellWrapper := strings.Replace(paths.ShellWrapperFmt, "%s", topPath, -1) + err = os.WriteFile(paths.ShellWrapperPath(), []byte(shellWrapper), 0755) if err != nil { return utils.FileOwner{}, errors.New( err, - fmt.Sprintf("failed to write shell wrapper (%s)", paths.ShellWrapperPath), - errors.M("destination", paths.ShellWrapperPath)) + fmt.Sprintf("failed to write shell wrapper (%s)", paths.ShellWrapperPath()), + errors.M("destination", paths.ShellWrapperPath())) } } } @@ -177,31 +154,24 @@ func Install(cfgFile, topPath string, unprivileged bool, log *logp.Logger, pt *p } // fix permissions - err = FixPermissions(topPath, ownership) + err = perms.FixPermissions(topPath, perms.WithOwnership(ownership)) if err != nil { return ownership, fmt.Errorf("failed to perform permission changes on path %s: %w", topPath, err) } - if paths.ShellWrapperPath != "" { - err = FixPermissions(paths.ShellWrapperPath, ownership) + if paths.ShellWrapperPath() != "" { + err = perms.FixPermissions(paths.ShellWrapperPath(), perms.WithOwnership(ownership)) if err != nil { - return ownership, fmt.Errorf("failed to perform permission changes on path %s: %w", paths.ShellWrapperPath, err) + return ownership, fmt.Errorf("failed to perform permission changes on path %s: %w", paths.ShellWrapperPath(), err) } } // install service pt.Describe("Installing service") - svc, err := newService(topPath, withUserGroup(username, groupName)) - if err != nil { - pt.Describe("Failed to install service") - return ownership, fmt.Errorf("error installing new service: %w", err) - } - err = svc.Install() + err = InstallService(topPath, ownership, username, groupName) if err != nil { pt.Describe("Failed to install service") - return ownership, errors.New( - err, - fmt.Sprintf("failed to install service (%s)", paths.ServiceName), - errors.M("service", paths.ServiceName)) + // error context already added by InstallService + return ownership, err } pt.Describe("Installed service") @@ -370,31 +340,29 @@ func StartService(topPath string) error { // only starting the service, so no need to set the username and group to any value svc, err := newService(topPath) if err != nil { - return fmt.Errorf("error creating new service handler: %w", err) + return fmt.Errorf("error creating new service handler for start: %w", err) } err = svc.Start() if err != nil { - return errors.New( - err, - fmt.Sprintf("failed to start service (%s)", paths.ServiceName), - errors.M("service", paths.ServiceName)) + return fmt.Errorf("failed to start service (%s): %w", paths.ServiceName(), err) } return nil } // StopService stops the installed service. -func StopService(topPath string) error { +func StopService(topPath string, timeout time.Duration, interval time.Duration) error { // only stopping the service, so no need to set the username and group to any value svc, err := newService(topPath) if err != nil { - return fmt.Errorf("error creating new service handler: %w", err) + return fmt.Errorf("error creating new service handler for stop: %w", err) } err = svc.Stop() if err != nil { - return errors.New( - err, - fmt.Sprintf("failed to stop service (%s)", paths.ServiceName), - errors.M("service", paths.ServiceName)) + return fmt.Errorf("failed to stop service (%s): %w", paths.ServiceName(), err) + } + err = isStopped(timeout, interval, paths.ServiceName()) + if err != nil { + return fmt.Errorf("failed to stop service (%s): %w", paths.ServiceName(), err) } return nil } @@ -404,14 +372,11 @@ func RestartService(topPath string) error { // only restarting the service, so no need to set the username and group to any value svc, err := newService(topPath) if err != nil { - return fmt.Errorf("error creating new service handler: %w", err) + return fmt.Errorf("error creating new service handler for restart: %w", err) } err = svc.Restart() if err != nil { - return errors.New( - err, - fmt.Sprintf("failed to restart service (%s)", paths.ServiceName), - errors.M("service", paths.ServiceName)) + return fmt.Errorf("failed to restart service (%s): %w", paths.ServiceName(), err) } return nil } @@ -420,11 +385,47 @@ func RestartService(topPath string) error { func StatusService(topPath string) (service.Status, error) { svc, err := newService(topPath) if err != nil { - return service.StatusUnknown, err + return service.StatusUnknown, fmt.Errorf("error creating new service handler for status: %w", err) } return svc.Status() } +// InstallService installs the service. +func InstallService(topPath string, ownership utils.FileOwner, username string, groupName string) error { + opts, err := withServiceOptions(username, groupName) + if err != nil { + return fmt.Errorf("error getting service installation options: %w", err) + } + svc, err := newService(topPath, opts...) + if err != nil { + return fmt.Errorf("error creating new service handler for install: %w", err) + } + err = svc.Install() + if err != nil { + return fmt.Errorf("failed to install service (%s): %w", paths.ServiceName(), err) + } + err = serviceConfigure(ownership) + if err != nil { + // ignore error + _ = svc.Uninstall() + return fmt.Errorf("failed to configure service (%s): %w", paths.ServiceName(), err) + } + return nil +} + +// UninstallService uninstalls the service. +func UninstallService(topPath string) error { + svc, err := newService(topPath) + if err != nil { + return fmt.Errorf("error creating new service handler for uninstall: %w", err) + } + err = svc.Uninstall() + if err != nil { + return fmt.Errorf("failed to uninstall service (%s): %w", paths.ServiceName(), err) + } + return nil +} + // findDirectory returns the directory to copy into the installation location. // // This also verifies that the discovered directory is a valid directory for installation. diff --git a/internal/pkg/agent/install/install_unix.go b/internal/pkg/agent/install/install_unix.go index 52f9f92847e..e24e8807b57 100644 --- a/internal/pkg/agent/install/install_unix.go +++ b/internal/pkg/agent/install/install_unix.go @@ -26,3 +26,13 @@ func fixInstallMarkerPermissions(markerFilePath string, ownership utils.FileOwne } return nil } + +// withServiceOptions just sets the user/group for the service. +func withServiceOptions(username string, groupName string) ([]serviceOpt, error) { + return []serviceOpt{withUserGroup(username, groupName)}, nil +} + +func serviceConfigure(ownership utils.FileOwner) error { + // do nothing on unix + return nil +} diff --git a/internal/pkg/agent/install/install_windows.go b/internal/pkg/agent/install/install_windows.go index c589ccaf384..cc53fcf670f 100644 --- a/internal/pkg/agent/install/install_windows.go +++ b/internal/pkg/agent/install/install_windows.go @@ -7,10 +7,16 @@ package install import ( + "fmt" "os" "path/filepath" + "strings" + + "golang.org/x/sys/windows" + "golang.org/x/sys/windows/svc/eventlog" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/internal/pkg/agent/perms" "github.com/elastic/elastic-agent/pkg/utils" "github.com/elastic/elastic-agent/version" ) @@ -45,6 +51,61 @@ func postInstall(topPath string) error { } func fixInstallMarkerPermissions(markerFilePath string, ownership utils.FileOwner) error { - // TODO(blakerouse): Fix the market permissions on Windows. + return perms.FixPermissions(markerFilePath, perms.WithOwnership(ownership)) +} + +// withServiceOptions just sets the user/group for the service. +func withServiceOptions(username string, groupName string) ([]serviceOpt, error) { + if username == "" { + // not installed with --unprivileged; nothing to do + return []serviceOpt{}, nil + } + + // service requires a password to launch as the user + // this sets it to a random password that is only known by the service + password, err := RandomPassword() + if err != nil { + return nil, fmt.Errorf("failed to generate random password: %w", err) + } + err = SetUserPassword(username, password) + if err != nil { + return nil, fmt.Errorf("failed to set user %s password for service: %w", username, err) + } + + // username must be prefixed with `.\` so the service references the local systems users + username = fmt.Sprintf(`.\%s`, username) + return []serviceOpt{withUserGroup(username, groupName), withPassword(password)}, nil +} + +// serviceConfigure sets the security descriptor for the service +// +// gives user the ability to control the service, needed when installed with --unprivileged or +// ReExec is not possible on Windows. +func serviceConfigure(ownership utils.FileOwner) error { + // Modify registry to allow logging to eventlog as "Elastic Agent". + err := eventlog.InstallAsEventCreate(paths.ServiceName(), eventlog.Info|eventlog.Warning|eventlog.Error) + if err != nil && !strings.Contains(err.Error(), "registry key already exists") { + return fmt.Errorf("unable to create registry key for logging: %w", err) + } + // https://learn.microsoft.com/en-us/windows-hardware/drivers/kernel/sddl-for-device-objects + sddl := "D:(A;;GA;;;SY)" + // SDDL_LOCAL_SYSTEM -> SDDL_GENERIC_ALL + "(A;;GA;;;BA)" + // SDDL_BUILTIN_ADMINISTRATORS -> SDDL_GENERIC_ALL + "(A;;GR;;;WD)" + // SDDL_EVERYONE -> SDDL_GENERIC_READ + "(A;;GRGX;;;NS)" // SDDL_NETWORK_SERVICE -> SDDL_GENERIC_READ|SDDL_GENERIC_EXECUTE + if ownership.UID != "" { + sddl += fmt.Sprintf("(A;;GA;;;%s)", ownership.UID) // Ownership UID -> SDDL_GENERIC_ALL + } + securityDescriptor, err := windows.SecurityDescriptorFromString(sddl) + if err != nil { + return fmt.Errorf("failed to build security descriptor from SSDL: %w", err) + } + dacl, _, err := securityDescriptor.DACL() + if err != nil { + return fmt.Errorf("failed to get DACL from security descriptor: %w", err) + } + err = windows.SetNamedSecurityInfo(paths.ServiceName(), windows.SE_SERVICE, windows.DACL_SECURITY_INFORMATION, nil, nil, dacl, nil) + if err != nil { + return fmt.Errorf("failed to set DACL for service(%s): %w", paths.ServiceName(), err) + } return nil } diff --git a/internal/pkg/agent/install/perms_windows.go b/internal/pkg/agent/install/perms_windows.go deleted file mode 100644 index 1281479f695..00000000000 --- a/internal/pkg/agent/install/perms_windows.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. - -//go:build windows - -package install - -import ( - "errors" - "io/fs" - "path/filepath" - - "github.com/hectane/go-acl" - "golang.org/x/sys/windows" - - "github.com/elastic/elastic-agent/pkg/utils" -) - -// FixPermissions fixes the permissions so only SYSTEM and Administrators have access to the files in the install path -func FixPermissions(topPath string, ownership utils.FileOwner) error { - return filepath.Walk(topPath, func(name string, info fs.FileInfo, err error) error { - if err == nil { - // first level doesn't inherit - inherit := true - if topPath == name { - inherit = false - } - err = systemAdministratorsOnly(name, inherit) - } else if errors.Is(err, fs.ErrNotExist) { - return nil - } - return err - }) -} - -func systemAdministratorsOnly(path string, inherit bool) error { - // https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems - systemSID, err := windows.StringToSid(utils.SystemSID) - if err != nil { - return err - } - administratorsSID, err := windows.StringToSid(utils.AdministratorSID) - if err != nil { - return err - } - - // https://docs.microsoft.com/en-us/windows/win32/secauthz/access-mask - return acl.Apply( - path, true, inherit, - acl.GrantSid(0xF10F0000, systemSID), // full control of all acl's - acl.GrantSid(0xF10F0000, administratorsSID)) -} diff --git a/internal/pkg/agent/install/prereq.go b/internal/pkg/agent/install/prereq.go new file mode 100644 index 00000000000..ca7f56dcafd --- /dev/null +++ b/internal/pkg/agent/install/prereq.go @@ -0,0 +1,57 @@ +// 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 install + +import ( + "errors" + "fmt" + + "github.com/schollz/progressbar/v3" + + "github.com/elastic/elastic-agent/pkg/utils" +) + +// EnsureUserAndGroup creates the given username and group returning the file ownership information for that +// user and group. +func EnsureUserAndGroup(username string, groupName string, pt *progressbar.ProgressBar) (utils.FileOwner, error) { + var err error + var ownership utils.FileOwner + + // ensure required group + ownership.GID, err = FindGID(groupName) + if err != nil && !errors.Is(err, ErrGroupNotFound) { + return utils.FileOwner{}, fmt.Errorf("failed finding group %s: %w", groupName, err) + } + if errors.Is(err, ErrGroupNotFound) { + pt.Describe(fmt.Sprintf("Creating group %s", groupName)) + ownership.GID, err = CreateGroup(groupName) + if err != nil { + pt.Describe(fmt.Sprintf("Failed to create group %s", groupName)) + return utils.FileOwner{}, fmt.Errorf("failed to create group %s: %w", groupName, err) + } + pt.Describe(fmt.Sprintf("Successfully created group %s", groupName)) + } + + // ensure required user + ownership.UID, err = FindUID(username) + if err != nil && !errors.Is(err, ErrUserNotFound) { + return utils.FileOwner{}, fmt.Errorf("failed finding username %s: %w", username, err) + } + if errors.Is(err, ErrUserNotFound) { + pt.Describe(fmt.Sprintf("Creating user %s", username)) + ownership.UID, err = CreateUser(username, ownership.GID) + if err != nil { + pt.Describe(fmt.Sprintf("Failed to create user %s", username)) + return utils.FileOwner{}, fmt.Errorf("failed to create user %s: %w", username, err) + } + err = AddUserToGroup(username, groupName) + if err != nil { + pt.Describe(fmt.Sprintf("Failed to add user %s to group %s", username, groupName)) + return utils.FileOwner{}, fmt.Errorf("failed to add user %s to group %s: %w", username, groupName, err) + } + pt.Describe(fmt.Sprintf("Successfully created user %s", username)) + } + return ownership, nil +} diff --git a/internal/pkg/agent/install/svc.go b/internal/pkg/agent/install/svc.go index 080fd81fd0c..eacc39fc0a1 100644 --- a/internal/pkg/agent/install/svc.go +++ b/internal/pkg/agent/install/svc.go @@ -15,9 +15,6 @@ import ( ) const ( - // ServiceDisplayName is the service display name for the service. - ServiceDisplayName = "Elastic Agent" - // ServiceDescription is the description for the service. ServiceDescription = "Elastic Agent is a unified agent to observe, monitor and protect your system." @@ -31,8 +28,8 @@ const ( // ExecutablePath returns the path for the installed Agents executable. func ExecutablePath(topPath string) string { exec := filepath.Join(topPath, paths.BinaryName) - if paths.ShellWrapperPath != "" { - exec = paths.ShellWrapperPath + if paths.ShellWrapperPath() != "" { + exec = paths.ShellWrapperPath() } return exec } @@ -40,6 +37,7 @@ func ExecutablePath(topPath string) string { type serviceOpts struct { Username string Group string + Password string } type serviceOpt func(opts *serviceOpts) @@ -57,25 +55,30 @@ func newService(topPath string, opt ...serviceOpt) (service.Service, error) { o(&opts) } + option := map[string]interface{}{ + // GroupName + "GroupName": opts.Group, + + // Linux (systemd) always restart on failure + "Restart": "always", + + // Windows setup restart on failure + "OnFailure": "restart", + "OnFailureDelayDuration": "15s", // Matches the value used by endpoint-security. + "OnFailureResetPeriod": 10, + } + if opts.Password != "" { + option["Password"] = opts.Password + } + cfg := &service.Config{ - Name: paths.ServiceName, - DisplayName: ServiceDisplayName, + Name: paths.ServiceName(), + DisplayName: paths.ServiceDisplayName(), Description: ServiceDescription, Executable: ExecutablePath(topPath), WorkingDirectory: topPath, UserName: opts.Username, - Option: map[string]interface{}{ - // GroupName - "GroupName": opts.Group, - - // Linux (systemd) always restart on failure - "Restart": "always", - - // Windows setup restart on failure - "OnFailure": "restart", - "OnFailureDelayDuration": "15s", // Matches the value used by endpoint-security. - "OnFailureResetPeriod": 10, - }, + Option: option, } if runtime.GOOS == "linux" { @@ -101,8 +104,8 @@ func newService(topPath string, opt ...serviceOpt) (service.Service, error) { // Set the stdout and stderr logs to be inside the installation directory, ensures that the // executing user for the service can write to the directory for the logs. - cfg.Option["StandardOutPath"] = filepath.Join(topPath, fmt.Sprintf("%s.out.log", paths.ServiceName)) - cfg.Option["StandardErrorPath"] = filepath.Join(topPath, fmt.Sprintf("%s.err.log", paths.ServiceName)) + cfg.Option["StandardOutPath"] = filepath.Join(topPath, fmt.Sprintf("%s.out.log", paths.ServiceName())) + cfg.Option["StandardErrorPath"] = filepath.Join(topPath, fmt.Sprintf("%s.err.log", paths.ServiceName())) } return service.New(nil, cfg) diff --git a/internal/pkg/agent/install/svc_windows.go b/internal/pkg/agent/install/svc_windows.go new file mode 100644 index 00000000000..78f7e07b722 --- /dev/null +++ b/internal/pkg/agent/install/svc_windows.go @@ -0,0 +1,13 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build windows + +package install + +func withPassword(password string) serviceOpt { + return func(opts *serviceOpts) { + opts.Password = password + } +} diff --git a/internal/pkg/agent/install/switch.go b/internal/pkg/agent/install/switch.go new file mode 100644 index 00000000000..9ae6a2a74f7 --- /dev/null +++ b/internal/pkg/agent/install/switch.go @@ -0,0 +1,106 @@ +// 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 install + +import ( + "fmt" + + "github.com/kardianos/service" + "github.com/schollz/progressbar/v3" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/internal/pkg/agent/perms" + "github.com/elastic/elastic-agent/pkg/utils" +) + +// SwitchExecutingMode switches the executing mode of the installed Elastic Agent. +// +// When username and groupName are blank then it switched back to root/Administrator and when a username/groupName is +// provided then it switched to running with that username and groupName. +func SwitchExecutingMode(topPath string, pt *progressbar.ProgressBar, username string, groupName string) error { + // ensure service is stopped + status, err := EnsureStoppedService(topPath, pt) + if err != nil { + // context for the error already provided in the EnsureStoppedService function + return err + } + + // ensure that upon exit of this function that the service is always placed back to running, in the case + // that it was running when the command was executed + defer func() { + if err != nil && status == service.StatusRunning { + _ = StartService(topPath) + } + }() + + // ensure user/group are created + var ownership utils.FileOwner + if username != "" && groupName != "" { + ownership, err = EnsureUserAndGroup(username, groupName, pt) + if err != nil { + // context for the error already provided in the EnsureUserAndGroup function + return err + } + } + + // **start critical section** + // after this point changes will be made that can leave the installed Elastic Agent broken if they do not + // complete successfully + + // perform platform specific work + err = switchPlatformMode(pt, ownership) + + // fix all permissions to use the new ownership + pt.Describe("Adjusting permissions") + err = perms.FixPermissions(topPath, perms.WithOwnership(ownership)) + if err != nil { + return fmt.Errorf("failed to perform permission changes on path %s: %w", topPath, err) + } + if paths.ShellWrapperPath() != "" { + err = perms.FixPermissions(paths.ShellWrapperPath(), perms.WithOwnership(ownership)) + if err != nil { + return fmt.Errorf("failed to perform permission changes on path %s: %w", paths.ShellWrapperPath(), err) + } + } + + // the service has to be uninstalled + pt.Describe("Removing service") + // error is ignored because it's possible that its already uninstalled + // + // this can happen if this action failed in the middle of this critical section, so to allow the + // command to be called again we don't error on the uninstall + // + // the install error below will include an error about the service still existing if this failed + // to uninstall (really this should never fail, but the unexpected can happen) + _ = UninstallService(topPath) + + // re-install service + pt.Describe("Installing service") + err = InstallService(topPath, ownership, username, groupName) + if err != nil { + pt.Describe("Failed to install service") + // error context already added by InstallService + + // this is now in a bad state, because the service is uninstall and now the service failed to install + return err + } + pt.Describe("Installed service") + + // start the service + pt.Describe("Starting service") + err = StartService(topPath) + if err != nil { + pt.Describe("Failed to start service") + // error context already added by InstallService + + // this is now in a bad state, because the service is not running and failed to install + return err + } + + // **end critical section** + // service is now re-created and started + + return nil +} diff --git a/internal/pkg/agent/install/switch_darwin.go b/internal/pkg/agent/install/switch_darwin.go new file mode 100644 index 00000000000..3eb566cc5e6 --- /dev/null +++ b/internal/pkg/agent/install/switch_darwin.go @@ -0,0 +1,102 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build darwin + +package install + +import ( + "context" + "fmt" + "os" + + "github.com/schollz/progressbar/v3" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/secret" + "github.com/elastic/elastic-agent/internal/pkg/agent/vault" + "github.com/elastic/elastic-agent/pkg/utils" +) + +func switchPlatformMode(pt *progressbar.ProgressBar, ownership utils.FileOwner) error { + ctx := context.Background() + + unprivilegedVault, err := checkForUnprivilegedVault(ctx) + if err != nil { + return fmt.Errorf("error checking for unprivileged vault: %w", err) + } + if unprivilegedVault { + if ownership.UID != 0 { + // already has unprivileged vault and going into unprivileged mode (nothing to do) + return nil + } + + pt.Describe("Migrating the vault") + + // get the agent secret from the file vault + var fileVaultOpts vault.Options + vault.WithReadonly(true)(&fileVaultOpts) + vault.WithVaultPath(paths.AgentVaultPath())(&fileVaultOpts) + fileVault, err := vault.NewFileVault(ctx, fileVaultOpts) + if err != nil { + return fmt.Errorf("failed to open file vault: %w", err) + } + agentKey, err := fileVault.Get(ctx, secret.AgentSecretKey) + if err != nil { + return fmt.Errorf("failed to get agent secret from file vault: %w", err) + } + + // set the agent secret into the keychain vault + keychainVault, err := vault.NewDarwinKeyChainVault(ctx, vault.Options{}) + if err != nil { + return fmt.Errorf("failed to open keychain vault: %w", err) + } + err = keychainVault.Set(ctx, secret.AgentSecretKey, agentKey) + if err != nil { + return fmt.Errorf("failed to set agent secret into keychain vault: %w", err) + } + + // remove the file-based vault path + err = os.Remove(paths.AgentVaultPath()) + if err != nil { + return fmt.Errorf("failed to delete file vault: %w", err) + } + + return nil + } + if ownership.UID == 0 { + // already has privileged vault and going into privileged mode (nothing to do) + return nil + } + + pt.Describe("Migrating the vault") + + // get the agent secret from the keychain vault + var keychainVaultOpts vault.Options + vault.WithReadonly(true)(&keychainVaultOpts) + keychainVault, err := vault.NewDarwinKeyChainVault(ctx, keychainVaultOpts) + if err != nil { + return fmt.Errorf("failed to open keychain vault: %w", err) + } + agentKey, err := keychainVault.Get(ctx, secret.AgentSecretKey) + if err != nil { + return fmt.Errorf("failed to get agent secret from keychain vault: %w", err) + } + + // set the agent secret into the file vault + var fileVaultOpts vault.Options + vault.WithVaultPath(paths.AgentVaultPath())(&fileVaultOpts) + fileVault, err := vault.NewFileVault(ctx, fileVaultOpts) + if err != nil { + return fmt.Errorf("failed to open file vault: %w", err) + } + err = fileVault.Set(ctx, secret.AgentSecretKey, agentKey) + if err != nil { + return fmt.Errorf("failed to set agent secret into file vault: %w", err) + } + + // no need to set the permissions, that will be set in the next step of the switch operation + + return nil +} diff --git a/internal/pkg/agent/install/switch_other.go b/internal/pkg/agent/install/switch_other.go new file mode 100644 index 00000000000..79c9b1a01ca --- /dev/null +++ b/internal/pkg/agent/install/switch_other.go @@ -0,0 +1,17 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build !darwin + +package install + +import ( + "github.com/schollz/progressbar/v3" + + "github.com/elastic/elastic-agent/pkg/utils" +) + +func switchPlatformMode(pt *progressbar.ProgressBar, ownership utils.FileOwner) error { + return nil +} diff --git a/internal/pkg/agent/install/uninstall.go b/internal/pkg/agent/install/uninstall.go index efcbafcaaff..703aef69e4e 100644 --- a/internal/pkg/agent/install/uninstall.go +++ b/internal/pkg/agent/install/uninstall.go @@ -45,39 +45,14 @@ func Uninstall(cfgFile, topPath, uninstallToken string, log *logp.Logger, pt *pr if runtime.GOOS == "windows" && paths.HasPrefix(cwd, topPath) { return fmt.Errorf("uninstall must be run from outside the installed path '%s'", topPath) } - // uninstall the current service - // not creating the service, so no need to set the username and group to any value - svc, err := newService(topPath) - if err != nil { - return fmt.Errorf("error creating new service handler: %w", err) - } - status, _ := svc.Status() - pt.Describe("Stopping service") - if status == service.StatusRunning { - err := svc.Stop() - if err != nil { - pt.Describe("Failed to issue stop service") - return aerrors.New( - err, - fmt.Sprintf("failed to issue stop service (%s)", paths.ServiceName), - aerrors.M("service", paths.ServiceName)) - } - } - // The kardianos service manager can't tell the difference - // between 'Stopped' and 'StopPending' on Windows, so make - // sure the service is stopped. - err = isStopped(30*time.Second, 250*time.Millisecond, paths.ServiceName) + // ensure service is stopped + status, err := EnsureStoppedService(topPath, pt) if err != nil { - pt.Describe("Failed to complete stop of service") - return aerrors.New( - err, - fmt.Sprintf("failed to complete stop service (%s)", paths.ServiceName), - aerrors.M("service", paths.ServiceName)) + // context for the error already provided in the EnsureStoppedService function + return err } - pt.Describe("Successfully stopped service") - // kill any running watcher if err := killWatcher(pt); err != nil { return fmt.Errorf("failed trying to kill any running watcher: %w", err) @@ -96,11 +71,9 @@ func Uninstall(cfgFile, topPath, uninstallToken string, log *logp.Logger, pt *pr // If service status was running it was stopped to uninstall the components. // If the components uninstall failed start the service again if status == service.StatusRunning { - if startErr := svc.Start(); startErr != nil { - return aerrors.New( - err, - fmt.Sprintf("failed to restart service (%s), after failed components uninstall: %v", paths.ServiceName, startErr), - aerrors.M("service", paths.ServiceName)) + if startErr := StartService(topPath); startErr != nil { + // context for the error already provided in the StartService function + return err } } return fmt.Errorf("error uninstalling components: %w", err) @@ -108,7 +81,7 @@ func Uninstall(cfgFile, topPath, uninstallToken string, log *logp.Logger, pt *pr // Uninstall service only after components were uninstalled successfully pt.Describe("Removing service") - err = svc.Uninstall() + err = UninstallService(topPath) // Is there a reason why we don't want to hard-fail on this? if err != nil { pt.Describe(fmt.Sprintf("Failed to Uninstall existing service: %s", err)) @@ -117,13 +90,13 @@ func Uninstall(cfgFile, topPath, uninstallToken string, log *logp.Logger, pt *pr } // remove, if present on platform - if paths.ShellWrapperPath != "" { - err = os.Remove(paths.ShellWrapperPath) + if paths.ShellWrapperPath() != "" { + err = os.Remove(paths.ShellWrapperPath()) if !os.IsNotExist(err) && err != nil { return aerrors.New( err, - fmt.Sprintf("failed to remove shell wrapper (%s)", paths.ShellWrapperPath), - aerrors.M("destination", paths.ShellWrapperPath)) + fmt.Sprintf("failed to remove shell wrapper (%s)", paths.ShellWrapperPath()), + aerrors.M("destination", paths.ShellWrapperPath())) } } @@ -142,6 +115,24 @@ func Uninstall(cfgFile, topPath, uninstallToken string, log *logp.Logger, pt *pr return nil } +// EnsureStoppedService ensures that the installed service is stopped. +func EnsureStoppedService(topPath string, pt *progressbar.ProgressBar) (service.Status, error) { + status, _ := StatusService(topPath) + if status == service.StatusRunning { + pt.Describe("Stopping service") + err := StopService(topPath, 30*time.Second, 250*time.Millisecond) + if err != nil { + pt.Describe("Failed to issue stop service") + // context for the error already provided in the StopService function + return status, err + } + pt.Describe("Successfully stopped service") + } else { + pt.Describe("Service already stopped") + } + return status, nil +} + func checkForUnprivilegedVault(ctx context.Context, opts ...vault.OptionFunc) (bool, error) { // check if we have a file vault to detect if we have to use it for reading config opts = append(opts, vault.WithReadonly(true)) @@ -168,7 +159,7 @@ func checkForUnprivilegedVault(ctx context.Context, opts ...vault.OptionFunc) (b // to an ERROR_SHARING_VIOLATION. RemovePath will retry up to 2 // seconds if it keeps getting that error. func RemovePath(path string) error { - const arbitraryTimeout = 30 * time.Second + const arbitraryTimeout = 60 * time.Second start := time.Now() var lastErr error for time.Since(start) <= arbitraryTimeout { @@ -230,7 +221,6 @@ func containsString(str string, a []string, caseSensitive bool) bool { } func uninstallComponents(ctx context.Context, cfgFile string, uninstallToken string, log *logp.Logger, pt *progressbar.ProgressBar, unprivileged bool) error { - platform, err := component.LoadPlatformDetail() if err != nil { return fmt.Errorf("failed to gather system information: %w", err) @@ -310,7 +300,7 @@ func serviceComponentsFromConfig(specs component.RuntimeSpecs, cfg *config.Confi if err != nil { return nil, aerrors.New("failed to create a map from config", err) } - allComps, err := specs.ToComponents(mm, nil, logp.InfoLevel, nil) + allComps, err := specs.ToComponents(mm, nil, logp.InfoLevel, nil, map[string]uint64{}) if err != nil { return nil, fmt.Errorf("failed to render components: %w", err) } @@ -391,7 +381,7 @@ func killWatcher(pt *progressbar.ProgressBar) error { errs = errors.Join(errs, fmt.Errorf("failed to load watcher process with pid %d: %w", pid, err)) continue } - err = proc.Kill() + err = killNoneChildProcess(proc) if err != nil && !errors.Is(err, os.ErrProcessDone) { errs = errors.Join(errs, fmt.Errorf("failed to kill watcher process with pid %d: %w", pid, err)) continue diff --git a/internal/pkg/agent/install/uninstall_unix.go b/internal/pkg/agent/install/uninstall_unix.go index d63d4bcf2d4..2181a6db481 100644 --- a/internal/pkg/agent/install/uninstall_unix.go +++ b/internal/pkg/agent/install/uninstall_unix.go @@ -6,6 +6,8 @@ package install +import "os" + func isBlockingOnExe(_ error) bool { return false } @@ -17,3 +19,10 @@ func removeBlockingExe(_ error) error { func isRetryableError(_ error) bool { return false } + +// killNoneChildProcess provides a way of killing a process that is not started as a child of this process. +// +// On Unix systems it just calls the native golang kill. +func killNoneChildProcess(proc *os.Process) error { + return proc.Kill() +} diff --git a/internal/pkg/agent/install/uninstall_windows.go b/internal/pkg/agent/install/uninstall_windows.go index 5339cd376b3..07b6d2ddeaa 100644 --- a/internal/pkg/agent/install/uninstall_windows.go +++ b/internal/pkg/agent/install/uninstall_windows.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io/fs" + "os" "syscall" "unsafe" @@ -160,3 +161,19 @@ type fileRenameInfo struct { type fileDispositionInfo struct { DeleteFile bool } + +// killNoneChildProcess provides a way of killing a process that is not started as a child of this process. +// +// On Windows when running in unprivileged mode the internal way that golang uses DuplicateHandle to perform the kill +// only works when the process is a child of this process. +func killNoneChildProcess(proc *os.Process) error { + h, e := syscall.OpenProcess(syscall.PROCESS_TERMINATE, false, uint32(proc.Pid)) + if e != nil { + return os.NewSyscallError("OpenProcess", e) + } + defer func() { + _ = syscall.CloseHandle(h) + }() + e = syscall.TerminateProcess(h, 1) + return os.NewSyscallError("TerminateProcess", e) +} diff --git a/internal/pkg/agent/install/user_windows.go b/internal/pkg/agent/install/user_windows.go index 0c68c74222f..357b5c0a779 100644 --- a/internal/pkg/agent/install/user_windows.go +++ b/internal/pkg/agent/install/user_windows.go @@ -6,29 +6,261 @@ package install -import "errors" +import ( + "crypto/rand" + "errors" + "fmt" + "math/big" + "strings" + "syscall" + "unsafe" + + "github.com/winlabs/gowin32" + "golang.org/x/sys/windows" +) + +const ( + passwordLength = 127 // maximum length allowed by Windows +) + +var ( + modnetapi32 = syscall.NewLazyDLL("netapi32.dll") + procNetLocalGroupAdd = modnetapi32.NewProc("NetLocalGroupAdd") + procNetLocalGroupAddMembers = modnetapi32.NewProc("NetLocalGroupAddMembers") + procNetUserAdd = modnetapi32.NewProc("NetUserAdd") + procNetUserSetInfo = modnetapi32.NewProc("NetUserSetInfo") +) + +const ( + // USER_PRIV_USER is standard user permissions. + USER_PRIV_USER = 1 + + // USER_UF_SCRIPT logon script executed. (always required to be set) + USER_UF_SCRIPT = 1 + USER_UF_NORMAL_ACCOUNT = 512 + USER_UF_DONT_EXPIRE_PASSWD = 65536 + + accountRightCreateSymbolicLink gowin32.AccountRightName = "SeCreateSymbolicLinkPrivilege" +) // FindGID returns the group's GID on the machine. func FindGID(name string) (string, error) { - return "", errors.New("not implemented") + sid, _, t, err := windows.LookupSID("", name) + if err != nil { + if errors.Is(err, windows.ERROR_NONE_MAPPED) { + // no account exists with that name + return "", ErrGroupNotFound + } + return "", fmt.Errorf("failed to lookup SID for group %s: %w", name, err) + } + if t != windows.SidTypeGroup && t != windows.SidTypeWellKnownGroup && t != windows.SidTypeAlias { + return "", fmt.Errorf("invalid SID type for group %s; should be group account type, not %d", name, t) + } + return sid.String(), nil } // CreateGroup creates a group on the machine. func CreateGroup(name string) (string, error) { - return "", errors.New("not implemented") + var parmErr uint32 + var err error + var info LOCALGROUP_INFO_0 + info.Lgrpi0_name, err = syscall.UTF16PtrFromString(name) + if err != nil { + return "", fmt.Errorf("failed to encode group name %s to UTF16: %w", name, err) + } + ret, _, _ := procNetLocalGroupAdd.Call( + uintptr(0), + uintptr(uint32(0)), + uintptr(unsafe.Pointer(&info)), + uintptr(unsafe.Pointer(&parmErr)), + ) + if ret != 0 { + return "", fmt.Errorf("call to NetLocalGroupAdd failed: status=%d error=%d", ret, parmErr) + } + return FindGID(name) } // FindUID returns the user's UID on the machine. func FindUID(name string) (string, error) { - return "", errors.New("not implemented") + sid, _, t, err := windows.LookupSID("", name) + if err != nil { + if errors.Is(err, windows.ERROR_NONE_MAPPED) { + // no account exists with that name + return "", ErrUserNotFound + } + return "", fmt.Errorf("failed to lookup SID for user %s: %w", name, err) + } + if t != windows.SidTypeUser && t != windows.SidTypeAlias { + return "", fmt.Errorf("invalid SID type for user %s; should be user account type, not %d", name, t) + } + return sid.String(), nil } // CreateUser creates a user on the machine. -func CreateUser(name string, gid string) (string, error) { - return "", errors.New("not implemented") +// +// User is created without interactive rights, no logon rights, and only service rights. +func CreateUser(name string, _ string) (string, error) { + var parmErr uint32 + password, err := RandomPassword() + if err != nil { + return "", fmt.Errorf("failed to generate random password: %w", err) + } + info := USER_INFO_1{ + Usri1_priv: USER_PRIV_USER, + Usri1_flags: USER_UF_SCRIPT | USER_UF_NORMAL_ACCOUNT | USER_UF_DONT_EXPIRE_PASSWD, + } + info.Usri1_name, err = syscall.UTF16PtrFromString(name) + if err != nil { + return "", fmt.Errorf("failed to encode username %s to UTF16: %w", name, err) + } + info.Usri1_password, err = syscall.UTF16PtrFromString(password) + if err != nil { + return "", fmt.Errorf("failed to encode password to UTF16: %w", err) + } + ret, _, _ := procNetUserAdd.Call( + uintptr(0), + uintptr(uint32(1)), + uintptr(unsafe.Pointer(&info)), + uintptr(unsafe.Pointer(&parmErr)), + ) + if ret != 0 { + return "", fmt.Errorf("call to NetUserAdd failed: status=%d error=%d", ret, parmErr) + } + + // adjust the local security policy to ensure that the created user is scoped to a service only + sid, _, _, err := gowin32.GetLocalAccountByName(name) + if err != nil { + return "", fmt.Errorf("failed to get SID for %s: %w", name, err) + } + sp, err := gowin32.OpenLocalSecurityPolicy() + if err != nil { + return "", fmt.Errorf("failed to open local security policy: %w", err) + } + defer sp.Close() + err = sp.AddAccountRight(sid, gowin32.AccountRightDenyInteractiveLogon) + if err != nil { + return "", fmt.Errorf("failed to set deny interactive logon: %w", err) + } + err = sp.AddAccountRight(sid, gowin32.AccountRightDenyNetworkLogon) + if err != nil { + return "", fmt.Errorf("failed to set deny network logon: %w", err) + } + err = sp.AddAccountRight(sid, gowin32.AccountRightDenyRemoteInteractiveLogon) + if err != nil { + return "", fmt.Errorf("failed to set deny remote interactive logon: %w", err) + } + err = sp.AddAccountRight(sid, gowin32.AccountRightServiceLogon) + if err != nil { + return "", fmt.Errorf("failed to set service logon: %w", err) + } + err = sp.AddAccountRight(sid, accountRightCreateSymbolicLink) + if err != nil { + return "", fmt.Errorf("failed to add right to create symbolic link: %w", err) + } + + return FindUID(name) } -// AddUserToGroup adds a user to a group. +// AddUserToGroup adds a user to a group. func AddUserToGroup(username string, groupName string) error { - return errors.New("not implemented") + userSid, _, t, err := windows.LookupSID("", username) + if err != nil { + return fmt.Errorf("failed to lookup SID for user %s: %w", username, err) + } + if t != windows.SidTypeUser && t != windows.SidTypeAlias { + return fmt.Errorf("invalid SID type for user %s; should be user account type, not %d", username, t) + } + groupNamePtr, err := syscall.UTF16PtrFromString(groupName) + if err != nil { + return fmt.Errorf("failed to encode group name %s to UTF16: %w", groupName, err) + } + entries := make([]LOCALGROUP_MEMBERS_INFO_0, 1) + entries[0] = LOCALGROUP_MEMBERS_INFO_0{ + Lgrmi0_sid: userSid, + } + ret, _, _ := procNetLocalGroupAddMembers.Call( + uintptr(0), + uintptr(unsafe.Pointer(groupNamePtr)), + uintptr(uint32(0)), + uintptr(unsafe.Pointer(&entries[0])), + uintptr(uint32(len(entries))), + ) + if ret != 0 { + return fmt.Errorf("call to NetLocalGroupAddMembers failed: status=%d", ret) + } + return nil +} + +// SetUserPassword sets the password for a user. +func SetUserPassword(name string, password string) error { + var parmErr uint32 + var err error + var info USER_INFO_1003 + + namePtr, err := syscall.UTF16PtrFromString(name) + if err != nil { + return fmt.Errorf("failed to encode username %s to UTF16: %w", name, err) + } + info.Usri1003_password, err = syscall.UTF16PtrFromString(password) + if err != nil { + return fmt.Errorf("failed to encode password to UTF16: %w", err) + } + ret, _, _ := procNetUserSetInfo.Call( + uintptr(0), + uintptr(unsafe.Pointer(namePtr)), + uintptr(uint32(1003)), + uintptr(unsafe.Pointer(&info)), + uintptr(unsafe.Pointer(&parmErr)), + ) + if ret != 0 { + return fmt.Errorf("call to NetUserSetInfo failed: status=%d error=%d", ret, parmErr) + } + return nil +} + +// RandomPassword generates a random password. +func RandomPassword() (string, error) { + runes := []rune("abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*ABCDEFGHIJKLMNOPQRSTUVWXYZ") + maxN := big.NewInt(int64(len(runes))) + var sb strings.Builder + for i := 0; i < passwordLength; i++ { + n, err := rand.Int(rand.Reader, maxN) + if err != nil { + return "", fmt.Errorf("failed to generate random integer: %w", err) + } + sb.WriteRune(runes[n.Int64()]) + } + return sb.String(), nil +} + +// LOCALGROUP_INFO_0 structure contains a local group name. +// https://learn.microsoft.com/en-us/windows/win32/api/lmaccess/ns-lmaccess-localgroup_info_0 +type LOCALGROUP_INFO_0 struct { + Lgrpi0_name *uint16 +} + +// USER_INFO_1 structure contains information about a user account, including account name, password data, +// privilege level, and the path to the user's home directory. +// https://learn.microsoft.com/en-us/windows/win32/api/lmaccess/ns-lmaccess-user_info_1 +type USER_INFO_1 struct { + Usri1_name *uint16 + Usri1_password *uint16 + Usri1_password_age uint32 + Usri1_priv uint32 + Usri1_home_dir *uint16 + Usri1_comment *uint16 + Usri1_flags uint32 + Usri1_script_path *uint16 +} + +// USER_INFO_1003 structure contains a user password. +// https://learn.microsoft.com/en-us/windows/win32/api/lmaccess/ns-lmaccess-user_info_1003 +type USER_INFO_1003 struct { + Usri1003_password *uint16 +} + +// LOCALGROUP_MEMBERS_INFO_0 structure contains the security identifier (SID) associated with a local group member. +// https://learn.microsoft.com/en-us/windows/win32/api/lmaccess/ns-lmaccess-localgroup_members_info_0 +type LOCALGROUP_MEMBERS_INFO_0 struct { + Lgrmi0_sid *windows.SID } diff --git a/internal/pkg/agent/migration/migrate_config.go b/internal/pkg/agent/migration/migrate_config.go index 2f7099d47e5..a88c5582bb0 100644 --- a/internal/pkg/agent/migration/migrate_config.go +++ b/internal/pkg/agent/migration/migrate_config.go @@ -23,7 +23,7 @@ import ( // - The contents from the unencrypted file will be copied as a byte stream without any transformation. // - The function will not perform any operation if the encryptedConfigPath already exists and it's not empty to avoid overwrites. // - If neither the encrypted file nor the unencrypted file exist this call is a no-op -func MigrateToEncryptedConfig(ctx context.Context, l *logp.Logger, unencryptedConfigPath string, encryptedConfigPath string, storageOpts ...storage.OptionFunc) error { +func MigrateToEncryptedConfig(ctx context.Context, l *logp.Logger, unencryptedConfigPath string, encryptedConfigPath string, storageOpts ...storage.EncryptedOptionFunc) error { encStat, encFileErr := os.Stat(encryptedConfigPath) if encFileErr != nil && !errors.Is(encFileErr, fs.ErrNotExist) { diff --git a/internal/pkg/agent/perms/opts.go b/internal/pkg/agent/perms/opts.go new file mode 100644 index 00000000000..1735b084dcf --- /dev/null +++ b/internal/pkg/agent/perms/opts.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 perms + +import ( + "os" + + "github.com/elastic/elastic-agent/pkg/utils" +) + +const ( + defaultMask = 0770 +) + +type opts struct { + mask os.FileMode + ownership utils.FileOwner +} + +type OptFunc func(o *opts) + +// WithMask adjusts the default mask used. +func WithMask(mask os.FileMode) OptFunc { + return func(o *opts) { + o.mask = mask + } +} + +// WithOwnership sets the ownership for the permissions +func WithOwnership(ownership utils.FileOwner) OptFunc { + return func(o *opts) { + o.ownership = ownership + } +} + +func newOpts(optFuncs ...OptFunc) *opts { + o := &opts{ + mask: defaultMask, + ownership: utils.CurrentFileOwner(), + } + for _, f := range optFuncs { + f(o) + } + return o +} diff --git a/internal/pkg/agent/install/perms_unix.go b/internal/pkg/agent/perms/unix.go similarity index 78% rename from internal/pkg/agent/install/perms_unix.go rename to internal/pkg/agent/perms/unix.go index 8cafc79fe8b..098c5b3462d 100644 --- a/internal/pkg/agent/install/perms_unix.go +++ b/internal/pkg/agent/perms/unix.go @@ -4,7 +4,7 @@ //go:build !windows -package install +package perms import ( "errors" @@ -12,12 +12,11 @@ import ( "io/fs" "os" "path/filepath" - - "github.com/elastic/elastic-agent/pkg/utils" ) // FixPermissions fixes the permissions so only root:root is the owner and no world read-able permissions -func FixPermissions(topPath string, ownership utils.FileOwner) error { +func FixPermissions(topPath string, opts ...OptFunc) error { + o := newOpts(opts...) return filepath.Walk(topPath, func(name string, info fs.FileInfo, err error) error { if errors.Is(err, fs.ErrNotExist) { return nil @@ -28,12 +27,12 @@ func FixPermissions(topPath string, ownership utils.FileOwner) error { // all files should be owned by uid:gid // uses `os.Lchown` so the symlink is updated to have the permissions - if err := os.Lchown(name, ownership.UID, ownership.GID); err != nil { + if err := os.Lchown(name, o.ownership.UID, o.ownership.GID); err != nil { return fmt.Errorf("cannot update ownership of %q: %w", topPath, err) } // remove any world permissions from the file - if err := os.Chmod(name, info.Mode().Perm()&0770); err != nil { + if err := os.Chmod(name, info.Mode().Perm()&o.mask); err != nil { return fmt.Errorf("could not update permissions of %q: %w", topPath, err) } diff --git a/internal/pkg/agent/perms/windows.go b/internal/pkg/agent/perms/windows.go new file mode 100644 index 00000000000..6a2fb208f5e --- /dev/null +++ b/internal/pkg/agent/perms/windows.go @@ -0,0 +1,130 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build windows + +package perms + +import ( + "errors" + "fmt" + "io/fs" + "path/filepath" + + "github.com/Microsoft/go-winio" + "github.com/hectane/go-acl" + "github.com/hectane/go-acl/api" + "golang.org/x/sys/windows" + + "github.com/elastic/elastic-agent/pkg/utils" +) + +// FixPermissions fixes the permissions so only SYSTEM and Administrators have access to the files in the install path +func FixPermissions(topPath string, opts ...OptFunc) error { + o := newOpts(opts...) + + // SYSTEM and Administrators always get permissions + // https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems + systemSID, err := windows.StringToSid(utils.SystemSID) + if err != nil { + return fmt.Errorf("failed to get SYSTEM SID: %w", err) + } + administratorsSID, err := windows.StringToSid(utils.AdministratorSID) + if err != nil { + return fmt.Errorf("failed to get Administrators SID: %w", err) + } + + // https://docs.microsoft.com/en-us/windows/win32/secauthz/access-mask + grants := make([]api.ExplicitAccess, 0, 4) + grants = append(grants, acl.GrantSid(0xF10F0000, systemSID)) // full control of all acl's + grants = append(grants, acl.GrantSid(0xF10F0000, administratorsSID)) // full control of all acl's + + // user gets grant based on the mask + userSID := administratorsSID // defaults to owned by Administrators + if o.mask&0700 != 0 && o.ownership.UID != "" { + userSID, err = windows.StringToSid(o.ownership.UID) + if err != nil { + return fmt.Errorf("failed to get user %s: %w", o.ownership.UID, err) + } + grants = append(grants, acl.GrantSid(uint32(((o.mask&0700)<<23)|((o.mask&0200)<<9)), userSID)) + } + + // group gets grant based on the mask + groupSID := administratorsSID // defaults to owned by Administrators + if o.mask&0070 != 0 && o.ownership.GID != "" { + groupSID, err = windows.StringToSid(o.ownership.GID) + if err != nil { + return fmt.Errorf("failed to get group %s: %w", o.ownership.GID, err) + } + grants = append(grants, acl.GrantSid(uint32(((o.mask&0070)<<26)|((o.mask&0020)<<12)), groupSID)) + } + + // everyone gets grant based on the mask + if o.mask&0007 != 0 { + everyoneSID, err := windows.StringToSid(utils.EveryoneSID) + if err != nil { + return fmt.Errorf("failed to get Everyone SID: %w", err) + } + grants = append(grants, acl.GrantSid(uint32(((o.mask&0007)<<29)|((o.mask&0002)<<15)), everyoneSID)) + } + + // ownership can only be change to another user when running as Administrator + isAdmin, err := utils.HasRoot() + if err != nil { + return fmt.Errorf("failed to determine Administrator: %w", err) + } + if isAdmin { + // call to `takeOwnership` which sets the ownership information requires the current process + // token to have the 'SeRestorePrivilege' or it's unable to adjust the ownership + return winio.RunWithPrivileges([]string{winio.SeRestorePrivilege}, func() error { + return filepath.Walk(topPath, func(name string, info fs.FileInfo, err error) error { + if err == nil { + // first level doesn't inherit + inherit := true + if topPath == name { + inherit = false + } + + err = acl.Apply(name, true, inherit, grants...) + if err != nil { + return err + } + if userSID != nil && groupSID != nil { + err = takeOwnership(name, userSID, groupSID) + } + } else if errors.Is(err, fs.ErrNotExist) { + return nil + } + return err + }) + }) + } + + // ownership cannot be changed, this will keep the ownership as it currently is but apply the ACL's + return filepath.Walk(topPath, func(name string, info fs.FileInfo, err error) error { + if err == nil { + // first level doesn't inherit + inherit := true + if topPath == name { + inherit = false + } + return acl.Apply(name, true, inherit, grants...) + } else if errors.Is(err, fs.ErrNotExist) { + return nil + } + return err + }) +} + +func takeOwnership(name string, owner *windows.SID, group *windows.SID) error { + return api.SetNamedSecurityInfo( + name, + api.SE_FILE_OBJECT, + api.OWNER_SECURITY_INFORMATION|api.GROUP_SECURITY_INFORMATION, + owner, + group, + 0, + 0, + ) +} diff --git a/internal/pkg/agent/protection/policy_test.go b/internal/pkg/agent/protection/policy_test.go index 80934d32b99..ed0f1750fd0 100644 --- a/internal/pkg/agent/protection/policy_test.go +++ b/internal/pkg/agent/protection/policy_test.go @@ -18,7 +18,11 @@ import ( func getLogger() *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.DebugLevel - l, _ := logger.NewFromConfig("", loggerCfg, false) + + eventLoggerCfg := logger.DefaultEventLoggingConfig() + eventLoggerCfg.Level = loggerCfg.Level + + l, _ := logger.NewFromConfig("", loggerCfg, eventLoggerCfg, false) return l } diff --git a/internal/pkg/agent/storage/disk_store.go b/internal/pkg/agent/storage/disk_store.go index 8ebd92a9608..79f775964d9 100644 --- a/internal/pkg/agent/storage/disk_store.go +++ b/internal/pkg/agent/storage/disk_store.go @@ -9,15 +9,29 @@ import ( "io" "os" - "github.com/hectane/go-acl" - "github.com/elastic/elastic-agent-libs/file" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" + "github.com/elastic/elastic-agent/internal/pkg/agent/perms" + "github.com/elastic/elastic-agent/pkg/utils" ) +// DiskStoreOptionFunc is an option configuration for the disk store. +type DiskStoreOptionFunc func(s *DiskStore) + +// DiskStoreWithOwnership sets ownership for creating the files. +func DiskStoreWithOwnership(ownership utils.FileOwner) DiskStoreOptionFunc { + return func(s *DiskStore) { + s.ownership = &ownership + } +} + // NewDiskStore creates an unencrypted disk store. -func NewDiskStore(target string) (*DiskStore, error) { - return &DiskStore{target: target}, nil +func NewDiskStore(target string, opts ...DiskStoreOptionFunc) (*DiskStore, error) { + s := &DiskStore{target: target} + for _, opt := range opts { + opt(s) + } + return s, nil } // Exists check if the store file exists on the disk @@ -43,7 +57,7 @@ func (d *DiskStore) Delete() error { func (d *DiskStore) Save(in io.Reader) error { tmpFile := d.target + ".tmp" - fd, err := os.OpenFile(tmpFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, perms) + fd, err := os.OpenFile(tmpFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, permMask) if err != nil { return errors.New(err, fmt.Sprintf("could not save to %s", tmpFile), @@ -68,7 +82,7 @@ func (d *DiskStore) Save(in io.Reader) error { if err := fd.Sync(); err != nil { return errors.New(err, - fmt.Sprintf("could not sync temporary file %s", d.target), + fmt.Sprintf("could not sync temporary file %s", tmpFile), errors.TypeFilesystem, errors.M(errors.MetaKeyPath, tmpFile)) } @@ -79,16 +93,23 @@ func (d *DiskStore) Save(in io.Reader) error { errors.M(errors.MetaKeyPath, tmpFile)) } - if err := file.SafeFileRotate(d.target, tmpFile); err != nil { + // fix the permissions of the temp file, ensuring that when the file is rotated in to place + // it has the correct permissions (otherwise it is possible to be a permissions error, between + // rotating the file and setting the permissions after). + opts := []perms.OptFunc{perms.WithMask(permMask)} + if d.ownership != nil { + opts = append(opts, perms.WithOwnership(*d.ownership)) + } + if err := perms.FixPermissions(tmpFile, opts...); err != nil { return errors.New(err, - fmt.Sprintf("could not replace target file %s", d.target), + fmt.Sprintf("could not set permissions on temporary file %s", tmpFile), errors.TypeFilesystem, - errors.M(errors.MetaKeyPath, d.target)) + errors.M(errors.MetaKeyPath, tmpFile)) } - if err := acl.Chmod(d.target, perms); err != nil { + if err := file.SafeFileRotate(d.target, tmpFile); err != nil { return errors.New(err, - fmt.Sprintf("could not set permissions target file %s", d.target), + fmt.Sprintf("could not replace target file %s", d.target), errors.TypeFilesystem, errors.M(errors.MetaKeyPath, d.target)) } @@ -98,7 +119,7 @@ func (d *DiskStore) Save(in io.Reader) error { // Load return a io.ReadCloser for the target file. func (d *DiskStore) Load() (io.ReadCloser, error) { - fd, err := os.OpenFile(d.target, os.O_RDONLY|os.O_CREATE, perms) + fd, err := os.OpenFile(d.target, os.O_RDONLY|os.O_CREATE, permMask) if err != nil { return nil, errors.New(err, fmt.Sprintf("could not open %s", d.target), diff --git a/internal/pkg/agent/storage/encrypted_disk_store.go b/internal/pkg/agent/storage/encrypted_disk_store.go index 78d77db4828..6a6ea0110db 100644 --- a/internal/pkg/agent/storage/encrypted_disk_store.go +++ b/internal/pkg/agent/storage/encrypted_disk_store.go @@ -13,17 +13,15 @@ import ( "os" "runtime" - "github.com/elastic/elastic-agent/internal/pkg/agent/vault" - "github.com/elastic/elastic-agent/pkg/utils" - - "github.com/hectane/go-acl" - "github.com/elastic/elastic-agent-libs/file" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/internal/pkg/agent/application/secret" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" + "github.com/elastic/elastic-agent/internal/pkg/agent/perms" + "github.com/elastic/elastic-agent/internal/pkg/agent/vault" "github.com/elastic/elastic-agent/internal/pkg/crypto" + "github.com/elastic/elastic-agent/pkg/utils" ) const darwin = "darwin" @@ -38,27 +36,21 @@ func DisableEncryptionDarwin() { } } -// OptionFunc is the functional configuration type. -type OptionFunc func(s *EncryptedDiskStore) +// EncryptedOptionFunc is an option configuration for the encrypted disk store. +type EncryptedOptionFunc func(s *EncryptedDiskStore) // NewEncryptedDiskStore creates an encrypted disk store. // Drop-in replacement for NewDiskStorage -func NewEncryptedDiskStore(ctx context.Context, target string, opts ...OptionFunc) (Storage, error) { - if encryptionDisabled { - return NewDiskStore(target) - } - +func NewEncryptedDiskStore(ctx context.Context, target string, opts ...EncryptedOptionFunc) (Storage, error) { unprivileged := false - hasRoot, err := utils.HasRoot() if err != nil { return nil, fmt.Errorf("error checking for root/Administrator privileges: %w", err) } if !hasRoot { unprivileged = true - opts = append([]OptionFunc{WithUnprivileged(unprivileged)}, opts...) + opts = append([]EncryptedOptionFunc{WithUnprivileged(unprivileged)}, opts...) } - s := &EncryptedDiskStore{ ctx: ctx, target: target, @@ -68,23 +60,37 @@ func NewEncryptedDiskStore(ctx context.Context, target string, opts ...OptionFun for _, opt := range opts { opt(s) } + if encryptionDisabled { + var opts []DiskStoreOptionFunc + if s.ownership != nil { + opts = append(opts, DiskStoreWithOwnership(*s.ownership)) + } + return NewDiskStore(target, opts...) + } return s, nil } // WithVaultPath sets the path of the vault. -func WithVaultPath(vaultPath string) OptionFunc { +func WithVaultPath(vaultPath string) EncryptedOptionFunc { return func(s *EncryptedDiskStore) { s.vaultPath = vaultPath } } // WithUnprivileged sets if vault should be unprivileged. -func WithUnprivileged(unprivileged bool) OptionFunc { +func WithUnprivileged(unprivileged bool) EncryptedOptionFunc { return func(s *EncryptedDiskStore) { s.unprivileged = unprivileged } } +// EncryptedStoreWithOwnership sets ownership for creating the files. +func EncryptedStoreWithOwnership(ownership utils.FileOwner) EncryptedOptionFunc { + return func(s *EncryptedDiskStore) { + s.ownership = &ownership + } +} + // Exists will check if the encrypted disk store exists. func (d *EncryptedDiskStore) Exists() (bool, error) { _, err := os.Stat(d.target) @@ -119,7 +125,7 @@ func (d *EncryptedDiskStore) Save(in io.Reader) error { tmpFile := d.target + ".tmp" - fd, err := os.OpenFile(tmpFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, perms) + fd, err := os.OpenFile(tmpFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, permMask) if err != nil { return errors.New(err, fmt.Sprintf("could not save to %s", tmpFile), @@ -162,16 +168,23 @@ func (d *EncryptedDiskStore) Save(in io.Reader) error { errors.M(errors.MetaKeyPath, tmpFile)) } - if err := file.SafeFileRotate(d.target, tmpFile); err != nil { + // fix the permissions of the temp file, ensuring that when the file is rotated in to place + // it has the correct permissions (otherwise it is possible to be a permissions error, between + // rotating the file and setting the permissions after). + opts := []perms.OptFunc{perms.WithMask(permMask)} + if d.ownership != nil { + opts = append(opts, perms.WithOwnership(*d.ownership)) + } + if err := perms.FixPermissions(tmpFile, opts...); err != nil { return errors.New(err, - fmt.Sprintf("could not replace target file %s", d.target), + fmt.Sprintf("could not set permissions on temporary file %s", tmpFile), errors.TypeFilesystem, - errors.M(errors.MetaKeyPath, d.target)) + errors.M(errors.MetaKeyPath, tmpFile)) } - if err := acl.Chmod(d.target, perms); err != nil { + if err := file.SafeFileRotate(d.target, tmpFile); err != nil { return errors.New(err, - fmt.Sprintf("could not set permissions target file %s", d.target), + fmt.Sprintf("could not replace target file %s", d.target), errors.TypeFilesystem, errors.M(errors.MetaKeyPath, d.target)) } @@ -181,7 +194,7 @@ func (d *EncryptedDiskStore) Save(in io.Reader) error { // Load returns an io.ReadCloser for the target. func (d *EncryptedDiskStore) Load() (rc io.ReadCloser, err error) { - fd, err := os.OpenFile(d.target, os.O_RDONLY, perms) + fd, err := os.OpenFile(d.target, os.O_RDONLY, permMask) if err != nil { if errors.Is(err, os.ErrNotExist) { // If file doesn't exist, return empty reader closer diff --git a/internal/pkg/agent/storage/encrypted_disk_store_test.go b/internal/pkg/agent/storage/encrypted_disk_store_test.go index c0db1b1d619..3f0dbeb9885 100644 --- a/internal/pkg/agent/storage/encrypted_disk_store_test.go +++ b/internal/pkg/agent/storage/encrypted_disk_store_test.go @@ -27,7 +27,7 @@ func TestNewEncryptedDiskStore(t *testing.T) { type args struct { target string - opts []OptionFunc + opts []EncryptedOptionFunc } tests := []struct { name string @@ -58,7 +58,7 @@ func TestNewEncryptedDiskStore(t *testing.T) { name: fmt.Sprintf("encrypted store with unprivileged=%v override", hasRoot), args: args{ target: "privilegedoverridestore.enc", - opts: []OptionFunc{WithUnprivileged(hasRoot)}, + opts: []EncryptedOptionFunc{WithUnprivileged(hasRoot)}, }, want: func(t *testing.T, storage Storage) { if assert.IsType(t, (*EncryptedDiskStore)(nil), storage, "a *EncryptedDiskStore should have been returned") { @@ -75,7 +75,7 @@ func TestNewEncryptedDiskStore(t *testing.T) { name: "encrypted store with custom vault path override", args: args{ target: "customvaultpathstore.enc", - opts: []OptionFunc{WithVaultPath("somecustomvault")}, + opts: []EncryptedOptionFunc{WithVaultPath("somecustomvault")}, }, want: func(t *testing.T, storage Storage) { if assert.IsType(t, (*EncryptedDiskStore)(nil), storage, "a *EncryptedDiskStore should have been returned") { diff --git a/internal/pkg/agent/storage/replace_store.go b/internal/pkg/agent/storage/replace_store.go index aa17535236d..c53d716438d 100644 --- a/internal/pkg/agent/storage/replace_store.go +++ b/internal/pkg/agent/storage/replace_store.go @@ -11,12 +11,22 @@ import ( "os" "time" - "github.com/hectane/go-acl" - "github.com/elastic/elastic-agent-libs/file" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" + "github.com/elastic/elastic-agent/internal/pkg/agent/perms" + "github.com/elastic/elastic-agent/pkg/utils" ) +// ReplaceOnSuccessStoreOptionFunc is an option configuration for the replace on success store. +type ReplaceOnSuccessStoreOptionFunc func(s *ReplaceOnSuccessStore) + +// ReplaceOnSuccessStoreWithOwnership sets ownership for creating the files. +func ReplaceOnSuccessStoreWithOwnership(ownership utils.FileOwner) ReplaceOnSuccessStoreOptionFunc { + return func(s *ReplaceOnSuccessStore) { + s.ownership = &ownership + } +} + // ReplaceOnSuccessStore takes a target file, a replacement content and a wrapped store. This // store is useful if you want to trigger an action to replace another file when the wrapped store save method // is successful. This store will take care of making a backup copy of the target file and will not @@ -27,16 +37,22 @@ type ReplaceOnSuccessStore struct { replaceWith []byte wrapped Store + + ownership *utils.FileOwner } // NewReplaceOnSuccessStore takes a target file and a replacement content and will replace the target // file content if the wrapped store execution is done without any error. -func NewReplaceOnSuccessStore(target string, replaceWith []byte, wrapped Store) *ReplaceOnSuccessStore { - return &ReplaceOnSuccessStore{ +func NewReplaceOnSuccessStore(target string, replaceWith []byte, wrapped Store, opts ...ReplaceOnSuccessStoreOptionFunc) *ReplaceOnSuccessStore { + r := &ReplaceOnSuccessStore{ target: target, replaceWith: replaceWith, wrapped: wrapped, } + for _, opt := range opts { + opt(r) + } + return r } // Save will replace a target file with new content if the wrapped store is successful. @@ -77,7 +93,7 @@ func (r *ReplaceOnSuccessStore) Save(in io.Reader) error { errors.M(errors.MetaKeyPath, r.target)) } - fd, err := os.OpenFile(r.target, os.O_CREATE|os.O_WRONLY, perms) + fd, err := os.OpenFile(r.target, os.O_CREATE|os.O_WRONLY, permMask) if err != nil { // Rollback on any errors to minimize non working state. if err := file.SafeFileRotate(r.target, backFilename); err != nil { @@ -100,7 +116,7 @@ func (r *ReplaceOnSuccessStore) Save(in io.Reader) error { // Always clean up the temporary file and ignore errors. defer os.Remove(tmpFile) - fdt, err := os.OpenFile(tmpFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, perms) + fdt, err := os.OpenFile(tmpFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, permMask) if err != nil { return errors.New(err, fmt.Sprintf("could not save to %s", tmpFile), @@ -132,17 +148,23 @@ func (r *ReplaceOnSuccessStore) Save(in io.Reader) error { errors.M(errors.MetaKeyPath, tmpFile)) } - if err := file.SafeFileRotate(r.target, tmpFile); err != nil { + // fix the permissions of the temp file, ensuring that when the file is rotated in to place + // it has the correct permissions (otherwise it is possible to be a permissions error, between + // rotating the file and setting the permissions after). + opts := []perms.OptFunc{perms.WithMask(permMask)} + if r.ownership != nil { + opts = append(opts, perms.WithOwnership(*r.ownership)) + } + if err := perms.FixPermissions(tmpFile, opts...); err != nil { return errors.New(err, - fmt.Sprintf("could not replace target file %s with %s", r.target, tmpFile), + fmt.Sprintf("could not set permissions on temporary file %s", tmpFile), errors.TypeFilesystem, - errors.M(errors.MetaKeyPath, r.target), - errors.M("backup_path", backFilename)) + errors.M(errors.MetaKeyPath, tmpFile)) } - if err := acl.Chmod(r.target, perms); err != nil { + if err := file.SafeFileRotate(r.target, tmpFile); err != nil { return errors.New(err, - fmt.Sprintf("could not set permissions target file %s", r.target), + fmt.Sprintf("could not replace target file %s with %s", r.target, tmpFile), errors.TypeFilesystem, errors.M(errors.MetaKeyPath, r.target)) } diff --git a/internal/pkg/agent/storage/storage.go b/internal/pkg/agent/storage/storage.go index 865c53cb30d..28126ac4094 100644 --- a/internal/pkg/agent/storage/storage.go +++ b/internal/pkg/agent/storage/storage.go @@ -8,9 +8,11 @@ import ( "context" "io" "os" + + "github.com/elastic/elastic-agent/pkg/utils" ) -const perms os.FileMode = 0600 +const permMask os.FileMode = 0600 // Store saves the io.Reader. type Store interface { @@ -31,7 +33,8 @@ type Storage interface { // DiskStore takes a persistedConfig and save it to a temporary files and replace the target file. type DiskStore struct { - target string + target string + ownership *utils.FileOwner } // EncryptedDiskStore encrypts config when saving to disk. @@ -42,4 +45,5 @@ type EncryptedDiskStore struct { vaultPath string key []byte unprivileged bool + ownership *utils.FileOwner } diff --git a/internal/pkg/agent/storage/storage_test.go b/internal/pkg/agent/storage/storage_test.go index c9ddff98dd7..370cad4b85f 100644 --- a/internal/pkg/agent/storage/storage_test.go +++ b/internal/pkg/agent/storage/storage_test.go @@ -49,7 +49,7 @@ func TestReplaceOrRollbackStore(t *testing.T) { require.True(t, bytes.Equal(writtenContent, replaceWith)) requireFilesCount(t, dir, 2) - checkPerms(t, target, perms) + checkPerms(t, target, permMask) }) t.Run("when save is not successful", func(t *testing.T) { @@ -155,7 +155,7 @@ func TestDiskStore(t *testing.T) { require.NoError(t, err) require.Equal(t, msg, content) - checkPerms(t, target, perms) + checkPerms(t, target, permMask) }) t.Run("when the target do no exist", func(t *testing.T) { @@ -175,7 +175,7 @@ func TestDiskStore(t *testing.T) { require.NoError(t, err) require.Equal(t, msg, content) - checkPerms(t, target, perms) + checkPerms(t, target, permMask) }) t.Run("return an io.ReadCloser to the target file", func(t *testing.T) { @@ -193,7 +193,7 @@ func TestDiskStore(t *testing.T) { content, err := io.ReadAll(r) require.NoError(t, err) require.Equal(t, msg, content) - checkPerms(t, target, perms) + checkPerms(t, target, permMask) }) } diff --git a/internal/pkg/agent/storage/store/state_store.go b/internal/pkg/agent/storage/store/state_store.go index 50d9f92e8bf..3bb8162988e 100644 --- a/internal/pkg/agent/storage/store/state_store.go +++ b/internal/pkg/agent/storage/store/state_store.go @@ -75,13 +75,13 @@ type stateSerializer struct { } // NewStateStoreWithMigration creates a new state store and migrates the old one. -func NewStateStoreWithMigration(ctx context.Context, log *logger.Logger, actionStorePath, stateStorePath string) (*StateStore, error) { - err := migrateStateStore(ctx, log, actionStorePath, stateStorePath) +func NewStateStoreWithMigration(ctx context.Context, log *logger.Logger, actionStorePath, stateStorePath string, storageOpts ...storage.EncryptedOptionFunc) (*StateStore, error) { + err := migrateStateStore(ctx, log, actionStorePath, stateStorePath, storageOpts...) if err != nil { return nil, err } - encryptedDiskStore, err := storage.NewEncryptedDiskStore(ctx, stateStorePath) + encryptedDiskStore, err := storage.NewEncryptedDiskStore(ctx, stateStorePath, storageOpts...) if err != nil { return nil, fmt.Errorf("error instantiating encrypted disk store: %w", err) } @@ -147,14 +147,14 @@ func NewStateStore(log *logger.Logger, store storeLoad) (*StateStore, error) { }, nil } -func migrateStateStore(ctx context.Context, log *logger.Logger, actionStorePath, stateStorePath string) (err error) { +func migrateStateStore(ctx context.Context, log *logger.Logger, actionStorePath, stateStorePath string, storageOpts ...storage.EncryptedOptionFunc) (err error) { log = log.Named("state_migration") actionDiskStore, err := storage.NewDiskStore(actionStorePath) if err != nil { return fmt.Errorf("error creating disk store: %w", err) } - stateDiskStore, err := storage.NewEncryptedDiskStore(ctx, stateStorePath) + stateDiskStore, err := storage.NewEncryptedDiskStore(ctx, stateStorePath, storageOpts...) if err != nil { return fmt.Errorf("error instantiating encrypted disk store: %w", err) } diff --git a/internal/pkg/agent/vault/vault_file.go b/internal/pkg/agent/vault/vault_file.go index e05ad3b3d26..0b1b7ea08de 100644 --- a/internal/pkg/agent/vault/vault_file.go +++ b/internal/pkg/agent/vault/vault_file.go @@ -54,7 +54,7 @@ func NewFileVault(ctx context.Context, options Options) (v *FileVault, err error if err != nil { return nil, fmt.Errorf("failed to create vault path: %v, err: %w", path, err) } - err = tightenPermissions(path) + err = tightenPermissions(path, options.ownership) if err != nil { return nil, err } diff --git a/internal/pkg/agent/vault/vault_file_notwindows.go b/internal/pkg/agent/vault/vault_file_notwindows.go index cec2a5fec0b..f9878ffab9e 100644 --- a/internal/pkg/agent/vault/vault_file_notwindows.go +++ b/internal/pkg/agent/vault/vault_file_notwindows.go @@ -18,6 +18,7 @@ import ( "golang.org/x/crypto/pbkdf2" "github.com/elastic/elastic-agent/internal/pkg/agent/vault/aesgcm" + "github.com/elastic/elastic-agent/pkg/utils" ) const ( @@ -58,7 +59,7 @@ func deriveKey(pw []byte, salt []byte) ([]byte, []byte, error) { return pbkdf2.Key(pw, salt, 12022, 32, sha256.New), salt, nil } -func tightenPermissions(path string) error { +func tightenPermissions(path string, ownership utils.FileOwner) error { // Noop for linx return nil } diff --git a/internal/pkg/agent/vault/vault_file_windows.go b/internal/pkg/agent/vault/vault_file_windows.go index 885231be8a4..bbc0bf5806d 100644 --- a/internal/pkg/agent/vault/vault_file_windows.go +++ b/internal/pkg/agent/vault/vault_file_windows.go @@ -10,9 +10,8 @@ import ( "os" "github.com/billgraziano/dpapi" - "github.com/hectane/go-acl" - "golang.org/x/sys/windows" + "github.com/elastic/elastic-agent/internal/pkg/agent/perms" "github.com/elastic/elastic-agent/pkg/utils" ) @@ -24,26 +23,8 @@ func (v *FileVault) decrypt(data []byte) ([]byte, error) { return dpapi.DecryptBytesEntropy(data, v.seed) } -func tightenPermissions(path string) error { - return systemAdministratorsOnly(path, false) -} - -func systemAdministratorsOnly(path string, inherit bool) error { - // https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems - systemSID, err := windows.StringToSid(utils.SystemSID) - if err != nil { - return err - } - administratorsSID, err := windows.StringToSid(utils.AdministratorSID) - if err != nil { - return err - } - - // https://docs.microsoft.com/en-us/windows/win32/secauthz/access-mask - return acl.Apply( - path, true, inherit, - acl.GrantSid(0xF10F0000, systemSID), // full control of all acl's - acl.GrantSid(0xF10F0000, administratorsSID)) +func tightenPermissions(path string, ownership utils.FileOwner) error { + return perms.FixPermissions(path, perms.WithMask(0750), perms.WithOwnership(ownership)) } func writeFile(fp string, data []byte) error { diff --git a/internal/pkg/agent/vault/vault_options.go b/internal/pkg/agent/vault/vault_options.go index 51661c0ee1f..81b2a976903 100644 --- a/internal/pkg/agent/vault/vault_options.go +++ b/internal/pkg/agent/vault/vault_options.go @@ -8,6 +8,7 @@ import ( "time" "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/pkg/utils" ) type OptionFunc func(o *Options) @@ -20,6 +21,7 @@ type CommonVaultOptions struct { type FileVaultOptions struct { vaultPath string lockRetryDelay time.Duration + ownership utils.FileOwner } type KeychainVaultOptions struct { @@ -46,6 +48,13 @@ func WithVaultPath(vaultPath string) OptionFunc { } } +// WithVaultOwnership allows to specify the ownership that should apply for the file-based vault implementation (doesn't apply for the keychain vault) +func WithVaultOwnership(ownership utils.FileOwner) OptionFunc { + return func(o *Options) { + o.ownership = ownership + } +} + // WithVaultEntryName allows to specify the vault key entry name in the keychain (it applies only for keychain vault on darwin) func WithVaultEntryName(entryName string) OptionFunc { return func(o *Options) { @@ -70,6 +79,7 @@ func ApplyOptions(opts ...OptionFunc) Options { FileVaultOptions: FileVaultOptions{ vaultPath: paths.AgentVaultPath(), lockRetryDelay: defaultFlockRetryDelay, + ownership: utils.CurrentFileOwner(), }, KeychainVaultOptions: KeychainVaultOptions{ entryName: paths.AgentKeychainName(), diff --git a/internal/pkg/basecmd/version/cmd_test.go b/internal/pkg/basecmd/version/cmd_test.go index 93ed88101e2..dd82a1ce4b5 100644 --- a/internal/pkg/basecmd/version/cmd_test.go +++ b/internal/pkg/basecmd/version/cmd_test.go @@ -135,7 +135,10 @@ func newErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + eventLoggerCfg := logger.DefaultEventLoggingConfig() + eventLoggerCfg.Level = loggerCfg.Level + + log, err := logger.NewFromConfig("", loggerCfg, eventLoggerCfg, false) require.NoError(t, err) return log } diff --git a/internal/pkg/cli/streams.go b/internal/pkg/cli/streams.go index 95b032b4bdf..e9fa03badc6 100644 --- a/internal/pkg/cli/streams.go +++ b/internal/pkg/cli/streams.go @@ -8,6 +8,7 @@ import ( "bytes" "io" "os" + "sync" ) // IOStreams encapsulate the interaction with the OS pipes: STDIN, STDOUT and STDERR. @@ -30,10 +31,43 @@ func NewIOStreams() *IOStreams { } // NewTestingIOStreams returns a IOStream and the raw bytes buffers so we can interact with them. +// The returned bytes buffers are goroutine safe // Note: mostly used for testing. -func NewTestingIOStreams() (*IOStreams, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer) { - in := &bytes.Buffer{} - out := &bytes.Buffer{} - err := &bytes.Buffer{} +func NewTestingIOStreams() (*IOStreams, *SyncBuffer, *SyncBuffer, *SyncBuffer) { + in := &SyncBuffer{} + out := &SyncBuffer{} + err := &SyncBuffer{} return &IOStreams{In: in, Out: out, Err: err}, in, out, err } + +// SyncBuffer is a goroutine safe bytes.Buffer +type SyncBuffer struct { + buffer bytes.Buffer + mutex sync.RWMutex +} + +// Write appends the contents of p to the buffer, growing the buffer as needed. It returns +// the number of bytes written. +func (s *SyncBuffer) Write(p []byte) (n int, err error) { + s.mutex.Lock() + defer s.mutex.Unlock() + return s.buffer.Write(p) +} + +// Read reads the next len(p) bytes from the buffer or until the buffer +// is drained. The return value n is the number of bytes read. If the +// buffer has no data to return, err is io.EOF (unless len(p) is zero); +// otherwise it is nil. +func (s *SyncBuffer) Read(p []byte) (n int, err error) { + s.mutex.RLock() + defer s.mutex.RUnlock() + return s.buffer.Read(p) +} + +// String returns the contents of the unread portion of the buffer +// as a string. If the Buffer is a nil pointer, it returns "". +func (s *SyncBuffer) String() string { + s.mutex.RLock() + defer s.mutex.RUnlock() + return s.buffer.String() +} diff --git a/internal/pkg/composable/providers/agent/agent.go b/internal/pkg/composable/providers/agent/agent.go index a560d4cac5f..7959bb86c86 100644 --- a/internal/pkg/composable/providers/agent/agent.go +++ b/internal/pkg/composable/providers/agent/agent.go @@ -36,6 +36,7 @@ func (*contextProvider) Run(ctx context.Context, comm corecomp.ContextProviderCo "build_time": release.BuildTime().Format("2006-01-02 15:04:05 -0700 MST"), "snapshot": release.Snapshot(), }, + "unprivileged": a.Unprivileged(), }) if err != nil { return errors.New(err, "failed to set mapping", errors.TypeUnexpected) diff --git a/internal/pkg/composable/providers/agent/agent_test.go b/internal/pkg/composable/providers/agent/agent_test.go index 5a4e9e2bd6a..57b6a6d15c5 100644 --- a/internal/pkg/composable/providers/agent/agent_test.go +++ b/internal/pkg/composable/providers/agent/agent_test.go @@ -35,4 +35,6 @@ func TestContextProvider(t *testing.T) { assert.True(t, hasID, "missing id") _, hasVersion := current["version"] assert.True(t, hasVersion, "missing version") + _, hasUnprivileged := current["unprivileged"] + assert.True(t, hasUnprivileged, "missing unprivileged") } diff --git a/internal/pkg/composable/providers/kubernetes/hints.go b/internal/pkg/composable/providers/kubernetes/hints.go index 8557007c87e..44d4db8b018 100644 --- a/internal/pkg/composable/providers/kubernetes/hints.go +++ b/internal/pkg/composable/providers/kubernetes/hints.go @@ -30,6 +30,8 @@ const ( processors = "processors" ) +var allSupportedHints = []string{"enabled", integration, datastreams, host, period, timeout, metricspath, username, password, stream, processors} + type hintsBuilder struct { Key string @@ -288,7 +290,7 @@ func GetHintsMapping(k8sMapping map[string]interface{}, logger *logp.Logger, pre } } - hintsExtracted := utils.GenerateHints(annotations, cName, prefix) + hintsExtracted, _ := utils.GenerateHints(annotations, cName, prefix, false, allSupportedHints) if len(hintsExtracted) == 0 { return hintData } diff --git a/internal/pkg/composable/providers/kubernetes/hints_test.go b/internal/pkg/composable/providers/kubernetes/hints_test.go index 0cc709acaf7..e442afff6f9 100644 --- a/internal/pkg/composable/providers/kubernetes/hints_test.go +++ b/internal/pkg/composable/providers/kubernetes/hints_test.go @@ -367,6 +367,137 @@ func TestGenerateHintsMappingWithLogStream(t *testing.T) { assert.Equal(t, expected, hintsMapping) } +func TestGenerateHintsMappingWithDefaultsandTypo(t *testing.T) { + logger := getLogger() + pod := &kubernetes.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "testpod", + UID: types.UID(uid), + Namespace: "testns", + Labels: map[string]string{ + "foo": "bar", + }, + Annotations: map[string]string{ + "app": "production", + }, + }, + TypeMeta: metav1.TypeMeta{ + Kind: "Pod", + APIVersion: "v1", + }, + Spec: kubernetes.PodSpec{ + NodeName: "testnode", + }, + Status: kubernetes.PodStatus{PodIP: "127.0.0.5"}, + } + + mapping := map[string]interface{}{ + "namespace": pod.GetNamespace(), + "pod": mapstr.M{ + "uid": string(pod.GetUID()), + "name": pod.GetName(), + "ip": pod.Status.PodIP, + }, + "namespace_annotations": mapstr.M{ + "nsa": "nsb", + }, + "labels": mapstr.M{ + "foo": "bar", + }, + "annotations": mapstr.M{ + "app": "production", + }, + } + hints := mapstr.M{ + "hints": mapstr.M{ + "host": "${kubernetes.pod.ip}:6379", + "package": "redis", + "notsupportedhint": "/metrics", // on purpose we have introduced a typo + "timeout": "42s", + "period": "42s", + }, + } + + expected := mapstr.M{ + "redis": mapstr.M{ + "enabled": true, + "host": "127.0.0.5:6379", + "timeout": "42s", + "period": "42s", + }, + } + + hintsMapping := GenerateHintsMapping(hints, mapping, logger, "") + + assert.Equal(t, expected, hintsMapping) +} + +func TestGenerateHintsMappingWithInfoandTypo(t *testing.T) { + logger := getLogger() + pod := &kubernetes.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "testpod", + UID: types.UID(uid), + Namespace: "testns", + Labels: map[string]string{ + "foo": "bar", + }, + Annotations: map[string]string{ + "app": "production", + }, + }, + TypeMeta: metav1.TypeMeta{ + Kind: "Pod", + APIVersion: "v1", + }, + Spec: kubernetes.PodSpec{ + NodeName: "testnode", + }, + Status: kubernetes.PodStatus{PodIP: "127.0.0.5"}, + } + + mapping := map[string]interface{}{ + "namespace": pod.GetNamespace(), + "pod": mapstr.M{ + "uid": string(pod.GetUID()), + "name": pod.GetName(), + "ip": pod.Status.PodIP, + }, + "namespace_annotations": mapstr.M{ + "nsa": "nsb", + }, + "labels": mapstr.M{ + "foo": "bar", + }, + "annotations": mapstr.M{ + "app": "production", + }, + } + hints := mapstr.M{ + "hints": mapstr.M{ + "package": "redis", + "data_streams": "info", + "info": mapstr.M{ + "period": "5m", + "notsupportedhint": "stdout", // On purpose we have added this typo + }, + }, + } + + expected := mapstr.M{ + "redis": mapstr.M{ + "info": mapstr.M{ + "enabled": true, + "period": "5m", + }, + }, + } + + hintsMapping := GenerateHintsMapping(hints, mapping, logger, "") + + assert.Equal(t, expected, hintsMapping) +} + func TestGenerateHintsMappingWithProcessors(t *testing.T) { logger := getLogger() pod := &kubernetes.Pod{ diff --git a/internal/pkg/composable/providers/kubernetes/pod.go b/internal/pkg/composable/providers/kubernetes/pod.go index 393c502d069..4722a6adc18 100644 --- a/internal/pkg/composable/providers/kubernetes/pod.go +++ b/internal/pkg/composable/providers/kubernetes/pod.go @@ -9,10 +9,9 @@ import ( "sync" "time" - "github.com/elastic/elastic-agent-autodiscover/utils" - "github.com/elastic/elastic-agent-autodiscover/kubernetes" "github.com/elastic/elastic-agent-autodiscover/kubernetes/metadata" + "github.com/elastic/elastic-agent-autodiscover/utils" c "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" @@ -74,7 +73,7 @@ func NewPodEventer( return nil, errors.New(err, "couldn't create kubernetes watcher") } - var replicaSetWatcher, jobWatcher kubernetes.Watcher + var replicaSetWatcher, jobWatcher, namespaceWatcher, nodeWatcher kubernetes.Watcher options := kubernetes.WatchOptions{ SyncTimeout: cfg.SyncPeriod, @@ -82,15 +81,20 @@ func NewPodEventer( } metaConf := cfg.AddResourceMetadata - nodeWatcher, err := kubernetes.NewNamedWatcher("agent-node", client, &kubernetes.Node{}, options, nil) - if err != nil { - logger.Errorf("couldn't create watcher for %T due to error %+v", &kubernetes.Node{}, err) + if metaConf.Node.Enabled() || cfg.Hints.Enabled { + nodeWatcher, err = kubernetes.NewNamedWatcher("agent-node", client, &kubernetes.Node{}, options, nil) + if err != nil { + logger.Errorf("couldn't create watcher for %T due to error %+v", &kubernetes.Node{}, err) + } } - namespaceWatcher, err := kubernetes.NewNamedWatcher("agent-namespace", client, &kubernetes.Namespace{}, kubernetes.WatchOptions{ - SyncTimeout: cfg.SyncPeriod, - }, nil) - if err != nil { - logger.Errorf("couldn't create watcher for %T due to error %+v", &kubernetes.Namespace{}, err) + + if metaConf.Namespace.Enabled() || cfg.Hints.Enabled { + namespaceWatcher, err = kubernetes.NewNamedWatcher("agent-namespace", client, &kubernetes.Namespace{}, kubernetes.WatchOptions{ + SyncTimeout: cfg.SyncPeriod, + }, nil) + if err != nil { + logger.Errorf("couldn't create watcher for %T due to error %+v", &kubernetes.Namespace{}, err) + } } // Resource is Pod so we need to create watchers for Replicasets and Jobs that it might belong to @@ -212,7 +216,7 @@ func (p *pod) emitRunning(pod *kubernetes.Pod) { if !p.managed { if ann, ok := data.mapping["annotations"]; ok { annotations, _ := ann.(mapstr.M) - hints := utils.GenerateHints(annotations, "", p.config.Prefix) + hints, _ := hintsCheck(annotations, "", p.config.Prefix, true, allSupportedHints, p.logger, pod) if len(hints) > 0 { p.logger.Debugf("Extracted hints are :%v", hints) hintsMapping := GenerateHintsMapping(hints, data.mapping, p.logger, "") @@ -520,3 +524,12 @@ func updateProcessors(newprocessors []mapstr.M, processors []map[string]interfac return processors } + +// HintsCheck geenrates hints from provided annotations of the pod and logs any possible incorrect annotations that have been provided in the pod +func hintsCheck(annotations mapstr.M, container string, prefix string, validate bool, allSupportedHints []string, logger *logp.Logger, pod *kubernetes.Pod) (mapstr.M, []string) { + hints, incorrecthints := utils.GenerateHints(annotations, container, prefix, validate, allSupportedHints) + for _, value := range incorrecthints { //We check whether the provided annotation follows the supported format and vocabulary. The check happens for annotations that have prefix co.elastic + logger.Warnf("provided hint: %s/%s is not recognised as supported annotation for pod %s in namespace %s", prefix, value, pod.Name, pod.ObjectMeta.Namespace) + } + return hints, incorrecthints +} diff --git a/internal/pkg/composable/providers/kubernetes/pod_test.go b/internal/pkg/composable/providers/kubernetes/pod_test.go index 7409ad1a3ea..4df008b518c 100644 --- a/internal/pkg/composable/providers/kubernetes/pod_test.go +++ b/internal/pkg/composable/providers/kubernetes/pod_test.go @@ -12,22 +12,31 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + k8sfake "k8s.io/client-go/kubernetes/fake" "github.com/stretchr/testify/assert" "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/elastic-agent/pkg/core/logger" "github.com/elastic/elastic-agent-autodiscover/kubernetes" "github.com/elastic/elastic-agent-autodiscover/kubernetes/metadata" "github.com/elastic/elastic-agent-libs/mapstr" + + c "github.com/elastic/elastic-agent-libs/config" + "github.com/elastic/elastic-agent/internal/pkg/config" ) func getLogger() *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - l, _ := logger.NewFromConfig("", loggerCfg, false) + + eventLoggerCfg := logger.DefaultEventLoggingConfig() + eventLoggerCfg.Level = loggerCfg.Level + + l, _ := logger.NewFromConfig("", loggerCfg, eventLoggerCfg, false) return l } @@ -370,6 +379,143 @@ func TestEphemeralContainers(t *testing.T) { } +func TestGenerateHints(t *testing.T) { + pod := &kubernetes.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "testpod", + UID: types.UID(uid), + Namespace: "testns", + Labels: map[string]string{ + "foo": "bar", + }, + Annotations: map[string]string{ + "app": "production", + "co.elastic.hints/host": "${kubernetes.pod.ip}:6379", + "co.elastic.hints/package": "redis", + "co.elastic.hints/metricssssssspath": "/metrics", + "co.elastic.hints/period": "42s", + }, + }, + TypeMeta: metav1.TypeMeta{ + Kind: "Pod", + APIVersion: "v1", + }, + Spec: kubernetes.PodSpec{ + NodeName: "testnode", + }, + Status: kubernetes.PodStatus{PodIP: "127.0.0.5"}, + } + + data := generatePodData(pod, &podMeta{}, mapstr.M{}) + + hints_result := mapstr.M{ + "hints": mapstr.M{ + "host": "${kubernetes.pod.ip}:6379", + "package": "redis", + "metricssssssspath": "/metrics", // on purpose we have introduced a typo + "period": "42s", + }, + } + incorrecthints_results := []string{"hints/metricssssssspath"} + + ann := data.mapping["annotations"] + annotations, _ := ann.(mapstr.M) + prefix := "co.elastic" + + log, err := logger.New("hint-test", true) + assert.NoError(t, err) + + hints, incorrecthints := hintsCheck(annotations, "", prefix, true, allSupportedHints, log, pod) + + assert.Equal(t, string(pod.GetUID()), data.uid) + assert.Equal(t, hints, hints_result) + assert.Equal(t, incorrecthints, incorrecthints_results) +} + +func TestPodEventer_Namespace_Node_Watcher(t *testing.T) { + client := k8sfake.NewSimpleClientset() + + log, err := logger.New("service-eventer-test", true) + assert.NoError(t, err) + + providerDataChan := make(chan providerData, 1) + + comm := MockDynamicComm{ + context.TODO(), + providerDataChan, + } + + tests := []struct { + namespaceEnabled bool + nodeEnabled bool + hintsEnabled bool + expectedNil bool + name string + msg string + }{ + { + namespaceEnabled: false, + nodeEnabled: false, + hintsEnabled: false, + expectedNil: true, + name: "add_resource_metadata.namespace and add_resource_metadata.node disabled and hints disabled.", + msg: "Watcher should be nil.", + }, + { + namespaceEnabled: false, + nodeEnabled: false, + hintsEnabled: true, + expectedNil: false, + name: "add_resource_metadata.namespace and add_resource_metadata.node disabled and hints enabled.", + msg: "Watcher should not be nil.", + }, + { + namespaceEnabled: true, + nodeEnabled: true, + hintsEnabled: false, + expectedNil: false, + name: "add_resource_metadata.namespace and add_resource_metadata.node enabled and hints disabled.", + msg: "Watcher should not be nil.", + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var cfg Config + cfg.InitDefaults() + + nsCfg, err := c.NewConfigFrom(map[string]interface{}{ + "enabled": test.namespaceEnabled, + }) + assert.NoError(t, err) + nodeCfg, err := c.NewConfigFrom(map[string]interface{}{ + "enabled": test.nodeEnabled, + }) + assert.NoError(t, err) + + cfg.AddResourceMetadata.Namespace = nsCfg + cfg.AddResourceMetadata.Node = nodeCfg + cfg.Hints.Enabled = test.hintsEnabled + + eventer, err := NewPodEventer(&comm, &cfg, log, client, "cluster", false) + if err != nil { + t.Fatal(err) + } + + namespaceWatcher := eventer.(*pod).namespaceWatcher + nodeWatcher := eventer.(*pod).nodeWatcher + + if test.expectedNil { + assert.Equalf(t, nil, namespaceWatcher, "Namespace "+test.msg) + assert.Equalf(t, nil, nodeWatcher, "Node "+test.msg) + } else { + assert.NotEqualf(t, nil, namespaceWatcher, "Namespace "+test.msg) + assert.NotEqualf(t, nil, nodeWatcher, "Node "+test.msg) + } + }) + } +} + // MockDynamicComm is used in tests. type MockDynamicComm struct { context.Context diff --git a/internal/pkg/composable/providers/kubernetes/service.go b/internal/pkg/composable/providers/kubernetes/service.go index 4060c12e646..96a93ed0c9a 100644 --- a/internal/pkg/composable/providers/kubernetes/service.go +++ b/internal/pkg/composable/providers/kubernetes/service.go @@ -16,6 +16,7 @@ import ( "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" "github.com/elastic/elastic-agent-libs/safemapstr" + "github.com/elastic/elastic-agent/internal/pkg/agent/errors" "github.com/elastic/elastic-agent/internal/pkg/composable" ) @@ -54,15 +55,21 @@ func NewServiceEventer( return nil, errors.New(err, "couldn't create kubernetes watcher") } - metaConf := metadata.GetDefaultResourceMetadataConfig() - namespaceWatcher, err := kubernetes.NewNamedWatcher("agent-namespace", client, &kubernetes.Namespace{}, kubernetes.WatchOptions{ - SyncTimeout: cfg.SyncPeriod, - Namespace: cfg.Namespace, - }, nil) - if err != nil { - return nil, fmt.Errorf("couldn't create watcher for %T due to error %w", &kubernetes.Namespace{}, err) + metaConf := cfg.AddResourceMetadata + + var namespaceMeta metadata.MetaGen + var namespaceWatcher kubernetes.Watcher + + if metaConf.Namespace.Enabled() || cfg.Hints.Enabled { + namespaceWatcher, err = kubernetes.NewNamedWatcher("agent-namespace", client, &kubernetes.Namespace{}, kubernetes.WatchOptions{ + SyncTimeout: cfg.SyncPeriod, + Namespace: cfg.Namespace, + }, nil) + if err != nil { + return nil, fmt.Errorf("couldn't create watcher for %T due to error %w", &kubernetes.Namespace{}, err) + } + namespaceMeta = metadata.NewNamespaceMetadataGenerator(metaConf.Namespace, namespaceWatcher.Store(), client) } - namespaceMeta := metadata.NewNamespaceMetadataGenerator(metaConf.Namespace, namespaceWatcher.Store(), client) rawConfig, err := config.NewConfigFrom(cfg) if err != nil { diff --git a/internal/pkg/composable/providers/kubernetes/service_test.go b/internal/pkg/composable/providers/kubernetes/service_test.go index 1943e3cfcdb..bbc61106b2c 100644 --- a/internal/pkg/composable/providers/kubernetes/service_test.go +++ b/internal/pkg/composable/providers/kubernetes/service_test.go @@ -5,9 +5,13 @@ package kubernetes import ( + "context" "testing" "github.com/stretchr/testify/assert" + k8sfake "k8s.io/client-go/kubernetes/fake" + + "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-autodiscover/kubernetes" "github.com/elastic/elastic-agent-autodiscover/kubernetes/metadata" @@ -16,6 +20,8 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + "github.com/elastic/elastic-agent/pkg/core/logger" ) func TestGenerateServiceData(t *testing.T) { @@ -104,6 +110,85 @@ func TestGenerateServiceData(t *testing.T) { } } +func TestServiceEventer_NamespaceWatcher(t *testing.T) { + client := k8sfake.NewSimpleClientset() + + log, err := logger.New("service-eventer-test", true) + assert.NoError(t, err) + + providerDataChan := make(chan providerData, 1) + + comm := MockDynamicComm{ + context.TODO(), + providerDataChan, + } + + tests := []struct { + namespaceEnabled bool + hintsEnabled bool + expectedNil bool + name string + msg string + }{ + { + namespaceEnabled: false, + hintsEnabled: false, + expectedNil: true, + name: "add_resource_metadata.namespace disabled and hints disabled.", + msg: "Namespace watcher should be nil.", + }, + { + namespaceEnabled: false, + hintsEnabled: true, + expectedNil: false, + name: "add_resource_metadata.namespace disabled and hints enabled.", + msg: "Namespace watcher should not be nil.", + }, + { + namespaceEnabled: true, + hintsEnabled: false, + expectedNil: false, + name: "add_resource_metadata.namespace enabled and hints disabled.", + msg: "Namespace watcher should not be nil.", + }, + { + namespaceEnabled: true, + hintsEnabled: false, + expectedNil: false, + name: "add_resource_metadata default and hints default.", + msg: "Watcher should not be nil.", + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + var cfg Config + cfg.InitDefaults() + + nsCfg, err := config.NewConfigFrom(map[string]interface{}{ + "enabled": test.namespaceEnabled, + }) + assert.NoError(t, err) + + cfg.AddResourceMetadata.Namespace = nsCfg + cfg.Hints.Enabled = test.hintsEnabled + + eventer, err := NewServiceEventer(&comm, &cfg, log, client, "cluster", false) + if err != nil { + t.Fatal(err) + } + + namespaceWatcher := eventer.(*service).namespaceWatcher + + if test.expectedNil { + assert.Equalf(t, nil, namespaceWatcher, test.msg) + } else { + assert.NotEqualf(t, nil, namespaceWatcher, test.msg) + } + }) + } +} + type svcMeta struct{} // Generate generates svc metadata from a resource object diff --git a/internal/pkg/composable/providers/kubernetesleaderelection/kubernetes_leaderelection.go b/internal/pkg/composable/providers/kubernetesleaderelection/kubernetes_leaderelection.go index c32b57d78c8..056b0e28b0c 100644 --- a/internal/pkg/composable/providers/kubernetesleaderelection/kubernetes_leaderelection.go +++ b/internal/pkg/composable/providers/kubernetesleaderelection/kubernetes_leaderelection.go @@ -10,10 +10,12 @@ import ( "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sclient "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/leaderelection" "k8s.io/client-go/tools/leaderelection/resourcelock" "github.com/elastic/elastic-agent-autodiscover/kubernetes" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/info" "github.com/elastic/elastic-agent/internal/pkg/agent/errors" "github.com/elastic/elastic-agent/internal/pkg/composable" @@ -22,6 +24,8 @@ import ( "github.com/elastic/elastic-agent/pkg/core/logger" ) +const leaderElectorPrefix = "elastic-agent-leader-" + func init() { composable.Providers.MustAddContextProvider("kubernetes_leaderelection", ContextProviderBuilder) } @@ -45,11 +49,15 @@ func ContextProviderBuilder(logger *logger.Logger, c *config.Config, managed boo return &contextProvider{logger, &cfg, nil}, nil } +// This is needed to overwrite the Kubernetes client for the tests +var getK8sClientFunc = func(kubeconfig string, opt kubernetes.KubeClientOptions) (k8sclient.Interface, error) { + return kubernetes.GetKubernetesClient(kubeconfig, opt) +} + // Run runs the leaderelection provider. func (p *contextProvider) Run(ctx context.Context, comm corecomp.ContextProviderComm) error { - client, err := kubernetes.GetKubernetesClient(p.config.KubeConfig, p.config.KubeClientOptions) + client, err := getK8sClientFunc(p.config.KubeConfig, p.config.KubeClientOptions) if err != nil { - // info only; return nil (do nothing) p.logger.Debugf("Kubernetes leaderelection provider skipped, unable to connect: %s", err) return nil } @@ -61,9 +69,9 @@ func (p *contextProvider) Run(ctx context.Context, comm corecomp.ContextProvider var id string podName, found := os.LookupEnv("POD_NAME") if found { - id = "elastic-agent-leader-" + podName + id = leaderElectorPrefix + podName } else { - id = "elastic-agent-leader-" + agentInfo.AgentID() + id = leaderElectorPrefix + agentInfo.AgentID() } ns, err := kubernetes.InClusterNamespace() @@ -104,9 +112,14 @@ func (p *contextProvider) Run(ctx context.Context, comm corecomp.ContextProvider p.logger.Errorf("error while creating Leader Elector: %v", err) } p.logger.Debugf("Starting Leader Elector") - le.Run(comm) - p.logger.Debugf("Stopped Leader Elector") - return comm.Err() + + for { + le.Run(ctx) + if ctx.Err() != nil { + p.logger.Debugf("Stopped Leader Elector") + return comm.Err() + } + } } func (p *contextProvider) startLeading(comm corecomp.ContextProviderComm) { diff --git a/internal/pkg/composable/providers/kubernetesleaderelection/kubernetes_leaderelection_test.go b/internal/pkg/composable/providers/kubernetesleaderelection/kubernetes_leaderelection_test.go new file mode 100644 index 00000000000..6abb0a3e0e9 --- /dev/null +++ b/internal/pkg/composable/providers/kubernetesleaderelection/kubernetes_leaderelection_test.go @@ -0,0 +1,229 @@ +// 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 kubernetesleaderelection + +import ( + "context" + "os" + "testing" + "time" + + autodiscoverK8s "github.com/elastic/elastic-agent-autodiscover/kubernetes" + + "github.com/stretchr/testify/require" + v1 "k8s.io/api/coordination/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + k8sfake "k8s.io/client-go/kubernetes/fake" + + "github.com/elastic/elastic-agent-libs/logp" + + ctesting "github.com/elastic/elastic-agent/internal/pkg/composable/testing" + "github.com/elastic/elastic-agent/internal/pkg/config" +) + +const namespace = "default" +const leaseName = "agent-lease-test" + +// createLease creates a new lease resource +func createLease() *v1.Lease { + lease := &v1.Lease{ + ObjectMeta: metav1.ObjectMeta{ + Name: leaseName, + Namespace: namespace, + }, + } + return lease +} + +// applyLease applies the lease +func applyLease(client kubernetes.Interface, lease *v1.Lease, firstTime bool) error { + var err error + if firstTime { + _, err = client.CoordinationV1().Leases(namespace).Create(context.Background(), lease, metav1.CreateOptions{}) + return err + } + _, err = client.CoordinationV1().Leases(namespace).Update(context.Background(), lease, metav1.UpdateOptions{}) + return err +} + +// getLeaseHolder returns the holder identity of the lease +func getLeaseHolder(client kubernetes.Interface) (string, error) { + lease, err := client.CoordinationV1().Leases(namespace).Get(context.Background(), leaseName, metav1.GetOptions{}) + if err != nil { + return "", err + } + holder := lease.Spec.HolderIdentity + if holder == nil { + return "", err + } + return *holder, nil +} + +// TestNewLeaderElectionManager will test the leader elector. +// We will try to check if an instance can acquire the lease more than one time. This way, we will know that +// the leader elector starts running again after it has stopped - which happens once a leader loses the lease. +// To make sure that happens we will do the following: +// 1. We will create the lease to be used by the leader elector. +// 2. We will create two context providers - in the default context, this would mean two nodes, each one with an agent running. +// We will wait for one of the agents, agent1, to acquire the lease, before starting the other. +// 3. We force the lease to be acquired by the other agent, agent2. +// 4. We will force the lease to be acquired by the agent1 again. To avoid the agent2 reacquiring it multiple times, +// we will stop this provider and make sure the agent1 can reacquire it. +func TestNewLeaderElectionManager(t *testing.T) { + client := k8sfake.NewSimpleClientset() + + lease := createLease() + // create the lease that leader election will be using + err := applyLease(client, lease, true) + require.NoError(t, err) + + // Create the provider + logger := logp.NewLogger("test_leaderelection") + + leaseDuration := 3 + leaseRenewDeadline := 2 + leaseRetryPeriod := 1 + + c := map[string]interface{}{ + "leader_lease": leaseName, + "leader_leaseduration": leaseDuration, + "leader_renewdeadline": leaseRenewDeadline, + "leader_retryperiod": leaseRetryPeriod, + } + cfg, err := config.NewConfigFrom(c) + require.NoError(t, err) + + getK8sClientFunc = func(kubeconfig string, opt autodiscoverK8s.KubeClientOptions) (kubernetes.Interface, error) { + return client, nil + } + require.NoError(t, err) + + podNames := [2]string{"agent1", "agent2"} + cancelFuncs := [2]context.CancelFunc{} + + done := make(chan int, 1) + + // Create two leader election providers representing two agents running + for i := 0; i < 2; i++ { + p, err := ContextProviderBuilder(logger, cfg, true) + require.NoError(t, err) + + ctx, cancel := context.WithCancel(context.Background()) + cancelFuncs[i] = cancel + defer cancel() + + comm := ctesting.NewContextComm(ctx) + + err = os.Setenv("POD_NAME", podNames[i]) + if err != nil { + require.FailNow(t, "Failed to set pod name environment variable.") + } + go func() { + _ = p.Run(ctx, comm) + }() + + if i == 1 { + break + } + + // We need to wait for the first agent to acquire the lease, so we can POD_NAME environment variable again + go func() { + expectedLeader := leaderElectorPrefix + podNames[i] + for { + holder, err := getLeaseHolder(client) + require.NoError(t, err) + + if holder == expectedLeader { + done <- 1 + break + } + } + }() + + select { + case <-done: + case <-time.After(time.Duration(leaseDuration+leaseRetryPeriod) * 30 * time.Second): + require.FailNow(t, "Timeout"+ + " while waiting for the first pod to acquire the lease. This should not happen. Consider increasing "+ + "the timeout.") + } + } + + go func() { + // At this point the current holder is agent1. Let's change it to agent2. + for { + // Force the lease to be applied again, so a new leader is elected. + intermediateHolder := "does-not-matter" + lease.Spec.HolderIdentity = &intermediateHolder + err = applyLease(client, lease, false) + require.NoError(t, err) + + var currentHolder string + for { + currentHolder, err = getLeaseHolder(client) + require.NoError(t, err) + + // In this case, we already have an agent as holder + if currentHolder == leaderElectorPrefix+podNames[0] || currentHolder == leaderElectorPrefix+podNames[1] { + break + } + } + + if currentHolder == leaderElectorPrefix+podNames[1] { + done <- 1 + break + } + } + }() + + select { + case <-done: + case <-time.After(time.Duration(leaseDuration+leaseRetryPeriod) * 30 * time.Second): + require.FailNow(t, "Timeout "+ + " while waiting for agent2 to acquire the lease. This should not happen. Consider increasing "+ + "the timeout.") + } + + // Now that the holder is agent2, let's wait for agent1 to be reelected. + // To avoid having to wait very long, the context of agent2 will be canceled so the leader elector will not be + // running anymore. This way there is only one instance fighting to acquire the lease. + cancelFuncs[1]() + go func() { + for { + // Force the lease to be applied again, so a new leader is elected. + intermediateHolder := "does-not-matter" + lease.Spec.HolderIdentity = &intermediateHolder + err = applyLease(client, lease, false) + require.NoError(t, err) + + var currentHolder string + for { + currentHolder, err = getLeaseHolder(client) + require.NoError(t, err) + + // In this case, we already have an agent as holder + if currentHolder == leaderElectorPrefix+podNames[0] || currentHolder == leaderElectorPrefix+podNames[1] { + break + } + } + + if currentHolder == leaderElectorPrefix+podNames[0] { + done <- 1 + break + } + } + }() + + select { + case <-done: + case <-time.After(time.Duration(leaseDuration+leaseRetryPeriod) * 30 * time.Second): + require.FailNow(t, "Timeout"+ + " while waiting for agent1 to reacquire the lease. This should not happen. Consider increasing "+ + "the timeout.") + } + + cancelFuncs[0]() +} diff --git a/internal/pkg/composable/providers/kubernetessecrets/kubernetes_secrets.go b/internal/pkg/composable/providers/kubernetessecrets/kubernetes_secrets.go index ffc125386db..cd0208e1ae6 100644 --- a/internal/pkg/composable/providers/kubernetessecrets/kubernetes_secrets.go +++ b/internal/pkg/composable/providers/kubernetessecrets/kubernetes_secrets.go @@ -45,7 +45,7 @@ type secretsData struct { } // ContextProviderBuilder builds the context provider. -func ContextProviderBuilder(logger *logger.Logger, c *config.Config, managed bool) (corecomp.ContextProvider, error) { +func ContextProviderBuilder(logger *logger.Logger, c *config.Config, _ bool) (corecomp.ContextProvider, error) { var cfg Config if c == nil { c = config.New() diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index 0f0f9a53dea..b9524eafd1d 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -38,6 +38,7 @@ var DefaultOptions = []interface{}{ ucfg.ResolveEnv, ucfg.VarExp, VarSkipKeys("inputs"), + ucfg.IgnoreCommas, } // Config custom type over a ucfg.Config to add new methods on the object. @@ -155,9 +156,8 @@ func (c *Config) ToMapStr(opts ...interface{}) (map[string]interface{}, error) { } ucfgOpts, local, err := getOptions(opts...) if err != nil { - return nil, fmt.Errorf("error unpacking logs: %w", err) + return nil, fmt.Errorf("error unpacking config: %w", err) } - // remove and unpack each skip keys into its own map with no resolve // so that variables are not substituted skippedKeys := map[string]interface{}{} diff --git a/internal/pkg/config/config_test.go b/internal/pkg/config/config_test.go index a2f18443f11..5d393d3486a 100644 --- a/internal/pkg/config/config_test.go +++ b/internal/pkg/config/config_test.go @@ -78,6 +78,22 @@ func testToMapStr(t *testing.T) { assert.True(t, reflect.DeepEqual(m, nm)) } +func TestCommaParsing(t *testing.T) { + _ = os.Setenv("testname", "motmot") + // test to make sure that we don't blow up the parsers when we have a `,` in a string + inMap := map[string]interface{}{ + "test": "startsWith('${testname}','motmot')", + } + outMap := map[string]interface{}{ + "test": "startsWith('motmot','motmot')", + } + c := MustNewConfigFrom(inMap) + parsedMap, err := c.ToMapStr() + require.NoError(t, err) + t.Logf("got :%#v", parsedMap) + require.Equal(t, outMap, parsedMap) +} + func testLoadFiles(t *testing.T) { tmp, err := os.MkdirTemp("", "watch") require.NoError(t, err) diff --git a/internal/pkg/config/operations/inspector.go b/internal/pkg/config/operations/inspector.go index 1e10cbf9226..83107c3c64e 100644 --- a/internal/pkg/config/operations/inspector.go +++ b/internal/pkg/config/operations/inspector.go @@ -55,7 +55,7 @@ func LoadFullAgentConfig(ctx context.Context, logger *logger.Logger, cfgPath str return c, nil } - fleetConfig, err := loadFleetConfig(ctx, logger) + fleetConfig, err := loadFleetConfig(ctx, logger, unprivileged) if err != nil { return nil, fmt.Errorf("error obtaining fleet config: %w", err) } else if fleetConfig == nil { @@ -115,8 +115,8 @@ func loadConfig(ctx context.Context, configPath string, unprivileged bool) (*con return rawConfig, nil } -func loadFleetConfig(ctx context.Context, l *logger.Logger) (map[string]interface{}, error) { - stateStore, err := store.NewStateStoreWithMigration(ctx, l, paths.AgentActionStoreFile(), paths.AgentStateStoreFile()) +func loadFleetConfig(ctx context.Context, l *logger.Logger, unprivileged bool) (map[string]interface{}, error) { + stateStore, err := store.NewStateStoreWithMigration(ctx, l, paths.AgentActionStoreFile(), paths.AgentStateStoreFile(), storage.WithUnprivileged(unprivileged)) if err != nil { return nil, err } diff --git a/internal/pkg/core/composable/providers.go b/internal/pkg/core/composable/providers.go index b7aee80b694..f39cdb72ad9 100644 --- a/internal/pkg/core/composable/providers.go +++ b/internal/pkg/core/composable/providers.go @@ -4,7 +4,9 @@ package composable -import "context" +import ( + "context" +) // FetchContextProvider is the interface that a context provider uses allow variable values to be determined when the // configuration is rendered versus it being known in advanced. diff --git a/internal/pkg/core/monitoring/config/config.go b/internal/pkg/core/monitoring/config/config.go index cc6f345e123..20b2434be83 100644 --- a/internal/pkg/core/monitoring/config/config.go +++ b/internal/pkg/core/monitoring/config/config.go @@ -24,6 +24,7 @@ type MonitoringConfig struct { Enabled bool `yaml:"enabled" config:"enabled"` MonitorLogs bool `yaml:"logs" config:"logs"` MonitorMetrics bool `yaml:"metrics" config:"metrics"` + MetricsPeriod string `yaml:"metrics_period" config:"metrics_period"` LogMetrics bool `yaml:"-" config:"-"` HTTP *MonitoringHTTPConfig `yaml:"http" config:"http"` Namespace string `yaml:"namespace" config:"namespace"` @@ -39,23 +40,25 @@ type MonitoringConfig struct { type MonitoringHTTPConfig struct { Enabled bool `yaml:"enabled" config:"enabled"` Host string `yaml:"host" config:"host"` - Port int `yaml:"port" config:"port" validate:"min=0,max=65535,nonzero"` + Port int `yaml:"port" config:"port" validate:"min=0,max=65535"` Buffer *BufferConfig `yaml:"buffer" config:"buffer"` + // EnabledIsSet is set during the Unpack() operation, and will be set to true if `Enabled` has been manually set by the incoming yaml + // This is done so we can distinguish between a default value supplied by the code, and a user-supplied value + EnabledIsSet bool `yaml:"-" config:"-"` } // Unpack reads a config object into the settings. func (c *MonitoringHTTPConfig) Unpack(cfg *c.C) error { // do not use MonitoringHTTPConfig, it will end up in a loop tmp := struct { - Enabled bool `yaml:"enabled" config:"enabled"` + Enabled *bool `yaml:"enabled" config:"enabled"` Host string `yaml:"host" config:"host"` - Port int `yaml:"port" config:"port" validate:"min=0,max=65535,nonzero"` + Port int `yaml:"port" config:"port" validate:"min=0,max=65535"` Buffer *BufferConfig `yaml:"buffer" config:"buffer"` }{ - Enabled: c.Enabled, - Host: c.Host, - Port: c.Port, - Buffer: c.Buffer, + Host: c.Host, + Port: c.Port, + Buffer: c.Buffer, } if err := cfg.Unpack(&tmp); err != nil { @@ -66,13 +69,26 @@ func (c *MonitoringHTTPConfig) Unpack(cfg *c.C) error { tmp.Host = DefaultHost } - *c = MonitoringHTTPConfig{ - Enabled: tmp.Enabled, - Host: tmp.Host, - Port: tmp.Port, - Buffer: tmp.Buffer, + set := MonitoringHTTPConfig{ + Host: tmp.Host, + Port: tmp.Port, + Buffer: tmp.Buffer, } + // this logic is here to help us distinguish between `http.enabled` being manually set after unpacking, + // and whatever a user-specified default may be. + // This is needed in order to prevent a larger set of breaking changes where fleet doesn't expect the HTTP monitor to be live-reloadable + // see https://github.com/elastic/elastic-agent/issues/4582 + if tmp.Enabled == nil { + set.EnabledIsSet = false + set.Enabled = c.Enabled + } else { + set.EnabledIsSet = true + set.Enabled = *tmp.Enabled + } + + *c = set + return nil } diff --git a/internal/pkg/core/monitoring/config/config_test.go b/internal/pkg/core/monitoring/config/config_test.go index 70ae6a77b4c..3f7ec7c9ab8 100644 --- a/internal/pkg/core/monitoring/config/config_test.go +++ b/internal/pkg/core/monitoring/config/config_test.go @@ -13,6 +13,101 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/config" ) +func TestIsSetLogic(t *testing.T) { + testCases := []struct { + name string + config string + startingCfg *MonitoringConfig + expectedEnabled bool + expectedIsSet bool + }{ + { + "explicitly-disabled", + `enabled: true +logs: true +metrics: true +http: + enabled: false`, + DefaultConfig(), + false, true, + }, + { + "explicitly-enabled", + `enabled: true +logs: true +metrics: true +http: + enabled: true`, + DefaultConfig(), + true, true, + }, + { + "not-set", + `enabled: true +logs: true +metrics: true`, + DefaultConfig(), + false, false, + }, + { + "not-set-default-enabled", + `enabled: true +logs: true +metrics: true +http: + port: 1234`, + &MonitoringConfig{ + Enabled: true, + HTTP: &MonitoringHTTPConfig{Enabled: true, Host: DefaultHost, Port: defaultPort}, + Namespace: defaultNamespace, + APM: defaultAPMConfig(), + Diagnostics: defaultDiagnostics(), + }, + true, false, + }, + { + "no-http-field-default-enabled", + `enabled: true +logs: true +metrics: true`, + &MonitoringConfig{ + Enabled: true, + HTTP: &MonitoringHTTPConfig{Enabled: true, Host: DefaultHost, Port: defaultPort}, + Namespace: defaultNamespace, + APM: defaultAPMConfig(), + Diagnostics: defaultDiagnostics(), + }, + true, false, + }, + { + "empty-cfg", + ``, + &MonitoringConfig{ + Enabled: true, + HTTP: &MonitoringHTTPConfig{Enabled: true, Host: DefaultHost, Port: defaultPort}, + Namespace: defaultNamespace, + APM: defaultAPMConfig(), + Diagnostics: defaultDiagnostics(), + }, + true, false, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + c, err := config.NewConfigFrom(testCase.config) + require.NoError(t, err, "failed to create config") + + cfg := testCase.startingCfg + err = c.Unpack(&cfg) + require.NoError(t, err, "failed to unpack config") + + assert.Equal(t, testCase.expectedEnabled, cfg.HTTP.Enabled, "enabled incorrect") + assert.Equal(t, testCase.expectedIsSet, cfg.HTTP.EnabledIsSet, "IsSet incorrect") + }) + } +} + func TestHost(t *testing.T) { testCases := []struct { name string diff --git a/internal/pkg/diagnostics/diagnostics.go b/internal/pkg/diagnostics/diagnostics.go index f34a76f93c6..023cbc0e6ed 100644 --- a/internal/pkg/diagnostics/diagnostics.go +++ b/internal/pkg/diagnostics/diagnostics.go @@ -171,7 +171,15 @@ func CreateCPUProfile(ctx context.Context, period time.Duration) ([]byte, error) // ZipArchive creates a zipped diagnostics bundle using the passed writer with the passed diagnostics and local logs. // If any error is encountered when writing the contents of the archive it is returned. -func ZipArchive(errOut, w io.Writer, agentDiag []client.DiagnosticFileResult, unitDiags []client.DiagnosticUnitResult, compDiags []client.DiagnosticComponentResult) error { +func ZipArchive( + errOut, + w io.Writer, + topPath string, + agentDiag []client.DiagnosticFileResult, + unitDiags []client.DiagnosticUnitResult, + compDiags []client.DiagnosticComponentResult, + excludeEvents bool) error { + ts := time.Now().UTC() zw := zip.NewWriter(w) defer zw.Close() @@ -291,7 +299,7 @@ func ZipArchive(errOut, w io.Writer, agentDiag []client.DiagnosticFileResult, un } // Gather Logs: - return zipLogs(zw, ts) + return zipLogs(zw, ts, topPath, excludeEvents) } func writeErrorResult(zw *zip.Writer, path string, errBody string) error { @@ -389,15 +397,17 @@ func redactKey(k string) bool { strings.Contains(k, "key") } -func zipLogs(zw *zip.Writer, ts time.Time) error { - currentDir := filepath.Base(paths.Home()) +func zipLogs(zw *zip.Writer, ts time.Time, topPath string, excludeEvents bool) error { + homePath := paths.HomeFrom(topPath) + dataPath := paths.DataFrom(topPath) + currentDir := filepath.Base(homePath) if !paths.IsVersionHome() { // running in a container with custom top path set // logs are directly under top path - return zipLogsWithPath(paths.Home(), currentDir, true, zw, ts) + return zipLogsWithPath(homePath, currentDir, true, excludeEvents, zw, ts) } - dataDir, err := os.Open(paths.Data()) + dataDir, err := os.Open(dataPath) if err != nil { return err } @@ -414,8 +424,8 @@ func zipLogs(zw *zip.Writer, ts time.Time) error { continue } collectServices := dir == currentDir - path := filepath.Join(paths.Data(), dir) - if err := zipLogsWithPath(path, dir, collectServices, zw, ts); err != nil { + path := filepath.Join(dataPath, dir) + if err := zipLogsWithPath(path, dir, collectServices, excludeEvents, zw, ts); err != nil { return err } } @@ -424,7 +434,7 @@ func zipLogs(zw *zip.Writer, ts time.Time) error { } // zipLogs walks paths.Logs() and copies the file structure into zw in "logs/" -func zipLogsWithPath(pathsHome, commitName string, collectServices bool, zw *zip.Writer, ts time.Time) error { +func zipLogsWithPath(pathsHome, commitName string, collectServices, excludeEvents bool, zw *zip.Writer, ts time.Time) error { _, err := zw.CreateHeader(&zip.FileHeader{ Name: "logs/", Method: zip.Deflate, @@ -466,6 +476,14 @@ func zipLogsWithPath(pathsHome, commitName string, collectServices bool, zw *zip return nil } + // Skip events logs, if necessary + // name can either be the folder name 'events' or the folder plus + // the file name like 'events/elastic-agent-events-log.ndjson' + // we need to skip both. + if excludeEvents && strings.HasPrefix(name, "events") { + return nil + } + name = filepath.Join(commitName, name) if d.IsDir() { diff --git a/internal/pkg/diagnostics/diagnostics_test.go b/internal/pkg/diagnostics/diagnostics_test.go index 6fc33d27558..628353bed65 100644 --- a/internal/pkg/diagnostics/diagnostics_test.go +++ b/internal/pkg/diagnostics/diagnostics_test.go @@ -165,26 +165,67 @@ func TestUnitAndStateMapping(t *testing.T) { require.Empty(t, errOut.String()) } +type zippedItem struct { + Name string + IsDir bool +} + func TestZipLogs(t *testing.T) { - // Setup a directory structure of: logs/httpjson/log.ndjson - { - paths.SetTop(t.TempDir()) - dir := filepath.Join(paths.Home(), "logs/sub-dir") - require.NoError(t, os.MkdirAll(dir, 0o700)) - require.NoError(t, os.WriteFile(filepath.Join(dir, "log.ndjson"), []byte(".\n"), 0o600)) + topPath := t.TempDir() + dir := filepath.Join(paths.HomeFrom(topPath), "logs", "sub-dir") + require.NoError(t, os.MkdirAll(dir, 0o700)) + require.NoError(t, os.WriteFile(filepath.Join(dir, "log.ndjson"), []byte(".\n"), 0o600)) + + eventLogs := filepath.Join(paths.HomeFrom(topPath), "logs", "events") + require.NoError(t, os.MkdirAll(eventLogs, 0o700)) + require.NoError(t, os.WriteFile(filepath.Join(eventLogs, "elastic-agent-events-log.ndjson"), []byte(".\n"), 0o600)) + + testCases := []struct { + name string + excludeEventsLog bool + expectedItems []zippedItem + }{ + { + name: "include events logs", + excludeEventsLog: false, + expectedItems: []zippedItem{ + {"logs/", true}, + {"logs/elastic-agent-unknow/", true}, + {"logs/elastic-agent-unknow/events/", true}, + {"logs/elastic-agent-unknow/events/elastic-agent-events-log.ndjson", false}, + {"logs/elastic-agent-unknow/sub-dir/", true}, + {"logs/elastic-agent-unknow/sub-dir/log.ndjson", false}, + }, + }, + + { + name: "exclude events logs", + excludeEventsLog: true, + expectedItems: []zippedItem{ + {"logs/", true}, + {"logs/elastic-agent-unknow/", true}, + {"logs/elastic-agent-unknow/sub-dir/", true}, + {"logs/elastic-agent-unknow/sub-dir/log.ndjson", false}, + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + zipLogsAndAssertFiles(t, topPath, tc.excludeEventsLog, tc.expectedItems) + }) } +} + +func zipLogsAndAssertFiles(t *testing.T, topPath string, excludeEvents bool, expected []zippedItem) { + t.Helper() // Zip the logs directory. buf := new(bytes.Buffer) w := zip.NewWriter(buf) - require.NoError(t, zipLogs(w, time.Now())) + require.NoError(t, zipLogs(w, time.Now(), topPath, excludeEvents)) require.NoError(t, w.Close()) - type zippedItem struct { - Name string - IsDir bool - } - // Read back the contents. r, err := zip.NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len())) require.NoError(t, err) @@ -193,14 +234,18 @@ func TestZipLogs(t *testing.T) { observed = append(observed, zippedItem{Name: f.Name, IsDir: f.FileInfo().IsDir()}) } - // Verify the results. - expected := []zippedItem{ - {"logs/", true}, - {"logs/elastic-agent-unknow/", true}, - {"logs/elastic-agent-unknow/sub-dir/", true}, - {"logs/elastic-agent-unknow/sub-dir/log.ndjson", false}, - } assert.Equal(t, expected, observed) + if t.Failed() { + t.Log("Expected") + for _, f := range expected { + t.Logf("name: %s, dir? %t", f.Name, f.IsDir) + } + + t.Log("Got") + for _, f := range observed { + t.Logf("name: %s, dir? %t", f.Name, f.IsDir) + } + } } func TestGlobalHooks(t *testing.T) { diff --git a/internal/pkg/fleetapi/acker/lazy/lazy_acker_test.go b/internal/pkg/fleetapi/acker/lazy/lazy_acker_test.go index 3766a57fbf4..cf7ce57406f 100644 --- a/internal/pkg/fleetapi/acker/lazy/lazy_acker_test.go +++ b/internal/pkg/fleetapi/acker/lazy/lazy_acker_test.go @@ -87,7 +87,12 @@ func TestLazyAcker(t *testing.T) { cfg.Level = logp.DebugLevel // cfg.ToFiles = false cfg.ToStderr = true - log, _ := logger.NewFromConfig("", cfg, true) + + eventLoggerCfg := logger.DefaultEventLoggingConfig() + eventLoggerCfg.Level = cfg.Level + eventLoggerCfg.ToStderr = cfg.ToStderr + + log, _ := logger.NewFromConfig("", cfg, eventLoggerCfg, true) // Tests tests := []struct { diff --git a/internal/pkg/fleetapi/action.go b/internal/pkg/fleetapi/action.go index 028348e6e7f..95e4d543e18 100644 --- a/internal/pkg/fleetapi/action.go +++ b/internal/pkg/fleetapi/action.go @@ -437,6 +437,7 @@ type ActionDiagnostics struct { ActionID string `json:"action_id"` ActionType string `json:"type"` AdditionalMetrics []string `json:"additional_metrics"` + ExcludeEventsLog bool `json:"exclude_events_log"` UploadID string `json:"-"` Err error `json:"-"` } diff --git a/internal/pkg/fleetapi/client/client_test.go b/internal/pkg/fleetapi/client/client_test.go index 40be306bc80..4baf3c13eeb 100644 --- a/internal/pkg/fleetapi/client/client_test.go +++ b/internal/pkg/fleetapi/client/client_test.go @@ -183,6 +183,37 @@ func TestElasticApiVersion(t *testing.T) { } }) + t.Run("verify that we don't log a generic 400 status as a downgrade request", func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + mux := http.NewServeMux() + mux.HandleFunc("/genericbadrequest", func(writer http.ResponseWriter, request *http.Request) { + assert.Equal(t, request.Header.Get(elasticApiVersionHeaderKey), defaultFleetApiVersion) + // request return a 400 with the defaultFleetApiVersion (just testing that we don't log that as a downgrade request) + writer.Header().Add(elasticApiVersionHeaderKey, defaultFleetApiVersion) + writer.WriteHeader(http.StatusBadRequest) + }) + + ts := httptest.NewServer(mux) + defer ts.Close() + + testLogger, obsLogs := logger.NewTesting("testElasticApiVersion") + + clt, err := NewWithConfig(testLogger, remote.Config{ + Hosts: []string{ts.URL}, + }) + require.NoError(t, err) + + resp, err := clt.Send(ctx, http.MethodGet, "/genericbadrequest", nil, nil, nil) + if assert.NoError(t, err) { + defer resp.Body.Close() + } + logs := obsLogs.FilterMessageSnippet("fleet requested a different api version").All() + t.Logf("retrieved logs: %v", logs) + assert.Empty(t, logs, "downgrade response should not be logged when the fleet api version is the same as the request") + }) + t.Run("verify that we log a downgrade request", func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/internal/pkg/fleetapi/enroll_cmd.go b/internal/pkg/fleetapi/enroll_cmd.go index b5e932fa7e7..a650f8f12dc 100644 --- a/internal/pkg/fleetapi/enroll_cmd.go +++ b/internal/pkg/fleetapi/enroll_cmd.go @@ -30,6 +30,16 @@ var ErrTooManyRequests = errors.New("too many requests received (429)") // ErrConnRefused is returned when the connection to the server is refused. var ErrConnRefused = errors.New("connection refused") +// ErrTemporaryServerError is returned when the request caused a temporary server error +var ErrTemporaryServerError = errors.New("temporary server error, please retry later") + +// temporaryServerErrorCodes defines status codes that allow clients to retry their request. +var temporaryServerErrorCodes = map[int]struct{}{ + http.StatusBadGateway: {}, + http.StatusServiceUnavailable: {}, + http.StatusGatewayTimeout: {}, +} + const ( // PermanentEnroll is default enrollment type, by default an Agent is permanently enroll to Agent. PermanentEnroll = EnrollType("PERMANENT") @@ -214,6 +224,10 @@ func (e *EnrollCmd) Execute(ctx context.Context, r *EnrollRequest) (*EnrollRespo return nil, ErrTooManyRequests } + if _, temporary := temporaryServerErrorCodes[resp.StatusCode]; temporary { + return nil, fmt.Errorf("received code %d: %w", resp.StatusCode, ErrTemporaryServerError) + } + if resp.StatusCode != http.StatusOK { return nil, client.ExtractError(resp.Body) } diff --git a/internal/pkg/fleetapi/enroll_cmd_test.go b/internal/pkg/fleetapi/enroll_cmd_test.go index aa3dec8c675..4ddefda38e6 100644 --- a/internal/pkg/fleetapi/enroll_cmd_test.go +++ b/internal/pkg/fleetapi/enroll_cmd_test.go @@ -12,6 +12,7 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/elastic/elastic-agent/internal/pkg/agent/application/info" @@ -58,7 +59,8 @@ func TestEnroll(t *testing.T) { b, err := json.Marshal(response) require.NoError(t, err) - w.Write(b) + _, err = w.Write(b) + assert.NoError(t, err) }) return mux }, func(t *testing.T, host string) { @@ -93,7 +95,8 @@ func TestEnroll(t *testing.T) { mux.HandleFunc("/api/fleet/agents/enroll", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusInternalServerError) w.Header().Set("Content-Type", "application/json") - w.Write([]byte(`{"statusCode": 500, "error":"Something is really bad here"}`)) + _, err := w.Write([]byte(`{"statusCode": 500, "error":"Something is really bad here"}`)) + assert.NoError(t, err) }) return mux }, func(t *testing.T, host string) { @@ -121,6 +124,41 @@ func TestEnroll(t *testing.T) { require.True(t, strings.Index(err.Error(), "Something is really bad here") > 0) }, )) + + t.Run("Returns temporary server errors", withServer( + func(t *testing.T) *http.ServeMux { + mux := http.NewServeMux() + mux.HandleFunc("/api/fleet/agents/enroll", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusServiceUnavailable) + w.Header().Set("Content-Type", "application/json") + _, err := w.Write([]byte(`{"statusCode": 503, "error":"maintenance"}`)) + assert.NoError(t, err) + }) + return mux + }, func(t *testing.T, host string) { + cfg := config.MustNewConfigFrom(map[string]interface{}{ + "host": host, + }) + + client, err := remote.NewWithRawConfig(nil, cfg, nil) + require.NoError(t, err) + + req := &EnrollRequest{ + Type: PermanentEnroll, + EnrollAPIKey: "my-enrollment-api-key", + Metadata: Metadata{ + Local: testMetadata(), + UserProvided: make(map[string]interface{}), + }, + } + + cmd := &EnrollCmd{client: client} + _, err = cmd.Execute(context.Background(), req) + require.Error(t, err) + require.ErrorIs(t, err, ErrTemporaryServerError) + require.Contains(t, err.Error(), "code 503") + }, + )) } func testMetadata() *info.ECSMeta { diff --git a/internal/pkg/otel/README.md b/internal/pkg/otel/README.md index 07a79079f6a..4113e9dab32 100644 --- a/internal/pkg/otel/README.md +++ b/internal/pkg/otel/README.md @@ -8,15 +8,19 @@ To run the Elastic Distribution for OpenTelemetry Collector you can use Elastic- Running command ```bash -./elastic-agent -c otel.yml run +./elastic-agent otel --config otel.yml ``` -from unpacked Elastic Agent package will run Elastic-Agent as an OpenTelemetry Collector. The `-c` flag needs to point to [OpenTelemetry Collector Configuration file](https://opentelemetry.io/docs/collector/configuration/) named `otel`, `otlp` or `otelcol`. -Both `yaml` and `yml` suffixes are supported. +from unpacked Elastic Agent package will run Elastic-Agent as an OpenTelemetry Collector. The `--config` flag needs to point to [OpenTelemetry Collector Configuration file](https://opentelemetry.io/docs/collector/configuration/). OTel mode is available only using `otel` subcommand. Elastic Agent will not do any autodetection of configuration file passed when used without `otel` subcommand and will try to run normally. -> In case this condition is not met, Elastic Agent will run in its default mode and will not behave as OpenTelemetry Collector. -Note that `validate` subcommand and [feature gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md#controlling-gates) are not supported yet. +To validate OTel configuration run `otel validate` subcommand: + +```bash +./elastic-agent otel validate --config otel.yml +``` + +[feature gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md#controlling-gates) are supported using `--feature-gates` flag. ## Components @@ -27,8 +31,12 @@ This section provides a summary of components included in the Elastic Distributi | Component | Version | |---|---| -| filelogreceiver | v0.96.0| -| otlpreceiver | v0.96.0| +| filelogreceiver | v0.103.0| +| hostmetricsreceiver | v0.103.0| +| httpcheckreceiver | v0.103.0| +| k8sclusterreceiver | v0.103.0| +| kubeletstatsreceiver | v0.103.0| +| otlpreceiver | v0.103.0| @@ -37,9 +45,11 @@ This section provides a summary of components included in the Elastic Distributi | Component | Version | |---|---| -| fileexporter | v0.96.0| -| debugexporter | v0.96.0| -| otlpexporter | v0.96.0| +| elasticsearchexporter | v0.103.0| +| fileexporter | v0.103.0| +| debugexporter | v0.103.0| +| otlpexporter | v0.103.0| +| otlphttpexporter | v0.103.0| @@ -48,11 +58,31 @@ This section provides a summary of components included in the Elastic Distributi | Component | Version | |---|---| -| attributesprocessor | v0.96.0| -| resourceprocessor | v0.96.0| -| transformprocessor | v0.96.0| -| batchprocessor | v0.96.0| -| memorylimiterprocessor | v0.96.0| +| elasticinframetricsprocessor | v0.2.0| +| attributesprocessor | v0.103.0| +| filterprocessor | v0.103.0| +| k8sattributesprocessor | v0.103.0| +| resourcedetectionprocessor | v0.103.0| +| resourceprocessor | v0.103.0| +| transformprocessor | v0.103.0| +| batchprocessor | v0.103.0| + + + + +### Extensions + +| Component | Version | +|---|---| +| storage/filestorage | v0.103.0| +| memorylimiterextension | v0.103.0| + +### Connectors + +| Component | Version | +|---|---| +| spanmetricsconnector | v0.103.0| + diff --git a/internal/pkg/otel/components.go b/internal/pkg/otel/components.go index ccb3374585d..e395c6cf4c0 100644 --- a/internal/pkg/otel/components.go +++ b/internal/pkg/otel/components.go @@ -2,29 +2,50 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package otel import ( + "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/otelcol" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/receiver" // Receivers: filelogreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver" // for collecting log files + hostmetricsreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver" + httpcheckreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver" + k8sclusterreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver" + kubeletstatsreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver" otlpreceiver "go.opentelemetry.io/collector/receiver/otlpreceiver" // Processors: attributesprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor" // for modifying signal attributes - resourceprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor" // for modifying resource attributes - transformprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor" // for OTTL processing on logs - "go.opentelemetry.io/collector/processor/batchprocessor" // for batching events - "go.opentelemetry.io/collector/processor/memorylimiterprocessor" // for putting backpressure when approach a memory limit + "github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor" + k8sattributesprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor" // for adding k8s metadata + "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor" + resourceprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor" // for modifying resource attributes + transformprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor" // for OTTL processing on logs + "go.opentelemetry.io/collector/processor/batchprocessor" // for batching events + + "github.com/elastic/opentelemetry-collector-components/processor/elasticinframetricsprocessor" // Exporters: + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter" fileexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter" // for e2e tests debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" // for dev "go.opentelemetry.io/collector/exporter/otlpexporter" + otlphttpexporter "go.opentelemetry.io/collector/exporter/otlphttpexporter" + + // Extensions + filestorage "github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage" + "go.opentelemetry.io/collector/extension/memorylimiterextension" // for putting backpressure when approach a memory limit + + // Connectors + spanmetricsconnector "github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector" ) func components() (otelcol.Factories, error) { @@ -35,6 +56,10 @@ func components() (otelcol.Factories, error) { factories.Receivers, err = receiver.MakeFactoryMap( otlpreceiver.NewFactory(), filelogreceiver.NewFactory(), + kubeletstatsreceiver.NewFactory(), + k8sclusterreceiver.NewFactory(), + hostmetricsreceiver.NewFactory(), + httpcheckreceiver.NewFactory(), ) if err != nil { return otelcol.Factories{}, err @@ -43,10 +68,13 @@ func components() (otelcol.Factories, error) { // Processors factories.Processors, err = processor.MakeFactoryMap( batchprocessor.NewFactory(), - memorylimiterprocessor.NewFactory(), resourceprocessor.NewFactory(), attributesprocessor.NewFactory(), transformprocessor.NewFactory(), + filterprocessor.NewFactory(), + k8sattributesprocessor.NewFactory(), + elasticinframetricsprocessor.NewFactory(), + resourcedetectionprocessor.NewFactory(), ) if err != nil { return otelcol.Factories{}, err @@ -57,6 +85,23 @@ func components() (otelcol.Factories, error) { otlpexporter.NewFactory(), debugexporter.NewFactory(), fileexporter.NewFactory(), + elasticsearchexporter.NewFactory(), + otlphttpexporter.NewFactory(), + ) + if err != nil { + return otelcol.Factories{}, err + } + + factories.Connectors, err = connector.MakeFactoryMap( + spanmetricsconnector.NewFactory(), + ) + if err != nil { + return otelcol.Factories{}, err + } + + factories.Extensions, err = extension.MakeFactoryMap( + memorylimiterextension.NewFactory(), + filestorage.NewFactory(), ) if err != nil { return otelcol.Factories{}, err diff --git a/internal/pkg/otel/config_file_provider.go b/internal/pkg/otel/config_file_provider.go index 039693ed9c9..1c2d2697f63 100644 --- a/internal/pkg/otel/config_file_provider.go +++ b/internal/pkg/otel/config_file_provider.go @@ -2,6 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package otel import ( diff --git a/internal/pkg/otel/config_file_provider_test.go b/internal/pkg/otel/config_file_provider_test.go index 4fbd75da6d0..16478e3ac56 100644 --- a/internal/pkg/otel/config_file_provider_test.go +++ b/internal/pkg/otel/config_file_provider_test.go @@ -2,6 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package otel import ( diff --git a/internal/pkg/otel/run.go b/internal/pkg/otel/run.go index d64e06e320c..5042e7c14d3 100644 --- a/internal/pkg/otel/run.go +++ b/internal/pkg/otel/run.go @@ -2,6 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package otel import ( @@ -53,33 +55,28 @@ func newSettings(version string, configPaths []string) (*otelcol.CollectorSettin Description: buildDescription, Version: version, } - converterSet := confmap.ConverterSettings{} configProviderSettings := otelcol.ConfigProviderSettings{ ResolverSettings: confmap.ResolverSettings{ - URIs: configPaths, - Providers: makeMapProvidersMap(fileprovider.New(), envprovider.New(), yamlprovider.New(), httpprovider.New(), httpsprovider.New()), - Converters: []confmap.Converter{expandconverter.New(converterSet)}, + URIs: configPaths, + ProviderFactories: []confmap.ProviderFactory{ + fileprovider.NewFactory(), + envprovider.NewFactory(), + yamlprovider.NewFactory(), + httpprovider.NewFactory(), + httpsprovider.NewFactory(), + }, + ConverterFactories: []confmap.ConverterFactory{ + expandconverter.NewFactory(), + }, }, } - provider, err := otelcol.NewConfigProvider(configProviderSettings) - if err != nil { - return nil, err - } return &otelcol.CollectorSettings{ - Factories: components, - BuildInfo: buildInfo, - ConfigProvider: provider, + Factories: components, + BuildInfo: buildInfo, + ConfigProviderSettings: configProviderSettings, // we're handling DisableGracefulShutdown via the cancelCtx being passed // to the collector's Run method in the Run function DisableGracefulShutdown: true, }, nil } - -func makeMapProvidersMap(providers ...confmap.Provider) map[string]confmap.Provider { - ret := make(map[string]confmap.Provider, len(providers)) - for _, provider := range providers { - ret[provider.Scheme()] = provider - } - return ret -} diff --git a/internal/pkg/otel/run_test.go b/internal/pkg/otel/run_test.go new file mode 100644 index 00000000000..983044d5170 --- /dev/null +++ b/internal/pkg/otel/run_test.go @@ -0,0 +1,98 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build !windows + +package otel + +import ( + "context" + "os" + "path/filepath" + "runtime" + "strings" + "sync" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/otelcol" +) + +func TestStartCollector(t *testing.T) { + testCases := []struct { + configFile string + expectedErrorMessage string + }{ + { + configFile: "all-components.yml", + expectedErrorMessage: "", // empty string means no error is expected + }, + { + configFile: "nonexistent-component.yml", + expectedErrorMessage: `error decoding 'extensions': unknown type: "zpages"`, + }, + } + + for _, tc := range testCases { + t.Run(tc.configFile, func(t *testing.T) { + configFiles := getConfigFiles(tc.configFile) + settings, err := newSettings("test", configFiles) + require.NoError(t, err) + + collector, err := otelcol.NewCollector(*settings) + require.NoError(t, err) + require.NotNil(t, collector) + + wg := startCollector(context.Background(), t, collector, tc.expectedErrorMessage) + + if tc.expectedErrorMessage == "" { + assert.Eventually(t, func() bool { + return otelcol.StateRunning == collector.GetState() + }, 10*time.Second, 200*time.Millisecond) + } + collector.Shutdown() + wg.Wait() + assert.Equal(t, otelcol.StateClosed, collector.GetState()) + }) + } +} + +// getConfigFiles returns a collection of config file paths for the collector to use. +// In the simplest scenario, the collection will contains only one path. +// In case there is an operating system-specific override file found, it will be added to the collection. +// E.g. if the input file name is `all-components.yml` and a file named `all-components.windows.yml` exists, +// the config path collection will have two elements on Windows, and only one element on other OSes. +// Use `darwin` for MacOS, `linux` for Linux and `windows` for Windows. +func getConfigFiles(configFileName string) []string { + // Add base file to the collection. + baseFilePath := filepath.Join(".", "testdata", configFileName) + configFiles := []string{"file:" + baseFilePath} + + // Check if an os-specific override file exists; if it does, add it to the collection. + overrideFileName := strings.TrimSuffix(configFileName, filepath.Ext(configFileName)) + "." + runtime.GOOS + filepath.Ext(configFileName) + overrideFilePath := filepath.Join(".", "testdata", overrideFileName) + if _, err := os.Stat(overrideFilePath); err == nil { + configFiles = append(configFiles, "file:"+overrideFilePath) + } + + return configFiles +} + +func startCollector(ctx context.Context, t *testing.T, col *otelcol.Collector, expectedErrorMessage string) *sync.WaitGroup { + wg := &sync.WaitGroup{} + wg.Add(1) + go func() { + defer wg.Done() + err := col.Run(ctx) + if expectedErrorMessage == "" { + require.NoError(t, err) + } else { + assert.Error(t, err) + assert.Contains(t, err.Error(), expectedErrorMessage) + } + }() + return wg +} diff --git a/internal/pkg/otel/templates/README.md.tmpl b/internal/pkg/otel/templates/README.md.tmpl index 0470c57a012..e89fb749fa2 100644 --- a/internal/pkg/otel/templates/README.md.tmpl +++ b/internal/pkg/otel/templates/README.md.tmpl @@ -8,15 +8,19 @@ To run the Elastic Distribution for OpenTelemetry Collector you can use Elastic- Running command ```bash -./elastic-agent -c otel.yml run +./elastic-agent otel --config otel.yml ``` -from unpacked Elastic Agent package will run Elastic-Agent as an OpenTelemetry Collector. The `-c` flag needs to point to [OpenTelemetry Collector Configuration file](https://opentelemetry.io/docs/collector/configuration/) named `otel`, `otlp` or `otelcol`. -Both `yaml` and `yml` suffixes are supported. +from unpacked Elastic Agent package will run Elastic-Agent as an OpenTelemetry Collector. The `--config` flag needs to point to [OpenTelemetry Collector Configuration file](https://opentelemetry.io/docs/collector/configuration/). OTel mode is available only using `otel` subcommand. Elastic Agent will not do any autodetection of configuration file passed when used without `otel` subcommand and will try to run normally. -> In case this condition is not met, Elastic Agent will run in its default mode and will not behave as OpenTelemetry Collector. -Note that `validate` subcommand and [feature gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md#controlling-gates) are not supported yet. +To validate OTel configuration run `otel validate` subcommand: + +```bash +./elastic-agent otel validate --config otel.yml +``` + +[feature gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md#controlling-gates) are supported using `--feature-gates` flag. ## Components @@ -56,4 +60,13 @@ This section provides a summary of components included in the Elastic Distributi |---|---| {{ range .Extensions }}| {{ .Name }} | {{ .Version -}} | {{ end }} +{{ end }} + +{{ if .Connectors }} +### Connectors + +| Component | Version | +|---|---| +{{ range .Connectors }}| {{ .Name }} | {{ .Version -}} | +{{ end }} {{ end }} \ No newline at end of file diff --git a/internal/pkg/otel/testdata/all-components.windows.yml b/internal/pkg/otel/testdata/all-components.windows.yml new file mode 100644 index 00000000000..d5348d7171d --- /dev/null +++ b/internal/pkg/otel/testdata/all-components.windows.yml @@ -0,0 +1,3 @@ +exporters: + file: + path: ${env:TMP}\file-exporter-output.json \ No newline at end of file diff --git a/internal/pkg/otel/testdata/all-components.yml b/internal/pkg/otel/testdata/all-components.yml new file mode 100644 index 00000000000..81361104cb5 --- /dev/null +++ b/internal/pkg/otel/testdata/all-components.yml @@ -0,0 +1,128 @@ +exporters: + debug: + elasticsearch: + endpoints: + - http://localhost:9200 + file: + path: /tmp/file-exporter-output.json + otlp: + endpoint: localhots:4317 + otlphttp: + endpoint: https://localhost.com:4318 + +extensions: + memory_limiter: + check_interval: 5s + limit_mib: 100 + +processors: + attributes: + actions: + - action: insert + key: key1 + value: value1 + batch: + elasticinframetrics: + filter: + resource: + attributes: + - action: insert + key: key1 + value: value1 + resourcedetection: + transform: + +receivers: + filelog: + include: + - /filelog/path + otlp: + protocols: + grpc: + http: + httpcheck: + targets: + - endpoint: http://localhost:80 + method: GET + collection_interval: 10s + +connectors: + spanmetrics: + histogram: + explicit: + buckets: [100us, 1ms, 2ms, 6ms, 10ms, 100ms, 250ms] + dimensions: + - name: http.method + default: GET + - name: http.status_code + exemplars: + enabled: true + exclude_dimensions: ['status.code'] + dimensions_cache_size: 1000 + aggregation_temporality: "AGGREGATION_TEMPORALITY_CUMULATIVE" + metrics_flush_interval: 15s + metrics_expiration: 5m + events: + enabled: true + dimensions: + - name: exception.type + - name: exception.message + resource_metrics_key_attributes: + - service.name + - telemetry.sdk.language + - telemetry.sdk.name + +service: + extensions: + - memory_limiter + pipelines: + logs: + exporters: + - debug + - elasticsearch + - file + - otlp + processors: + - attributes + - batch + - filter + - resource + - resourcedetection + - transform + receivers: + - filelog + - otlp + + metrics: + exporters: + - debug + - otlp + processors: + - attributes + - batch + - elasticinframetrics + - filter + - resource + - resourcedetection + - transform + receivers: + - otlp + - httpcheck + - spanmetrics + + traces: + exporters: + - debug + - elasticsearch + - otlp + - otlphttp + - spanmetrics + processors: + - attributes + - batch + - filter + - resource + - resourcedetection + - transform + receivers: + - otlp diff --git a/internal/pkg/otel/testdata/nonexistent-component.yml b/internal/pkg/otel/testdata/nonexistent-component.yml new file mode 100644 index 00000000000..420fcfef4b3 --- /dev/null +++ b/internal/pkg/otel/testdata/nonexistent-component.yml @@ -0,0 +1,20 @@ +receivers: + otlp: + protocols: + grpc: + +exporters: + debug: + +extensions: + zpages: + +service: + extensions: + - zpages + pipelines: + logs: + exporters: + - debug + receivers: + - otlp diff --git a/internal/pkg/otel/testdata/otel.yml b/internal/pkg/otel/testdata/otel.yml index 1d5daf48a9c..bba68b878ca 100644 --- a/internal/pkg/otel/testdata/otel.yml +++ b/internal/pkg/otel/testdata/otel.yml @@ -22,4 +22,4 @@ service: receivers: [filelog] processors: [resource] exporters: - - debug \ No newline at end of file + - debug diff --git a/internal/pkg/otel/validate.go b/internal/pkg/otel/validate.go index 924ae784a1f..ce3414536da 100644 --- a/internal/pkg/otel/validate.go +++ b/internal/pkg/otel/validate.go @@ -2,6 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. +//go:build !windows + package otel import ( diff --git a/internal/pkg/remote/client.go b/internal/pkg/remote/client.go index 1a1e8de068c..25a68a37372 100644 --- a/internal/pkg/remote/client.go +++ b/internal/pkg/remote/client.go @@ -27,6 +27,7 @@ import ( const ( retryOnBadConnTimeout = 5 * time.Minute + requestIDHeaderName = "X-Request-ID" ) type wrapperFunc func(rt http.RoundTripper) (http.RoundTripper, error) @@ -194,7 +195,7 @@ func (c *Client) Send( // If available, add the request id as an HTTP header if reqID != "" { - req.Header.Add("X-Request-ID", reqID) + req.Header.Add(requestIDHeaderName, reqID) } // copy headers. @@ -220,7 +221,7 @@ func (c *Client) Send( c.log.With("error", err).Debugf(msg) continue } - c.checkApiVersionHeaders(reqID, resp) + c.checkApiVersionHeaders(req, resp) return resp, nil } @@ -228,19 +229,22 @@ func (c *Client) Send( return nil, fmt.Errorf("all hosts failed: %w", multiErr) } -func (c *Client) checkApiVersionHeaders(reqID string, resp *http.Response) { +func (c *Client) checkApiVersionHeaders(req *http.Request, resp *http.Response) { const elasticApiVersionHeaderKey = "Elastic-Api-Version" const warningHeaderKey = "Warning" warning := resp.Header.Get(warningHeaderKey) + requestID := req.Header.Get(requestIDHeaderName) if warning != "" { - c.log.With("http.request.id", reqID).Warnf("warning in fleet response: %q", warning) + c.log.With("http.request.id", requestID).Warnf("warning in fleet response: %q", warning) } - if downgradeVersion := resp.Header.Get(elasticApiVersionHeaderKey); resp.StatusCode == http.StatusBadRequest && downgradeVersion != "" { + requestAPIVersion := req.Header.Get(elasticApiVersionHeaderKey) + downgradeVersion := resp.Header.Get(elasticApiVersionHeaderKey) + if resp.StatusCode == http.StatusBadRequest && downgradeVersion != "" && downgradeVersion != requestAPIVersion { // fleet server requested a downgrade to a different api version, we should bubble up an error until some kind // of fallback mechanism can instantiate the requested version. This is not yet implemented so we log an error - c.log.With("http.request.id", reqID).Errorf("fleet requested a different api version %q but this is currently not implemented", downgradeVersion) + c.log.With("http.request.id", requestID).Errorf("fleet requested a different api version %q but this is currently not implemented", downgradeVersion) } } diff --git a/internal/pkg/remote/config.go b/internal/pkg/remote/config.go index c0846899611..230c463b960 100644 --- a/internal/pkg/remote/config.go +++ b/internal/pkg/remote/config.go @@ -13,7 +13,7 @@ import ( // Config is the configuration for the client. type Config struct { - Protocol Protocol `config:"protocol" yaml:"protocol"` + Protocol Protocol `config:"protocol" yaml:"protocol,omitempty"` SpaceID string `config:"space.id" yaml:"space.id,omitempty"` Path string `config:"path" yaml:"path,omitempty"` Host string `config:"host" yaml:"host,omitempty"` @@ -34,8 +34,8 @@ const ( // Unpack the protocol. func (p *Protocol) Unpack(from string) error { - if Protocol(from) != ProtocolHTTPS && Protocol(from) != ProtocolHTTP { - return fmt.Errorf("invalid protocol %s, accepted values are 'http' and 'https'", from) + if from != "" && Protocol(from) != ProtocolHTTPS && Protocol(from) != ProtocolHTTP { + return fmt.Errorf("invalid protocol %q, accepted values are 'http' and 'https'", from) } *p = Protocol(from) diff --git a/internal/pkg/testutils/testutils.go b/internal/pkg/testutils/testutils.go index 4c3c0781cca..a1a180dd82c 100644 --- a/internal/pkg/testutils/testutils.go +++ b/internal/pkg/testutils/testutils.go @@ -37,7 +37,10 @@ func NewErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + eventLoggerCfg := logger.DefaultEventLoggingConfig() + eventLoggerCfg.Level = loggerCfg.Level + + log, err := logger.NewFromConfig("", loggerCfg, eventLoggerCfg, false) require.NoError(t, err) return log } diff --git a/magefile.go b/magefile.go index 3d15a6771f3..fd4fe088f87 100644 --- a/magefile.go +++ b/magefile.go @@ -9,12 +9,14 @@ package main import ( "bufio" "context" + "crypto/sha512" "encoding/json" "errors" "fmt" "html/template" "log" "math/rand" + "net/http" "os" "os/exec" "path/filepath" @@ -22,20 +24,24 @@ import ( "runtime" "strconv" "strings" + "sync" "sync/atomic" "time" "github.com/jedib0t/go-pretty/v6/table" + "github.com/otiai10/copy" "github.com/elastic/e2e-testing/pkg/downloads" "github.com/elastic/elastic-agent/dev-tools/mage" devtools "github.com/elastic/elastic-agent/dev-tools/mage" "github.com/elastic/elastic-agent/dev-tools/mage/manifest" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/upgrade/artifact/download" "github.com/elastic/elastic-agent/pkg/testing/define" "github.com/elastic/elastic-agent/pkg/testing/ess" "github.com/elastic/elastic-agent/pkg/testing/multipass" "github.com/elastic/elastic-agent/pkg/testing/ogc" "github.com/elastic/elastic-agent/pkg/testing/runner" + "github.com/elastic/elastic-agent/pkg/testing/tools" "github.com/elastic/elastic-agent/pkg/testing/tools/git" pv "github.com/elastic/elastic-agent/pkg/testing/tools/product_versions" "github.com/elastic/elastic-agent/pkg/testing/tools/snapshots" @@ -53,7 +59,6 @@ import ( "github.com/hashicorp/go-multierror" "github.com/magefile/mage/mg" "github.com/magefile/mage/sh" - "github.com/otiai10/copy" "github.com/sirupsen/logrus" "golang.org/x/sync/errgroup" "gopkg.in/yaml.v2" @@ -77,6 +82,9 @@ const ( commitLen = 7 cloudImageTmpl = "docker.elastic.co/observability-ci/elastic-agent:%s" + + baseURLForStagingDRA = "https://staging.elastic.co/" + agentCoreProjectName = "elastic-agent-core" ) var ( @@ -86,7 +94,7 @@ var ( "demo": Demo.Enroll, } - errNoManifest = errors.New("missing ManifestURL environment variable") + errNoManifest = errors.New(fmt.Sprintf("missing %q environment variable", mage.ManifestUrlEnvVar)) errNoAgentDropPath = errors.New("missing AGENT_DROP_PATH environment variable") errAtLeastOnePlatform = errors.New("elastic-agent package is expected to build at least one platform package") @@ -100,7 +108,7 @@ func init() { common.RegisterCheckDeps(Update, Check.All) test.RegisterDeps(UnitTest) devtools.BeatLicense = "Elastic License" - devtools.BeatDescription = "Agent manages other beats based on configuration provided." + devtools.BeatDescription = "Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host." devtools.Platforms = devtools.Platforms.Filter("!linux/386") devtools.Platforms = devtools.Platforms.Filter("!windows/386") @@ -195,14 +203,69 @@ func (Dev) Package() { Package() } +func mocksPath() (string, error) { + repositoryRoot, err := findRepositoryRoot() + if err != nil { + return "", fmt.Errorf("finding repository root: %w", err) + } + return filepath.Join(repositoryRoot, "testing", "mocks"), nil +} + +func (Dev) CleanMocks() error { + mPath, err := mocksPath() + if err != nil { + return fmt.Errorf("retrieving mocks path: %w", err) + } + err = os.RemoveAll(mPath) + if err != nil { + return fmt.Errorf("removing mocks: %w", err) + } + return nil +} + +func (Dev) RegenerateMocks() error { + mg.Deps(Dev.CleanMocks) + err := sh.Run("mockery") + if err != nil { + return fmt.Errorf("generating mocks: %w", err) + } + + // change CWD + workingDir, err := os.Getwd() + if err != nil { + return fmt.Errorf("retrieving CWD: %w", err) + } + // restore the working directory when exiting the function + defer func() { + err := os.Chdir(workingDir) + if err != nil { + panic(fmt.Errorf("failed to restore working dir %q: %w", workingDir, err)) + } + }() + + mPath, err := mocksPath() + if err != nil { + return fmt.Errorf("retrieving mocks path: %w", err) + } + + err = os.Chdir(mPath) + if err != nil { + return fmt.Errorf("changing current directory to %q: %w", mPath, err) + } + + mg.Deps(devtools.AddLicenseHeaders) + mg.Deps(devtools.GoImports) + return nil +} + // InstallGoLicenser install go-licenser to check license of the files. func (Prepare) InstallGoLicenser() error { - return GoGet(goLicenserRepo) + return GoInstall(goLicenserRepo) } // InstallGoLint for the code. func (Prepare) InstallGoLint() error { - return GoGet(goLintRepo) + return GoInstall(goLintRepo) } // All build all the things for the current projects. @@ -420,7 +483,14 @@ func Package() { panic("elastic-agent package is expected to build at least one platform package") } - packageAgent(platforms, devtools.UseElasticAgentPackaging) + var dependenciesVersion string + if beatVersion, found := os.LookupEnv("BEAT_VERSION"); !found { + dependenciesVersion = bversion.GetDefaultVersion() + } else { + dependenciesVersion = beatVersion + } + + packageAgent(platforms, dependenciesVersion, mg.F(devtools.UseElasticAgentPackaging), mg.F(CrossBuild)) } // DownloadManifest downloads the provided manifest file into the predefined folder @@ -545,9 +615,9 @@ func RunGo(args ...string) error { return sh.RunV(mg.GoCmd(), args...) } -// GoGet fetch a remote dependencies. -func GoGet(link string) error { - _, err := sh.Exec(map[string]string{"GO111MODULE": "off"}, os.Stdout, os.Stderr, "go", "get", link) +// GoInstall installs a tool by calling `go install +func GoInstall(link string) error { + _, err := sh.Exec(map[string]string{}, os.Stdout, os.Stderr, "go", "install", link) return err } @@ -574,13 +644,23 @@ func Update() { mg.SerialDeps(Config, BuildPGP, BuildFleetCfg, Otel.Readme) } +func EnsureCrossBuildOutputDir() error { + repositoryRoot, err := findRepositoryRoot() + if err != nil { + return fmt.Errorf("finding repository root: %w", err) + } + return os.MkdirAll(filepath.Join(repositoryRoot, "build", "golang-crossbuild"), 0o770) +} + // CrossBuild cross-builds the beat for all target platforms. func CrossBuild() error { + mg.Deps(EnsureCrossBuildOutputDir) return devtools.CrossBuild() } // CrossBuildGoDaemon cross-builds the go-daemon binary using Docker. func CrossBuildGoDaemon() error { + mg.Deps(EnsureCrossBuildOutputDir) return devtools.CrossBuildGoDaemon() } @@ -824,10 +904,17 @@ func runAgent(env map[string]string) error { // docker does not exists for this commit, build it if !strings.Contains(dockerImageOut, tag) { + var dependenciesVersion string + if beatVersion, found := os.LookupEnv("BEAT_VERSION"); !found { + dependenciesVersion = bversion.GetDefaultVersion() + } else { + dependenciesVersion = beatVersion + } + // produce docker package packageAgent([]string{ "linux/amd64", - }, devtools.UseElasticAgentDemoPackaging) + }, dependenciesVersion, mg.F(devtools.UseElasticAgentDemoPackaging), mg.F(CrossBuild)) dockerPackagePath := filepath.Join("build", "package", "elastic-agent", "elastic-agent-linux-amd64.docker", "docker-build") if err := os.Chdir(dockerPackagePath); err != nil { @@ -874,10 +961,61 @@ func runAgent(env map[string]string) error { return sh.Run("docker", dockerCmdArgs...) } -func packageAgent(platforms []string, packagingFn func()) { +var platformPackages = map[string]string{ + "darwin/amd64": "darwin-x86_64.tar.gz", + "darwin/arm64": "darwin-aarch64.tar.gz", + "linux/amd64": "linux-x86_64.tar.gz", + "linux/arm64": "linux-arm64.tar.gz", + "windows/amd64": "windows-x86_64.zip", +} + +func packageAgent(platforms []string, dependenciesVersion string, agentPackaging, agentBinaryTarget mg.Fn) { fmt.Println("--- Package Elastic-Agent") - var packageVersion string - // if we have defined a manifest URL to package Agent from, we sould be using the same packageVersion of that manifest + + requiredPackages := []string{} + for _, p := range platforms { + requiredPackages = append(requiredPackages, platformPackages[p]) + } + if mg.Verbose() { + log.Printf("--- Packaging dependenciesVersion[%s], %+v \n", dependenciesVersion, requiredPackages) + } + + // download/copy all the necessary dependencies for packaging elastic-agent + archivePath, dropPath := collectPackageDependencies(platforms, dependenciesVersion, requiredPackages) + + // cleanup after build + defer os.RemoveAll(archivePath) + defer os.RemoveAll(dropPath) + defer os.Unsetenv(agentDropPath) + + // create flat dir + flatPath := filepath.Join(dropPath, ".elastic-agent_flat") + if mg.Verbose() { + log.Printf("--- creating flat dir in .elastic-agent_flat") + } + os.MkdirAll(flatPath, 0755) + defer os.RemoveAll(flatPath) + + // extract all dependencies from their archives into flat dir + flattenDependencies(requiredPackages, dependenciesVersion, archivePath, dropPath, flatPath) + + // package agent + log.Println("--- Running packaging function") + mg.Deps(agentPackaging) + + log.Println("--- Running post packaging ") + mg.Deps(Update) + mg.Deps(agentBinaryTarget, CrossBuildGoDaemon) + mg.SerialDeps(devtools.Package, TestPackages) +} + +// collectPackageDependencies performs the download (if it's an external dep), unpacking and move all the elastic-agent +// dependencies in the archivePath and dropPath +// NOTE: after the build is done the caller must: +// - delete archivePath and dropPath contents +// - unset AGENT_DROP_PATH environment variable +func collectPackageDependencies(platforms []string, packageVersion string, requiredPackages []string) (archivePath string, dropPath string) { + // if we have defined a manifest URL to package Agent from, we should be using the same packageVersion of that manifest if devtools.PackagingFromManifest { if manifestResponse, err := manifest.DownloadManifest(devtools.ManifestURL); err != nil { log.Panicf("failed to download remote manifest file %s", err) @@ -895,35 +1033,17 @@ func packageAgent(platforms []string, packagingFn func()) { } } } - if beatVersion, found := os.LookupEnv("BEAT_VERSION"); !found { - packageVersion = bversion.GetDefaultVersion() - } else { - packageVersion = beatVersion - } dropPath, found := os.LookupEnv(agentDropPath) - var archivePath string - platformPackages := map[string]string{ - "darwin/amd64": "darwin-x86_64.tar.gz", - "darwin/arm64": "darwin-aarch64.tar.gz", - "linux/amd64": "linux-x86_64.tar.gz", - "linux/arm64": "linux-arm64.tar.gz", - "windows/amd64": "windows-x86_64.zip", - } + // try not to shadow too many variables + var err error - requiredPackages := []string{} - for _, p := range platforms { - requiredPackages = append(requiredPackages, platformPackages[p]) - } - if mg.Verbose() { - log.Printf("--- Packaging packageVersion[%s], %+v \n", packageVersion, requiredPackages) - } // build deps only when drop is not provided if !found || len(dropPath) == 0 { // prepare new drop dropPath = filepath.Join("build", "distributions", "elastic-agent-drop") - dropPath, err := filepath.Abs(dropPath) + dropPath, err = filepath.Abs(dropPath) if err != nil { panic(err) } @@ -933,12 +1053,8 @@ func packageAgent(platforms []string, packagingFn func()) { } archivePath = movePackagesToArchive(dropPath, requiredPackages) - defer os.RemoveAll(dropPath) os.Setenv(agentDropPath, dropPath) - // cleanup after build - defer os.Unsetenv(agentDropPath) - if devtools.ExternalBuild == true { // Map of binaries to download to their project name in the unified-release manager. // The project names are used to generate the URLs when downloading binaries. For example: @@ -951,12 +1067,7 @@ func packageAgent(platforms []string, packagingFn func()) { // https://artifacts-snapshot.elastic.co/fleet-server/latest/8.11.0-SNAPSHOT.json // https://artifacts-snapshot.elastic.co/prodfiler/latest/8.11.0-SNAPSHOT.json externalBinaries := map[string]string{ - "auditbeat": "beats", - "filebeat": "beats", - "heartbeat": "beats", - "metricbeat": "beats", - "osquerybeat": "beats", - "packetbeat": "beats", + "agentbeat": "beats", "cloudbeat": "cloudbeat", // only supporting linux/amd64 or linux/arm64 "cloud-defend": "cloud-defend", "apm-server": "apm-server", // not supported on darwin/aarch64 @@ -989,7 +1100,7 @@ func packageAgent(platforms []string, packagingFn func()) { } } - err := errGroup.Wait() + err = errGroup.Wait() if err != nil { panic(err) } @@ -997,7 +1108,7 @@ func packageAgent(platforms []string, packagingFn func()) { panic(fmt.Sprintf("No packages were successfully downloaded. You may be building against an invalid or unreleased version. version=%s. If this is an unreleased version, try SNAPSHOT=true or EXTERNAL=false", packageVersion)) } } else { - packedBeats := []string{"filebeat", "heartbeat", "metricbeat", "osquerybeat"} + packedBeats := []string{"agentbeat"} // build from local repo, will assume beats repo is located on the same root level for _, b := range packedBeats { pwd, err := filepath.Abs(filepath.Join("../beats/x-pack", b)) @@ -1060,16 +1171,12 @@ func packageAgent(platforms []string, packagingFn func()) { } else { archivePath = movePackagesToArchive(dropPath, requiredPackages) } - defer os.RemoveAll(archivePath) - - // create flat dir - flatPath := filepath.Join(dropPath, ".elastic-agent_flat") - if mg.Verbose() { - log.Printf("--- creating flat dir in .elastic-agent_flat") - } - os.MkdirAll(flatPath, 0755) - defer os.RemoveAll(flatPath) + return archivePath, dropPath +} +// flattenDependencies will extract all the required packages collected in archivePath and dropPath in flatPath and +// regenerate checksums +func flattenDependencies(requiredPackages []string, packageVersion, archivePath, dropPath, flatPath string) { for _, rp := range requiredPackages { targetPath := filepath.Join(archivePath, rp) versionedFlatPath := filepath.Join(flatPath, rp) @@ -1090,11 +1197,12 @@ func packageAgent(platforms []string, packagingFn func()) { matches = append(matches, zipMatches...) if mg.Verbose() { - log.Printf("--- Extracting into the flat dir") + log.Printf("--- Extracting into the flat dir: %v", matches) } for _, m := range matches { stat, err := os.Stat(m) if os.IsNotExist(err) { + log.Printf("--- File %s not found: %v", m, err) continue } else if err != nil { panic(fmt.Errorf("failed stating file: %w", err)) @@ -1111,13 +1219,17 @@ func packageAgent(platforms []string, packagingFn func()) { } } - files, err := filepath.Glob(filepath.Join(versionedFlatPath, fmt.Sprintf("*%s*", packageVersion))) + globExpr := filepath.Join(versionedFlatPath, fmt.Sprintf("*%s*", packageVersion)) + if mg.Verbose() { + log.Printf("Finding files to copy with %s", globExpr) + } + files, err := filepath.Glob(globExpr) if err != nil { panic(err) } if mg.Verbose() { log.Printf("Validating checksums for %+v", files) - log.Printf("--- Copy files into %s", versionedDropPath) + log.Printf("--- Copying into %s: %v", versionedDropPath, files) } checksums := make(map[string]string) for _, f := range files { @@ -1154,15 +1266,310 @@ func packageAgent(platforms []string, packagingFn func()) { panic(err) } } +} + +// simple struct to deserialize branch information. +// When we remove snapshot API dependency this can go in the artifact api client code +type branchInfo struct { + Version string `json:"version"` + BuildID string `json:"build_id"` + ManifestURL string `json:"manifest_url"` + SummaryURL string `json:"summary_url"` +} + +// FetchLatestAgentCoreStagingDRA is a mage target that will retrieve the elastic-agent-core DRA artifacts and +// place them under build/dra/buildID. It accepts one argument that has to be a release branch present in staging DRA +func FetchLatestAgentCoreStagingDRA(ctx context.Context, branch string) error { + + branchInfo, err := findLatestBuildForBranch(ctx, baseURLForStagingDRA, branch) + + // Create a dir with the buildID at /build/dra/ + repositoryRoot, err := findRepositoryRoot() + if err != nil { + return fmt.Errorf("finding repository root: %w", err) + } + draDownloadDir := filepath.Join(repositoryRoot, "build", "dra") + err = os.MkdirAll(draDownloadDir, 0o770) + if err != nil { + return fmt.Errorf("creating %q directory: %w", err) + } - // package agent - log.Println("--- Running packaging function") - packagingFn() + artifacts, err := downloadDRAArtifacts(ctx, branchInfo.ManifestURL, draDownloadDir, agentCoreProjectName) + if err != nil { + return fmt.Errorf("downloading DRA artifacts from %q: %w", branchInfo.ManifestURL, err) + } - log.Println("--- Running post packaging ") - mg.Deps(Update) - mg.Deps(CrossBuild, CrossBuildGoDaemon) - mg.SerialDeps(devtools.Package, TestPackages) + fmt.Println("Downloaded agent core DRAs:") + for k, _ := range artifacts { + fmt.Println(k) + } + return nil +} + +// PackageUsingDRA packages elastic-agent for distribution using Daily Released Artifacts specified in manifest. +func PackageUsingDRA(ctx context.Context) error { + + start := time.Now() + defer func() { fmt.Println("package ran for", time.Since(start)) }() + + platforms := devtools.Platforms.Names() + if len(platforms) == 0 { + return fmt.Errorf("elastic-agent package is expected to build at least one platform package") + } + + if !devtools.PackagingFromManifest { + return fmt.Errorf("elastic-agent PackageUsingDRA is expected to build from a manifest. Check that %s is set to a manifest URL", devtools.ManifestUrlEnvVar) + } + + manifestUrl := devtools.ManifestURL + + build, err := manifest.DownloadManifest(manifestUrl) + if err != nil { + return fmt.Errorf("downloading manifest from %q: %w", manifestUrl, err) + } + + parsedVersion, err := version.ParseVersion(build.Version) + if err != nil { + return fmt.Errorf("parsing version string %q: %w", build.Version, err) + } + + // fix the commit hash independently of the current commit hash on the branch + agentCoreProject, ok := build.Projects[agentCoreProjectName] + if !ok { + return fmt.Errorf("%q project not found in manifest %q", agentCoreProjectName, manifestUrl) + } + err = os.Setenv(mage.AgentCommitHashEnvVar, agentCoreProject.CommitHash) + if err != nil { + return fmt.Errorf("setting agent commit hash %q: %w", agentCoreProject.CommitHash, err) + } + + packageAgent(platforms, parsedVersion.VersionWithPrerelease(), mg.F(devtools.UseElasticAgentPackaging), mg.F(useDRAAgentBinaryForPackage, manifestUrl)) + return nil +} + +func findRepositoryRoot() (string, error) { + return sh.Output(mg.GoCmd(), "list", "-f", "{{.Root}}") +} + +func findLatestBuildForBranch(ctx context.Context, baseURL string, branch string) (*branchInfo, error) { + // latest build info for a branch is at "/latest/.json" + branchLatestBuildUrl := strings.TrimSuffix(baseURL, "/") + fmt.Sprintf("/latest/%s.json", branch) + request, err := http.NewRequestWithContext(ctx, http.MethodGet, branchLatestBuildUrl, nil) + if err != nil { + return nil, fmt.Errorf("error composing request for finding latest build using %q: %w", branchLatestBuildUrl, err) + } + + c := new(http.Client) + resp, err := c.Do(request) + if err != nil { + return nil, fmt.Errorf("error fetching latest build using %q: %w", branchLatestBuildUrl, err) + } + if mg.Verbose() { + log.Printf("Received response for %q : %+v", branchLatestBuildUrl, resp) + } + defer resp.Body.Close() + if resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices { + return nil, fmt.Errorf("bad HTTP status for GET %q: %d - %q", branchLatestBuildUrl, resp.StatusCode, resp.Status) + } + + bi := new(branchInfo) + // consume body + err = json.NewDecoder(resp.Body).Decode(bi) + if err != nil { + return nil, fmt.Errorf("decoding json branch information: %w", err) + } + + if mg.Verbose() { + log.Printf("Received branch information for %q: %+v", branch, bi) + } + + return bi, nil +} + +func mapManifestPlatformToAgentPlatform(manifestPltf string) (string, bool) { + mappings := map[string]string{ + "linux-x86_64": "linux-amd64", + "windows-x86_64": "windows-amd64", + "darwin-x86_64": "darwin-amd64", + "darwin-aarch64": "darwin-arm64", + "linux/x86_64": "linux/amd64", + "windows/x86_64": "windows/amd64", + "darwin/x86_64": "darwin/amd64", + "darwin/aarch64": "darwin/arm64", + } + + mappedPltf, found := mappings[manifestPltf] + if !found { + // default to the manifest platform if no mapping is found + mappedPltf = manifestPltf + } + + return mappedPltf, found +} + +func filterPackagesByPlatform(pkgs map[string]tools.Package) map[string]tools.Package { + if mg.Verbose() { + log.Printf("unfiltered packages: %v", pkgs) + } + platforms := devtools.Platforms.Names() + filteredPackages := map[string]tools.Package{} + for pkgName, pkgDesc := range pkgs { + if mg.Verbose() { + log.Printf("checking if %s:%v should be included", pkgName, pkgDesc) + } + for _, pkgOS := range pkgDesc.Os { + platformString, _ := mapManifestPlatformToAgentPlatform(fmt.Sprintf("%s/%s", pkgOS, pkgDesc.Architecture)) + if slices.Contains(platforms, platformString) { + if mg.Verbose() { + log.Printf("platforms include %s", platformString) + } + filteredPackages[pkgName] = pkgDesc + break + } + } + } + if mg.Verbose() { + log.Printf("filtered packages: %v", filteredPackages) + } + return filteredPackages +} + +func downloadDRAArtifacts(ctx context.Context, manifestUrl string, downloadDir string, projects ...string) (map[string]tools.Package, error) { + + build, err := manifest.DownloadManifest(manifestUrl) + if err != nil { + return nil, fmt.Errorf("downloading manifest from %q: %w", manifestUrl, err) + } + + // Create a dir with the buildID at / + draDownloadDir := filepath.Join(downloadDir, build.BuildID) + err = os.MkdirAll(draDownloadDir, 0o770) + if err != nil { + return nil, fmt.Errorf("creating %q directory: %w", err) + } + + // sync access to the downloadedArtifacts map + mx := new(sync.Mutex) + downloadedArtifacts := map[string]tools.Package{} + errGrp, errCtx := errgroup.WithContext(ctx) + + for _, projectName := range projects { + project, ok := build.Projects[projectName] + if !ok { + return nil, fmt.Errorf("project %q not found in manifest at %q", projectName, manifestUrl) + } + + if mg.Verbose() { + log.Printf("build %q project %s packages: %+v", build.BuildID, projectName, project) + } + // filter down the packages to the platforms we are building/support + filteredPackages := filterPackagesByPlatform(project.Packages) + if mg.Verbose() { + log.Printf("packages to download: %v", filteredPackages) + } + for pkgName, pkgDesc := range filteredPackages { + downloadFunc := func(pkgName string, pkgDesc tools.Package) func() error { + return func() error { + artifactDownloadPath := filepath.Join(draDownloadDir, pkgName) + err := manifest.DownloadPackage(errCtx, pkgDesc.URL, artifactDownloadPath) + if err != nil { + return fmt.Errorf("downloading %q: %w", pkgName, err) + } + + // download the SHA to check integrity + artifactSHADownloadPath := filepath.Join(draDownloadDir, pkgName+".sha512") + err = manifest.DownloadPackage(errCtx, pkgDesc.ShaURL, artifactSHADownloadPath) + if err != nil { + return fmt.Errorf("downloading SHA for %q: %w", pkgName, err) + } + + err = download.VerifyChecksum(sha512.New(), artifactDownloadPath, artifactSHADownloadPath) + if err != nil { + return fmt.Errorf("validating checksum for %q: %w", pkgName, err) + } + + // we should probably validate the signature, it can be done later as we return the package metadata + // see https://github.com/elastic/elastic-agent/issues/4445 + + mx.Lock() + defer mx.Unlock() + downloadedArtifacts[artifactDownloadPath] = pkgDesc + + return nil + } + }(pkgName, pkgDesc) + + errGrp.Go(downloadFunc) + } + } + + return downloadedArtifacts, errGrp.Wait() +} + +func useDRAAgentBinaryForPackage(ctx context.Context, manifestUrl string) error { + + repositoryRoot, err := findRepositoryRoot() + if err != nil { + return fmt.Errorf("looking up for repository root: %w", err) + } + + downloadDir := filepath.Join(repositoryRoot, "build", "dra") + + // fetch the agent-core DRA artifacts for the current branch + artifacts, err := downloadDRAArtifacts(ctx, manifestUrl, downloadDir, agentCoreProjectName) + if err != nil { + return fmt.Errorf("downloading elastic-agent-core artifacts: %w", err) + } + + mg.Deps(EnsureCrossBuildOutputDir) + + // place the artifacts where the package.yml expects them (in build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}}) + for artifactFile, artifactMeta := range artifacts { + // uncompress the archive first + const extractionSubdir = "extracted" + extractDir := filepath.Join(filepath.Dir(artifactFile), extractionSubdir) + err = devtools.Extract(artifactFile, extractDir) + if err != nil { + return fmt.Errorf("extracting %q: %w", artifactFile, err) + } + + // we can take a shortcut as the archive contains a subdirectory with the same name of the file minus the extension + // and we have to rename the binary file while moving using the same name + artifactBaseFileName := filepath.Base(artifactFile) + artifactBaseFileExt := filepath.Ext(artifactBaseFileName) + if artifactBaseFileExt == ".gz" { + // get the next extension to get .tar.gz if it's there + artifactBaseFileExt = filepath.Ext(strings.TrimSuffix(artifactBaseFileName, artifactBaseFileExt)) + artifactBaseFileExt + } + + // this is the directory name where we can find the agent executable + targetArtifactName := strings.TrimSuffix(artifactBaseFileName, artifactBaseFileExt) + const agentBinaryName = "elastic-agent" + binaryExt := "" + if slices.Contains(artifactMeta.Os, "windows") { + binaryExt += ".exe" + } + srcBinaryPath := filepath.Join(extractDir, targetArtifactName, agentBinaryName+binaryExt) + srcStat, err := os.Stat(srcBinaryPath) + if err != nil { + return fmt.Errorf("stat source binary name %q: %w", srcBinaryPath, err) + } + log.Printf("Source binary %q stat: %+v", srcBinaryPath, srcStat) + + dstPlatform, _ := mapManifestPlatformToAgentPlatform(fmt.Sprintf("%s-%s", artifactMeta.Os[0], artifactMeta.Architecture)) + dstFileName := fmt.Sprintf("elastic-agent-%s", dstPlatform) + binaryExt + dstBinaryPath := filepath.Join(repositoryRoot, "build", "golang-crossbuild", dstFileName) + + log.Printf("copying %q to %q", srcBinaryPath, dstBinaryPath) + + err = copy.Copy(srcBinaryPath, dstBinaryPath, copy.Options{ + PermissionControl: copy.PerservePermission, + }) + if err != nil { + return fmt.Errorf("copying %q to %q: %w", srcBinaryPath, dstBinaryPath, err) + } + } + return nil } // Helper that wraps the fetchBinaryFromArtifactsApi in a way that is compatible with the errgroup.Go() function. @@ -1606,13 +2013,13 @@ func (Integration) UpdateVersions(ctx context.Context) error { reqs := upgradetest.VersionRequirements{ UpgradeToVersion: bversion.Agent, - CurrentMajors: 2, - PreviousMinors: 1, + CurrentMajors: 1, + PreviousMinors: 2, PreviousMajors: 1, SnapshotBranches: branches, } b, _ := json.MarshalIndent(reqs, "", " ") - fmt.Printf("Current version requirements: \n%s\n", b) + fmt.Println(string(b)) pvc := pv.NewProductVersionsClient() sc := snapshots.NewSnapshotsClient() @@ -1638,6 +2045,39 @@ func (Integration) UpdateVersions(ctx context.Context) error { return nil } +// UpdatePackageVersion update the file that contains the latest available snapshot version +func (Integration) UpdatePackageVersion(ctx context.Context) error { + const packageVersionFilename = ".package-version" + + currentReleaseBranch, err := git.GetCurrentReleaseBranch(ctx) + if err != nil { + return fmt.Errorf("failed to identify the current release branch: %w", err) + } + + sc := snapshots.NewSnapshotsClient() + versions, err := sc.FindLatestSnapshots(ctx, []string{currentReleaseBranch}) + if err != nil { + return fmt.Errorf("failed to fetch a manifest for the latest snapshot: %w", err) + } + if len(versions) != 1 { + return fmt.Errorf("expected a single version, got %v", versions) + } + packageVersion := versions[0].CoreVersion() + file, err := os.OpenFile(packageVersionFilename, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) + if err != nil { + return fmt.Errorf("failed to open %s for write: %w", packageVersionFilename, err) + } + defer file.Close() + _, err = file.WriteString(packageVersion) + if err != nil { + return fmt.Errorf("failed to write the package version file %s: %w", packageVersionFilename, err) + } + + fmt.Println(packageVersion) + + return nil +} + var stateDir = ".integration-cache" var stateFile = "state.yml" @@ -2285,6 +2725,7 @@ func createTestRunner(matrix bool, singleTest string, goTestFlags string, batche DiagnosticsDir: diagDir, StateDir: ".integration-cache", Platforms: testPlatforms(), + Packages: testPackages(), Groups: testGroups(), Matrix: matrix, SingleTest: singleTest, @@ -2380,6 +2821,23 @@ func testPlatforms() []string { return platforms } +func testPackages() []string { + packagesStr, defined := os.LookupEnv("TEST_PACKAGES") + if !defined { + return nil + } + + var packages []string + for _, p := range strings.Split(packagesStr, ",") { + if p == "tar.gz" { + p = "targz" + } + packages = append(packages, p) + } + + return packages +} + func testGroups() []string { groupsStr := os.Getenv("TEST_GROUPS") if groupsStr == "" { @@ -2695,6 +3153,7 @@ type dependencies struct { Exporters []dependency Processors []dependency Extensions []dependency + Connectors []dependency } func (d dependency) Clean(sep string) dependency { @@ -2751,13 +3210,14 @@ func getOtelDependencies() (*dependencies, error) { scanner := bufio.NewScanner(readFile) scanner.Split(bufio.ScanLines) - var receivers, extensions, exporters, processors []dependency + var receivers, extensions, exporters, processors, connectors []dependency // process imports for scanner.Scan() { l := strings.TrimSpace(scanner.Text()) // is otel if !strings.Contains(l, "go.opentelemetry.io/") && - !strings.Contains(l, "github.com/open-telemetry/") { + !strings.Contains(l, "github.com/open-telemetry/") && + !strings.Contains(l, "github.com/elastic/opentelemetry-collector-components/") { continue } @@ -2789,6 +3249,8 @@ func getOtelDependencies() (*dependencies, error) { exporters = append(exporters, d.Clean("/exporter/")) } else if strings.Contains(l, "/extension/") { extensions = append(extensions, d.Clean("/extension/")) + } else if strings.Contains(l, "/connector/") { + connectors = append(connectors, d.Clean("/connector/")) } } @@ -2797,5 +3259,6 @@ func getOtelDependencies() (*dependencies, error) { Exporters: exporters, Processors: processors, Extensions: extensions, + Connectors: connectors, }, nil } diff --git a/otel.yml b/otel.yml index 1d5daf48a9c..89351371405 100644 --- a/otel.yml +++ b/otel.yml @@ -16,7 +16,14 @@ exporters: sampling_initial: 10000 sampling_thereafter: 10000 +extensions: + memory_limiter: + check_interval: 1s + limit_mib: 700 + spike_limit_mib: 180 + service: + extensions: [memory_limiter] pipelines: logs: receivers: [filelog] diff --git a/pkg/component/component.go b/pkg/component/component.go index 455f8ad0e48..f7b7195d1cd 100644 --- a/pkg/component/component.go +++ b/pkg/component/component.go @@ -21,11 +21,10 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/eql" "github.com/elastic/elastic-agent/pkg/features" "github.com/elastic/elastic-agent/pkg/limits" - "github.com/elastic/elastic-agent/pkg/utils" ) // GenerateMonitoringCfgFn is a function that can inject information into the model generation process. -type GenerateMonitoringCfgFn func(map[string]interface{}, []Component, map[string]string) (map[string]interface{}, error) +type GenerateMonitoringCfgFn func(map[string]interface{}, []Component, map[string]string, map[string]uint64) (map[string]interface{}, error) type HeadersProvider interface { Headers() map[string]string @@ -208,6 +207,26 @@ func (c *Component) Type() string { return "" } +// BinaryName returns the binary name used for the component. +// +// This can differ from the actual binary name that is on disk, when the input specification states that the +// command has a different name. +func (c *Component) BinaryName() string { + if c.InputSpec != nil { + if c.InputSpec.Spec.Command != nil && c.InputSpec.Spec.Command.Name != "" { + return c.InputSpec.Spec.Command.Name + } + return c.InputSpec.BinaryName + } + if c.ShipperSpec != nil { + if c.ShipperSpec.Spec.Command != nil && c.ShipperSpec.Spec.Command.Name != "" { + return c.ShipperSpec.Spec.Command.Name + } + return c.ShipperSpec.BinaryName + } + return "" +} + // Model is the components model with signed policy data // This replaces former top level []Components with the top Model that captures signed policy data. // The signed data is a part of the policy since 8.8.0 release and contains the signed policy fragments and the signature that can be validated. @@ -264,6 +283,7 @@ func (r *RuntimeSpecs) ToComponents( monitoringInjector GenerateMonitoringCfgFn, ll logp.Level, headers HeadersProvider, + currentServiceCompInts map[string]uint64, ) ([]Component, error) { components, err := r.PolicyToComponents(policy, ll, headers) if err != nil { @@ -275,11 +295,9 @@ func (r *RuntimeSpecs) ToComponents( // binary name binaryMapping := make(map[string]string) for _, component := range components { - if spec := component.InputSpec; spec != nil { - binaryMapping[component.ID] = spec.BinaryName - } + binaryMapping[component.ID] = component.BinaryName() } - monitoringCfg, err := monitoringInjector(policy, components, binaryMapping) + monitoringCfg, err := monitoringInjector(policy, components, binaryMapping, currentServiceCompInts) if err != nil { return nil, fmt.Errorf("failed to inject monitoring: %w", err) } @@ -333,18 +351,13 @@ func unitForShipperOutput(output outputI, id string, shipperType string) Unit { } } -// Collect all inputs of the given type going to the given output and return -// the resulting Component. The returned Component may have no units if no -// active inputs were found. -func (r *RuntimeSpecs) componentForInputType( - inputType string, +// createShipperReference creates a ShipperReference for the given output and input spec. +func (r *RuntimeSpecs) createShipperReference( output outputI, - featureFlags *features.Flags, - componentConfig *ComponentConfig, -) Component { - componentID := fmt.Sprintf("%s-%s", inputType, output.name) - - inputSpec, componentErr := r.GetInput(inputType) + inputSpec InputRuntimeSpec, + componentID string, + componentErr error, +) (*ShipperReference, error) { var shipperRef *ShipperReference if componentErr == nil { if output.shipperEnabled { @@ -375,40 +388,113 @@ func (r *RuntimeSpecs) componentForInputType( } } } + // If there's an error at this point we still proceed with assembling the // policy into a component, we just attach the error to its Err field to // indicate that it can't be run. + return shipperRef, componentErr +} - var units []Unit - for _, input := range output.inputs[inputType] { - if input.enabled { - unitID := fmt.Sprintf("%s-%s", componentID, input.id) - units = append(units, unitForInput(input, unitID)) +// populateOutputUnitsForInput adds the output units to the given slice. +func populateOutputUnitsForInput( + units *[]Unit, + output outputI, + componentID string, + componentErr error, + shipperRef *ShipperReference, +) { + if shipperRef != nil { + // Shipper units are skipped if componentErr isn't nil, because in that + // case we generally don't have a valid shipper type to base it on. + if componentErr == nil { + *units = append(*units, unitForShipperOutput(output, componentID, shipperRef.ShipperType)) } + } else { + *units = append(*units, unitForOutput(output, componentID)) } - if len(units) > 0 { - if shipperRef != nil { - // Shipper units are skipped if componentErr isn't nil, because in that - // case we generally don't have a valid shipper type to base it on. - if componentErr == nil { - units = append(units, - unitForShipperOutput(output, componentID, shipperRef.ShipperType)) +} + +// Collect all inputs of the given type going to the given output and return +// the resulting Components. The returned Components may have no units if no +// active inputs were found. +func (r *RuntimeSpecs) componentsForInputType( + inputType string, + output outputI, + featureFlags *features.Flags, + componentConfig *ComponentConfig, +) []Component { + var components []Component + inputSpec, componentErr := r.GetInput(inputType) + + // Treat as non isolated units component on error of reading the input spec + if componentErr != nil || !inputSpec.Spec.IsolateUnits { + componentID := fmt.Sprintf("%s-%s", inputType, output.name) + shipperRef, componentErr := r.createShipperReference(output, inputSpec, componentID, componentErr) + + var units []Unit + for _, input := range output.inputs[inputType] { + if input.enabled { + unitID := fmt.Sprintf("%s-%s", componentID, input.id) + units = append(units, unitForInput(input, unitID)) } - } else { - units = append(units, unitForOutput(output, componentID)) + } + + if len(units) > 0 { + // Populate the output units for this component + populateOutputUnitsForInput( + &units, + output, + componentID, + componentErr, + shipperRef, + ) + } + + components = append(components, Component{ + ID: componentID, + Err: componentErr, + InputSpec: &inputSpec, + InputType: inputType, + OutputType: output.outputType, + Units: units, + Features: featureFlags.AsProto(), + Component: componentConfig.AsProto(), + ShipperRef: shipperRef, + }) + } else { + for _, input := range output.inputs[inputType] { + // Units are being mapped to components, so we need a unique ID for each. + componentID := fmt.Sprintf("%s-%s-%s", inputType, output.name, input.id) + shipperRef, componentErr := r.createShipperReference(output, inputSpec, componentID, componentErr) + + var units []Unit + if input.enabled { + unitID := fmt.Sprintf("%s-unit", componentID) + units = append(units, unitForInput(input, unitID)) + // Populate the output units for this component + populateOutputUnitsForInput( + &units, + output, + componentID, + componentErr, + shipperRef, + ) + } + + components = append(components, Component{ + ID: componentID, + Err: componentErr, + InputSpec: &inputSpec, + InputType: inputType, + OutputType: output.outputType, + Units: units, + Features: featureFlags.AsProto(), + Component: componentConfig.AsProto(), + ShipperRef: shipperRef, + }) } } - return Component{ - ID: componentID, - Err: componentErr, - InputSpec: &inputSpec, - InputType: inputType, - OutputType: output.outputType, - Units: units, - Features: featureFlags.AsProto(), - Component: componentConfig.AsProto(), - ShipperRef: shipperRef, - } + return components } func (r *RuntimeSpecs) componentsForOutput(output outputI, featureFlags *features.Flags, componentConfig *ComponentConfig) []Component { @@ -416,17 +502,19 @@ func (r *RuntimeSpecs) componentsForOutput(output outputI, featureFlags *feature shipperTypes := make(map[string]bool) for inputType := range output.inputs { // No need for error checking at this stage -- we are guaranteed - // to get a Component back. If there is an error that prevents it + // to get a Component/s back. If there is an error that prevents it/them // from running then it will be in the Component's Err field and - // we will report it later. The only thing we skip is a component + // we will report it later. The only thing we skip is a component/s // with no units. - component := r.componentForInputType(inputType, output, featureFlags, componentConfig) - if len(component.Units) > 0 { - if component.ShipperRef != nil { - // If this component uses a shipper, mark that shipper type as active - shipperTypes[component.ShipperRef.ShipperType] = true + typeComponents := r.componentsForInputType(inputType, output, featureFlags, componentConfig) + for _, component := range typeComponents { + if len(component.Units) > 0 { + if component.ShipperRef != nil { + // If this component uses a shipper, mark that shipper type as active + shipperTypes[component.ShipperRef.ShipperType] = true + } + components = append(components, component) } - components = append(components, component) } } @@ -858,10 +946,6 @@ type outputI struct { // input specification runtime checks. This function should always be // edited in sync with the documentation in specs/README.md. func varsForPlatform(platform PlatformDetail) (*transpiler.Vars, error) { - hasRoot, err := utils.HasRoot() - if err != nil { - return nil, err - } return transpiler.NewVars("", map[string]interface{}{ "install": map[string]interface{}{ "in_default": paths.ArePathsEqual(paths.Top(), paths.InstallPath(paths.DefaultBasePath)) || pkgmgr.InstalledViaExternalPkgMgr(), @@ -876,7 +960,7 @@ func varsForPlatform(platform PlatformDetail) (*transpiler.Vars, error) { "minor": platform.Minor, }, "user": map[string]interface{}{ - "root": hasRoot, + "root": platform.User.Root, }, }, nil) } diff --git a/pkg/component/component_test.go b/pkg/component/component_test.go index 368145e3909..a1032da799a 100644 --- a/pkg/component/component_test.go +++ b/pkg/component/component_test.go @@ -234,6 +234,27 @@ func TestToComponents(t *testing.T) { }, Err: `invalid 'inputs.1.id', has a duplicate id "filestream". Please add a unique value for the 'id' key to each input in the agent policy`, }, + { + Name: "Invalid: inputs entry duplicate because of missing id (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + }, + map[string]interface{}{ + "type": "cloudbeat", + }, + }, + }, + Err: `invalid 'inputs.1.id', has a duplicate id "cloudbeat". Please add a unique value for the 'id' key to each input in the agent policy`, + }, { Name: "Invalid: inputs entry id not a string", Platform: linuxAMD64Platform, @@ -253,6 +274,25 @@ func TestToComponents(t *testing.T) { }, Err: "invalid 'inputs.0.id', expected a string not a int", }, + { + Name: "Invalid: inputs entry id not a string (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": 0, + }, + }, + }, + Err: "invalid 'inputs.0.id', expected a string not a int", + }, { Name: "Invalid: inputs entry use_output not a string", Platform: linuxAMD64Platform, @@ -273,6 +313,26 @@ func TestToComponents(t *testing.T) { }, Err: "invalid 'inputs.0.use_output', expected a string not a int", }, + { + Name: "Invalid: inputs entry use_output not a string (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "use_output": 0, + }, + }, + }, + Err: "invalid 'inputs.0.use_output', expected a string not a int", + }, { Name: "Invalid: inputs entry use_output references unknown output", Platform: linuxAMD64Platform, @@ -293,6 +353,26 @@ func TestToComponents(t *testing.T) { }, Err: "invalid 'inputs.0.use_output', references an unknown output 'other'", }, + { + Name: "Invalid: inputs entry use_output references unknown output (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "use_output": "other", + }, + }, + }, + Err: "invalid 'inputs.0.use_output', references an unknown output 'other'", + }, { Name: "Invalid: inputs entry enabled not a bool", Platform: linuxAMD64Platform, @@ -314,6 +394,27 @@ func TestToComponents(t *testing.T) { }, Err: "invalid 'inputs.0.enabled', expected a bool not a string", }, + { + Name: "Invalid: inputs entry enabled not a bool (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "use_output": "default", + "enabled": "false", + }, + }, + }, + Err: "invalid 'inputs.0.enabled', expected a bool not a string", + }, { Name: "Invalid: inputs unknown type", Platform: linuxAMD64Platform, @@ -420,8 +521,8 @@ func TestToComponents(t *testing.T) { GOOS: Linux, }, Family: "redhat", - Major: "7", - Minor: "2", + Major: 7, + Minor: 2, }, Policy: map[string]interface{}{ "outputs": map[string]interface{}{ @@ -444,8 +545,12 @@ func TestToComponents(t *testing.T) { InputType: "endpoint", OutputType: "elasticsearch", ID: "endpoint-default", - InputSpec: &InputRuntimeSpec{}, - Err: NewErrInputRuntimeCheckFail("Elastic Defend doesn't support RHEL7 on arm64"), + InputSpec: &InputRuntimeSpec{ + InputType: "endpoint", + BinaryName: "endpoint-security", + BinaryPath: filepath.Join("..", "..", "specs", "endpoint-security"), + }, + Err: NewErrInputRuntimeCheckFail("Elastic Defend doesn't support RHEL7 on arm64"), Units: []Unit{ { ID: "endpoint-default", @@ -505,8 +610,8 @@ func TestToComponents(t *testing.T) { ID: "filestream-default", InputSpec: &InputRuntimeSpec{ InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -536,6 +641,94 @@ func TestToComponents(t *testing.T) { }, }, }, + { + Name: "Invalid: single input failed to decode into config (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "use_output": "default", + "enabled": true, + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-1", + "use_output": "default", + "enabled": true, + "meta": []interface{}{ + map[string]interface{}{ + "bad": "should not have been array of dicts", + }, + }, + }, + }, + }, + Result: []Component{ + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + ID: "cloudbeat-default-cloudbeat-0", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-0", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-0-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + }), + }, + }, + }, + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + ID: "cloudbeat-default-cloudbeat-1", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-1", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-1-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Err: errors.New("1 decoding error(s): 'meta' expected a map, got 'slice'"), + }, + }, + }, + }, + }, { Name: "Output disabled", Platform: linuxAMD64Platform, @@ -555,6 +748,25 @@ func TestToComponents(t *testing.T) { }, }, }, + { + Name: "Output disabled (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": false, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "enabled": true, + }, + }, + }, + }, { Name: "Input disabled", Platform: linuxAMD64Platform, @@ -574,6 +786,30 @@ func TestToComponents(t *testing.T) { }, }, }, + { + Name: "Input disabled (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-1", + "enabled": false, + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-2", + "enabled": false, + }, + }, + }, + }, { Name: "Simple representation", Platform: linuxAMD64Platform, @@ -603,8 +839,8 @@ func TestToComponents(t *testing.T) { OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -629,9 +865,8 @@ func TestToComponents(t *testing.T) { }, }, { - Name: "Debug log level", + Name: "Simple representation (isolated units)", Platform: linuxAMD64Platform, - LogLevel: logp.DebugLevel, Policy: map[string]interface{}{ "outputs": map[string]interface{}{ "default": map[string]interface{}{ @@ -641,42 +876,42 @@ func TestToComponents(t *testing.T) { }, "inputs": []interface{}{ map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", + "type": "cloudbeat", + "id": "cloudbeat-0", "enabled": true, }, map[string]interface{}{ - "type": "filestream", - "id": "filestream-1", + "type": "cloudbeat", + "id": "cloudbeat-1", "enabled": false, }, }, }, Result: []Component{ { - InputType: "filestream", + InputType: "cloudbeat", OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ - InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, Units: []Unit{ { - ID: "filestream-default", + ID: "cloudbeat-default-cloudbeat-0", Type: client.UnitTypeOutput, - LogLevel: client.UnitLogLevelDebug, + LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ "type": "elasticsearch", }), }, { - ID: "filestream-default-filestream-0", + ID: "cloudbeat-default-cloudbeat-0-unit", Type: client.UnitTypeInput, - LogLevel: client.UnitLogLevelDebug, + LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", + "type": "cloudbeat", + "id": "cloudbeat-0", }), }, }, @@ -684,9 +919,9 @@ func TestToComponents(t *testing.T) { }, }, { - Name: "Unique log level", + Name: "Debug log level", Platform: linuxAMD64Platform, - LogLevel: logp.ErrorLevel, + LogLevel: logp.DebugLevel, Policy: map[string]interface{}{ "outputs": map[string]interface{}{ "default": map[string]interface{}{ @@ -696,10 +931,9 @@ func TestToComponents(t *testing.T) { }, "inputs": []interface{}{ map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", - "enabled": true, - "log_level": "debug", + "type": "filestream", + "id": "filestream-0", + "enabled": true, }, map[string]interface{}{ "type": "filestream", @@ -714,14 +948,14 @@ func TestToComponents(t *testing.T) { OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { ID: "filestream-default", Type: client.UnitTypeOutput, - LogLevel: client.UnitLogLevelError, + LogLevel: client.UnitLogLevelDebug, Config: MustExpectedConfig(map[string]interface{}{ "type": "elasticsearch", }), @@ -740,45 +974,212 @@ func TestToComponents(t *testing.T) { }, }, { - Name: "Complex representation", + Name: "Debug log level (isolated units)", Platform: linuxAMD64Platform, + LogLevel: logp.DebugLevel, Policy: map[string]interface{}{ "outputs": map[string]interface{}{ "default": map[string]interface{}{ - "type": "elasticsearch", - }, - "other": map[string]interface{}{ - "type": "elasticsearch", - }, - "stashit": map[string]interface{}{ - "type": "logstash", - }, - "redis": map[string]interface{}{ - "type": "redis", + "type": "elasticsearch", + "enabled": true, }, }, "inputs": []interface{}{ map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", - }, - map[string]interface{}{ - "type": "filestream", - "id": "filestream-1", + "type": "cloudbeat", + "id": "cloudbeat-0", + "enabled": true, }, map[string]interface{}{ - "type": "filestream", - "id": "filestream-2", + "type": "cloudbeat", + "id": "cloudbeat-1", "enabled": false, }, - map[string]interface{}{ - "type": "filestream", - "id": "filestream-3", - "use_output": "other", + }, + }, + Result: []Component{ + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, - map[string]interface{}{ - "type": "filestream", - "id": "filestream-4", + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-0", + Type: client.UnitTypeOutput, + LogLevel: client.UnitLogLevelDebug, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-0-unit", + Type: client.UnitTypeInput, + LogLevel: client.UnitLogLevelDebug, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + }), + }, + }, + }, + }, + }, + { + Name: "Unique log level", + Platform: linuxAMD64Platform, + LogLevel: logp.ErrorLevel, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "filestream", + "id": "filestream-0", + "enabled": true, + "log_level": "debug", + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-1", + "enabled": false, + }, + }, + }, + Result: []Component{ + { + InputType: "filestream", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "filestream", + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), + }, + Units: []Unit{ + { + ID: "filestream-default", + Type: client.UnitTypeOutput, + LogLevel: client.UnitLogLevelError, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "filestream-default-filestream-0", + Type: client.UnitTypeInput, + LogLevel: client.UnitLogLevelDebug, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "filestream", + "id": "filestream-0", + }), + }, + }, + }, + }, + }, + { + Name: "Unique log level (isolated units)", + Platform: linuxAMD64Platform, + LogLevel: logp.ErrorLevel, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "enabled": true, + "log_level": "debug", + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-1", + "enabled": false, + }, + }, + }, + Result: []Component{ + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-0", + Type: client.UnitTypeOutput, + LogLevel: client.UnitLogLevelError, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-0-unit", + Type: client.UnitTypeInput, + LogLevel: client.UnitLogLevelDebug, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + }), + }, + }, + }, + }, + }, + { + Name: "Complex representation", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + }, + "other": map[string]interface{}{ + "type": "elasticsearch", + }, + "stashit": map[string]interface{}{ + "type": "logstash", + }, + "redis": map[string]interface{}{ + "type": "redis", + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "filestream", + "id": "filestream-0", + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-1", + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-2", + "enabled": false, + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-3", + "use_output": "other", + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-4", "use_output": "other", }, map[string]interface{}{ @@ -818,8 +1219,8 @@ func TestToComponents(t *testing.T) { OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -855,8 +1256,8 @@ func TestToComponents(t *testing.T) { OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -892,8 +1293,8 @@ func TestToComponents(t *testing.T) { OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ InputType: "log", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -915,7 +1316,6 @@ func TestToComponents(t *testing.T) { }, { ID: "log-default-logfile-1", - Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ "type": "log", @@ -929,8 +1329,8 @@ func TestToComponents(t *testing.T) { OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ InputType: "log", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -957,8 +1357,8 @@ func TestToComponents(t *testing.T) { OutputType: "logstash", InputSpec: &InputRuntimeSpec{ InputType: "log", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -985,8 +1385,8 @@ func TestToComponents(t *testing.T) { OutputType: "redis", InputSpec: &InputRuntimeSpec{ InputType: "log", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -1039,77 +1439,118 @@ func TestToComponents(t *testing.T) { }, }, { - Name: "Simple w/ shipper", + Name: "Complex representation (isolated units)", Platform: linuxAMD64Platform, Policy: map[string]interface{}{ "outputs": map[string]interface{}{ "default": map[string]interface{}{ - "type": "elasticsearch", - "enabled": true, - "shipper": map[string]interface{}{ - "enabled": true, - }, + "type": "elasticsearch", + }, + "other": map[string]interface{}{ + "type": "elasticsearch", + }, + "stashit": map[string]interface{}{ + "type": "logstash", + }, + "redis": map[string]interface{}{ + "type": "redis", }, }, "inputs": []interface{}{ map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", - "enabled": true, + "type": "cloudbeat", + "id": "cloudbeat-0", }, map[string]interface{}{ - "type": "filestream", - "id": "filestream-1", + "type": "cloudbeat", + "id": "cloudbeat-1", + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-2", "enabled": false, }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-3", + "use_output": "other", + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-4", + "use_output": "other", + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-5", + "use_output": "default", + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-6", + "use_output": "default", + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-7", + "use_output": "other", + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-8", + "use_output": "stashit", + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-9", + "use_output": "redis", + }, + map[string]interface{}{ + "type": "apm", + "id": "apm-server-0", + }, }, }, Result: []Component{ { - ID: "filestream-default", - InputType: "filestream", + InputType: "cloudbeat", OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ - InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, Units: []Unit{ { - ID: "filestream-default", + ID: "cloudbeat-default-cloudbeat-0", Type: client.UnitTypeOutput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "type": "shipper", + "type": "elasticsearch", }), }, { - ID: "filestream-default-filestream-0", + ID: "cloudbeat-default-cloudbeat-0-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", + "type": "cloudbeat", + "id": "cloudbeat-0", }), }, }, - ShipperRef: &ShipperReference{ - ShipperType: "shipper", - ComponentID: "shipper-default", - UnitID: "filestream-default", - }, }, { - ID: "shipper-default", + InputType: "cloudbeat", OutputType: "elasticsearch", - ShipperSpec: &ShipperRuntimeSpec{ - ShipperType: "shipper", - BinaryName: "shipper", - BinaryPath: filepath.Join("..", "..", "specs", "shipper"), + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, Units: []Unit{ { - ID: "shipper-default", + ID: "cloudbeat-default-cloudbeat-1", Type: client.UnitTypeOutput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ @@ -1117,42 +1558,938 @@ func TestToComponents(t *testing.T) { }), }, { - ID: "filestream-default", + ID: "cloudbeat-default-cloudbeat-1-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "id": "filestream-default", - "type": "shipper", - "units": []interface{}{ - map[string]interface{}{ - "id": "filestream-default-filestream-0", - "config": map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", - }, - }, - }, + "type": "cloudbeat", + "id": "cloudbeat-1", }), }, }, }, - }, - }, - { - Name: "Complex w/ shipper", - Platform: linuxAMD64Platform, - Policy: map[string]interface{}{ - "outputs": map[string]interface{}{ - "default": map[string]interface{}{ - "type": "elasticsearch", - "shipper": map[string]interface{}{ - "enabled": true, - }, + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, - "other": map[string]interface{}{ - "type": "elasticsearch", - "shipper": map[string]interface{}{ - "enabled": false, + Units: []Unit{ + { + ID: "cloudbeat-other-cloudbeat-3", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-other-cloudbeat-3-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-3", + }), + }, + }, + }, + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-other-cloudbeat-4", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-other-cloudbeat-4-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-4", + }), + }, + }, + }, + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-5", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-5-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: mustExpectedConfigForceType(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-5", + }, "cloudbeat"), + }, + }, + }, + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-6", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-6-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-6", + }), + }, + }, + }, + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-other-cloudbeat-7", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-other-cloudbeat-7-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: mustExpectedConfigForceType(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-7", + }, "cloudbeat"), + }, + }, + }, + { + InputType: "cloudbeat", + OutputType: "logstash", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-stashit-cloudbeat-8", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "logstash", + }), + }, + { + ID: "cloudbeat-stashit-cloudbeat-8-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: mustExpectedConfigForceType(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-8", + }, "cloudbeat"), + }, + }, + }, + { + InputType: "cloudbeat", + OutputType: "redis", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-redis-cloudbeat-9", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "redis", + }), + }, + { + ID: "cloudbeat-redis-cloudbeat-9-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: mustExpectedConfigForceType(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-9", + }, "cloudbeat"), + }, + }, + }, + { + InputType: "apm", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "apm", + BinaryName: "apm-server", + BinaryPath: filepath.Join("..", "..", "specs", "apm-server"), + }, + Units: []Unit{ + { + ID: "apm-default", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "apm-default-apm-server-0", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "apm", + "id": "apm-server-0", + }), + }, + }, + }, + }, + }, + { + Name: "Simple w/ shipper", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + "shipper": map[string]interface{}{ + "enabled": true, + }, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "filestream", + "id": "filestream-0", + "enabled": true, + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-1", + "enabled": false, + }, + }, + }, + Result: []Component{ + { + ID: "filestream-default", + InputType: "filestream", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "filestream", + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), + }, + Units: []Unit{ + { + ID: "filestream-default", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "shipper", + }), + }, + { + ID: "filestream-default-filestream-0", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "filestream", + "id": "filestream-0", + }), + }, + }, + ShipperRef: &ShipperReference{ + ShipperType: "shipper", + ComponentID: "shipper-default", + UnitID: "filestream-default", + }, + }, + { + ID: "shipper-default", + OutputType: "elasticsearch", + ShipperSpec: &ShipperRuntimeSpec{ + ShipperType: "shipper", + BinaryName: "shipper", + BinaryPath: filepath.Join("..", "..", "specs", "shipper"), + }, + Units: []Unit{ + { + ID: "shipper-default", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "filestream-default", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "id": "filestream-default", + "type": "shipper", + "units": []interface{}{ + map[string]interface{}{ + "id": "filestream-default-filestream-0", + "config": map[string]interface{}{ + "type": "filestream", + "id": "filestream-0", + }, + }, + }, + }), + }, + }, + }, + }, + }, + { + Name: "Simple w/ shipper (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + "shipper": map[string]interface{}{ + "enabled": true, + }, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "enabled": true, + }, + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-1", + "enabled": false, + }, + }, + }, + Result: []Component{ + { + ID: "cloudbeat-default", + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-0", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "shipper", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-0-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + }), + }, + }, + ShipperRef: &ShipperReference{ + ShipperType: "shipper", + ComponentID: "shipper-default", + UnitID: "cloudbeat-default-cloudbeat-0", + }, + }, + { + ID: "shipper-default", + OutputType: "elasticsearch", + ShipperSpec: &ShipperRuntimeSpec{ + ShipperType: "shipper", + BinaryName: "shipper", + BinaryPath: filepath.Join("..", "..", "specs", "shipper"), + }, + Units: []Unit{ + { + ID: "shipper-default", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-0", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "id": "cloudbeat-default-cloudbeat-0", + "type": "shipper", + "units": []interface{}{ + map[string]interface{}{ + "id": "cloudbeat-default-cloudbeat-0-unit", + "config": map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + }, + }, + }, + }), + }, + }, + }, + }, + }, + { + Name: "Complex w/ shipper", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "shipper": map[string]interface{}{ + "enabled": true, + }, + }, + "other": map[string]interface{}{ + "type": "elasticsearch", + "shipper": map[string]interface{}{ + "enabled": false, + }, + }, + "stashit": map[string]interface{}{ + "type": "logstash", + "shipper": map[string]interface{}{ + "enabled": true, + }, + }, + "redis": map[string]interface{}{ + "type": "redis", + "shipper": map[string]interface{}{ + "enabled": true, + }, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "filestream", + "id": "filestream-0", + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-1", + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-2", + "enabled": false, + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-3", + "use_output": "other", + }, + map[string]interface{}{ + "type": "filestream", + "id": "filestream-4", + "use_output": "other", + }, + map[string]interface{}{ + "type": "logfile", + "id": "logfile-0", + "use_output": "default", + }, + map[string]interface{}{ + "type": "log", + "id": "logfile-1", + "use_output": "default", + }, + map[string]interface{}{ + "type": "logfile", + "id": "logfile-2", + "use_output": "other", + }, + map[string]interface{}{ + "type": "logfile", + "id": "logfile-3", + "use_output": "stashit", + }, + map[string]interface{}{ + "type": "logfile", + "id": "logfile-4", + "use_output": "redis", + }, + map[string]interface{}{ + "type": "apm", + "id": "apm-server-0", + }, + }, + }, + Result: []Component{ + { + ID: "filestream-default", + InputType: "filestream", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "filestream", + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), + }, + Units: []Unit{ + { + ID: "filestream-default", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "shipper", + }), + }, + { + ID: "filestream-default-filestream-0", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "filestream", + "id": "filestream-0", + }), + }, + { + ID: "filestream-default-filestream-1", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "filestream", + "id": "filestream-1", + }), + }, + }, + ShipperRef: &ShipperReference{ + ShipperType: "shipper", + ComponentID: "shipper-default", + UnitID: "filestream-default", + }, + }, + { + ID: "filestream-other", + InputType: "filestream", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "filestream", + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), + }, + Units: []Unit{ + { + ID: "filestream-other", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "filestream-other-filestream-3", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "filestream", + "id": "filestream-3", + }), + }, + { + ID: "filestream-other-filestream-4", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "filestream", + "id": "filestream-4", + }), + }, + }, + }, + { + ID: "log-default", + InputType: "log", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "log", + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), + }, + Units: []Unit{ + { + ID: "log-default", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "shipper", + }), + }, + { + ID: "log-default-logfile-0", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: mustExpectedConfigForceType(map[string]interface{}{ + "type": "log", + "id": "logfile-0", + }, "log"), + }, + { + ID: "log-default-logfile-1", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "log", + "id": "logfile-1", + }), + }, + }, + ShipperRef: &ShipperReference{ + ShipperType: "shipper", + ComponentID: "shipper-default", + UnitID: "log-default", + }, + }, + { + ID: "shipper-default", + OutputType: "elasticsearch", + ShipperSpec: &ShipperRuntimeSpec{ + ShipperType: "shipper", + BinaryName: "shipper", + BinaryPath: filepath.Join("..", "..", "specs", "shipper"), + }, + Units: []Unit{ + { + ID: "filestream-default", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "id": "filestream-default", + "type": "shipper", + "units": []interface{}{ + map[string]interface{}{ + "id": "filestream-default-filestream-0", + "config": map[string]interface{}{ + "type": "filestream", + "id": "filestream-0", + }, + }, + map[string]interface{}{ + "id": "filestream-default-filestream-1", + "config": map[string]interface{}{ + "type": "filestream", + "id": "filestream-1", + }, + }, + }, + }), + }, + { + ID: "log-default", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "id": "log-default", + "type": "shipper", + "units": []interface{}{ + map[string]interface{}{ + "id": "log-default-logfile-0", + "config": map[string]interface{}{ + "type": "log", + "id": "logfile-0", + }, + }, + map[string]interface{}{ + "id": "log-default-logfile-1", + "config": map[string]interface{}{ + "type": "log", + "id": "logfile-1", + }, + }, + }, + }), + }, + { + ID: "shipper-default", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + }, + }, + { + ID: "log-other", + InputType: "log", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "log", + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), + }, + Units: []Unit{ + { + ID: "log-other", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "log-other-logfile-2", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: mustExpectedConfigForceType(map[string]interface{}{ + "type": "log", + "id": "logfile-2", + }, "log"), + }, + }, + }, + { + ID: "log-stashit", + InputType: "log", + OutputType: "logstash", + InputSpec: &InputRuntimeSpec{ + InputType: "log", + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), + }, + Units: []Unit{ + { + ID: "log-stashit", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "shipper", + }), + }, + { + ID: "log-stashit-logfile-3", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: mustExpectedConfigForceType(map[string]interface{}{ + "type": "log", + "id": "logfile-3", + }, "log"), + }, + }, + ShipperRef: &ShipperReference{ + ShipperType: "shipper", + ComponentID: "shipper-stashit", + UnitID: "log-stashit", + }, + }, + { + ID: "shipper-stashit", + OutputType: "logstash", + ShipperSpec: &ShipperRuntimeSpec{ + ShipperType: "shipper", + BinaryName: "shipper", + BinaryPath: filepath.Join("..", "..", "specs", "shipper"), + }, + Units: []Unit{ + { + ID: "log-stashit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "id": "log-stashit", + "type": "shipper", + "units": []interface{}{ + map[string]interface{}{ + "id": "log-stashit-logfile-3", + "config": map[string]interface{}{ + "type": "log", + "id": "logfile-3", + }, + }, + }, + }), + }, + { + ID: "shipper-stashit", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "logstash", + }), + }, + }, + }, + { + ID: "log-redis", + InputType: "log", + OutputType: "redis", + InputSpec: &InputRuntimeSpec{ + InputType: "log", + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), + }, + Units: []Unit{ + { + ID: "log-redis", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "shipper", + }), + }, + { + ID: "log-redis-logfile-4", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: mustExpectedConfigForceType(map[string]interface{}{ + "type": "log", + "id": "logfile-4", + }, "log"), + }, + }, + ShipperRef: &ShipperReference{ + ShipperType: "shipper", + ComponentID: "shipper-redis", + UnitID: "log-redis", + }, + }, + { + ID: "shipper-redis", + OutputType: "redis", + ShipperSpec: &ShipperRuntimeSpec{ + ShipperType: "shipper", + BinaryName: "shipper", + BinaryPath: filepath.Join("..", "..", "specs", "shipper"), + }, + Units: []Unit{ + { + ID: "log-redis", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "id": "log-redis", + "type": "shipper", + "units": []interface{}{ + map[string]interface{}{ + "id": "log-redis-logfile-4", + "config": map[string]interface{}{ + "type": "log", + "id": "logfile-4", + }, + }, + }, + }), + }, + { + ID: "shipper-redis", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "redis", + }), + }, + }, + }, + { + ID: "apm-default", + InputType: "apm", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "apm", + BinaryName: "apm-server", + BinaryPath: filepath.Join("..", "..", "specs", "apm-server"), + }, + Units: []Unit{ + { + ID: "apm-default", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + }), + }, + { + ID: "apm-default-apm-server-0", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "apm", + "id": "apm-server-0", + }), + }, + }, + }, + }, + }, + { + Name: "Complex w/ shipper (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "shipper": map[string]interface{}{ + "enabled": true, + }, + }, + "other": map[string]interface{}{ + "type": "elasticsearch", + "shipper": map[string]interface{}{ + "enabled": false, }, }, "stashit": map[string]interface{}{ @@ -1170,51 +2507,51 @@ func TestToComponents(t *testing.T) { }, "inputs": []interface{}{ map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", + "type": "cloudbeat", + "id": "cloudbeat-0", }, map[string]interface{}{ - "type": "filestream", - "id": "filestream-1", + "type": "cloudbeat", + "id": "cloudbeat-1", }, map[string]interface{}{ - "type": "filestream", - "id": "filestream-2", + "type": "cloudbeat", + "id": "cloudbeat-2", "enabled": false, }, map[string]interface{}{ - "type": "filestream", - "id": "filestream-3", + "type": "cloudbeat", + "id": "cloudbeat-3", "use_output": "other", }, map[string]interface{}{ - "type": "filestream", - "id": "filestream-4", + "type": "cloudbeat", + "id": "cloudbeat-4", "use_output": "other", }, map[string]interface{}{ - "type": "logfile", - "id": "logfile-0", + "type": "cloudbeat", + "id": "cloudbeat-5", "use_output": "default", }, map[string]interface{}{ - "type": "log", - "id": "logfile-1", + "type": "cloudbeat", + "id": "cloudbeat-6", "use_output": "default", }, map[string]interface{}{ - "type": "logfile", - "id": "logfile-2", + "type": "cloudbeat", + "id": "cloudbeat-7", "use_output": "other", }, map[string]interface{}{ - "type": "logfile", - "id": "logfile-3", + "type": "cloudbeat", + "id": "cloudbeat-8", "use_output": "stashit", }, map[string]interface{}{ - "type": "logfile", - "id": "logfile-4", + "type": "cloudbeat", + "id": "cloudbeat-9", "use_output": "redis", }, map[string]interface{}{ @@ -1225,17 +2562,17 @@ func TestToComponents(t *testing.T) { }, Result: []Component{ { - ID: "filestream-default", - InputType: "filestream", + ID: "cloudbeat-default-cloudbeat-0", + InputType: "cloudbeat", OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ - InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, Units: []Unit{ { - ID: "filestream-default", + ID: "cloudbeat-default-cloudbeat-0", Type: client.UnitTypeOutput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ @@ -1243,42 +2580,67 @@ func TestToComponents(t *testing.T) { }), }, { - ID: "filestream-default-filestream-0", + ID: "cloudbeat-default-cloudbeat-0-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", + "type": "cloudbeat", + "id": "cloudbeat-0", + }), + }, + }, + ShipperRef: &ShipperReference{ + ShipperType: "shipper", + ComponentID: "shipper-default", + UnitID: "cloudbeat-default-cloudbeat-0", + }, + }, + { + ID: "cloudbeat-default-cloudbeat-1", + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-1", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "shipper", }), }, { - ID: "filestream-default-filestream-1", + ID: "cloudbeat-default-cloudbeat-1-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "type": "filestream", - "id": "filestream-1", + "type": "cloudbeat", + "id": "cloudbeat-1", }), }, }, ShipperRef: &ShipperReference{ ShipperType: "shipper", ComponentID: "shipper-default", - UnitID: "filestream-default", + UnitID: "cloudbeat-default-cloudbeat-1", }, }, { - ID: "filestream-other", - InputType: "filestream", + ID: "cloudbeat-other-cloudbeat-3", + InputType: "cloudbeat", OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ - InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, Units: []Unit{ { - ID: "filestream-other", + ID: "cloudbeat-other-cloudbeat-3", Type: client.UnitTypeOutput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ @@ -1286,37 +2648,57 @@ func TestToComponents(t *testing.T) { }), }, { - ID: "filestream-other-filestream-3", + ID: "cloudbeat-other-cloudbeat-3-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "type": "filestream", - "id": "filestream-3", + "type": "cloudbeat", + "id": "cloudbeat-3", + }), + }, + }, + }, + { + ID: "cloudbeat-other-cloudbeat-4", + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-other-cloudbeat-4", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", }), }, { - ID: "filestream-other-filestream-4", + ID: "cloudbeat-other-cloudbeat-4-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "type": "filestream", - "id": "filestream-4", + "type": "cloudbeat", + "id": "cloudbeat-4", }), }, }, }, { - ID: "log-default", - InputType: "log", + ID: "cloudbeat-default-cloudbeat-5", + InputType: "cloudbeat", OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ - InputType: "log", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, Units: []Unit{ { - ID: "log-default", + ID: "cloudbeat-default-cloudbeat-5", Type: client.UnitTypeOutput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ @@ -1324,28 +2706,53 @@ func TestToComponents(t *testing.T) { }), }, { - ID: "log-default-logfile-0", + ID: "cloudbeat-default-cloudbeat-5-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: mustExpectedConfigForceType(map[string]interface{}{ - "type": "log", - "id": "logfile-0", - }, "log"), + "type": "cloudbeat", + "id": "cloudbeat-5", + }, "cloudbeat"), }, + }, + ShipperRef: &ShipperReference{ + ShipperType: "shipper", + ComponentID: "shipper-default", + UnitID: "cloudbeat-default-cloudbeat-5", + }, + }, + { + ID: "cloudbeat-default-cloudbeat-6", + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ { - ID: "log-default-logfile-1", - Type: client.UnitTypeInput, + ID: "cloudbeat-default-cloudbeat-6", + Type: client.UnitTypeOutput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "type": "log", - "id": "logfile-1", + "type": "shipper", }), }, + { + ID: "cloudbeat-default-cloudbeat-6-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: mustExpectedConfigForceType(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-6", + }, "cloudbeat"), + }, }, ShipperRef: &ShipperReference{ ShipperType: "shipper", ComponentID: "shipper-default", - UnitID: "log-default", + UnitID: "cloudbeat-default-cloudbeat-6", }, }, { @@ -1358,50 +2765,72 @@ func TestToComponents(t *testing.T) { }, Units: []Unit{ { - ID: "filestream-default", + ID: "cloudbeat-default-cloudbeat-0", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "id": "filestream-default", + "id": "cloudbeat-default-cloudbeat-0", "type": "shipper", "units": []interface{}{ map[string]interface{}{ - "id": "filestream-default-filestream-0", + "id": "cloudbeat-default-cloudbeat-0-unit", "config": map[string]interface{}{ - "type": "filestream", - "id": "filestream-0", + "type": "cloudbeat", + "id": "cloudbeat-0", }, }, + }, + }), + }, + { + ID: "cloudbeat-default-cloudbeat-1", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "id": "cloudbeat-default-cloudbeat-1", + "type": "shipper", + "units": []interface{}{ map[string]interface{}{ - "id": "filestream-default-filestream-1", + "id": "cloudbeat-default-cloudbeat-1-unit", "config": map[string]interface{}{ - "type": "filestream", - "id": "filestream-1", + "type": "cloudbeat", + "id": "cloudbeat-1", }, }, }, }), }, { - ID: "log-default", + ID: "cloudbeat-default-cloudbeat-5", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "id": "log-default", + "id": "cloudbeat-default-cloudbeat-5", "type": "shipper", "units": []interface{}{ map[string]interface{}{ - "id": "log-default-logfile-0", + "id": "cloudbeat-default-cloudbeat-5-unit", "config": map[string]interface{}{ - "type": "log", - "id": "logfile-0", + "type": "cloudbeat", + "id": "cloudbeat-5", }, }, + }, + }), + }, + { + ID: "cloudbeat-default-cloudbeat-6", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "id": "cloudbeat-default-cloudbeat-6", + "type": "shipper", + "units": []interface{}{ map[string]interface{}{ - "id": "log-default-logfile-1", + "id": "cloudbeat-default-cloudbeat-6-unit", "config": map[string]interface{}{ - "type": "log", - "id": "logfile-1", + "type": "cloudbeat", + "id": "cloudbeat-6", }, }, }, @@ -1418,17 +2847,17 @@ func TestToComponents(t *testing.T) { }, }, { - ID: "log-other", - InputType: "log", + ID: "cloudbeat-other-cloudbeat-7", + InputType: "cloudbeat", OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ - InputType: "log", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, Units: []Unit{ { - ID: "log-other", + ID: "cloudbeat-other-cloudbeat-7", Type: client.UnitTypeOutput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ @@ -1436,28 +2865,28 @@ func TestToComponents(t *testing.T) { }), }, { - ID: "log-other-logfile-2", + ID: "cloudbeat-other-cloudbeat-7-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: mustExpectedConfigForceType(map[string]interface{}{ - "type": "log", - "id": "logfile-2", - }, "log"), + "type": "cloudbeat", + "id": "cloudbeat-7", + }, "cloudbeat"), }, }, }, { - ID: "log-stashit", - InputType: "log", + ID: "cloudbeat-stashit-cloudbeat-8", + InputType: "cloudbeat", OutputType: "logstash", InputSpec: &InputRuntimeSpec{ - InputType: "log", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, Units: []Unit{ { - ID: "log-stashit", + ID: "cloudbeat-stashit-cloudbeat-8", Type: client.UnitTypeOutput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ @@ -1465,19 +2894,19 @@ func TestToComponents(t *testing.T) { }), }, { - ID: "log-stashit-logfile-3", + ID: "cloudbeat-stashit-cloudbeat-8-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: mustExpectedConfigForceType(map[string]interface{}{ - "type": "log", - "id": "logfile-3", - }, "log"), + "type": "cloudbeat", + "id": "cloudbeat-8", + }, "cloudbeat"), }, }, ShipperRef: &ShipperReference{ ShipperType: "shipper", ComponentID: "shipper-stashit", - UnitID: "log-stashit", + UnitID: "cloudbeat-stashit-cloudbeat-8", }, }, { @@ -1490,18 +2919,18 @@ func TestToComponents(t *testing.T) { }, Units: []Unit{ { - ID: "log-stashit", + ID: "cloudbeat-stashit-cloudbeat-8", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "id": "log-stashit", + "id": "cloudbeat-stashit-cloudbeat-8", "type": "shipper", "units": []interface{}{ map[string]interface{}{ - "id": "log-stashit-logfile-3", + "id": "cloudbeat-stashit-cloudbeat-8-unit", "config": map[string]interface{}{ - "type": "log", - "id": "logfile-3", + "type": "cloudbeat", + "id": "cloudbeat-8", }, }, }, @@ -1518,17 +2947,17 @@ func TestToComponents(t *testing.T) { }, }, { - ID: "log-redis", - InputType: "log", + ID: "cloudbeat-redis-cloudbeat-9", + InputType: "cloudbeat", OutputType: "redis", InputSpec: &InputRuntimeSpec{ - InputType: "log", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), }, Units: []Unit{ { - ID: "log-redis", + ID: "cloudbeat-redis-cloudbeat-9", Type: client.UnitTypeOutput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ @@ -1536,19 +2965,19 @@ func TestToComponents(t *testing.T) { }), }, { - ID: "log-redis-logfile-4", + ID: "cloudbeat-redis-cloudbeat-9-unit", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: mustExpectedConfigForceType(map[string]interface{}{ - "type": "log", - "id": "logfile-4", - }, "log"), + "type": "cloudbeat", + "id": "cloudbeat-9", + }, "cloudbeat"), }, }, ShipperRef: &ShipperReference{ ShipperType: "shipper", ComponentID: "shipper-redis", - UnitID: "log-redis", + UnitID: "cloudbeat-redis-cloudbeat-9", }, }, { @@ -1561,18 +2990,18 @@ func TestToComponents(t *testing.T) { }, Units: []Unit{ { - ID: "log-redis", + ID: "cloudbeat-redis-cloudbeat-9", Type: client.UnitTypeInput, LogLevel: defaultUnitLogLevel, Config: MustExpectedConfig(map[string]interface{}{ - "id": "log-redis", + "id": "cloudbeat-redis-cloudbeat-9", "type": "shipper", "units": []interface{}{ map[string]interface{}{ - "id": "log-redis-logfile-4", + "id": "cloudbeat-redis-cloudbeat-9-unit", "config": map[string]interface{}{ - "type": "log", - "id": "logfile-4", + "type": "cloudbeat", + "id": "cloudbeat-9", }, }, }, @@ -1648,8 +3077,8 @@ func TestToComponents(t *testing.T) { OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ InputType: "log", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -1706,8 +3135,8 @@ func TestToComponents(t *testing.T) { OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -1737,6 +3166,61 @@ func TestToComponents(t *testing.T) { "header-one": "val-1", }}, }, + { + Name: "Headers injection (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "enabled": true, + }, + }, + }, + Result: []Component{ + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-0", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + "headers": map[string]interface{}{ + "cloud": "beat", + }, + }), + }, + { + ID: "cloudbeat-default-cloudbeat-0-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + }), + }, + }, + }, + }, + headers: &testHeadersProvider{headers: map[string]string{ + "cloud": "beat", + }}, + }, { Name: "Headers injection merge", Platform: linuxAMD64Platform, @@ -1764,8 +3248,8 @@ func TestToComponents(t *testing.T) { OutputType: "elasticsearch", InputSpec: &InputRuntimeSpec{ InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -1796,6 +3280,65 @@ func TestToComponents(t *testing.T) { "header-one": "val-1", }}, }, + { + Name: "Headers injection merge (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "elasticsearch", + "enabled": true, + "headers": map[string]interface{}{ + "cloud1": "beat1", + }, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "enabled": true, + }, + }, + }, + Result: []Component{ + { + InputType: "cloudbeat", + OutputType: "elasticsearch", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-0", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "elasticsearch", + "headers": map[string]interface{}{ + "cloud1": "beat1", + "cloud2": "beat2", + }, + }), + }, + { + ID: "cloudbeat-default-cloudbeat-0-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + }), + }, + }, + }, + }, + headers: &testHeadersProvider{headers: map[string]string{ + "cloud2": "beat2", + }}, + }, { Name: "Headers injection not injecting kafka", Platform: linuxAMD64Platform, @@ -1820,8 +3363,8 @@ func TestToComponents(t *testing.T) { OutputType: "kafka", InputSpec: &InputRuntimeSpec{ InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -1848,6 +3391,58 @@ func TestToComponents(t *testing.T) { "header-one": "val-1", }}, }, + { + Name: "Headers injection not injecting kafka (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "kafka", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "enabled": true, + }, + }, + }, + Result: []Component{ + { + InputType: "cloudbeat", + OutputType: "kafka", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-0", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "kafka", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-0-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + }), + }, + }, + }, + }, + headers: &testHeadersProvider{headers: map[string]string{ + "cloud": "beat", + }}, + }, { Name: "Headers injection not injecting logstash", Platform: linuxAMD64Platform, @@ -1872,8 +3467,8 @@ func TestToComponents(t *testing.T) { OutputType: "logstash", InputSpec: &InputRuntimeSpec{ InputType: "filestream", - BinaryName: "filebeat", - BinaryPath: filepath.Join("..", "..", "specs", "filebeat"), + BinaryName: "testbeat", + BinaryPath: filepath.Join("..", "..", "specs", "testbeat"), }, Units: []Unit{ { @@ -1900,6 +3495,58 @@ func TestToComponents(t *testing.T) { "header-one": "val-1", }}, }, + { + Name: "Headers injection not injecting logstash (isolated units)", + Platform: linuxAMD64Platform, + Policy: map[string]interface{}{ + "outputs": map[string]interface{}{ + "default": map[string]interface{}{ + "type": "logstash", + "enabled": true, + }, + }, + "inputs": []interface{}{ + map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + "enabled": true, + }, + }, + }, + Result: []Component{ + { + InputType: "cloudbeat", + OutputType: "logstash", + InputSpec: &InputRuntimeSpec{ + InputType: "cloudbeat", + BinaryName: "cloudbeat", + BinaryPath: filepath.Join("..", "..", "specs", "cloudbeat"), + }, + Units: []Unit{ + { + ID: "cloudbeat-default-cloudbeat-0", + Type: client.UnitTypeOutput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "logstash", + }), + }, + { + ID: "cloudbeat-default-cloudbeat-0-unit", + Type: client.UnitTypeInput, + LogLevel: defaultUnitLogLevel, + Config: MustExpectedConfig(map[string]interface{}{ + "type": "cloudbeat", + "id": "cloudbeat-0", + }), + }, + }, + }, + }, + headers: &testHeadersProvider{headers: map[string]string{ + "cloud": "beat", + }}, + }, } for _, scenario := range scenarios { @@ -1907,7 +3554,7 @@ func TestToComponents(t *testing.T) { runtime, err := LoadRuntimeSpecs(filepath.Join("..", "..", "specs"), scenario.Platform, SkipBinaryCheck()) require.NoError(t, err) - result, err := runtime.ToComponents(scenario.Policy, nil, scenario.LogLevel, scenario.headers) + result, err := runtime.ToComponents(scenario.Policy, nil, scenario.LogLevel, scenario.headers, map[string]uint64{}) if scenario.Err != "" { assert.Equal(t, scenario.Err, err.Error()) } else { @@ -1985,8 +3632,8 @@ func TestPreventionsAreValid(t *testing.T) { "arch": "arch", "native_arch": "native_arch", "family": "family", - "major": "major", - "minor": "minor", + "major": 1, + "minor": 2, }, "user": map[string]interface{}{ "root": false, @@ -2418,7 +4065,7 @@ func TestFlattenedDataStream(t *testing.T) { t.Fatalf("cannot load runtime specs: %s", err) } - result, err := runtime.ToComponents(policy, nil, logp.DebugLevel, nil) + result, err := runtime.ToComponents(policy, nil, logp.DebugLevel, nil, map[string]uint64{}) if err != nil { t.Fatalf("cannot convert policy to component: %s", err) } @@ -2458,3 +4105,108 @@ func TestFlattenedDataStream(t *testing.T) { t.Errorf("expecting DataStream.Namespace: %q, got: %q", expectedNamespace, dataStream.Namespace) } } + +func TestFlattenedDataStreamIsolatedUnits(t *testing.T) { + id0 := "cloudbeat-0" + id1 := "cloudbeat-1" + expectedNamespace := map[string]string{ + id0: "test-namespace-0", + id1: "test-namespace-1", + } + expectedType := map[string]string{ + id0: "test-type-0", + id1: "test-type-1", + } + expectedDataset := map[string]string{ + id0: "test-dataset-0", + id1: "test-dataset-1", + } + + policy := map[string]any{ + "outputs": map[string]any{ + "default": map[string]any{ + "type": "elasticsearch", + "enabled": true, + }, + }, + "inputs": []any{ + map[string]any{ + "type": "cloudbeat", + "id": id0, + "enabled": true, + "data_stream.type": expectedType[id0], + "data_stream.dataset": expectedDataset[id0], + "data_stream": map[string]any{ + "namespace": expectedNamespace[id0], + }, + }, + map[string]any{ + "type": "cloudbeat", + "id": id1, + "enabled": true, + "data_stream.type": expectedType[id1], + "data_stream.dataset": expectedDataset[id1], + "data_stream": map[string]any{ + "namespace": expectedNamespace[id1], + }, + }, + }, + } + + linuxAMD64Platform := PlatformDetail{ + Platform: Platform{ + OS: Linux, + Arch: AMD64, + GOOS: Linux, + }, + } + + runtime, err := LoadRuntimeSpecs(filepath.Join("..", "..", "specs"), linuxAMD64Platform, SkipBinaryCheck()) + if err != nil { + t.Fatalf("cannot load runtime specs: %s", err) + } + + result, err := runtime.ToComponents(policy, nil, logp.DebugLevel, nil, map[string]uint64{}) + if err != nil { + t.Fatalf("cannot convert policy to component: %s", err) + } + + if len(result) != 2 { + t.Fatalf("expecting result to have one element, got %d", len(result)) + } + + for _, component := range result { + if len(component.Units) != 2 { + t.Fatalf("expecting component.Units to have two elements, got %d", len(component.Units)) + } + + // We do not make assumptions about ordering. + // Get the input Unit + var dataStream *proto.DataStream + for _, unit := range component.Units { + if unit.Err != nil { + t.Fatalf("unit.Err: %s", unit.Err) + } + if unit.Type == client.UnitTypeInput { + dataStream = unit.Config.DataStream + break + } + } + + if dataStream == nil { + t.Fatal("DataStream cannot be nil") + } + + currentId := component.ID[len(component.ID)-len(id0):] + + if dataStream.Dataset != expectedDataset[currentId] { + t.Errorf("expecting DataStream.Dataset: %q, got: %q", expectedDataset[currentId], dataStream.Dataset) + } + if dataStream.Type != expectedType[currentId] { + t.Errorf("expecting DataStream.Type: %q, got: %q", expectedType[currentId], dataStream.Type) + } + if dataStream.Namespace != expectedNamespace[currentId] { + t.Errorf("expecting DataStream.Namespace: %q, got: %q", expectedNamespace[currentId], dataStream.Namespace) + } + } +} diff --git a/pkg/component/fake/component/comp/actions.go b/pkg/component/fake/component/comp/actions.go index 9b4dc74c0b2..8d211653044 100644 --- a/pkg/component/fake/component/comp/actions.go +++ b/pkg/component/fake/component/comp/actions.go @@ -133,7 +133,7 @@ func newRunningUnit(logger zerolog.Logger, manager *StateManager, unit *client.U expected.Config.Type) } switch expected.Config.Type { - case Fake: + case Fake, FakeIsolatedUnits: return newFakeInput(logger, expected.LogLevel, manager, unit, expected.Config) case APM: return newFakeAPMInput(logger, expected.LogLevel, unit) diff --git a/pkg/component/fake/component/comp/component.go b/pkg/component/fake/component/comp/component.go index 837689f912f..dac43114f74 100644 --- a/pkg/component/fake/component/comp/component.go +++ b/pkg/component/fake/component/comp/component.go @@ -27,9 +27,10 @@ import ( ) const ( - Fake = "fake" - fakeShipper = "fake-shipper" - APM = "fake-apm" + Fake = "fake" + FakeIsolatedUnits = "fake-isolated-units" + fakeShipper = "fake-shipper" + APM = "fake-apm" configuringMsg = "Configuring" stoppingMsg = "Stopping" @@ -386,7 +387,7 @@ func (f *fakeInput) Update(u *client.Unit, triggers client.Trigger) error { if expected.Config.Type == "" { return fmt.Errorf("unit missing config type") } - if expected.Config.Type != Fake { + if expected.Config.Type != Fake && expected.Config.Type != FakeIsolatedUnits { return fmt.Errorf("unit type changed with the same unit ID: %s", expected.Config.Type) } diff --git a/pkg/component/fake/shipper/main.go b/pkg/component/fake/shipper/main.go index 5dcd440ecc6..0ee90f9717f 100644 --- a/pkg/component/fake/shipper/main.go +++ b/pkg/component/fake/shipper/main.go @@ -106,14 +106,50 @@ type unitKey struct { unitID string } +type CachedServer struct { + cfg common.FakeShipperConfig + srv *grpc.Server + wg errgroup.Group + ref int +} + +// inc increments the reference count of the server +// it is used to keep the server running as long as there are units using it +// the server is stopped when the reference count reaches 0 +// this is protected by the unitsMx mutex +func (c *CachedServer) incRef() { + c.ref++ +} + +// dec decrements the reference count of the server and stops it if the reference count reaches 0 +// it returns true if the server was stopped and should be removed from the cache or false if the server is still in use +// this is protected by the unitsMx mutex +func (c *CachedServer) decRef() bool { + c.ref-- + if c.ref == 0 { + // safeguard, should not happen + if c.srv != nil { + c.srv.Stop() + // left the previous implementation as is, without the error handling + _ = c.wg.Wait() + } + // remove the server from the cache + return true + } + // server is still in use + return false +} + type stateManager struct { logger zerolog.Logger unitsMx sync.RWMutex units map[unitKey]runningUnit + // Protected from concurrent access by unitsMx mutex + serverCache map[string]*CachedServer } func newStateManager(logger zerolog.Logger) *stateManager { - return &stateManager{logger: logger, units: make(map[unitKey]runningUnit)} + return &stateManager{logger: logger, units: make(map[unitKey]runningUnit), serverCache: make(map[string]*CachedServer)} } func (s *stateManager) added(unit *client.Unit) { @@ -329,8 +365,7 @@ type fakeShipperInput struct { unit *client.Unit cfg *proto.UnitExpectedConfig - srv *grpc.Server - wg errgroup.Group + srv string } func newFakeShipperInput(logger zerolog.Logger, logLevel client.UnitLogLevel, manager *stateManager, unit *client.Unit, cfg *proto.UnitExpectedConfig) (*fakeShipperInput, error) { @@ -348,24 +383,36 @@ func newFakeShipperInput(logger zerolog.Logger, logLevel client.UnitLogLevel, ma return nil, err } - logger.Info().Str("server", srvCfg.Server).Msg("starting GRPC fake shipper server") - lis, err := createListener(srvCfg.Server) - if err != nil { - return nil, err - } - if srvCfg.TLS == nil || srvCfg.TLS.Cert == "" || srvCfg.TLS.Key == "" { - return nil, fmt.Errorf("ssl configuration missing") - } - cert, err := tls.X509KeyPair([]byte(srvCfg.TLS.Cert), []byte(srvCfg.TLS.Key)) - if err != nil { - return nil, err + // This access if protected by the unitsMx + cachedSrv, ok := manager.serverCache[srvCfg.Server] + if ok { + // Assuming that the server is already running and units are using the same TLS configuration + logger.Info().Str("server", srvCfg.Server).Msg("using existing GRPC fake shipper server") + cachedSrv.incRef() + i.srv = srvCfg.Server + } else { + logger.Info().Str("server", srvCfg.Server).Msg("starting GRPC fake shipper server") + lis, err := createListener(srvCfg.Server) + if err != nil { + return nil, err + } + if srvCfg.TLS == nil || srvCfg.TLS.Cert == "" || srvCfg.TLS.Key == "" { + return nil, fmt.Errorf("ssl configuration missing") + } + cert, err := tls.X509KeyPair([]byte(srvCfg.TLS.Cert), []byte(srvCfg.TLS.Key)) + if err != nil { + return nil, err + } + srv := grpc.NewServer(grpc.Creds(credentials.NewServerTLSFromCert(&cert))) + i.srv = srvCfg.Server + common.RegisterFakeEventProtocolServer(srv, i) + cSrv := &CachedServer{cfg: srvCfg, srv: srv, ref: 1} + // Launch the server in a goroutine + cSrv.wg.Go(func() error { + return srv.Serve(lis) + }) + manager.serverCache[srvCfg.Server] = cSrv } - srv := grpc.NewServer(grpc.Creds(credentials.NewServerTLSFromCert(&cert))) - i.srv = srv - common.RegisterFakeEventProtocolServer(srv, i) - i.wg.Go(func() error { - return srv.Serve(lis) - }) logger.Trace().Msg("registering kill action for unit") unit.RegisterAction(&killAction{logger}) @@ -394,10 +441,9 @@ func (f *fakeShipperInput) Update(u *client.Unit) error { _ = u.UpdateState(client.UnitStateStopping, stoppingMsg, nil) go func() { - if f.srv != nil { - f.srv.Stop() - _ = f.wg.Wait() - f.srv = nil + cSrv, ok := f.manager.serverCache[f.srv] + if ok && cSrv.decRef() { + delete(f.manager.serverCache, f.srv) } f.logger.Debug(). Str("state", client.UnitStateStopped.String()). diff --git a/pkg/component/input_spec.go b/pkg/component/input_spec.go index 1f19d53a5de..f5ec8f76250 100644 --- a/pkg/component/input_spec.go +++ b/pkg/component/input_spec.go @@ -21,8 +21,9 @@ type InputSpec struct { Shippers []string `config:"shippers,omitempty" yaml:"shippers,omitempty"` Runtime RuntimeSpec `config:"runtime,omitempty" yaml:"runtime,omitempty"` - Command *CommandSpec `config:"command,omitempty" yaml:"command,omitempty"` - Service *ServiceSpec `config:"service,omitempty" yaml:"service,omitempty"` + Command *CommandSpec `config:"command,omitempty" yaml:"command,omitempty"` + Service *ServiceSpec `config:"service,omitempty" yaml:"service,omitempty"` + IsolateUnits bool `config:"isolate_units,omitempty" yaml:"isolate_units,omitempty"` } // Validate ensures correctness of input specification. diff --git a/pkg/component/load.go b/pkg/component/load.go index 39343842dc5..46fe2e4c59f 100644 --- a/pkg/component/load.go +++ b/pkg/component/load.go @@ -289,10 +289,9 @@ func (r *RuntimeSpecs) GetInput(inputType string) (InputRuntimeSpec, error) { return InputRuntimeSpec{}, ErrInputNotSupportedOnPlatform } err := validateRuntimeChecks(&runtimeSpec.Spec.Runtime, r.platform) - if err != nil { - return InputRuntimeSpec{}, err - } - return runtimeSpec, nil + // runtimeSpec is always returned so the caller know which runtime would have been used + // even if the runtime checks return an error + return runtimeSpec, err } // ShippersForOutputType returns the shippers that support the outputType. diff --git a/pkg/component/load_test.go b/pkg/component/load_test.go index 1bc4bed8915..080eb80fa55 100644 --- a/pkg/component/load_test.go +++ b/pkg/component/load_test.go @@ -45,10 +45,6 @@ func TestLoadSpec_Components(t *testing.T) { Name: "APM Server", Path: "apm-server.spec.yml", }, - { - Name: "Auditbeat", - Path: "auditbeat.spec.yml", - }, { Name: "Cloudbeat", Path: "cloudbeat.spec.yml", @@ -59,28 +55,12 @@ func TestLoadSpec_Components(t *testing.T) { }, { Name: "Filebeat", - Path: "filebeat.spec.yml", + Path: "testbeat.spec.yml", }, { Name: "Fleet Server", Path: "fleet-server.spec.yml", }, - { - Name: "Heartbeat", - Path: "heartbeat.spec.yml", - }, - { - Name: "Metricbeat", - Path: "metricbeat.spec.yml", - }, - { - Name: "Osquerybeat", - Path: "osquerybeat.spec.yml", - }, - { - Name: "Packetbeat", - Path: "packetbeat.spec.yml", - }, { Name: "Universal Profiling Collector", Path: "pf-elastic-collector.spec.yml", diff --git a/pkg/component/platforms.go b/pkg/component/platforms.go index afb232e94db..66b9d6f0e16 100644 --- a/pkg/component/platforms.go +++ b/pkg/component/platforms.go @@ -7,10 +7,11 @@ package component import ( "fmt" goruntime "runtime" - "strconv" "strings" "github.com/elastic/go-sysinfo" + + "github.com/elastic/elastic-agent/pkg/utils" ) const ( @@ -99,14 +100,21 @@ func (p Platforms) Exists(platform string) bool { return false } +// UserDetail provides user specific information on the running platform. +type UserDetail struct { + Root bool +} + // PlatformDetail is platform that has more detail information about the running platform. type PlatformDetail struct { Platform NativeArch string Family string - Major string - Minor string + Major int + Minor int + + User UserDetail } // PlatformModifier can modify the platform details before the runtime specifications are loaded. @@ -114,6 +122,10 @@ type PlatformModifier func(detail PlatformDetail) PlatformDetail // LoadPlatformDetail loads the platform details for the current system. func LoadPlatformDetail(modifiers ...PlatformModifier) (PlatformDetail, error) { + hasRoot, err := utils.HasRoot() + if err != nil { + return PlatformDetail{}, err + } info, err := sysinfo.Host() if err != nil { return PlatformDetail{}, err @@ -138,8 +150,11 @@ func LoadPlatformDetail(modifiers ...PlatformModifier) (PlatformDetail, error) { }, NativeArch: nativeArch, Family: os.Family, - Major: strconv.Itoa(os.Major), - Minor: strconv.Itoa(os.Minor), + Major: os.Major, + Minor: os.Minor, + User: UserDetail{ + Root: hasRoot, + }, } for _, modifier := range modifiers { detail = modifier(detail) diff --git a/pkg/component/runtime/command.go b/pkg/component/runtime/command.go index c422371c2a3..4059396836b 100644 --- a/pkg/component/runtime/command.go +++ b/pkg/component/runtime/command.go @@ -497,13 +497,7 @@ func (c *commandRuntime) getSpecType() string { } func (c *commandRuntime) getSpecBinaryName() string { - if c.current.InputSpec != nil { - return c.current.InputSpec.BinaryName - } - if c.current.ShipperSpec != nil { - return c.current.ShipperSpec.BinaryName - } - return "" + return c.current.BinaryName() } func (c *commandRuntime) getSpecBinaryPath() string { diff --git a/pkg/component/runtime/conn_info_server.go b/pkg/component/runtime/conn_info_server.go index d6a55c4abb7..dd382027f53 100644 --- a/pkg/component/runtime/conn_info_server.go +++ b/pkg/component/runtime/conn_info_server.go @@ -13,6 +13,7 @@ import ( "time" "github.com/elastic/elastic-agent/pkg/core/logger" + "github.com/elastic/elastic-agent/pkg/ipc" ) const ( @@ -27,8 +28,18 @@ type connInfoServer struct { stopTimeout time.Duration } -func newConnInfoServer(log *logger.Logger, comm Communicator, port int) (*connInfoServer, error) { - listener, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", port)) +func newConnInfoServer(log *logger.Logger, comm Communicator, address string) (*connInfoServer, error) { + var ( + listener net.Listener + err error + ) + + if ipc.IsLocal(address) { + listener, err = ipc.CreateListener(log, address) + } else { + listener, err = net.Listen("tcp", address) + } + if err != nil { return nil, fmt.Errorf("failed to start connection credentials listener: %w", err) } diff --git a/pkg/component/runtime/conn_info_server_test.go b/pkg/component/runtime/conn_info_server_test.go index 299ef323509..b4ed931d153 100644 --- a/pkg/component/runtime/conn_info_server_test.go +++ b/pkg/component/runtime/conn_info_server_test.go @@ -10,6 +10,8 @@ import ( "fmt" "io" "net" + "net/url" + "os" "runtime" "syscall" "testing" @@ -22,6 +24,7 @@ import ( "github.com/elastic/elastic-agent-client/v7/pkg/client" "github.com/elastic/elastic-agent-client/v7/pkg/proto" "github.com/elastic/elastic-agent/internal/pkg/testutils" + "github.com/elastic/elastic-agent/pkg/ipc" ) type mockCommunicator struct { @@ -29,11 +32,11 @@ type mockCommunicator struct { startupInfo *proto.StartUpInfo } -func newMockCommunicator() *mockCommunicator { +func newMockCommunicator(address string) *mockCommunicator { return &mockCommunicator{ ch: make(chan *proto.CheckinObserved, 1), startupInfo: &proto.StartUpInfo{ - Addr: getAddress(), + Addr: address, ServerName: "endpoint", Token: "some token", CaCert: []byte("some CA cert"), @@ -69,22 +72,82 @@ func (c *mockCommunicator) CheckinObserved() <-chan *proto.CheckinObserved { const testPort = 6788 -func getAddress() string { +// Test Elastic Agent Connection Info sock +const testSock = ".teaci.sock" + +func getAddress(dir string, isLocal bool) string { + if isLocal { + u := url.URL{} + u.Path = "/" + + if runtime.GOOS == "windows" { + u.Scheme = "npipe" + return u.JoinPath("/", testSock).String() + } + + u.Scheme = "unix" + return u.JoinPath(dir, testSock).String() + } return fmt.Sprintf("127.0.0.1:%d", testPort) } +func runTests(t *testing.T, fn func(*testing.T, string)) { + sockdir, err := os.MkdirTemp("", "") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(sockdir) + + tests := []struct { + name string + address string + }{ + { + name: "port", + address: getAddress("", false), + }, + { + name: "local", + address: getAddress(sockdir, true), + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + fn(t, tc.address) + }) + } +} + func TestConnInfoNormal(t *testing.T) { + runTests(t, testConnInfoNormal) +} + +func dialAddress(address string) (net.Conn, error) { + // Connect to the server + if ipc.IsLocal(address) { + return dialLocal(address) + } + + return net.Dial("tcp", address) +} + +func testConnInfoNormal(t *testing.T, address string) { log := testutils.NewErrorLogger(t) - comm := newMockCommunicator() + comm := newMockCommunicator(address) // Start server - srv, err := newConnInfoServer(log, comm, testPort) + srv, err := newConnInfoServer(log, comm, address) if err != nil { t.Fatal(err) } defer func() { + err := srv.stop() + if ipc.IsLocal(address) { + ipc.CleanupListener(log, address) + } if err != nil { t.Fatal(err) } @@ -93,8 +156,7 @@ func TestConnInfoNormal(t *testing.T) { const count = 2 // read connection info a couple of times to make sure the server keeps working for multiple calls for i := 0; i < count; i++ { - // Connect to the server - conn, err := net.Dial("tcp", getAddress()) + conn, err := dialAddress(address) if err != nil { t.Fatal(err) } @@ -119,12 +181,16 @@ func TestConnInfoNormal(t *testing.T) { } func TestConnInfoConnCloseThenAnotherConn(t *testing.T) { + runTests(t, testConnInfoConnCloseThenAnotherConn) +} + +func testConnInfoConnCloseThenAnotherConn(t *testing.T, address string) { log := testutils.NewErrorLogger(t) - comm := newMockCommunicator() + comm := newMockCommunicator("") // Start server - srv, err := newConnInfoServer(log, comm, testPort) + srv, err := newConnInfoServer(log, comm, address) if err != nil { t.Fatal(err) } @@ -136,7 +202,7 @@ func TestConnInfoConnCloseThenAnotherConn(t *testing.T) { }() // Connect to the server - conn, err := net.Dial("tcp", getAddress()) + conn, err := dialAddress(address) if err != nil { t.Fatal(err) } @@ -148,7 +214,7 @@ func TestConnInfoConnCloseThenAnotherConn(t *testing.T) { } // Connect again after closed - conn, err = net.Dial("tcp", getAddress()) + conn, err = dialAddress(address) if err != nil { t.Fatal(err) } @@ -172,12 +238,16 @@ func TestConnInfoConnCloseThenAnotherConn(t *testing.T) { } func TestConnInfoClosed(t *testing.T) { + runTests(t, testConnInfoClosed) +} + +func testConnInfoClosed(t *testing.T, address string) { log := testutils.NewErrorLogger(t) - comm := newMockCommunicator() + comm := newMockCommunicator("") // Start server - srv, err := newConnInfoServer(log, comm, testPort) + srv, err := newConnInfoServer(log, comm, address) if err != nil { t.Fatal(err) } @@ -187,7 +257,7 @@ func TestConnInfoClosed(t *testing.T) { t.Fatal(err) } - _, err = net.Dial("tcp", getAddress()) + _, err = dialAddress(address) if err == nil { t.Fatal("want non-nil err") } @@ -198,9 +268,19 @@ func TestConnInfoClosed(t *testing.T) { // causes issue for *nix builds: "imports golang.org/x/sys/windows: build constraints exclude all Go files". // In order to avoid creating extra plaform specific files compare just errno for this test. wantErrNo := int(syscall.ECONNREFUSED) - if runtime.GOOS == windows { - wantErrNo = 10061 // windows.WSAECONNREFUSED + if ipc.IsLocal(address) { + if runtime.GOOS == windows { + wantErrNo = 2 // windows.ERROR_FILE_NOT_FOUND + } else { + // For local IPC on *nix the syscall.ENOENT is expected + wantErrNo = int(syscall.ENOENT) + } + } else { + if runtime.GOOS == windows { + wantErrNo = 10061 // windows.WSAECONNREFUSED + } } + var ( syserr syscall.Errno errno int @@ -216,12 +296,16 @@ func TestConnInfoClosed(t *testing.T) { } func TestConnInfoDoubleStop(t *testing.T) { + runTests(t, testConnInfoDoubleStop) +} + +func testConnInfoDoubleStop(t *testing.T, address string) { log := testutils.NewErrorLogger(t) - comm := newMockCommunicator() + comm := newMockCommunicator("") // Start server - srv, err := newConnInfoServer(log, comm, testPort) + srv, err := newConnInfoServer(log, comm, address) if err != nil { t.Fatal(err) } @@ -232,18 +316,25 @@ func TestConnInfoDoubleStop(t *testing.T) { } err = srv.stop() - if err == nil { - t.Fatal("want err, got nil ") + // Double close on named pipe doesn't cause the error + if !(ipc.IsLocal(address) && runtime.GOOS == "windows") { + if err == nil { + t.Fatal("want err, got nil ") + } } } func TestConnInfoStopTimeout(t *testing.T) { + runTests(t, testConnInfoStopTimeout) +} + +func testConnInfoStopTimeout(t *testing.T, address string) { log := testutils.NewErrorLogger(t) - comm := newMockCommunicator() + comm := newMockCommunicator("") // Start server - srv, err := newConnInfoServer(log, comm, testPort) + srv, err := newConnInfoServer(log, comm, address) if err != nil { t.Fatal(err) } diff --git a/pkg/component/runtime/conn_info_server_unix_test.go b/pkg/component/runtime/conn_info_server_unix_test.go new file mode 100644 index 00000000000..51a8b3764f7 --- /dev/null +++ b/pkg/component/runtime/conn_info_server_unix_test.go @@ -0,0 +1,21 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build !windows + +package runtime + +import ( + "net" + "net/url" +) + +func dialLocal(address string) (net.Conn, error) { + var u *url.URL + u, err := url.Parse(address) + if err != nil { + return nil, err + } + return net.Dial("unix", u.Path) +} diff --git a/pkg/component/runtime/conn_info_server_windows_test.go b/pkg/component/runtime/conn_info_server_windows_test.go new file mode 100644 index 00000000000..794df2d078f --- /dev/null +++ b/pkg/component/runtime/conn_info_server_windows_test.go @@ -0,0 +1,19 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build windows + +package runtime + +import ( + "net" + + "github.com/Microsoft/go-winio" + + "github.com/elastic/elastic-agent-libs/api/npipe" +) + +func dialLocal(address string) (net.Conn, error) { + return winio.DialPipe(npipe.TransformString(address), nil) +} diff --git a/pkg/component/runtime/log_writer.go b/pkg/component/runtime/log_writer.go index 960c7f07a1a..9cf68489342 100644 --- a/pkg/component/runtime/log_writer.go +++ b/pkg/component/runtime/log_writer.go @@ -106,6 +106,10 @@ func (r *logWriter) Write(p []byte) (int, error) { continue } str := strings.TrimSpace(string(line)) + if len(str) == 0 { + // empty line after trim + continue + } // try to parse line as JSON if str[0] == '{' && r.handleJSON(str) { // handled as JSON diff --git a/pkg/component/runtime/log_writer_test.go b/pkg/component/runtime/log_writer_test.go index f0b6b01caaa..dd7cc1ff338 100644 --- a/pkg/component/runtime/log_writer_test.go +++ b/pkg/component/runtime/log_writer_test.go @@ -122,6 +122,33 @@ func TestLogWriter(t *testing.T) { }, }, }, + { + Name: "multi empty text line", + LogLevel: zapcore.InfoLevel, + LogSource: logSourceStdout, + Lines: []string{ + "simple written line\r\n", + "\r\n", // empty line + " \r\n", // empty line with space + "another line\n", + }, + Wrote: []wrote{ + { + entry: zapcore.Entry{ + Level: zapcore.InfoLevel, + Time: time.Time{}, + Message: "simple written line", + }, + }, + { + entry: zapcore.Entry{ + Level: zapcore.InfoLevel, + Time: time.Time{}, + Message: "another line", + }, + }, + }, + }, { Name: "json log line split", LogLevel: zapcore.DebugLevel, diff --git a/pkg/component/runtime/manager.go b/pkg/component/runtime/manager.go index d03b1818819..b382dfac39a 100644 --- a/pkg/component/runtime/manager.go +++ b/pkg/component/runtime/manager.go @@ -12,8 +12,11 @@ import ( "errors" "fmt" "net" + "net/url" + "path" "strings" "sync" + "sync/atomic" "time" "github.com/gofrs/uuid" @@ -26,14 +29,16 @@ import ( "github.com/elastic/elastic-agent-client/v7/pkg/client" "github.com/elastic/elastic-agent-client/v7/pkg/proto" - "github.com/elastic/elastic-agent-libs/atomic" "github.com/elastic/elastic-agent/internal/pkg/agent/application/info" "github.com/elastic/elastic-agent/internal/pkg/agent/configuration" "github.com/elastic/elastic-agent/internal/pkg/core/authority" "github.com/elastic/elastic-agent/pkg/component" + "github.com/elastic/elastic-agent/pkg/control" "github.com/elastic/elastic-agent/pkg/control/v2/cproto" "github.com/elastic/elastic-agent/pkg/core/logger" + "github.com/elastic/elastic-agent/pkg/ipc" + "github.com/elastic/elastic-agent/pkg/utils" ) const ( @@ -97,6 +102,7 @@ type Manager struct { ca *authority.CertificateAuthority listenAddr string listenPort int + isLocal bool agentInfo info.Agent tracer *apm.Tracer monitor MonitoringManager @@ -149,7 +155,6 @@ type Manager struct { func NewManager( logger, baseLogger *logger.Logger, - listenAddr string, agentInfo info.Agent, tracer *apm.Tracer, monitor MonitoringManager, @@ -163,11 +168,21 @@ func NewManager( if agentInfo == nil { return nil, errors.New("agentInfo cannot be nil") } + + controlAddress := control.Address() + // [gRPC:8.15] For 8.14 this always returns local TCP address, until Endpoint is modified to support domain sockets gRPC + listenAddr, err := deriveCommsAddress(controlAddress, grpcConfig) + if err != nil { + return nil, fmt.Errorf("failed to derive comms GRPC: %w", err) + } + logger.With("address", listenAddr).Infof("GRPC comms socket listening at %s", listenAddr) + m := &Manager{ logger: logger, baseLogger: baseLogger, ca: ca, listenAddr: listenAddr, + isLocal: ipc.IsLocal(listenAddr), agentInfo: agentInfo, tracer: tracer, current: make(map[string]*componentRuntimeState), @@ -178,7 +193,7 @@ func NewManager( errCh: make(chan error), monitor: monitor, grpcConfig: grpcConfig, - serverReady: atomic.NewBool(false), + serverReady: &atomic.Bool{}, doneChan: make(chan struct{}), } return m, nil @@ -192,11 +207,25 @@ func NewManager( // // Blocks until the context is done. func (m *Manager) Run(ctx context.Context) error { - listener, err := net.Listen("tcp", m.listenAddr) + var ( + listener net.Listener + err error + ) + if m.isLocal { + listener, err = ipc.CreateListener(m.logger, m.listenAddr) + } else { + listener, err = net.Listen("tcp", m.listenAddr) + } + if err != nil { return fmt.Errorf("error starting tcp listener for runtime manager: %w", err) } - m.listenPort = listener.Addr().(*net.TCPAddr).Port + + if m.isLocal { + defer ipc.CleanupListener(m.logger, m.listenAddr) + } else { + m.listenPort = listener.Addr().(*net.TCPAddr).Port + } certPool := x509.NewCertPool() if ok := certPool.AppendCertsFromPEM(m.ca.Crt()); !ok { @@ -796,7 +825,7 @@ func (m *Manager) update(model component.Model, teardown bool) error { for _, comp := range newComponents { // new component; create its runtime logger := m.baseLogger.Named(fmt.Sprintf("component.runtime.%s", comp.ID)) - state, err := newComponentRuntimeState(m, logger, m.monitor, comp) + state, err := newComponentRuntimeState(m, logger, m.monitor, comp, m.isLocal) if err != nil { return fmt.Errorf("failed to create new component %s: %w", comp.ID, err) } @@ -968,6 +997,9 @@ func (m *Manager) getRuntimeFromComponent(comp component.Component) *componentRu } func (m *Manager) getListenAddr() string { + if m.isLocal { + return m.listenAddr + } addr := strings.SplitN(m.listenAddr, ":", 2) if len(addr) == 2 && addr[1] == "0" { return fmt.Sprintf("%s:%d", addr[0], m.listenPort) @@ -1054,3 +1086,32 @@ func (m *Manager) performDiagAction(ctx context.Context, comp component.Componen } return res.Diagnostic, nil } + +// deriveCommsAddress derives the comms socket/pipe path/name from given control address and GRPC config +func deriveCommsAddress(controlAddress string, grpc *configuration.GRPCConfig) (string, error) { + if grpc.IsLocal() { + return deriveCommsSocketName(controlAddress) + } + return grpc.String(), nil +} + +var errInvalidUri = errors.New("invalid uri") + +// deriveCommsSocketName derives the agent communication unix/npipe path +// currently from the control socket path, since it's already set properly +// matching the socket path length to meet the system limits of the platform +func deriveCommsSocketName(uri string) (string, error) { + u, err := url.Parse(uri) + if err != nil { + return "", err + } + + if len(u.Path) == 0 || (u.Scheme != "unix" && u.Scheme != "npipe") { + return "", fmt.Errorf("%w %s", errInvalidUri, uri) + } + + // The base name without extension and use it as id argument for SocketURLWithFallback call + // THe idea it to use the same logic for the comms path as for the control socket/pipe path + base := strings.TrimSuffix(path.Base(u.Path), path.Ext(u.Path)) + return utils.SocketURLWithFallback(base, path.Dir(u.Path)), nil +} diff --git a/pkg/component/runtime/manager_fake_input_test.go b/pkg/component/runtime/manager_fake_input_test.go index 2471be6bd5b..534c0639f63 100644 --- a/pkg/component/runtime/manager_fake_input_test.go +++ b/pkg/component/runtime/manager_fake_input_test.go @@ -109,7 +109,6 @@ func (suite *FakeInputSuite) TestManager_Features() { m, err := NewManager( newDebugLogger(t), newDebugLogger(t), - "localhost:0", agentInfo, apmtest.DiscardTracer, newTestMonitoringMgr(), @@ -310,7 +309,6 @@ func (suite *FakeInputSuite) TestManager_APM() { m, err := NewManager( newDebugLogger(t), newDebugLogger(t), - "localhost:0", agentInfo, apmtest.DiscardTracer, newTestMonitoringMgr(), @@ -545,7 +543,6 @@ func (suite *FakeInputSuite) TestManager_Limits() { m, err := NewManager( newDebugLogger(t), newDebugLogger(t), - "localhost:0", agentInfo, apmtest.DiscardTracer, newTestMonitoringMgr(), @@ -709,7 +706,6 @@ func (suite *FakeInputSuite) TestManager_ShipperLimits() { m, err := NewManager( newDebugLogger(t), newDebugLogger(t), - "localhost:0", agentInfo, apmtest.DiscardTracer, newTestMonitoringMgr(), @@ -870,7 +866,7 @@ func (suite *FakeInputSuite) TestManager_BadUnitToGood() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -1039,7 +1035,7 @@ func (suite *FakeInputSuite) TestManager_GoodUnitToBad() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) runResultChan := make(chan error, 1) go func() { @@ -1221,7 +1217,7 @@ func (suite *FakeInputSuite) TestManager_NoDeadlock() { // Create the runtime manager ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) // Start the runtime manager in a goroutine, passing its termination state @@ -1295,7 +1291,7 @@ func (suite *FakeInputSuite) TestManager_Configure() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -1417,7 +1413,7 @@ func (suite *FakeInputSuite) TestManager_RemoveUnit() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -1572,7 +1568,7 @@ func (suite *FakeInputSuite) TestManager_ActionState() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -1697,7 +1693,7 @@ func (suite *FakeInputSuite) TestManager_Restarts() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -1833,7 +1829,7 @@ func (suite *FakeInputSuite) TestManager_Restarts_ConfigKill() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -1977,7 +1973,7 @@ func (suite *FakeInputSuite) TestManager_KeepsRestarting() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -2121,7 +2117,7 @@ func (suite *FakeInputSuite) TestManager_RestartsOnMissedCheckins() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -2240,7 +2236,7 @@ func (suite *FakeInputSuite) TestManager_InvalidAction() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -2361,7 +2357,6 @@ func (suite *FakeInputSuite) TestManager_MultiComponent() { m, err := NewManager( newDebugLogger(t), newDebugLogger(t), - "localhost:0", agentInfo, apmtest.DiscardTracer, newTestMonitoringMgr(), @@ -2575,7 +2570,6 @@ func (suite *FakeInputSuite) TestManager_LogLevel() { m, err := NewManager( newDebugLogger(t), newDebugLogger(t), - "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), @@ -2725,7 +2719,7 @@ func (suite *FakeInputSuite) TestManager_Shipper() { defer cancel() ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), configuration.DefaultGRPCConfig()) require.NoError(t, err) errCh := make(chan error) go func() { @@ -3025,7 +3019,6 @@ func (suite *FakeInputSuite) TestManager_StartStopComponent() { m, err := NewManager( log, newDebugLogger(t), - "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), @@ -3213,7 +3206,7 @@ func (suite *FakeInputSuite) TestManager_Chunk() { grpcConfig.MaxMsgSize = grpcDefaultSize * 2 // set to double the default size ai := &info.AgentInfo{} - m, err := NewManager(newDebugLogger(t), newDebugLogger(t), "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), grpcConfig) + m, err := NewManager(newDebugLogger(t), newDebugLogger(t), ai, apmtest.DiscardTracer, newTestMonitoringMgr(), grpcConfig) require.NoError(t, err) errCh := make(chan error) go func() { diff --git a/pkg/component/runtime/manager_test.go b/pkg/component/runtime/manager_test.go index b94f42e1d26..9e769f4b638 100644 --- a/pkg/component/runtime/manager_test.go +++ b/pkg/component/runtime/manager_test.go @@ -31,7 +31,6 @@ func TestManager_SimpleComponentErr(t *testing.T) { m, err := NewManager( newDebugLogger(t), newDebugLogger(t), - "localhost:0", ai, apmtest.DiscardTracer, newTestMonitoringMgr(), @@ -133,7 +132,11 @@ func newDebugLogger(t *testing.T) *logger.Logger { loggerCfg.Level = logp.DebugLevel loggerCfg.ToStderr = true - log, err := logger.NewFromConfig("", loggerCfg, false) + eventLoggerCfg := logger.DefaultEventLoggingConfig() + eventLoggerCfg.Level = loggerCfg.Level + eventLoggerCfg.ToStderr = loggerCfg.ToStderr + + log, err := logger.NewFromConfig("", loggerCfg, eventLoggerCfg, false) require.NoError(t, err) return log } @@ -171,3 +174,82 @@ func waitForReady(ctx context.Context, m *Manager) error { } return nil } + +// [gRPC:8.15] Uncomment this test only after Agent/Endpoint switches fully to local gRPC, post 8.14 +// func TestDeriveCommsSocketName(t *testing.T) { +// const controlAddressNix = "unix:///tmp/elastic-agent/pge4ao-u1YaV1dmSBfVX4saT8BL7b-Ey.sock" +// const controlAddressWin = "npipe:///_HZ8OL-9bNW-SIU0joRfgUsej2KX0Sra.sock" + +// validControlAddress := func() string { +// if runtime.GOOS == "windows" { +// return controlAddressWin +// } +// return controlAddressNix +// } + +// defaultCfg := configuration.DefaultGRPCConfig() + +// tests := []struct { +// name string +// controlAddress string +// port int32 +// wantErr error +// want string +// }{ +// { +// name: "empty uri not local", +// port: 6789, +// want: func() string { +// grpcCfg := *defaultCfg +// grpcCfg.Port = 6789 +// return grpcCfg.String() +// }(), +// }, +// { +// name: "empty uri local", +// port: -1, +// wantErr: errInvalidUri, +// }, +// { +// name: "invalid schema", +// port: -1, +// controlAddress: "lunix:///2323", +// wantErr: errInvalidUri, +// }, +// { +// name: "valid schema empty path", +// port: -1, +// controlAddress: "unix://", +// wantErr: errInvalidUri, +// }, +// { +// name: "valid path", +// port: -1, +// controlAddress: validControlAddress(), +// want: validControlAddress(), +// }, +// } + +// for _, tc := range tests { +// t.Run(tc.name, func(t *testing.T) { +// // Copy default config +// grpcCfg := *defaultCfg // default rpc has port set to -1 == local rpc +// grpcCfg.Port = tc.port +// s, err := deriveCommsAddress(tc.controlAddress, &grpcCfg) + +// // If want error, test error and return +// if tc.wantErr != nil { +// diff := cmp.Diff(tc.wantErr, err, cmpopts.EquateErrors()) +// if diff != "" { +// t.Fatal(diff) +// } +// return +// } + +// diff := cmp.Diff(len(tc.want), len(s)) +// if diff != "" { +// t.Fatal(diff) +// } +// }) +// } +// } diff --git a/pkg/component/runtime/runtime.go b/pkg/component/runtime/runtime.go index 3cb031f501d..48d499960b8 100644 --- a/pkg/component/runtime/runtime.go +++ b/pkg/component/runtime/runtime.go @@ -8,10 +8,10 @@ import ( "context" "errors" "sync" + "sync/atomic" "github.com/elastic/elastic-agent-client/v7/pkg/client" "github.com/elastic/elastic-agent-client/v7/pkg/proto" - "github.com/elastic/elastic-agent-libs/atomic" "github.com/elastic/elastic-agent/internal/pkg/runner" "github.com/elastic/elastic-agent/pkg/component" "github.com/elastic/elastic-agent/pkg/core/logger" @@ -58,6 +58,7 @@ func newComponentRuntime( comp component.Component, logger *logger.Logger, monitor MonitoringManager, + isLocal bool, ) (componentRuntime, error) { if comp.Err != nil { return newFailedRuntime(comp) @@ -67,7 +68,7 @@ func newComponentRuntime( return newCommandRuntime(comp, logger, monitor) } if comp.InputSpec.Spec.Service != nil { - return newServiceRuntime(comp, logger) + return newServiceRuntime(comp, logger, isLocal) } return nil, errors.New("unknown component runtime") } @@ -99,12 +100,12 @@ type componentRuntimeState struct { actions map[string]func(*proto.ActionResponse) } -func newComponentRuntimeState(m *Manager, logger *logger.Logger, monitor MonitoringManager, comp component.Component) (*componentRuntimeState, error) { +func newComponentRuntimeState(m *Manager, logger *logger.Logger, monitor MonitoringManager, comp component.Component, isLocal bool) (*componentRuntimeState, error) { comm, err := newRuntimeComm(logger, m.getListenAddr(), m.ca, m.agentInfo, m.grpcConfig.MaxMsgSize) if err != nil { return nil, err } - runtime, err := newComponentRuntime(comp, logger, monitor) + runtime, err := newComponentRuntime(comp, logger, monitor, isLocal) if err != nil { return nil, err } @@ -187,11 +188,10 @@ func (s *componentRuntimeState) start() error { } func (s *componentRuntimeState) stop(teardown bool, signed *component.Signed) error { - if s.shuttingDown.Load() { + if !s.shuttingDown.CompareAndSwap(false, true) { // already stopping return nil } - s.shuttingDown.Store(true) if teardown { return s.runtime.Teardown(signed) } diff --git a/pkg/component/runtime/runtime_comm.go b/pkg/component/runtime/runtime_comm.go index 79eeb9f89c6..55ff74f9089 100644 --- a/pkg/component/runtime/runtime_comm.go +++ b/pkg/component/runtime/runtime_comm.go @@ -133,6 +133,7 @@ func (c *runtimeComm) WriteStartUpInfo(w io.Writer, services ...client.Service) Id: c.agentInfo.AgentID(), Version: c.agentInfo.Version(), Snapshot: c.agentInfo.Snapshot(), + Mode: protoAgentMode(c.agentInfo), }, } infoBytes, err := protobuf.Marshal(startupInfo) @@ -155,6 +156,7 @@ func (c *runtimeComm) CheckinExpected( Id: c.agentInfo.AgentID(), Version: c.agentInfo.Version(), Snapshot: c.agentInfo.Snapshot(), + Mode: protoAgentMode(c.agentInfo), } } else { expected.AgentInfo = nil @@ -293,6 +295,7 @@ func (c *runtimeComm) checkin(server proto.ElasticAgent_CheckinV2Server, init *p close(recvDone) return } + c.logger.Infof("got checkin with pid %d", checkin.Pid) c.checkinObserved <- checkin } }() @@ -433,3 +436,11 @@ func sendExpectedChunked(server proto.ElasticAgent_CheckinV2Server, msg *proto.C } return nil } + +// protoAgentMode converts the agent info mode bool to the AgentManagedMode enum +func protoAgentMode(agent info.Agent) proto.AgentManagedMode { + if agent.IsStandalone() { + return proto.AgentManagedMode_STANDALONE + } + return proto.AgentManagedMode_MANAGED +} diff --git a/pkg/component/runtime/runtime_comm_test.go b/pkg/component/runtime/runtime_comm_test.go index 933ab7c8cbb..0666e4726f9 100644 --- a/pkg/component/runtime/runtime_comm_test.go +++ b/pkg/component/runtime/runtime_comm_test.go @@ -17,9 +17,11 @@ import ( ) type agentInfoMock struct { - agentID string - snapshot bool - version string + agentID string + snapshot bool + version string + unprivileged bool + isStandalone bool } func (a agentInfoMock) AgentID() string { @@ -33,16 +35,26 @@ func (a agentInfoMock) Version() string { return a.version } +func (a agentInfoMock) Unprivileged() bool { + return a.unprivileged +} + +func (a agentInfoMock) IsStandalone() bool { + return a.isStandalone +} + func (a agentInfoMock) Headers() map[string]string { panic("implement me") } func (a agentInfoMock) LogLevel() string { panic("implement me") } +func (a agentInfoMock) RawLogLevel() string { panic("implement me") } func (a agentInfoMock) ReloadID(ctx context.Context) error { panic("implement me") } func (a agentInfoMock) SetLogLevel(ctx context.Context, level string) error { panic("implement me") } func TestRuntimeComm_WriteStartUpInfo_packageVersion(t *testing.T) { agentInfo := agentInfoMock{ - agentID: "NCC-1701", - snapshot: true, - version: "8.13.0+build1966-09-6", + agentID: "NCC-1701", + snapshot: true, + version: "8.13.0+build1966-09-6", + unprivileged: false, } want := client.AgentInfo{ diff --git a/pkg/component/runtime/service.go b/pkg/component/runtime/service.go index 5f007924d7f..bc683193714 100644 --- a/pkg/component/runtime/service.go +++ b/pkg/component/runtime/service.go @@ -8,12 +8,15 @@ import ( "context" "errors" "fmt" + "net/url" + "runtime" "time" "github.com/kardianos/service" "github.com/elastic/elastic-agent-client/v7/pkg/client" "github.com/elastic/elastic-agent-client/v7/pkg/proto" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/pkg/component" "github.com/elastic/elastic-agent/pkg/core/logger" "github.com/elastic/elastic-agent/pkg/features" @@ -51,10 +54,12 @@ type serviceRuntime struct { state ComponentState executeServiceCommandImpl executeServiceCommandFunc + + isLocal bool // true if rpc is domain socket, or named pipe } // newServiceRuntime creates a new command runtime for the provided component. -func newServiceRuntime(comp component.Component, logger *logger.Logger) (*serviceRuntime, error) { +func newServiceRuntime(comp component.Component, logger *logger.Logger, isLocal bool) (*serviceRuntime, error) { if comp.ShipperSpec != nil { return nil, errors.New("service runtime not supported for a shipper specification") } @@ -76,6 +81,7 @@ func newServiceRuntime(comp component.Component, logger *logger.Logger) (*servic statusCh: make(chan service.Status), state: state, executeServiceCommandImpl: executeServiceCommand, + isLocal: isLocal, } // Set initial state as STOPPED @@ -214,7 +220,19 @@ func (s *serviceRuntime) Run(ctx context.Context, comm Communicator) (err error) // Start connection info if cis == nil { - cis, err = newConnInfoServer(s.log, comm, s.comp.InputSpec.Spec.Service.CPort) + var address string + // [gRPC:8.15] Uncomment after 8.14 when Endpoint is ready for local gRPC + // isLocal := s.isLocal + + // [gRPC:8.15] Set connection info to local socket always for 8.14. Remove when Endpoint is ready for local gRPC + isLocal := true + address, err = getConnInfoServerAddress(runtime.GOOS, isLocal, s.comp.InputSpec.Spec.Service.CPort, s.comp.InputSpec.Spec.Service.CSocket) + if err != nil { + err = fmt.Errorf("failed to create connection info service address for %s: %w", s.name(), err) + break + } + s.log.Infof("Creating connection info server for %s service, address: %v", s.name(), address) + cis, err = newConnInfoServer(s.log, comm, address) if err != nil { err = fmt.Errorf("failed to start connection info service %s: %w", s.name(), err) break @@ -275,6 +293,31 @@ func (s *serviceRuntime) Run(ctx context.Context, comm Communicator) (err error) } } +var errEmptySocketValue = errors.New("empty socket value") + +func getConnInfoServerAddress(os string, isLocal bool, port int, socket string) (string, error) { + if isLocal { + // Return an empty string if socket string is empty + // The connectionInfo server fails on empty address + if socket == "" { + return "", errEmptySocketValue + } + + u := url.URL{} + u.Path = "/" + + if os == "windows" { + u.Scheme = "npipe" + return u.JoinPath("/", socket).String(), nil + } + + u.Scheme = "unix" + return u.JoinPath(paths.InstallPath(paths.DefaultBasePath), socket).String(), nil + } + + return fmt.Sprintf("127.0.0.1:%d", port), nil +} + func injectSigned(comp component.Component, signed *component.Signed) (component.Component, error) { if signed == nil { return comp, nil @@ -584,20 +627,20 @@ func (s *serviceRuntime) name() string { // check executes the service check command func (s *serviceRuntime) check(ctx context.Context) error { if s.comp.InputSpec.Spec.Service.Operations.Check == nil { - s.log.Errorf("missing check spec for %s service", s.comp.InputSpec.BinaryName) + s.log.Errorf("missing check spec for %s service", s.comp.BinaryName()) return ErrOperationSpecUndefined } - s.log.Debugf("check if the %s is installed", s.comp.InputSpec.BinaryName) + s.log.Debugf("check if the %s is installed", s.comp.BinaryName()) return s.executeServiceCommandImpl(ctx, s.log, s.comp.InputSpec.BinaryPath, s.comp.InputSpec.Spec.Service.Operations.Check) } // install executes the service install command func (s *serviceRuntime) install(ctx context.Context) error { if s.comp.InputSpec.Spec.Service.Operations.Install == nil { - s.log.Errorf("missing install spec for %s service", s.comp.InputSpec.BinaryName) + s.log.Errorf("missing install spec for %s service", s.comp.BinaryName()) return ErrOperationSpecUndefined } - s.log.Debugf("install %s service", s.comp.InputSpec.BinaryName) + s.log.Debugf("install %s service", s.comp.BinaryName()) return s.executeServiceCommandImpl(ctx, s.log, s.comp.InputSpec.BinaryPath, s.comp.InputSpec.Spec.Service.Operations.Install) } @@ -645,7 +688,7 @@ func resolveUninstallTokenArg(uninstallSpec *component.ServiceOperationsCommandS func uninstallService(ctx context.Context, log *logger.Logger, comp component.Component, uninstallToken string, executeServiceCommandImpl executeServiceCommandFunc) error { if comp.InputSpec.Spec.Service.Operations.Uninstall == nil { - log.Errorf("missing uninstall spec for %s service", comp.InputSpec.BinaryName) + log.Errorf("missing uninstall spec for %s service", comp.BinaryName()) return ErrOperationSpecUndefined } @@ -657,6 +700,6 @@ func uninstallService(ctx context.Context, log *logger.Logger, comp component.Co uninstallSpec := resolveUninstallTokenArg(comp.InputSpec.Spec.Service.Operations.Uninstall, uninstallToken) - log.Debugf("uninstall %s service", comp.InputSpec.BinaryName) + log.Debugf("uninstall %s service", comp.BinaryName()) return executeServiceCommandImpl(ctx, log, comp.InputSpec.BinaryPath, uninstallSpec) } diff --git a/pkg/component/runtime/service_test.go b/pkg/component/runtime/service_test.go index e8ce6e682b9..6a18dc9acc4 100644 --- a/pkg/component/runtime/service_test.go +++ b/pkg/component/runtime/service_test.go @@ -5,13 +5,16 @@ package runtime import ( + "net/url" "testing" "github.com/elastic/elastic-agent-client/v7/pkg/client" "github.com/elastic/elastic-agent-client/v7/pkg/proto" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" "github.com/elastic/elastic-agent/pkg/component" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" ) func makeComponent(name string, config map[string]interface{}) (component.Component, error) { @@ -175,3 +178,80 @@ func TestResolveUninstallTokenArg(t *testing.T) { }) } } + +func TestGetConnInfoServerAddress(t *testing.T) { + tests := []struct { + name string + os string + isLocal bool + port int + socket string + expected string + wantErr error + }{ + { + name: "windows.port", + os: "windows", + isLocal: false, + port: 6788, + expected: "127.0.0.1:6788", + }, + { + name: "unix.port", + os: "linux", + isLocal: false, + port: 6788, + expected: "127.0.0.1:6788", + }, + { + name: "windows.local.socket.empty", + os: "windows", + isLocal: true, + wantErr: errEmptySocketValue, + }, + { + name: "unix.local.socket.empty", + os: "linux", + isLocal: true, + wantErr: errEmptySocketValue, + }, + { + name: "windows.local.socket", + os: "windows", + isLocal: true, + socket: "test.sock", + expected: func() string { + u := url.URL{} + u.Path = "/" + u.Scheme = "npipe" + return u.JoinPath("/", "test.sock").String() + }(), + }, + { + name: "unix.local.socket", + os: "linux", + isLocal: true, + socket: "test.sock", + expected: func() string { + u := url.URL{} + u.Path = "/" + u.Scheme = "unix" + return u.JoinPath(paths.InstallPath(paths.DefaultBasePath), "test.sock").String() + }(), + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + address, err := getConnInfoServerAddress(tc.os, tc.isLocal, tc.port, tc.socket) + diff := cmp.Diff(tc.wantErr, err, cmpopts.EquateErrors()) + if diff != "" { + t.Fatal(diff) + } + diff = cmp.Diff(address, tc.expected) + if diff != "" { + t.Error(diff) + } + }) + } +} diff --git a/pkg/component/runtime/state.go b/pkg/component/runtime/state.go index 67dc9c028d3..6bd927fc68b 100644 --- a/pkg/component/runtime/state.go +++ b/pkg/component/runtime/state.go @@ -75,6 +75,11 @@ type ComponentState struct { VersionInfo ComponentVersionInfo `yaml:"version_info"` + // The PID of the process, as obtained from the *from the Protobuf API* + // As of now, this is only used by Endpoint, as agent doesn't know the PID + // of the endpoint service. If you need the PID for beats, use the coordinator/communicator + Pid uint64 + // internal expectedUnits map[ComponentUnitKey]expectedUnitState @@ -269,6 +274,12 @@ func (s *ComponentState) syncUnits(comp *component.Component) bool { func (s *ComponentState) syncCheckin(checkin *proto.CheckinObserved) bool { changed := false + + if s.Pid != checkin.Pid { + changed = true + s.Pid = checkin.Pid + } + touched := make(map[ComponentUnitKey]bool) for _, unit := range checkin.Units { key := ComponentUnitKey{ diff --git a/pkg/component/spec.go b/pkg/component/spec.go index dda00f4c223..d268ea74106 100644 --- a/pkg/component/spec.go +++ b/pkg/component/spec.go @@ -74,6 +74,7 @@ type RuntimePreventionSpec struct { // CommandSpec is the specification for an input that executes as a subprocess. type CommandSpec struct { + Name string `config:"name,omitempty" yaml:"name,omitempty"` Args []string `config:"args,omitempty" yaml:"args,omitempty"` Env []CommandEnvSpec `config:"env,omitempty" yaml:"env,omitempty"` Timeouts CommandTimeoutSpec `config:"timeouts,omitempty" yaml:"timeouts,omitempty"` @@ -132,6 +133,7 @@ func (t *ServiceTimeoutSpec) InitDefaults() { // ServiceSpec is the specification for an input that executes as a service. type ServiceSpec struct { CPort int `config:"cport" yaml:"cport" validate:"required"` + CSocket string `config:"csocket" yaml:"csocket" validate:"required"` Log *ServiceLogSpec `config:"log,omitempty" yaml:"log,omitempty"` Operations ServiceOperationsSpec `config:"operations" yaml:"operations" validate:"required"` Timeouts ServiceTimeoutSpec `config:"timeouts,omitempty" yaml:"timeouts,omitempty"` diff --git a/pkg/component/spec_test.go b/pkg/component/spec_test.go index c51ef4b4517..764fb93d9b9 100644 --- a/pkg/component/spec_test.go +++ b/pkg/component/spec_test.go @@ -13,9 +13,10 @@ import ( func TestSpec_Validation(t *testing.T) { scenarios := []struct { - Name string - Spec string - Err string + Name string + Spec string + Err string + CheckFn func(t *testing.T, spec Spec) }{ { Name: "Empty", @@ -30,126 +31,134 @@ func TestSpec_Validation(t *testing.T) { { Name: "No Command or Service", Spec: ` -version: 2 -inputs: - - name: testing - description: Testing Input - platforms: - - linux/amd64 - outputs: - - shipper -`, + version: 2 + inputs: + - name: testing + description: Testing Input + platforms: + - linux/amd64 + outputs: + - shipper + `, Err: "input 'testing' must define either command or service accessing 'inputs.0'", }, { Name: "Duplicate Platform", Spec: ` -version: 2 -inputs: - - name: testing - description: Testing Input - platforms: - - linux/amd64 - - linux/amd64 - outputs: - - shipper - command: {} -`, + version: 2 + inputs: + - name: testing + description: Testing Input + platforms: + - linux/amd64 + - linux/amd64 + outputs: + - shipper + command: {} + `, Err: "input 'testing' defines the platform 'linux/amd64' more than once accessing 'inputs.0'", }, { Name: "Unknown Platform", Spec: ` -version: 2 -inputs: - - name: testing - description: Testing Input - platforms: - - unknown/amd64 - outputs: - - shipper - command: {} -`, + version: 2 + inputs: + - name: testing + description: Testing Input + platforms: + - unknown/amd64 + outputs: + - shipper + command: {} + `, Err: "input 'testing' defines an unknown platform 'unknown/amd64' accessing 'inputs.0'", }, { Name: "Duplicate Output", Spec: ` -version: 2 -inputs: - - name: testing - description: Testing Input - platforms: - - linux/amd64 - outputs: - - shipper - - shipper - command: {} -`, + version: 2 + inputs: + - name: testing + description: Testing Input + platforms: + - linux/amd64 + outputs: + - shipper + - shipper + command: {} + `, Err: "input 'testing' defines the output 'shipper' more than once accessing 'inputs.0'", }, { Name: "Duplicate Platform Same Input Name", Spec: ` -version: 2 -inputs: - - name: testing - description: Testing Input - platforms: - - linux/amd64 - outputs: - - shipper - command: {} - - name: testing - description: Testing Input - platforms: - - linux/amd64 - outputs: - - shipper - command: {} -`, + version: 2 + inputs: + - name: testing + description: Testing Input + platforms: + - linux/amd64 + outputs: + - shipper + command: {} + - name: testing + description: Testing Input + platforms: + - linux/amd64 + outputs: + - shipper + command: {} + `, Err: "input 'testing' at inputs.1 defines the same platform as a previous definition accessing config", }, { Name: "Valid", Spec: ` -version: 2 -inputs: - - name: testing - description: Testing Input - platforms: - - linux/amd64 - - windows/amd64 - outputs: - - shipper - command: {} - - name: testing - description: Testing Input - platforms: - - darwin/amd64 - outputs: - - shipper - service: - name: "co.elastic.endpoint" - cport: 6788 - operations: - install: - args: ["install"] - uninstall: - args: ["uninstall"] -`, + version: 2 + inputs: + - name: testing + description: Testing Input + platforms: + - linux/amd64 + - windows/amd64 + outputs: + - shipper + command: {} + - name: testing + description: Testing Input + platforms: + - darwin/amd64 + outputs: + - shipper + service: + name: "co.elastic.endpoint" + cport: 6788 + csocket: ".test.sock" + operations: + install: + args: ["install"] + uninstall: + args: ["uninstall"] + `, Err: "", + CheckFn: func(t *testing.T, spec Spec) { + assert.Equal(t, spec.Inputs[1].Service.CPort, 6788) + assert.Equal(t, spec.Inputs[1].Service.CSocket, ".test.sock") + }, }, } for _, scenario := range scenarios { t.Run(scenario.Name, func(t *testing.T) { - _, err := LoadSpec([]byte(scenario.Spec)) + spec, err := LoadSpec([]byte(scenario.Spec)) if scenario.Err != "" { require.Error(t, err) assert.Equal(t, scenario.Err, err.Error()) } else { require.NoError(t, err) + if scenario.CheckFn != nil { + scenario.CheckFn(t, spec) + } } }) } diff --git a/pkg/control/v1/proto/control_v1.pb.go b/pkg/control/v1/proto/control_v1.pb.go index 139273e5f6b..ab0e91ce98b 100644 --- a/pkg/control/v1/proto/control_v1.pb.go +++ b/pkg/control/v1/proto/control_v1.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v4.23.4 +// protoc v5.27.1 // 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 90fc475812e..5b3758838b0 100644 --- a/pkg/control/v1/proto/control_v1_grpc.pb.go +++ b/pkg/control/v1/proto/control_v1_grpc.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v4.23.4 +// - protoc v5.27.1 // source: control_v1.proto package proto diff --git a/pkg/control/v2/client/client.go b/pkg/control/v2/client/client.go index 13ab946ca0c..7f263988583 100644 --- a/pkg/control/v2/client/client.go +++ b/pkg/control/v2/client/client.go @@ -99,12 +99,13 @@ type ComponentState struct { // AgentStateInfo is the overall information about the Elastic Agent. type AgentStateInfo struct { - ID string `json:"id" yaml:"id"` - Version string `json:"version" yaml:"version"` - Commit string `json:"commit" yaml:"commit"` - BuildTime string `json:"build_time" yaml:"build_time"` - Snapshot bool `json:"snapshot" yaml:"snapshot"` - PID int32 `json:"pid" yaml:"pid"` + ID string `json:"id" yaml:"id"` + Version string `json:"version" yaml:"version"` + Commit string `json:"commit" yaml:"commit"` + BuildTime string `json:"build_time" yaml:"build_time"` + Snapshot bool `json:"snapshot" yaml:"snapshot"` + PID int32 `json:"pid" yaml:"pid"` + Unprivileged bool `json:"unprivileged" yaml:"unprivileged"` } // AgentState is the current state of the Elastic Agent. @@ -157,8 +158,6 @@ type DiagnosticComponentResult struct { } // Client communicates to Elastic Agent through the control protocol. -// -//go:generate mockery --name Client type Client interface { // Connect connects to the running Elastic Agent. Connect(ctx context.Context, opts ...grpc.DialOption) error @@ -467,12 +466,13 @@ func (sw *stateWatcher) Recv() (*AgentState, error) { func toState(res *cproto.StateResponse) (*AgentState, error) { s := &AgentState{ Info: AgentStateInfo{ - ID: res.Info.Id, - Version: res.Info.Version, - Commit: res.Info.Commit, - BuildTime: res.Info.BuildTime, - Snapshot: res.Info.Snapshot, - PID: res.Info.Pid, + ID: res.Info.Id, + Version: res.Info.Version, + Commit: res.Info.Commit, + BuildTime: res.Info.BuildTime, + Snapshot: res.Info.Snapshot, + PID: res.Info.Pid, + Unprivileged: res.Info.Unprivileged, }, State: res.State, Message: res.Message, diff --git a/pkg/control/v2/client/wait/agent.go b/pkg/control/v2/client/wait/agent.go new file mode 100644 index 00000000000..6073bc38fdc --- /dev/null +++ b/pkg/control/v2/client/wait/agent.go @@ -0,0 +1,60 @@ +// 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 wait + +import ( + "context" + "errors" + "time" +) + +// ForAgent waits for the agent daemon to be able to be communicated with. +func ForAgent(ctx context.Context, timeout time.Duration) error { + if timeout == 0 { + timeout = 1 * time.Minute // default of 1 minute + } + if timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, timeout) + defer cancel() + } + maxBackoff := timeout + if maxBackoff <= 0 { + // indefinite timeout + maxBackoff = 10 * time.Minute + } + + resChan := make(chan waitResult) + innerCtx, innerCancel := context.WithCancel(context.Background()) + defer innerCancel() + go func() { + backOff := expBackoffWithContext(innerCtx, 1*time.Second, maxBackoff) + for { + backOff.Wait() + _, err := getDaemonState(innerCtx, DefaultDaemonTimeout) + if errors.Is(err, context.Canceled) { + resChan <- waitResult{err: err} + return + } + if err == nil { + resChan <- waitResult{} + break + } + } + }() + + var res waitResult + select { + case <-ctx.Done(): + innerCancel() + res = <-resChan + case res = <-resChan: + } + + if res.err != nil { + return res.err + } + return nil +} diff --git a/pkg/control/v2/client/wait/common.go b/pkg/control/v2/client/wait/common.go new file mode 100644 index 00000000000..56969d562fe --- /dev/null +++ b/pkg/control/v2/client/wait/common.go @@ -0,0 +1,44 @@ +// 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 wait + +import ( + "context" + "time" + + "github.com/elastic/elastic-agent/internal/pkg/core/backoff" + "github.com/elastic/elastic-agent/pkg/control/v2/client" +) + +const ( + // DefaultDaemonTimeout is the default timeout to use for waiting for the daemon. + DefaultDaemonTimeout = 30 * time.Second // max amount of for communication to running Agent daemon +) + +type waitResult struct { + err error +} + +func getDaemonState(ctx context.Context, timeout time.Duration) (*client.AgentState, error) { + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + daemon := client.New() + err := daemon.Connect(ctx) + if err != nil { + return nil, err + } + defer daemon.Disconnect() + return daemon.State(ctx) +} + +func expBackoffWithContext(ctx context.Context, init, max time.Duration) backoff.Backoff { + signal := make(chan struct{}) + bo := backoff.NewExpBackoff(signal, init, max) + go func() { + <-ctx.Done() + close(signal) + }() + return bo +} diff --git a/pkg/control/v2/control_test.go b/pkg/control/v2/control_test.go index 768407e6042..09b7dcb158a 100644 --- a/pkg/control/v2/control_test.go +++ b/pkg/control/v2/control_test.go @@ -50,7 +50,10 @@ func newErrorLogger(t *testing.T) *logger.Logger { loggerCfg := logger.DefaultLoggingConfig() loggerCfg.Level = logp.ErrorLevel - log, err := logger.NewFromConfig("", loggerCfg, false) + eventLoggerCfg := logger.DefaultEventLoggingConfig() + eventLoggerCfg.Level = loggerCfg.Level + + log, err := logger.NewFromConfig("", loggerCfg, eventLoggerCfg, false) require.NoError(t, err) return log } diff --git a/pkg/control/v2/cproto/control_v2.pb.go b/pkg/control/v2/cproto/control_v2.pb.go index 461fae9a2f0..9d8e73ad2ce 100644 --- a/pkg/control/v2/cproto/control_v2.pb.go +++ b/pkg/control/v2/cproto/control_v2.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v4.23.4 +// protoc v5.27.1 // source: control_v2.proto package cproto @@ -262,16 +262,19 @@ func (PprofOption) EnumDescriptor() ([]byte, []int) { type AdditionalDiagnosticRequest int32 const ( - AdditionalDiagnosticRequest_CPU AdditionalDiagnosticRequest = 0 + AdditionalDiagnosticRequest_CPU AdditionalDiagnosticRequest = 0 + AdditionalDiagnosticRequest_CONN AdditionalDiagnosticRequest = 1 ) // Enum value maps for AdditionalDiagnosticRequest. var ( AdditionalDiagnosticRequest_name = map[int32]string{ 0: "CPU", + 1: "CONN", } AdditionalDiagnosticRequest_value = map[string]int32{ - "CPU": 0, + "CPU": 0, + "CONN": 1, } ) @@ -893,6 +896,8 @@ type StateAgentInfo struct { Snapshot bool `protobuf:"varint,5,opt,name=snapshot,proto3" json:"snapshot,omitempty"` // Current running PID. Pid int32 `protobuf:"varint,6,opt,name=pid,proto3" json:"pid,omitempty"` + // True when running as unprivileged. + Unprivileged bool `protobuf:"varint,7,opt,name=unprivileged,proto3" json:"unprivileged,omitempty"` } func (x *StateAgentInfo) Reset() { @@ -969,6 +974,13 @@ func (x *StateAgentInfo) GetPid() int32 { return 0 } +func (x *StateAgentInfo) GetUnprivileged() bool { + if x != nil { + return x.Unprivileged + } + return false +} + // StateResponse is the current state of Elastic Agent. // Next unused id: 8 type StateResponse struct { @@ -1985,7 +1997,7 @@ var file_control_v2_proto_rawDesc = []byte{ 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, + 0x52, 0x0b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xc2, 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, @@ -1995,204 +2007,207 @@ var file_control_v2_proto_rawDesc = []byte{ 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, + 0x70, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x22, + 0x0a, 0x0c, 0x75, 0x6e, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x64, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x75, 0x6e, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, + 0x65, 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, 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, + 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, 0x30, + 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, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x4e, 0x4e, 0x10, 0x01, + 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, - 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, + 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 8375317eb4e..c2519621d5a 100644 --- a/pkg/control/v2/cproto/control_v2_grpc.pb.go +++ b/pkg/control/v2/cproto/control_v2_grpc.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v4.23.4 +// - protoc v5.27.1 // source: control_v2.proto package cproto diff --git a/pkg/control/v2/server/listener.go b/pkg/control/v2/server/listener.go index 435dd86ee24..2f2e45125d2 100644 --- a/pkg/control/v2/server/listener.go +++ b/pkg/control/v2/server/listener.go @@ -2,57 +2,20 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -//go:build !windows - package server import ( - "fmt" "net" - "os" - "path/filepath" - "strings" - "github.com/elastic/elastic-agent/internal/pkg/agent/errors" "github.com/elastic/elastic-agent/pkg/control" "github.com/elastic/elastic-agent/pkg/core/logger" - "github.com/elastic/elastic-agent/pkg/utils" + "github.com/elastic/elastic-agent/pkg/ipc" ) func createListener(log *logger.Logger) (net.Listener, error) { - path := strings.TrimPrefix(control.Address(), "unix://") - if _, err := os.Stat(path); !os.IsNotExist(err) { - cleanupListener(log) - } - dir := filepath.Dir(path) - if _, err := os.Stat(dir); os.IsNotExist(err) { - err = os.MkdirAll(dir, 0775) - if err != nil { - return nil, err - } - } - lis, err := net.Listen("unix", path) - if err != nil { - return nil, err - } - mode := os.FileMode(0700) - root, _ := utils.HasRoot() // error ignored - if !root { - // allow group access when not running as root - mode = os.FileMode(0770) - } - err = os.Chmod(path, mode) - if err != nil { - // failed to set permissions (close listener) - lis.Close() - return nil, err - } - return lis, nil + return ipc.CreateListener(log, control.Address()) } func cleanupListener(log *logger.Logger) { - path := strings.TrimPrefix(control.Address(), "unix://") - if err := os.Remove(path); err != nil && !os.IsNotExist(err) { - log.Debug("%s", errors.New(err, fmt.Sprintf("Failed to cleanup %s", path), errors.TypeFilesystem, errors.M("path", path))) - } + ipc.CleanupListener(log, control.Address()) } diff --git a/pkg/control/v2/server/listener_windows.go b/pkg/control/v2/server/listener_windows.go deleted file mode 100644 index 6aa82c4561a..00000000000 --- a/pkg/control/v2/server/listener_windows.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. - -//go:build windows - -package server - -import ( - "fmt" - "net" - "os/user" - - "github.com/elastic/elastic-agent-libs/api/npipe" - - "github.com/elastic/elastic-agent/pkg/control" - "github.com/elastic/elastic-agent/pkg/core/logger" - "github.com/elastic/elastic-agent/pkg/utils" -) - -// createListener creates a named pipe listener on Windows -func createListener(log *logger.Logger) (net.Listener, error) { - sd, err := securityDescriptor(log) - if err != nil { - return nil, fmt.Errorf("failed to create security descriptor: %w", err) - } - lis, err := npipe.NewListener(npipe.TransformString(control.Address()), sd) - if err != nil { - return nil, fmt.Errorf("failed to create npipe listener: %w", err) - } - return lis, nil -} - -func cleanupListener(_ *logger.Logger) { - // nothing to do on windows -} - -func securityDescriptor(log *logger.Logger) (string, error) { - u, err := user.Current() - if err != nil { - return "", fmt.Errorf("failed to get current user: %w", err) - } - - descriptor := "D:P(A;;GA;;;" + u.Uid + ")" - - if isAdmin, err := utils.HasRoot(); err != nil { - // do not fail, agent would end up in a loop, continue with limited permissions - log.Warnf("failed to detect admin: %w", err) - } else if isAdmin { - // running as SYSTEM, include Administrators group so Administrators can talk over - // the named pipe to the running Elastic Agent system process - // https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems - descriptor += "(A;;GA;;;" + utils.AdministratorSID + ")" - } - - return descriptor, nil -} diff --git a/pkg/control/v2/server/server.go b/pkg/control/v2/server/server.go index 6de85dea5fe..316108f21cc 100644 --- a/pkg/control/v2/server/server.go +++ b/pkg/control/v2/server/server.go @@ -392,12 +392,13 @@ func stateToProto(state *coordinator.State, agentInfo info.Agent) (*cproto.State return &cproto.StateResponse{ Info: &cproto.StateAgentInfo{ - Id: agentInfo.AgentID(), - Version: release.Version(), - Commit: release.Commit(), - BuildTime: release.BuildTime().Format(control.TimeFormat()), - Snapshot: release.Snapshot(), - Pid: int32(os.Getpid()), + Id: agentInfo.AgentID(), + Version: release.Version(), + Commit: release.Commit(), + BuildTime: release.BuildTime().Format(control.TimeFormat()), + Snapshot: release.Snapshot(), + Pid: int32(os.Getpid()), + Unprivileged: agentInfo.Unprivileged(), }, State: state.State, Message: state.Message, diff --git a/pkg/core/logger/logger.go b/pkg/core/logger/logger.go index b7598f9ef23..fc7e4acd554 100644 --- a/pkg/core/logger/logger.go +++ b/pkg/core/logger/logger.go @@ -5,6 +5,7 @@ package logger import ( + "bytes" "fmt" "os" "path/filepath" @@ -48,7 +49,8 @@ var internalLevelEnabler *zap.AtomicLevel // New returns a configured ECS Logger func New(name string, logInternal bool) (*Logger, error) { defaultCfg := DefaultLoggingConfig() - return new(name, defaultCfg, logInternal) + defaultEventLogCfg := DefaultEventLoggingConfig() + return new(name, defaultCfg, defaultEventLogCfg, logInternal) } // NewWithLogpLevel returns a configured logp Logger with specified level. @@ -56,13 +58,16 @@ func NewWithLogpLevel(name string, level logp.Level, logInternal bool) (*Logger, defaultCfg := DefaultLoggingConfig() defaultCfg.Level = level - return new(name, defaultCfg, logInternal) + defaultEventLogCfg := DefaultEventLoggingConfig() + defaultEventLogCfg.Level = level + + return new(name, defaultCfg, defaultEventLogCfg, logInternal) } // NewFromConfig takes the user configuration and generate the right logger. // We should finish implementation, need support on the library that we use. -func NewFromConfig(name string, cfg *Config, logInternal bool) (*Logger, error) { - return new(name, cfg, logInternal) +func NewFromConfig(name string, cfg, eventLogCfg *Config, logInternal bool) (*Logger, error) { + return new(name, cfg, eventLogCfg, logInternal) } // NewWithoutConfig returns a new logger without having a configuration. @@ -72,6 +77,31 @@ func NewWithoutConfig(name string) *Logger { return logp.NewLogger(name) } +// NewInMemory returns a new in-memory logger along with the buffer to which i +// logs. +// encCfg configures the log format, use logp.ConsoleEncoderConfig for console +// format, logp.JSONEncoderConfig for JSON or any other valid zapcore.EncoderConfig. +func NewInMemory(selector string, encCfg zapcore.EncoderConfig) (*Logger, *bytes.Buffer) { + buff := bytes.Buffer{} + + encoderConfig := ecszap.ECSCompatibleEncoderConfig(encCfg) + encoderConfig.EncodeTime = UtcTimestampEncode + encoder := zapcore.NewConsoleEncoder(encoderConfig) + + core := zapcore.NewCore( + encoder, + zapcore.AddSync(&buff), + zap.NewAtomicLevelAt(zap.DebugLevel)) + ecszap.ECSCompatibleEncoderConfig(logp.ConsoleEncoderConfig()) + + logger := logp.NewLogger( + selector, + zap.WrapCore(func(in zapcore.Core) zapcore.Core { + return core + })) + return logger, &buff +} + // AddCallerSkip returns new logger with incremented stack frames to skip. // This is needed in order to correctly report the log file lines when the logging statement // is wrapped in some convenience wrapping function for example. @@ -79,10 +109,10 @@ func AddCallerSkip(l *Logger, skip int) *Logger { return l.WithOptions(zap.AddCallerSkip(skip)) } -func new(name string, cfg *Config, logInternal bool) (*Logger, error) { +func new(name string, cfg, eventLoggerCfg *Config, logInternal bool) (*Logger, error) { commonCfg, err := ToCommonConfig(cfg) if err != nil { - return nil, err + return nil, fmt.Errorf("could not convert log config: %w", err) } var outputs []zapcore.Core @@ -95,9 +125,15 @@ func new(name string, cfg *Config, logInternal bool) (*Logger, error) { outputs = append(outputs, internal) } - if err := configure.LoggingWithOutputs("", commonCfg, outputs...); err != nil { + eventLoggercommonCfg, err := ToCommonConfig(eventLoggerCfg) + if err != nil { + return nil, fmt.Errorf("could not convert event log config: %w", err) + } + + if err := configure.LoggingWithTypedOutputs("", commonCfg, eventLoggercommonCfg, "log.type", "event", outputs...); err != nil { return nil, fmt.Errorf("error initializing logging: %w", err) } + return logp.NewLogger(name), nil } @@ -147,7 +183,24 @@ func DefaultLoggingConfig() *Config { return &cfg } -// makeInternalFileOutput creates a zapcore.Core logger that cannot be changed with configuration. +// DefaultLoggingConfig returns default configuration for agent logging. +func DefaultEventLoggingConfig() *Config { + cfg := logp.DefaultEventConfig(logp.DefaultEnvironment) + + // That's the same path useb by MakeInternalFileOutput + cfg.Files.Path = filepath.Join(paths.Home(), DefaultLogDirectory, "events") + cfg.Files.Name = agentName + "-event-log" + + root, _ := utils.HasRoot() // error ignored + if !root { + // when not running as root, the default changes to include the group + cfg.Files.Permissions = 0660 + } + + return &cfg +} + +// MakeInternalFileOutput creates a zapcore.Core logger that cannot be changed with configuration. // // This is the logger that the spawned filebeat expects to read the log file from and ship to ES. func MakeInternalFileOutput(cfg *Config) (zapcore.Core, error) { diff --git a/pkg/core/logger/logger_test.go b/pkg/core/logger/logger_test.go index 187a2f6a7f1..4a4378ba5a7 100644 --- a/pkg/core/logger/logger_test.go +++ b/pkg/core/logger/logger_test.go @@ -5,8 +5,10 @@ package logger import ( + "strings" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" @@ -56,3 +58,31 @@ func Test_SetLevel(t *testing.T) { require.Equal(t, tc.ErrEnabled, internalLevelEnabler.Enabled(zapcore.ErrorLevel)) } } + +func TestNewInMemory(t *testing.T) { + log, buff := NewInMemory("in_memory", logp.ConsoleEncoderConfig()) + + log.Debugw("a debug message", "debug_key", "debug_val") + log.Infow("a info message", "info_key", "info_val") + log.Warnw("a warn message", "warn_key", "warn_val") + log.Errorw("an error message", "error_key", "error_val") + + logs := strings.Split(strings.TrimSpace(buff.String()), "\n") + assert.Len(t, logs, 4, "expected 4 log entries") + + assert.Contains(t, logs[0], "a debug message") + assert.Contains(t, logs[0], "debug_key") + assert.Contains(t, logs[0], "debug_val") + + assert.Contains(t, logs[1], "a info message") + assert.Contains(t, logs[1], "info_key") + assert.Contains(t, logs[1], "info_val") + + assert.Contains(t, logs[2], "a warn message") + assert.Contains(t, logs[2], "warn_key") + assert.Contains(t, logs[2], "warn_val") + + assert.Contains(t, logs[3], "an error message") + assert.Contains(t, logs[3], "error_key") + assert.Contains(t, logs[3], "error_val") +} diff --git a/pkg/ipc/listener.go b/pkg/ipc/listener.go new file mode 100644 index 00000000000..80e76fbb980 --- /dev/null +++ b/pkg/ipc/listener.go @@ -0,0 +1,67 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build !windows + +package ipc + +import ( + "fmt" + "net" + "os" + "path/filepath" + "strings" + + "github.com/elastic/elastic-agent/internal/pkg/agent/errors" + "github.com/elastic/elastic-agent/pkg/core/logger" + "github.com/elastic/elastic-agent/pkg/utils" +) + +const schemeUnixPrefix = "unix://" + +func IsLocal(address string) bool { + return strings.HasPrefix(address, schemeUnixPrefix) +} + +// CreateListener creates net listener from address string +// Shared for control and beats comms sockets +func CreateListener(log *logger.Logger, address string) (net.Listener, error) { + path := strings.TrimPrefix(address, schemeUnixPrefix) + if _, err := os.Stat(path); !os.IsNotExist(err) { + CleanupListener(log, address) + } + dir := filepath.Dir(path) + if _, err := os.Stat(dir); os.IsNotExist(err) { + err = os.MkdirAll(dir, 0775) + if err != nil { + return nil, err + } + } + lis, err := net.Listen("unix", path) + if err != nil { + return nil, err + } + mode := os.FileMode(0700) + root, _ := utils.HasRoot() // error ignored + if !root { + // allow group access when not running as root + mode = os.FileMode(0770) + } + err = os.Chmod(path, mode) + if err != nil { + // failed to set permissions (close listener) + lis.Close() + return nil, err + } + return lis, nil +} + +// CleanupListener removes listener file if domain socket +// Shared for control and beats comms sockets +func CleanupListener(log *logger.Logger, address string) { + path := strings.TrimPrefix(address, schemeUnixPrefix) + if err := os.Remove(path); err != nil && !os.IsNotExist(err) { + log.Debug("%s", errors.New(err, fmt.Sprintf("Failed to cleanup %s", path), errors.TypeFilesystem, errors.M("path", path))) + } +} diff --git a/pkg/ipc/listener_windows.go b/pkg/ipc/listener_windows.go new file mode 100644 index 00000000000..8d298a90835 --- /dev/null +++ b/pkg/ipc/listener_windows.go @@ -0,0 +1,108 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build windows + +package ipc + +import ( + "fmt" + "net" + "os/user" + "strings" + + "github.com/hectane/go-acl/api" + "golang.org/x/sys/windows" + + "github.com/elastic/elastic-agent-libs/api/npipe" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/pkg/core/logger" + "github.com/elastic/elastic-agent/pkg/utils" +) + +const schemeNpipePrefix = "npipe://" + +func IsLocal(address string) bool { + return strings.HasPrefix(address, schemeNpipePrefix) +} + +// CreateListener creates net listener from address string +// Shared for control and beats comms sockets +func CreateListener(log *logger.Logger, address string) (net.Listener, error) { + sd, err := securityDescriptor(log) + if err != nil { + return nil, fmt.Errorf("failed to create security descriptor: %w", err) + } + lis, err := npipe.NewListener(npipe.TransformString(address), sd) + if err != nil { + return nil, fmt.Errorf("failed to create npipe listener: %w", err) + } + return lis, nil +} + +func CleanupListener(log *logger.Logger, address string) { + // nothing to do on windows +} + +func securityDescriptor(log *logger.Logger) (string, error) { + u, err := user.Current() + if err != nil { + return "", fmt.Errorf("failed to get current user: %w", err) + } + + descriptor := "D:P(A;;GA;;;" + u.Uid + ")" + + isAdmin, err := utils.HasRoot() + if err != nil { + // do not fail, agent would end up in a loop, continue with limited permissions + log.Warnf("failed to detect Administrator: %w", err) + isAdmin = false // just in-case to ensure that in error case that its always false + } + // SYSTEM/Administrators can always talk over the pipe, even when not running as privileged + // https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems + descriptor += "(A;;GA;;;" + utils.AdministratorSID + ")" + if !isAdmin && paths.RunningInstalled() { + // Windows doesn't provide a way to set the executing group when being executed as a service, + // but a group needs to be added to the named pipe in unprivileged mode to allow users in the group + // to ability to communicate with the named pipe. + // + // During installation a group is set as the owner of the files which can be used here to determine + // the group that should be added to the named pipe. + gid, err := pathGID(paths.Top()) + if err != nil { + // do not fail, agent would end up in a loop, continue with limited permissions + log.Warnf("failed to detect group: %w", err) + } else { + descriptor += "(A;;GA;;;" + gid + ")" + } + } + + return descriptor, nil +} + +func pathGID(path string) (string, error) { + var group *windows.SID + var secDesc windows.Handle + err := api.GetNamedSecurityInfo( + path, + api.SE_FILE_OBJECT, + api.GROUP_SECURITY_INFORMATION, + nil, + &group, + nil, + nil, + &secDesc, + ) + if err != nil { + return "", fmt.Errorf("call to GetNamedSecurityInfo at %s failed: %w", path, err) + } + defer func() { + _, _ = windows.LocalFree(secDesc) + }() + if group == nil { + return "", fmt.Errorf("failed to determine group using GetNamedSecurityInfo at %s", path) + } + return group.String(), nil +} diff --git a/pkg/testing/define/define.go b/pkg/testing/define/define.go index 20eac6c8f85..464d5f0eaf8 100644 --- a/pkg/testing/define/define.go +++ b/pkg/testing/define/define.go @@ -66,9 +66,9 @@ func Version() string { return ver } -// NewFixture returns a new Elastic Agent testing fixture with a LocalFetcher and +// NewFixtureFromLocalBuild returns a new Elastic Agent testing fixture with a LocalFetcher and // the agent logging to the test logger. -func NewFixture(t *testing.T, version string, opts ...atesting.FixtureOpt) (*atesting.Fixture, error) { +func NewFixtureFromLocalBuild(t *testing.T, version string, opts ...atesting.FixtureOpt) (*atesting.Fixture, error) { buildsDir := os.Getenv("AGENT_BUILD_DIR") if buildsDir == "" { projectDir, err := findProjectRoot() @@ -82,7 +82,7 @@ func NewFixture(t *testing.T, version string, opts ...atesting.FixtureOpt) (*ate } -// NewFixture returns a new Elastic Agent testing fixture with a LocalFetcher and +// NewFixtureWithBinary returns a new Elastic Agent testing fixture with a LocalFetcher and // the agent logging to the test logger. func NewFixtureWithBinary(t *testing.T, version string, binary string, buildsDir string, opts ...atesting.FixtureOpt) (*atesting.Fixture, error) { ver, err := semver.ParseVersion(version) diff --git a/pkg/testing/ess/deployment.go b/pkg/testing/ess/deployment.go index cbb15e40f5e..28a9a1b2c9d 100644 --- a/pkg/testing/ess/deployment.go +++ b/pkg/testing/ess/deployment.go @@ -9,6 +9,7 @@ import ( "context" _ "embed" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -251,20 +252,19 @@ func (c *Client) DeploymentIsReady(ctx context.Context, deploymentID string, tic ticker := time.NewTicker(tick) defer ticker.Stop() + var errs error statusCh := make(chan DeploymentStatus, 1) - errCh := make(chan error) - for { select { case <-ctx.Done(): - return false, ctx.Err() + return false, errors.Join(errs, ctx.Err()) case <-ticker.C: - statusCtx, statusCancel := context.WithTimeout(ctx, tick) - defer statusCancel() go func() { + statusCtx, statusCancel := context.WithTimeout(ctx, tick) + defer statusCancel() status, err := c.DeploymentStatus(statusCtx, deploymentID) if err != nil { - errCh <- err + errs = errors.Join(errs, err) return } statusCh <- status.Overall @@ -273,8 +273,6 @@ func (c *Client) DeploymentIsReady(ctx context.Context, deploymentID string, tic if status == DeploymentStatusStarted { return true, nil } - case err := <-errCh: - return false, err } } } diff --git a/pkg/testing/ess/statful_provisioner.go b/pkg/testing/ess/statful_provisioner.go index a9de4b3bbb8..b659381fa41 100644 --- a/pkg/testing/ess/statful_provisioner.go +++ b/pkg/testing/ess/statful_provisioner.go @@ -75,7 +75,7 @@ func (p *statefulProvisioner) Create(ctx context.Context, request runner.StackRe deploymentTags := map[string]string{ "division": "engineering", "org": "ingest", - "team": "elastic-agent", + "team": "elastic-agent-control-plane", "project": "elastic-agent", "integration-tests": "true", } diff --git a/pkg/testing/fetcher_artifact.go b/pkg/testing/fetcher_artifact.go index 3f3c1ec8ce8..cbf0e7c7835 100644 --- a/pkg/testing/fetcher_artifact.go +++ b/pkg/testing/fetcher_artifact.go @@ -80,7 +80,7 @@ func (f *artifactFetcher) Fetch(ctx context.Context, operatingSystem string, arc uri, err := findURI(ctx, f.doer, ver) if err != nil { - return nil, fmt.Errorf("failed to find snapshot URI for version %s: %w", ver, err) + return nil, fmt.Errorf("failed to find artifact URI for version %s: %w", ver, err) } // this remote path cannot have the build metadata in it @@ -136,129 +136,62 @@ func (r *artifactResult) Fetch(ctx context.Context, l Logger, dir string) error return nil } -type projectResponse struct { - Packages map[string]interface{} `json:"packages"` -} - -type projectsResponse struct { - ElasticPackage projectResponse `json:"elastic-agent-package"` -} - -type manifestResponse struct { - Projects projectsResponse `json:"projects"` -} - -func findBuild(ctx context.Context, doer httpDoer, version *semver.ParsedSemVer) (*projectResponse, error) { - // e.g. https://snapshots.elastic.co/8.13.0-l5snflwr/manifest-8.13.0-SNAPSHOT.json - manifestURI := fmt.Sprintf("https://snapshots.elastic.co/%s-%s/manifest-%s-SNAPSHOT.json", version.CoreVersion(), version.BuildMetadata(), version.CoreVersion()) - req, err := http.NewRequestWithContext(ctx, http.MethodGet, manifestURI, nil) - if err != nil { - return nil, err - } - resp, err := doer.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("%s; bad status: %s", manifestURI, resp.Status) +func findURI(ctx context.Context, doer httpDoer, version *semver.ParsedSemVer) (string, error) { + // if we know the exact build ID, we can build the URI right away + if version.BuildMetadata() != "" { + return fmt.Sprintf("https://snapshots.elastic.co/%s-%s/downloads/beats/elastic-agent/", version.CoreVersion(), version.BuildMetadata()), nil } - var body manifestResponse - - dec := json.NewDecoder(resp.Body) - if err := dec.Decode(&body); err != nil { - return nil, err + // if it's the latest snapshot of a version, we can find a build ID and build the URI in the same manner + if version.IsSnapshot() { + buildID, err := findLatestSnapshot(ctx, doer, version.CoreVersion()) + if err != nil { + return "", fmt.Errorf("failed to find snapshot information for version %q: %w", version, err) + } + return fmt.Sprintf("https://snapshots.elastic.co/%s-%s/downloads/beats/elastic-agent/", version.CoreVersion(), buildID), nil } - return &body.Projects.ElasticPackage, nil + // otherwise, we're looking for a publicly released version + return "https://artifacts.elastic.co/downloads/beats/elastic-agent/", nil } -func findVersion(ctx context.Context, doer httpDoer, version *semver.ParsedSemVer) (*projectResponse, error) { - artifactsURI := fmt.Sprintf("https://artifacts-api.elastic.co/v1/search/%s/elastic-agent", version.VersionWithPrerelease()) - req, err := http.NewRequestWithContext(ctx, http.MethodGet, artifactsURI, nil) - if err != nil { - return nil, err - } - resp, err := doer.Do(req) +func findLatestSnapshot(ctx context.Context, doer httpDoer, version string) (buildID string, err error) { + latestSnapshotURI := fmt.Sprintf("https://snapshots.elastic.co/latest/%s-SNAPSHOT.json", version) + request, err := http.NewRequestWithContext(ctx, http.MethodGet, latestSnapshotURI, nil) if err != nil { - return nil, err - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("%s; bad status: %s", artifactsURI, resp.Status) - } - - var body projectResponse - - dec := json.NewDecoder(resp.Body) - if err := dec.Decode(&body); err != nil { - return nil, err - } - - return &body, nil -} - -func findURI(ctx context.Context, doer httpDoer, version *semver.ParsedSemVer) (string, error) { - var ( - project *projectResponse - err error - ) - - if version.BuildMetadata() != "" { - project, err = findBuild(ctx, doer, version) - } else { - project, err = findVersion(ctx, doer, version) + return "", fmt.Errorf("failed to create request to the snapshot API: %w", err) } + resp, err := doer.Do(request) if err != nil { - return "", fmt.Errorf("failed to find package URL: %w", err) + return "", err } + defer resp.Body.Close() - if len(project.Packages) == 0 { - return "", fmt.Errorf("no packages found in repo") - } + switch resp.StatusCode { + case http.StatusNotFound: + return "", fmt.Errorf("snapshot for version %q not found", version) - for k, pkg := range project.Packages { - pkgMap, ok := pkg.(map[string]interface{}) - if !ok { - return "", fmt.Errorf("content of '%s' is not a map", k) + case http.StatusOK: + var info struct { + BuildID string `json:"build_id"` } - uriVal, found := pkgMap["url"] - if !found { - return "", fmt.Errorf("item '%s' does not contain url", k) + dec := json.NewDecoder(resp.Body) + if err := dec.Decode(&info); err != nil { + return "", err } - uri, ok := uriVal.(string) - if !ok { - return "", fmt.Errorf("uri is not a string") + parts := strings.Split(info.BuildID, "-") + if len(parts) != 2 { + return "", fmt.Errorf("wrong format for a build ID: %s", info.BuildID) } - // Because we're iterating over a map from the API response, - // the order is random and some elements there do not contain the - // `/beats/elastic-agent/` substring, so we need to go through the - // whole map before returning an error. - // - // One of the elements that might be there and do not contain this - // substring is the `elastic-agent-shipper`, whose URL is something like: - // https://snapshots.elastic.co/8.7.0-d050210c/downloads/elastic-agent-shipper/elastic-agent-shipper-8.7.0-SNAPSHOT-linux-x86_64.tar.gz - index := strings.Index(uri, "/beats/elastic-agent/") - if index != -1 { - if version.BuildMetadata() == "" { - // no build id, first is selected - return fmt.Sprintf("%s/beats/elastic-agent/", uri[:index]), nil - } - if strings.Contains(uri, fmt.Sprintf("%s-%s", version.CoreVersion(), version.BuildMetadata())) { - return fmt.Sprintf("%s/beats/elastic-agent/", uri[:index]), nil - } - } - } + return parts[1], nil - if version.BuildMetadata() == "" { - return "", fmt.Errorf("uri for version %q not detected", version) + default: + return "", fmt.Errorf("unexpected status code %d from %s", resp.StatusCode, latestSnapshotURI) } - return "", fmt.Errorf("uri not detected with specific build ID %q", version.BuildMetadata()) } func DownloadPackage(ctx context.Context, l Logger, doer httpDoer, downloadPath string, packageFile string) error { diff --git a/pkg/testing/fetcher_artifact_test.go b/pkg/testing/fetcher_artifact_test.go index f2f0aae51e2..db314bb739b 100644 --- a/pkg/testing/fetcher_artifact_test.go +++ b/pkg/testing/fetcher_artifact_test.go @@ -151,15 +151,15 @@ func newFakeHttpClient(t *testing.T) *fakeHttpClient { // actual artifacts // 8.12 release - "https://staging.elastic.co/8.12.0-xx1lc7my/downloads/beats/elastic-agent/elastic-agent-8.12.0-linux-x86_64.tar.gz": { + "https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.12.0-linux-x86_64.tar.gz": { StatusCode: 200, Body: io.NopCloser(bytes.NewReader([]byte(binaryResponse))), }, - "https://staging.elastic.co/8.12.0-xx1lc7my/downloads/beats/elastic-agent/elastic-agent-8.12.0-linux-x86_64.tar.gz.sha512": { + "https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.12.0-linux-x86_64.tar.gz.sha512": { StatusCode: 200, Body: io.NopCloser(bytes.NewReader([]byte(hashResponse))), }, - "https://staging.elastic.co/8.12.0-xx1lc7my/downloads/beats/elastic-agent/elastic-agent-8.12.0-linux-x86_64.tar.gz.asc": { + "https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.12.0-linux-x86_64.tar.gz.asc": { StatusCode: 200, Body: io.NopCloser(bytes.NewReader([]byte(ascResponse))), }, @@ -176,6 +176,10 @@ func newFakeHttpClient(t *testing.T) *fakeHttpClient { StatusCode: 200, Body: io.NopCloser(bytes.NewReader([]byte(ascResponse))), }, + "https://snapshots.elastic.co/latest/8.13.0-SNAPSHOT.json": { + StatusCode: 200, + Body: io.NopCloser(bytes.NewReader([]byte(`{"build_id":"8.13.0-yil7wib0"}`))), + }, // 8.13 build l5snflwr "https://snapshots.elastic.co/8.13.0-l5snflwr/downloads/beats/elastic-agent/elastic-agent-8.13.0-SNAPSHOT-linux-x86_64.tar.gz": { diff --git a/pkg/testing/fixture.go b/pkg/testing/fixture.go index 1f74eac5ad2..d2e5b2e40f5 100644 --- a/pkg/testing/fixture.go +++ b/pkg/testing/fixture.go @@ -831,13 +831,18 @@ func (f *Fixture) EnsurePrepared(ctx context.Context) error { func (f *Fixture) binaryPath() string { workDir := f.workDir if f.installed { + installDir := "Agent" + if f.installOpts != nil && f.installOpts.Namespace != "" { + installDir = paths.InstallDirNameForNamespace(f.installOpts.Namespace) + } + if f.installOpts != nil && f.installOpts.BasePath != "" { - workDir = filepath.Join(f.installOpts.BasePath, "Elastic", "Agent") + workDir = filepath.Join(f.installOpts.BasePath, "Elastic", installDir) } else { - workDir = filepath.Join(paths.DefaultBasePath, "Elastic", "Agent") + workDir = filepath.Join(paths.DefaultBasePath, "Elastic", installDir) } } - if f.packageFormat == "deb" { + if f.packageFormat == "deb" || f.packageFormat == "rpm" { workDir = "/usr/bin" } defaultBin := "elastic-agent" @@ -1162,11 +1167,13 @@ func performConfigure(ctx context.Context, c client.Client, cfg string, timeout type AgentStatusOutput struct { Info struct { - ID string `json:"id"` - Version string `json:"version"` - Commit string `json:"commit"` - BuildTime string `json:"build_time"` - Snapshot bool `json:"snapshot"` + ID string `json:"id"` + Version string `json:"version"` + Commit string `json:"commit"` + BuildTime string `json:"build_time"` + Snapshot bool `json:"snapshot"` + PID int32 `json:"pid"` + Unprivileged bool `json:"unprivileged"` } `json:"info"` State int `json:"state"` Message string `json:"message"` diff --git a/pkg/testing/fixture_install.go b/pkg/testing/fixture_install.go index c846874a068..81aa7db3ac6 100644 --- a/pkg/testing/fixture_install.go +++ b/pkg/testing/fixture_install.go @@ -14,6 +14,7 @@ import ( "io/fs" "os" "os/exec" + "path" "path/filepath" "runtime" "strconv" @@ -43,6 +44,11 @@ type CmdOpts interface { type EnrollOpts struct { URL string // --url EnrollmentToken string // --enrollment-token + + // SSL/TLS options + CertificateAuthorities []string // --certificate-authorities + Certificate string // --elastic-agent-cert + Key string // --elastic-agent-cert-key } func (e EnrollOpts) toCmdArgs() []string { @@ -53,6 +59,42 @@ func (e EnrollOpts) toCmdArgs() []string { if e.EnrollmentToken != "" { args = append(args, "--enrollment-token", e.EnrollmentToken) } + + if len(e.CertificateAuthorities) > 0 { + args = append(args, "--certificate-authorities="+strings.Join(e.CertificateAuthorities, ",")) + } + + if e.Certificate != "" { + args = append(args, "--elastic-agent-cert="+e.Certificate) + } + + if e.Key != "" { + args = append(args, "--elastic-agent-cert-key="+e.Key) + } + return args +} + +type FleetBootstrapOpts struct { + ESHost string // --fleet-server-es + ServiceToken string // --fleet-server-service-token + Policy string // --fleet-server-policy + Port int // --fleet-server-port +} + +func (f FleetBootstrapOpts) toCmdArgs() []string { + var args []string + if f.ESHost != "" { + args = append(args, "--fleet-server-es", f.ESHost) + } + if f.ServiceToken != "" { + args = append(args, "--fleet-server-service-token", f.ServiceToken) + } + if f.Policy != "" { + args = append(args, "--fleet-server-policy", f.Policy) + } + if f.Port > 0 { + args = append(args, "--fleet-server-port", fmt.Sprintf("%d", f.Port)) + } return args } @@ -64,24 +106,16 @@ type InstallOpts struct { NonInteractive bool // --non-interactive ProxyURL string // --proxy-url DelayEnroll bool // --delay-enroll + Develop bool // --develop, not supported for DEB and RPM. Calling Install() sets Namespace to the development namespace so that checking only for a Namespace is sufficient. + Namespace string // --namespace, not supported for DEB and RPM. - // Unprivileged by default installs the Elastic Agent as `--unprivileged` unless - // the platform being tested doesn't currently support it, or it's explicitly set - // to false. - Unprivileged *bool // --unprivileged + Privileged bool // inverse of --unprivileged (as false is the default) EnrollOpts + FleetBootstrapOpts } -func (i InstallOpts) IsUnprivileged(operatingSystem string) bool { - if i.Unprivileged == nil { - // not explicitly set, default to true on Linux only (until other platforms support it) - return operatingSystem == "linux" - } - return *i.Unprivileged -} - -func (i InstallOpts) toCmdArgs(operatingSystem string) ([]string, error) { +func (i *InstallOpts) toCmdArgs(operatingSystem string) ([]string, error) { var args []string if i.BasePath != "" { args = append(args, "--base-path", i.BasePath) @@ -101,25 +135,26 @@ func (i InstallOpts) toCmdArgs(operatingSystem string) ([]string, error) { if i.DelayEnroll { args = append(args, "--delay-enroll") } - - unprivileged := i.IsUnprivileged(operatingSystem) - if unprivileged { - if operatingSystem != "linux" { - return nil, fmt.Errorf("--unprivileged cannot be set to true unless testing is being done on Linux") - } + if !i.Privileged { args = append(args, "--unprivileged") } + if i.Namespace != "" { + args = append(args, "--namespace="+i.Namespace) + } + if i.Develop { + args = append(args, "--develop") + if i.Namespace == "" { + // If --namespace was used it will override the development namespace. + i.Namespace = paths.DevelopmentNamespace + } + } args = append(args, i.EnrollOpts.toCmdArgs()...) + args = append(args, i.FleetBootstrapOpts.toCmdArgs()...) return args, nil } -// NewBool returns a boolean pointer. -func NewBool(value bool) *bool { - return &value -} - // Install installs the prepared Elastic Agent binary and registers a t.Cleanup // function to uninstall the agent if it hasn't been uninstalled. It also takes // care of collecting a diagnostics when AGENT_COLLECT_DIAG=true or the test @@ -130,14 +165,18 @@ func NewBool(value bool) *bool { func (f *Fixture) Install(ctx context.Context, installOpts *InstallOpts, opts ...process.CmdOption) ([]byte, error) { f.t.Logf("[test %s] Inside fixture install function", f.t.Name()) - // check for running agents before installing, but proceed anyway - assert.Empty(f.t, getElasticAgentProcesses(f.t), "there should be no running agent at beginning of Install()") + // check for running agents before installing, but only if not installed into a namespace whose point is allowing two agents at once. + if installOpts != nil && !installOpts.Develop && installOpts.Namespace == "" { + assert.Empty(f.t, getElasticAgentProcesses(f.t), "there should be no running agent at beginning of Install()") + } switch f.packageFormat { case "targz", "zip": return f.installNoPkgManager(ctx, installOpts, opts) case "deb": return f.installDeb(ctx, installOpts, opts) + case "rpm": + return f.installRpm(ctx, installOpts, opts) default: return nil, fmt.Errorf("package format %s isn't supported yet", f.packageFormat) } @@ -172,19 +211,26 @@ func (f *Fixture) installNoPkgManager(ctx context.Context, installOpts *InstallO f.installed = true f.installOpts = installOpts + installDir := "Agent" + socketRunSymlink := paths.ControlSocketRunSymlink("") + if installOpts.Namespace != "" { + installDir = paths.InstallDirNameForNamespace(installOpts.Namespace) + socketRunSymlink = paths.ControlSocketRunSymlink(installOpts.Namespace) + } + if installOpts.BasePath == "" { - f.workDir = filepath.Join(paths.DefaultBasePath, "Elastic", "Agent") + f.workDir = filepath.Join(paths.DefaultBasePath, "Elastic", installDir) } else { - f.workDir = filepath.Join(installOpts.BasePath, "Elastic", "Agent") + f.workDir = filepath.Join(installOpts.BasePath, "Elastic", installDir) } // we just installed agent, the control socket is at a well-known location - socketPath := fmt.Sprintf("unix://%s", paths.ControlSocketRunSymlink) // use symlink as that works for all versions + socketPath := fmt.Sprintf("unix://%s", socketRunSymlink) // use symlink as that works for all versions if runtime.GOOS == "windows" { // Windows uses a fixed named pipe, that is always the same. // It is the same even running in unprivileged mode. socketPath = paths.WindowsControlSocketInstalledPath - } else if installOpts.IsUnprivileged(f.operatingSystem) { + } else if !installOpts.Privileged { // Unprivileged versions move the socket to inside the installed directory // of the Elastic Agent. socketPath = paths.ControlSocketFromPath(runtime.GOOS, f.workDir) @@ -205,10 +251,16 @@ func (f *Fixture) installNoPkgManager(ctx context.Context, installOpts *InstallO sanitizedTestName := strings.ReplaceAll(f.t.Name(), "/", "-") filePath := filepath.Join(dir, "build", "diagnostics", fmt.Sprintf("TEST-%s-%s-%s-ProcessDump.json", sanitizedTestName, f.operatingSystem, f.architecture)) + fileDir := path.Dir(filePath) + if err := os.MkdirAll(fileDir, 0777); err != nil { + f.t.Logf("failed to dump process; failed to create directory %s: %s", fileDir, err) + return + } + f.t.Logf("Dumping running processes in %s", filePath) file, err := os.OpenFile(filePath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0o644) if err != nil { - f.t.Logf("failed to dump process; failed to create output file %s root: %s", file.Name(), err) + f.t.Logf("failed to dump process; failed to create output file %s root: %s", filePath, err) return } defer func(file *os.File) { @@ -226,7 +278,20 @@ func (f *Fixture) installNoPkgManager(ctx context.Context, installOpts *InstallO f.t.Cleanup(func() { // check for running agents after uninstall had a chance to run - assert.Empty(f.t, getElasticAgentProcesses(f.t), "there should be no running agent at the end of the test") + processes := getElasticAgentProcesses(f.t) + + // there can be a single agent left when using --develop mode + if f.installOpts != nil && f.installOpts.Namespace != "" { + assert.LessOrEqualf(f.t, len(processes), 1, "More than one agent left running at the end of the test when second agent in namespace %s was used: %v", f.installOpts.Namespace, processes) + // The agent left running has to be the non-development agent. The development agent should be uninstalled first as a convention. + if len(processes) > 0 { + assert.NotContainsf(f.t, processes[0].Cmdline, paths.InstallDirNameForNamespace(f.installOpts.Namespace), + "The agent installed into namespace %s was left running at the end of the test or was not uninstalled first: %v", f.installOpts.Namespace, processes) + } + return + } + + assert.Empty(f.t, processes, "there should be no running agent at the end of the test") }) f.t.Cleanup(func() { @@ -435,6 +500,81 @@ func (f *Fixture) installDeb(ctx context.Context, installOpts *InstallOpts, opts return nil, nil } +// installRpm installs the prepared Elastic Agent binary from the rpm +// package and registers a t.Cleanup function to uninstall the agent if +// it hasn't been uninstalled. It also takes care of collecting a +// diagnostics when AGENT_COLLECT_DIAG=true or the test has failed. +// It returns: +// - the combined output of Install command stdout and stderr +// - an error if any. +func (f *Fixture) installRpm(ctx context.Context, installOpts *InstallOpts, opts []process.CmdOption) ([]byte, error) { + f.t.Logf("[test %s] Inside fixture installRpm function", f.t.Name()) + //Prepare so that the f.srcPackage string is populated + err := f.EnsurePrepared(ctx) + if err != nil { + return nil, fmt.Errorf("failed to prepare: %w", err) + } + + // sudo rpm -iv elastic-agent rpm + out, err := exec.CommandContext(ctx, "sudo", "rpm", "-i", "-v", f.srcPackage).CombinedOutput() // #nosec G204 -- Need to pass in name of package + if err != nil { + return out, fmt.Errorf("rpm install failed: %w output:%s", err, string(out)) + } + + f.t.Cleanup(func() { + f.t.Logf("[test %s] Inside fixture installRpm cleanup function", f.t.Name()) + uninstallCtx, uninstallCancel := context.WithTimeout(context.Background(), 5*time.Minute) + defer uninstallCancel() + // stop elastic-agent, non fatal if error, might have been stopped before this. + f.t.Logf("running 'sudo systemctl stop elastic-agent'") + out, err := exec.CommandContext(uninstallCtx, "sudo", "systemctl", "stop", "elastic-agent").CombinedOutput() + if err != nil { + f.t.Logf("error systemctl stop elastic-agent: %s, output: %s", err, string(out)) + } + // rpm -e elastic-agent rpm + f.t.Logf("running 'sudo rpm -e elastic-agent'") + out, err = exec.CommandContext(uninstallCtx, "sudo", "rpm", "-e", "elastic-agent").CombinedOutput() + if err != nil { + f.t.Logf("failed to 'sudo rpm -e elastic-agent': %s, output: %s", err, string(out)) + f.t.FailNow() + } + }) + + // start elastic-agent + out, err = exec.CommandContext(ctx, "sudo", "systemctl", "start", "elastic-agent").CombinedOutput() + if err != nil { + return out, fmt.Errorf("systemctl start elastic-agent failed: %w", err) + } + + // rpm install doesn't enroll, so need to do that + enrollArgs := []string{"elastic-agent", "enroll"} + if installOpts.Force { + enrollArgs = append(enrollArgs, "--force") + } + if installOpts.Insecure { + enrollArgs = append(enrollArgs, "--insecure") + } + if installOpts.ProxyURL != "" { + enrollArgs = append(enrollArgs, "--proxy-url="+installOpts.ProxyURL) + } + if installOpts.DelayEnroll { + enrollArgs = append(enrollArgs, "--delay-enroll") + } + if installOpts.EnrollOpts.URL != "" { + enrollArgs = append(enrollArgs, "--url", installOpts.EnrollOpts.URL) + } + if installOpts.EnrollOpts.EnrollmentToken != "" { + enrollArgs = append(enrollArgs, "--enrollment-token", installOpts.EnrollOpts.EnrollmentToken) + } + // run sudo elastic-agent enroll + out, err = exec.CommandContext(ctx, "sudo", enrollArgs...).CombinedOutput() + if err != nil { + return out, fmt.Errorf("elastic-agent enroll failed: %w, output: %s args: %v", err, string(out), enrollArgs) + } + + return nil, nil +} + type UninstallOpts struct { Force bool // --force UninstallToken string @@ -460,6 +600,8 @@ func (f *Fixture) Uninstall(ctx context.Context, uninstallOpts *UninstallOpts, o return f.uninstallNoPkgManager(ctx, uninstallOpts, opts) case "deb": return f.uninstallDeb(ctx, uninstallOpts, opts) + case "rpm": + return f.uninstallRpm(ctx, uninstallOpts, opts) default: return nil, fmt.Errorf("uninstall of package format '%s' not supported yet", f.packageFormat) } @@ -478,6 +620,19 @@ func (f *Fixture) uninstallDeb(ctx context.Context, uninstallOpts *UninstallOpts return out, nil } +func (f *Fixture) uninstallRpm(ctx context.Context, uninstallOpts *UninstallOpts, opts []process.CmdOption) ([]byte, error) { + // stop elastic-agent, non fatal if error, might have been stopped before this. + out, err := exec.CommandContext(ctx, "sudo", "systemctl", "stop", "elastic-agent").CombinedOutput() + if err != nil { + f.t.Logf("error systemctl stop elastic-agent: %s, output: %s", err, string(out)) + } + out, err = exec.CommandContext(ctx, "sudo", "rpm", "-e", "elastic-agent").CombinedOutput() + if err != nil { + return out, fmt.Errorf("error running 'sudo rpm -e elastic-agent': %w", err) + } + return out, nil +} + func (f *Fixture) uninstallNoPkgManager(ctx context.Context, uninstallOpts *UninstallOpts, opts []process.CmdOption) ([]byte, error) { if !f.installed { return nil, ErrNotInstalled diff --git a/pkg/testing/multipass/provisioner.go b/pkg/testing/multipass/provisioner.go index 72267d0dd8f..c0834175bc8 100644 --- a/pkg/testing/multipass/provisioner.go +++ b/pkg/testing/multipass/provisioner.go @@ -54,7 +54,7 @@ func (p *provisioner) Supported(os define.OS) bool { if os.Distro != Ubuntu { return false } - if os.Version != "20.04" && os.Version != "22.04" { + if os.Version != "20.04" && os.Version != "22.04" && os.Version != "24.04" { return false } // multipass only supports the same architecture of the host diff --git a/pkg/testing/ogc/provisioner.go b/pkg/testing/ogc/provisioner.go index 696fd90c974..34705185b1f 100644 --- a/pkg/testing/ogc/provisioner.go +++ b/pkg/testing/ogc/provisioner.go @@ -129,7 +129,7 @@ func (p *provisioner) Clean(ctx context.Context, cfg runner.Config, _ []runner.I func (p *provisioner) ogcPull(ctx context.Context) error { args := []string{ "pull", - "docker.io/gorambo/ogc:blake", // switch back to :latest when ready + "docker.elastic.co/observability-ci/ogc:5.0.1", } var output bytes.Buffer p.logger.Logf("Pulling latest ogc image") @@ -273,7 +273,7 @@ func (p *provisioner) ogcRun(ctx context.Context, args []string, interactive boo fmt.Sprintf("%s:%s", wd, wd), "-w", wd, - "docker.io/gorambo/ogc:blake", // switch back to :latest when ready + "docker.elastic.co/observability-ci/ogc:5.0.1", "--", "ogc", "-v", @@ -310,8 +310,8 @@ func osBatchToOGC(cacheDir string, batch runner.OSBatch) Layout { Tags: tags, Labels: map[string]string{ "division": "engineering", - "org": "platform", - "team": "ingest", + "org": "ingest", + "team": "elastic-agent-control-plane", "project": "elastic-agent", }, Scripts: "path", // not used; but required by OGC diff --git a/pkg/testing/ogc/supported.go b/pkg/testing/ogc/supported.go index 34ae7d86c89..77da56a4493 100644 --- a/pkg/testing/ogc/supported.go +++ b/pkg/testing/ogc/supported.go @@ -25,11 +25,11 @@ var ogcSupported = []LayoutOS{ Type: define.Linux, Arch: define.AMD64, Distro: runner.Ubuntu, - Version: "22.04", + Version: "24.04", }, Provider: Google, - InstanceSize: "e2-standard-2", // 2 amd64 cpus - RunsOn: "ubuntu-2204-lts", + InstanceSize: "e2-standard-2", // 2 amd64 cpus, 8 GB RAM + RunsOn: "ubuntu-2404-lts-amd64", Username: "ubuntu", RemotePath: "/home/ubuntu/agent", }, @@ -38,39 +38,81 @@ var ogcSupported = []LayoutOS{ Type: define.Linux, Arch: define.AMD64, Distro: runner.Ubuntu, - Version: "20.04", + Version: "22.04", }, Provider: Google, - InstanceSize: "e2-standard-2", // 2 amd64 cpus - RunsOn: "ubuntu-2004-lts", + InstanceSize: "e2-standard-2", // 2 amd64 cpus, 8 GB RAM + RunsOn: "ubuntu-2204-lts", Username: "ubuntu", RemotePath: "/home/ubuntu/agent", }, { OS: define.OS{ Type: define.Linux, - Arch: define.ARM64, + Arch: define.AMD64, Distro: runner.Ubuntu, - Version: "22.04", + Version: "20.04", }, Provider: Google, - InstanceSize: "t2a-standard-2", // 2 arm64 cpus - RunsOn: "ubuntu-2204-lts-arm64", + InstanceSize: "e2-standard-2", // 2 amd64 cpus, 8 GB RAM + RunsOn: "ubuntu-2004-lts", Username: "ubuntu", RemotePath: "/home/ubuntu/agent", }, + // These instance types are experimental on Google Cloud and very unstable + // We will wait until Google introduces new ARM instance types + // https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu + // { + // OS: define.OS{ + // Type: define.Linux, + // Arch: define.ARM64, + // Distro: runner.Ubuntu, + // Version: "24.04", + // }, + // Provider: Google, + // InstanceSize: "t2a-standard-4", // 4 arm64 cpus, 16 GB RAM + // RunsOn: "ubuntu-2404-lts-arm64", + // Username: "ubuntu", + // RemotePath: "/home/ubuntu/agent", + // }, + // { + // OS: define.OS{ + // Type: define.Linux, + // Arch: define.ARM64, + // Distro: runner.Ubuntu, + // Version: "22.04", + // }, + // Provider: Google, + // InstanceSize: "t2a-standard-4", // 4 arm64 cpus, 16 GB RAM + // RunsOn: "ubuntu-2204-lts-arm64", + // Username: "ubuntu", + // RemotePath: "/home/ubuntu/agent", + // }, + // { + // OS: define.OS{ + // Type: define.Linux, + // Arch: define.ARM64, + // Distro: runner.Ubuntu, + // Version: "20.04", + // }, + // Provider: Google, + // InstanceSize: "t2a-standard-4", // 4 arm64 cpus, 16 GB RAM + // RunsOn: "ubuntu-2004-lts-arm64", + // Username: "ubuntu", + // RemotePath: "/home/ubuntu/agent", + // }, { OS: define.OS{ Type: define.Linux, - Arch: define.ARM64, - Distro: runner.Ubuntu, - Version: "20.04", + Arch: define.AMD64, + Distro: runner.Rhel, + Version: "8", }, Provider: Google, - InstanceSize: "t2a-standard-2", // 2 arm64 cpus - RunsOn: "ubuntu-2004-lts-arm64", - Username: "ubuntu", - RemotePath: "/home/ubuntu/agent", + InstanceSize: "e2-standard-2", // 2 amd64 cpus, 8 GB RAM + RunsOn: "rhel-8", + Username: "rhel", + RemotePath: "/home/rhel/agent", }, { OS: define.OS{ @@ -79,7 +121,7 @@ var ogcSupported = []LayoutOS{ Version: "2022", }, Provider: Google, - InstanceSize: "e2-standard-4", // 4 amd64 cpus + InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM RunsOn: "windows-2022", Username: "windows", RemotePath: "C:\\Users\\windows\\agent", @@ -91,7 +133,7 @@ var ogcSupported = []LayoutOS{ Version: "2022-core", }, Provider: Google, - InstanceSize: "e2-standard-4", // 4 amd64 cpus + InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM RunsOn: "windows-2022-core", Username: "windows", RemotePath: "C:\\Users\\windows\\agent", @@ -103,7 +145,7 @@ var ogcSupported = []LayoutOS{ Version: "2019", }, Provider: Google, - InstanceSize: "e2-standard-4", // 4 amd64 cpus + InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM RunsOn: "windows-2019", Username: "windows", RemotePath: "C:\\Users\\windows\\agent", @@ -115,7 +157,7 @@ var ogcSupported = []LayoutOS{ Version: "2019-core", }, Provider: Google, - InstanceSize: "e2-standard-4", // 4 amd64 cpus + InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM RunsOn: "windows-2019-core", Username: "windows", RemotePath: "C:\\Users\\windows\\agent", @@ -127,7 +169,7 @@ var ogcSupported = []LayoutOS{ Version: "2016", }, Provider: Google, - InstanceSize: "e2-standard-4", // 4 amd64 cpus + InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM RunsOn: "windows-2016", Username: "windows", RemotePath: "C:\\Users\\windows\\agent", @@ -139,7 +181,7 @@ var ogcSupported = []LayoutOS{ Version: "2016-core", }, Provider: Google, - InstanceSize: "e2-standard-4", // 4 amd64 cpus + InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM RunsOn: "windows-2016-core", Username: "windows", RemotePath: "C:\\Users\\windows\\agent", diff --git a/pkg/testing/runner/config.go b/pkg/testing/runner/config.go index 22494ed58e3..92229e35a99 100644 --- a/pkg/testing/runner/config.go +++ b/pkg/testing/runner/config.go @@ -28,6 +28,11 @@ type Config struct { // defined in this list. Platforms []string + // Packages filters the tests to only run on the provided list + // of platforms even if the tests supports more than what is + // defined in this list. + Packages []string + // BinaryName is the name of the binary package under test, i.e, elastic-agent, metricbeat, etc // this is used to copy the .tar.gz to the remote host BinaryName string diff --git a/pkg/testing/runner/debian.go b/pkg/testing/runner/debian.go index a3995efd602..0d52f70eb4d 100644 --- a/pkg/testing/runner/debian.go +++ b/pkg/testing/runner/debian.go @@ -7,7 +7,6 @@ package runner import ( "context" "fmt" - "os" "path" "path/filepath" "strings" @@ -88,108 +87,7 @@ func (DebianRunner) Prepare(ctx context.Context, sshClient SSHClient, logger Log // Copy places the required files on the host. func (DebianRunner) Copy(ctx context.Context, sshClient SSHClient, logger Logger, repoArchive string, builds []Build) error { - // copy the archive and extract it on the host - logger.Logf("Copying repo") - destRepoName := filepath.Base(repoArchive) - err := sshClient.Copy(repoArchive, destRepoName) - if err != nil { - return fmt.Errorf("failed to SCP repo archive %s: %w", repoArchive, err) - } - - // remove build paths, on cases where the build path is different from agent. - for _, build := range builds { - for _, remoteBuildPath := range []string{build.Path, build.SHA512Path} { - relativeAgentDir := filepath.Join("agent", remoteBuildPath) - _, _, err := sshClient.Exec(ctx, "sudo", []string{"rm", "-rf", relativeAgentDir}, nil) - // doesn't need to be a fatal error. - if err != nil { - logger.Logf("error removing build dir %s: %w", relativeAgentDir, err) - } - } - } - - // ensure that agent directory is removed (possible it already exists if instance already used) - stdout, stderr, err := sshClient.Exec(ctx, - "sudo", []string{"rm", "-rf", "agent"}, nil) - if err != nil { - return fmt.Errorf( - "failed to remove agent directory before unziping new one: %w. stdout: %q, stderr: %q", - err, stdout, stderr) - } - - stdOut, errOut, err := sshClient.Exec(ctx, "unzip", []string{destRepoName, "-d", "agent"}, nil) - if err != nil { - return fmt.Errorf("failed to unzip %s to agent directory: %w (stdout: %s, stderr: %s)", destRepoName, err, stdOut, errOut) - } - - // prepare for testing - logger.Logf("Running make mage and prepareOnRemote") - envs := `GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH"` - installMage := strings.NewReader(fmt.Sprintf(`cd agent && %s make mage && %s mage integration:prepareOnRemote`, envs, envs)) - stdOut, errOut, err = sshClient.Exec(ctx, "bash", nil, installMage) - if err != nil { - return fmt.Errorf("failed to perform make mage and prepareOnRemote: %w (stdout: %s, stderr: %s)", err, stdOut, errOut) - } - - // determine if the build needs to be replaced on the host - // if it already exists and the SHA512 are the same contents, then - // there is no reason to waste time uploading the build - for _, build := range builds { - copyBuild := true - localSHA512, err := os.ReadFile(build.SHA512Path) - if err != nil { - return fmt.Errorf("failed to read local SHA52 contents %s: %w", build.SHA512Path, err) - } - hostSHA512Path := filepath.Base(build.SHA512Path) - hostSHA512, err := sshClient.GetFileContents(ctx, hostSHA512Path) - if err == nil { - if string(localSHA512) == string(hostSHA512) { - logger.Logf("Skipping copy agent build %s; already the same", filepath.Base(build.Path)) - copyBuild = false - } - } - - if copyBuild { - // ensure the existing copies are removed first - toRemove := filepath.Base(build.Path) - stdOut, errOut, err = sshClient.Exec(ctx, - "sudo", []string{"rm", "-f", toRemove}, nil) - if err != nil { - return fmt.Errorf("failed to remove %q: %w (stdout: %q, stderr: %q)", - toRemove, err, stdOut, errOut) - } - - toRemove = filepath.Base(build.SHA512Path) - stdOut, errOut, err = sshClient.Exec(ctx, - "sudo", []string{"rm", "-f", toRemove}, nil) - if err != nil { - return fmt.Errorf("failed to remove %q: %w (stdout: %q, stderr: %q)", - toRemove, err, stdOut, errOut) - } - - logger.Logf("Copying agent build %s", filepath.Base(build.Path)) - } - - for _, buildPath := range []string{build.Path, build.SHA512Path} { - if copyBuild { - err = sshClient.Copy(buildPath, filepath.Base(buildPath)) - if err != nil { - return fmt.Errorf("failed to SCP build %s: %w", filepath.Base(buildPath), err) - } - } - insideAgentDir := filepath.Join("agent", buildPath) - stdOut, errOut, err = sshClient.Exec(ctx, "mkdir", []string{"-p", filepath.Dir(insideAgentDir)}, nil) - if err != nil { - return fmt.Errorf("failed to create %s directory: %w (stdout: %s, stderr: %s)", filepath.Dir(insideAgentDir), err, stdOut, errOut) - } - stdOut, errOut, err = sshClient.Exec(ctx, "ln", []string{filepath.Base(buildPath), insideAgentDir}, nil) - if err != nil { - return fmt.Errorf("failed to hard link %s to %s: %w (stdout: %s, stderr: %s)", filepath.Base(buildPath), insideAgentDir, err, stdOut, errOut) - } - } - } - - return nil + return linuxCopy(ctx, sshClient, logger, repoArchive, builds) } // Run the test @@ -242,39 +140,7 @@ func (DebianRunner) Run(ctx context.Context, verbose bool, sshClient SSHClient, // Diagnostics gathers any diagnostics from the host. func (DebianRunner) Diagnostics(ctx context.Context, sshClient SSHClient, logger Logger, destination string) error { - // take ownership, as sudo tests will create with root permissions (allow to fail in the case it doesn't exist) - diagnosticDir := "$HOME/agent/build/diagnostics" - _, _, _ = sshClient.Exec(ctx, "sudo", []string{"chown", "-R", "$USER:$USER", diagnosticDir}, nil) - stdOut, _, err := sshClient.Exec(ctx, "ls", []string{"-1", diagnosticDir}, nil) - if err != nil { - //nolint:nilerr // failed to list the directory, probably don't have any diagnostics (do nothing) - return nil - } - eachDiagnostic := strings.Split(string(stdOut), "\n") - for _, filename := range eachDiagnostic { - filename = strings.TrimSpace(filename) - if filename == "" { - continue - } - - // don't use filepath.Join as we need this to work in Windows as well - // this is because if we use `filepath.Join` on a Windows host connected to a Linux host - // it will use a `\` and that will be incorrect for Linux - fp := fmt.Sprintf("%s/%s", diagnosticDir, filename) - // use filepath.Join on this path because it's a path on this specific host platform - dp := filepath.Join(destination, filename) - logger.Logf("Copying diagnostic %s", filename) - out, err := os.Create(dp) - if err != nil { - return fmt.Errorf("failed to create file %s: %w", dp, err) - } - err = sshClient.GetFileContentsOutput(ctx, fp, out) - _ = out.Close() - if err != nil { - return fmt.Errorf("failed to copy file from remote host to %s: %w", dp, err) - } - } - return nil + return linuxDiagnostics(ctx, sshClient, logger, destination) } func runTests(ctx context.Context, logger Logger, name string, prefix string, script string, sshClient SSHClient, tests []define.BatchPackageTests) ([]OSRunnerPackageResult, error) { diff --git a/pkg/testing/runner/linux.go b/pkg/testing/runner/linux.go new file mode 100644 index 00000000000..45ec2310290 --- /dev/null +++ b/pkg/testing/runner/linux.go @@ -0,0 +1,154 @@ +// 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 runner + +import ( + "context" + "fmt" + "os" + "path/filepath" + "strings" +) + +func linuxDiagnostics(ctx context.Context, sshClient SSHClient, logger Logger, destination string) error { + // take ownership, as sudo tests will create with root permissions (allow to fail in the case it doesn't exist) + diagnosticDir := "$HOME/agent/build/diagnostics" + _, _, _ = sshClient.Exec(ctx, "sudo", []string{"chown", "-R", "$USER:$USER", diagnosticDir}, nil) + stdOut, _, err := sshClient.Exec(ctx, "ls", []string{"-1", diagnosticDir}, nil) + if err != nil { + //nolint:nilerr // failed to list the directory, probably don't have any diagnostics (do nothing) + return nil + } + eachDiagnostic := strings.Split(string(stdOut), "\n") + for _, filename := range eachDiagnostic { + filename = strings.TrimSpace(filename) + if filename == "" { + continue + } + + // don't use filepath.Join as we need this to work in Windows as well + // this is because if we use `filepath.Join` on a Windows host connected to a Linux host + // it will use a `\` and that will be incorrect for Linux + fp := fmt.Sprintf("%s/%s", diagnosticDir, filename) + // use filepath.Join on this path because it's a path on this specific host platform + dp := filepath.Join(destination, filename) + logger.Logf("Copying diagnostic %s", filename) + out, err := os.Create(dp) + if err != nil { + return fmt.Errorf("failed to create file %s: %w", dp, err) + } + err = sshClient.GetFileContentsOutput(ctx, fp, out) + _ = out.Close() + if err != nil { + return fmt.Errorf("failed to copy file from remote host to %s: %w", dp, err) + } + } + return nil +} + +func linuxCopy(ctx context.Context, sshClient SSHClient, logger Logger, repoArchive string, builds []Build) error { + // copy the archive and extract it on the host + logger.Logf("Copying repo") + destRepoName := filepath.Base(repoArchive) + err := sshClient.Copy(repoArchive, destRepoName) + if err != nil { + return fmt.Errorf("failed to SCP repo archive %s: %w", repoArchive, err) + } + + // remove build paths, on cases where the build path is different from agent. + for _, build := range builds { + for _, remoteBuildPath := range []string{build.Path, build.SHA512Path} { + relativeAgentDir := filepath.Join("agent", remoteBuildPath) + _, _, err := sshClient.Exec(ctx, "sudo", []string{"rm", "-rf", relativeAgentDir}, nil) + // doesn't need to be a fatal error. + if err != nil { + logger.Logf("error removing build dir %s: %w", relativeAgentDir, err) + } + } + } + + // ensure that agent directory is removed (possible it already exists if instance already used) + stdout, stderr, err := sshClient.Exec(ctx, + "sudo", []string{"rm", "-rf", "agent"}, nil) + if err != nil { + return fmt.Errorf( + "failed to remove agent directory before unziping new one: %w. stdout: %q, stderr: %q", + err, stdout, stderr) + } + + stdOut, errOut, err := sshClient.Exec(ctx, "unzip", []string{destRepoName, "-d", "agent"}, nil) + if err != nil { + return fmt.Errorf("failed to unzip %s to agent directory: %w (stdout: %s, stderr: %s)", destRepoName, err, stdOut, errOut) + } + + // prepare for testing + logger.Logf("Running make mage and prepareOnRemote") + envs := `GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH"` + installMage := strings.NewReader(fmt.Sprintf(`cd agent && %s make mage && %s mage integration:prepareOnRemote`, envs, envs)) + stdOut, errOut, err = sshClient.Exec(ctx, "bash", nil, installMage) + if err != nil { + return fmt.Errorf("failed to perform make mage and prepareOnRemote: %w (stdout: %s, stderr: %s)", err, stdOut, errOut) + } + + // determine if the build needs to be replaced on the host + // if it already exists and the SHA512 are the same contents, then + // there is no reason to waste time uploading the build + for _, build := range builds { + copyBuild := true + localSHA512, err := os.ReadFile(build.SHA512Path) + if err != nil { + return fmt.Errorf("failed to read local SHA52 contents %s: %w", build.SHA512Path, err) + } + hostSHA512Path := filepath.Base(build.SHA512Path) + hostSHA512, err := sshClient.GetFileContents(ctx, hostSHA512Path) + if err == nil { + if string(localSHA512) == string(hostSHA512) { + logger.Logf("Skipping copy agent build %s; already the same", filepath.Base(build.Path)) + copyBuild = false + } + } + + if copyBuild { + // ensure the existing copies are removed first + toRemove := filepath.Base(build.Path) + stdOut, errOut, err = sshClient.Exec(ctx, + "sudo", []string{"rm", "-f", toRemove}, nil) + if err != nil { + return fmt.Errorf("failed to remove %q: %w (stdout: %q, stderr: %q)", + toRemove, err, stdOut, errOut) + } + + toRemove = filepath.Base(build.SHA512Path) + stdOut, errOut, err = sshClient.Exec(ctx, + "sudo", []string{"rm", "-f", toRemove}, nil) + if err != nil { + return fmt.Errorf("failed to remove %q: %w (stdout: %q, stderr: %q)", + toRemove, err, stdOut, errOut) + } + + logger.Logf("Copying agent build %s", filepath.Base(build.Path)) + } + + for _, buildPath := range []string{build.Path, build.SHA512Path} { + if copyBuild { + err = sshClient.Copy(buildPath, filepath.Base(buildPath)) + if err != nil { + return fmt.Errorf("failed to SCP build %s: %w", filepath.Base(buildPath), err) + } + } + insideAgentDir := filepath.Join("agent", buildPath) + stdOut, errOut, err = sshClient.Exec(ctx, "mkdir", []string{"-p", filepath.Dir(insideAgentDir)}, nil) + if err != nil { + return fmt.Errorf("failed to create %s directory: %w (stdout: %s, stderr: %s)", filepath.Dir(insideAgentDir), err, stdOut, errOut) + } + stdOut, errOut, err = sshClient.Exec(ctx, "ln", []string{filepath.Base(buildPath), insideAgentDir}, nil) + if err != nil { + return fmt.Errorf("failed to hard link %s to %s: %w (stdout: %s, stderr: %s)", filepath.Base(buildPath), insideAgentDir, err, stdOut, errOut) + } + } + } + + return nil +} diff --git a/pkg/testing/runner/rhel.go b/pkg/testing/runner/rhel.go new file mode 100644 index 00000000000..5d8a63bbc61 --- /dev/null +++ b/pkg/testing/runner/rhel.go @@ -0,0 +1,112 @@ +// 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 runner + +import ( + "context" + "fmt" + "path" + "strings" + "time" + + "github.com/elastic/elastic-agent/pkg/testing/define" +) + +// RhelRunner is a handler for running tests on SUSE Linux Enterpriser Server +type RhelRunner struct{} + +// Prepare configures the host for running the test +func (RhelRunner) Prepare(ctx context.Context, sshClient SSHClient, logger Logger, arch string, goVersion string) error { + logger.Logf("Install development tools") + dnfCtx, dnfCancel := context.WithTimeout(ctx, 20*time.Minute) + defer dnfCancel() + stdOut, errOut, err := sshClient.ExecWithRetry(dnfCtx, "sudo", []string{"dnf", "-y", "-v", "group", "install", "\"Development Tools\""}, 15*time.Second) + if err != nil { + return fmt.Errorf("failed to run 'dnf group install \"Development Tools\"': %w (stdout: %s, stderr: %s)", err, stdOut, errOut) + } + + // install golang + logger.Logf("Install golang %s (%s)", goVersion, arch) + goCtx, goCancel := context.WithTimeout(ctx, 20*time.Minute) + defer goCancel() + downloadURL := fmt.Sprintf("https://go.dev/dl/go%s.linux-%s.tar.gz", goVersion, arch) + filename := path.Base(downloadURL) + stdOut, errOut, err = sshClient.Exec(goCtx, "curl", []string{"-Ls", downloadURL, "--output", filename}, nil) + if err != nil { + return fmt.Errorf("failed to download go from %s with curl: %w (stdout: %s, stderr: %s)", downloadURL, err, stdOut, errOut) + } + stdOut, errOut, err = sshClient.Exec(goCtx, "sudo", []string{"tar", "-C", "/usr/local", "-xzf", filename}, nil) + if err != nil { + return fmt.Errorf("failed to extract go to /usr/local with tar: %w (stdout: %s, stderr: %s)", err, stdOut, errOut) + } + stdOut, errOut, err = sshClient.Exec(goCtx, "sudo", []string{"ln", "-s", "/usr/local/go/bin/go", "/usr/bin/go"}, nil) + if err != nil { + return fmt.Errorf("failed to symlink /usr/local/go/bin/go to /usr/bin/go: %w (stdout: %s, stderr: %s)", err, stdOut, errOut) + } + stdOut, errOut, err = sshClient.Exec(goCtx, "sudo", []string{"ln", "-s", "/usr/local/go/bin/gofmt", "/usr/bin/gofmt"}, nil) + if err != nil { + return fmt.Errorf("failed to symlink /usr/local/go/bin/gofmt to /usr/bin/gofmt: %w (stdout: %s, stderr: %s)", err, stdOut, errOut) + } + + return nil +} + +// Copy places the required files on the host +func (RhelRunner) Copy(ctx context.Context, sshClient SSHClient, logger Logger, repoArchive string, builds []Build) error { + return linuxCopy(ctx, sshClient, logger, repoArchive, builds) +} + +// Run the test +func (RhelRunner) Run(ctx context.Context, verbose bool, sshClient SSHClient, logger Logger, agentVersion string, prefix string, batch define.Batch, env map[string]string) (OSRunnerResult, error) { + var tests []string + for _, pkg := range batch.Tests { + for _, test := range pkg.Tests { + tests = append(tests, fmt.Sprintf("%s:%s", pkg.Name, test.Name)) + } + } + var sudoTests []string + for _, pkg := range batch.SudoTests { + for _, test := range pkg.Tests { + sudoTests = append(sudoTests, fmt.Sprintf("%s:%s", pkg.Name, test.Name)) + } + } + + logArg := "" + if verbose { + logArg = "-v" + } + var result OSRunnerResult + if len(tests) > 0 { + vars := fmt.Sprintf(`GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH" AGENT_VERSION="%s" TEST_DEFINE_PREFIX="%s" TEST_DEFINE_TESTS="%s"`, agentVersion, prefix, strings.Join(tests, ",")) + vars = extendVars(vars, env) + + script := fmt.Sprintf(`cd agent && %s ~/go/bin/mage %s integration:testOnRemote`, vars, logArg) + results, err := runTests(ctx, logger, "non-sudo", prefix, script, sshClient, batch.Tests) + if err != nil { + return OSRunnerResult{}, fmt.Errorf("error running non-sudo tests: %w", err) + } + result.Packages = results + } + + if len(sudoTests) > 0 { + prefix := fmt.Sprintf("%s-sudo", prefix) + vars := fmt.Sprintf(`GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH:/usr/sbin" AGENT_VERSION="%s" TEST_DEFINE_PREFIX="%s" TEST_DEFINE_TESTS="%s"`, agentVersion, prefix, strings.Join(sudoTests, ",")) + vars = extendVars(vars, env) + script := fmt.Sprintf(`cd agent && sudo %s ~/go/bin/mage %s integration:testOnRemote`, vars, logArg) + + results, err := runTests(ctx, logger, "sudo", prefix, script, sshClient, batch.SudoTests) + if err != nil { + return OSRunnerResult{}, fmt.Errorf("error running sudo tests: %w", err) + } + result.SudoPackages = results + } + + return result, nil +} + +// Diagnostics gathers any diagnostics from the host. +func (RhelRunner) Diagnostics(ctx context.Context, sshClient SSHClient, logger Logger, destination string) error { + return linuxDiagnostics(ctx, sshClient, logger, destination) +} diff --git a/pkg/testing/runner/runner.go b/pkg/testing/runner/runner.go index 939cf108e46..9ddcecbd24a 100644 --- a/pkg/testing/runner/runner.go +++ b/pkg/testing/runner/runner.go @@ -333,7 +333,7 @@ func (r *Runner) runInstance(ctx context.Context, sshAuth ssh.AuthMethod, logger } logger.Logf("Starting SSH; connect with `ssh -i %s %s@%s`", sshPrivateKeyPath, instance.Username, instance.IP) - client := NewSSHClient(instance.IP, instance.Username, sshAuth) + client := NewSSHClient(instance.IP, instance.Username, sshAuth, logger) connectCtx, connectCancel := context.WithTimeout(ctx, 10*time.Minute) defer connectCancel() err = client.Connect(connectCtx) @@ -447,20 +447,36 @@ func (r *Runner) validate() error { // getBuilds returns the build for the batch. func (r *Runner) getBuilds(b OSBatch) []Build { - builds := []Build{} + var builds []Build formats := []string{"targz", "zip", "rpm", "deb"} binaryName := "elastic-agent" + var packages []string + for _, p := range r.cfg.Packages { + if slices.Contains(formats, p) { + packages = append(packages, p) + } + } + if len(packages) == 0 { + packages = formats + } + // This is for testing beats in serverless environment if strings.HasSuffix(r.cfg.BinaryName, "beat") { - formats = []string{"targz", "zip"} + var serverlessPackages []string + for _, p := range packages { + if slices.Contains([]string{"targz", "zip"}, p) { + serverlessPackages = append(serverlessPackages, p) + } + } + packages = serverlessPackages } if r.cfg.BinaryName != "" { binaryName = r.cfg.BinaryName } - for _, f := range formats { + for _, f := range packages { arch := b.OS.Arch if arch == define.AMD64 { arch = "x86_64" diff --git a/pkg/testing/runner/ssh.go b/pkg/testing/runner/ssh.go index ebb9fcd96da..7e42ffacf1a 100644 --- a/pkg/testing/runner/ssh.go +++ b/pkg/testing/runner/ssh.go @@ -110,22 +110,36 @@ type sshClient struct { ip string username string auth ssh.AuthMethod - - c *ssh.Client + logger Logger + c *ssh.Client } // NewSSHClient creates a new SSH client connection to the host. -func NewSSHClient(ip string, username string, sshAuth ssh.AuthMethod) SSHClient { +func NewSSHClient(ip string, username string, sshAuth ssh.AuthMethod, logger Logger) SSHClient { return &sshClient{ ip: ip, username: username, auth: sshAuth, + logger: logger, } } // Connect connects to the host. func (s *sshClient) Connect(ctx context.Context) error { var lastErr error + config := &ssh.ClientConfig{ + User: s.username, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), //nolint:gosec // it's the tests framework test + Auth: []ssh.AuthMethod{s.auth}, + Timeout: 30 * time.Second, + } + addr := net.JoinHostPort(s.ip, "22") + + tcpAddr, err := net.ResolveTCPAddr("tcp", addr) + if err != nil { + return fmt.Errorf("unable to resolve ssh address %q :%w", addr, err) + } + delay := 1 * time.Second for { if ctx.Err() != nil { if lastErr == nil { @@ -133,18 +147,37 @@ func (s *sshClient) Connect(ctx context.Context) error { } return lastErr } - config := &ssh.ClientConfig{ - User: s.username, - HostKeyCallback: ssh.InsecureIgnoreHostKey(), //nolint:gosec // it's the tests framework test - Auth: []ssh.AuthMethod{s.auth}, - Timeout: 30 * time.Second, + if lastErr != nil { + s.logger.Logf("ssh connect error: %q, will try again in %s", lastErr, delay) + time.Sleep(delay) + delay = 2 * delay + } - client, err := ssh.Dial("tcp", net.JoinHostPort(s.ip, "22"), config) - if err == nil { - s.c = client - return nil + conn, err := net.DialTCP("tcp", nil, tcpAddr) + if err != nil { + lastErr = fmt.Errorf("error dialing tcp address %q :%w", addr, err) + continue } - lastErr = err + err = conn.SetKeepAlive(true) + if err != nil { + _ = conn.Close() + lastErr = fmt.Errorf("error setting TCP keepalive for ssh to %q :%w", addr, err) + continue + } + err = conn.SetKeepAlivePeriod(config.Timeout) + if err != nil { + _ = conn.Close() + lastErr = fmt.Errorf("error setting TCP keepalive period for ssh to %q :%w", addr, err) + continue + } + sshConn, chans, reqs, err := ssh.NewClientConn(conn, addr, config) + if err != nil { + _ = conn.Close() + lastErr = fmt.Errorf("error NewClientConn for ssh to %q :%w", addr, err) + continue + } + s.c = ssh.NewClient(sshConn, chans, reqs) + return nil } } @@ -189,12 +222,21 @@ func (s *sshClient) Exec(ctx context.Context, cmd string, args []string, stdin i return nil, nil, ctx.Err() } + var session *ssh.Session cmdArgs := []string{cmd} cmdArgs = append(cmdArgs, args...) cmdStr := strings.Join(cmdArgs, " ") session, err := s.NewSession() if err != nil { - return nil, nil, fmt.Errorf("could not create new SSH session: %w", err) + s.logger.Logf("new session failed: %q, trying reconnect", err) + lErr := s.Reconnect(ctx) + if lErr != nil { + return nil, nil, fmt.Errorf("ssh reconnect failed: %w, after new session failed: %w", lErr, err) + } + session, lErr = s.NewSession() + if lErr != nil { + return nil, nil, fmt.Errorf("new session failed after reconnect: %w, original new session failure was: %w", lErr, err) + } } defer session.Close() @@ -225,6 +267,7 @@ func (s *sshClient) ExecWithRetry(ctx context.Context, cmd string, args []string if err == nil { return stdout, stderr, nil } + s.logger.Logf("ssh exec error: %q, will try again in %s", err, interval) lastErr = err lastStdout = stdout lastStderr = stderr diff --git a/pkg/testing/runner/supported.go b/pkg/testing/runner/supported.go index e08814f4187..ffd8c020e15 100644 --- a/pkg/testing/runner/supported.go +++ b/pkg/testing/runner/supported.go @@ -12,6 +12,7 @@ import ( ) const ( + Rhel = "rhel" // Ubuntu is a Linux distro. Ubuntu = "ubuntu" ) @@ -30,6 +31,16 @@ type SupportedOS struct { } var ( + // UbuntuAMD64_2404 - Ubuntu (amd64) 24.04 + UbuntuAMD64_2404 = SupportedOS{ + OS: define.OS{ + Type: define.Linux, + Arch: define.AMD64, + Distro: Ubuntu, + Version: "24.04", + }, + Runner: DebianRunner{}, + } // UbuntuAMD64_2204 - Ubuntu (amd64) 22.04 UbuntuAMD64_2204 = SupportedOS{ OS: define.OS{ @@ -50,6 +61,16 @@ var ( }, Runner: DebianRunner{}, } + // UbuntuARM64_2404 - Ubuntu (arm64) 24.04 + UbuntuARM64_2404 = SupportedOS{ + OS: define.OS{ + Type: define.Linux, + Arch: define.ARM64, + Distro: Ubuntu, + Version: "24.04", + }, + Runner: DebianRunner{}, + } // UbuntuARM64_2204 - Ubuntu (arm64) 22.04 UbuntuARM64_2204 = SupportedOS{ OS: define.OS{ @@ -70,6 +91,16 @@ var ( }, Runner: DebianRunner{}, } + // RhelAMD64_8 - RedHat Enterprise Linux (amd64) 8 + RhelAMD64_8 = SupportedOS{ + OS: define.OS{ + Type: define.Linux, + Arch: define.AMD64, + Distro: Rhel, + Version: "8", + }, + Runner: RhelRunner{}, + } // WindowsAMD64_2022 - Windows (amd64) Server 2022 WindowsAMD64_2022 = SupportedOS{ OS: define.OS{ @@ -135,10 +166,13 @@ var ( // one in this list will be picked. So it's best to place the one that we want the // most testing at the top. var supported = []SupportedOS{ + UbuntuAMD64_2404, UbuntuAMD64_2204, UbuntuAMD64_2004, + UbuntuARM64_2404, UbuntuARM64_2204, UbuntuARM64_2004, + RhelAMD64_8, WindowsAMD64_2022, WindowsAMD64_2022_Core, WindowsAMD64_2019, diff --git a/pkg/testing/runner/supported_test.go b/pkg/testing/runner/supported_test.go index f1df343a70c..e89c54a5765 100644 --- a/pkg/testing/runner/supported_test.go +++ b/pkg/testing/runner/supported_test.go @@ -32,10 +32,12 @@ func TestGetSupported(t *testing.T) { { Name: "ubuntu/not specific", OS: define.OS{ - Type: define.Linux, - Arch: define.AMD64, + Type: define.Linux, + Arch: define.AMD64, + Distro: Ubuntu, }, Results: []SupportedOS{ + UbuntuAMD64_2404, UbuntuAMD64_2204, UbuntuAMD64_2004, }, @@ -77,6 +79,29 @@ func TestGetSupported(t *testing.T) { UbuntuAMD64_2004, }, }, + { + Name: "rhel/not specific", + OS: define.OS{ + Type: define.Linux, + Arch: define.AMD64, + Distro: Rhel, + }, + Results: []SupportedOS{ + RhelAMD64_8, + }, + }, + { + Name: "rhel/specific", + OS: define.OS{ + Type: define.Linux, + Arch: define.AMD64, + Distro: Rhel, + Version: "8", + }, + Results: []SupportedOS{ + RhelAMD64_8, + }, + }, } for _, scenario := range scenarios { t.Run(scenario.Name, func(t *testing.T) { diff --git a/pkg/testing/tools/estools/elasticsearch.go b/pkg/testing/tools/estools/elasticsearch.go index 8fcb4e41c0b..b722350c411 100644 --- a/pkg/testing/tools/estools/elasticsearch.go +++ b/pkg/testing/tools/estools/elasticsearch.go @@ -13,6 +13,8 @@ import ( "strconv" "strings" + "github.com/google/uuid" + "github.com/elastic/elastic-agent-libs/mapstr" "github.com/elastic/elastic-transport-go/v8/elastictransport" "github.com/elastic/go-elasticsearch/v8/esapi" @@ -201,6 +203,35 @@ func CreateAPIKey(ctx context.Context, client elastictransport.Interface, req AP return parsed, nil } +func CreateServiceToken(ctx context.Context, client elastictransport.Interface, service string) (string, error) { + req := esapi.SecurityCreateServiceTokenRequest{ + Namespace: "elastic", + Service: service, + Name: uuid.New().String(), // FIXME(michel-laterman): We need to specify a random name until an upstream issue is fixed: https://github.com/elastic/go-elasticsearch/issues/861 + } + resp, err := req.Do(ctx, client) + if err != nil { + return "", fmt.Errorf("error creating service token: %w", err) + } + defer resp.Body.Close() + resultBuf, err := handleResponseRaw(resp) + if err != nil { + return "", fmt.Errorf("error handling HTTP response: %w", err) + } + + var parsed struct { + Token struct { + Value string `json:"value"` + } `json:"token"` + } + err = json.Unmarshal(resultBuf, &parsed) + if err != nil { + return "", fmt.Errorf("error unmarshaling json response: %w", err) + } + return parsed.Token.Value, nil + +} + // FindMatchingLogLines returns any logs with message fields that match the given line func FindMatchingLogLines(ctx context.Context, client elastictransport.Interface, namespace, line string) (Documents, error) { return FindMatchingLogLinesWithContext(ctx, client, namespace, line) @@ -222,7 +253,7 @@ func GetLatestDocumentMatchingQuery(ctx context.Context, client elastictransport return Documents{}, fmt.Errorf("error creating ES query: %w", err) } - return performQueryForRawQuery(ctx, queryRaw, indexPattern, client) + return PerformQueryForRawQuery(ctx, queryRaw, indexPattern, client) } // GetIndexTemplatesForPattern lists all index templates on the system @@ -362,7 +393,7 @@ func FindMatchingLogLinesWithContext(ctx context.Context, client elastictranspor return Documents{}, fmt.Errorf("error creating ES query: %w", err) } - return performQueryForRawQuery(ctx, queryRaw, "logs-elastic_agent*", client) + return PerformQueryForRawQuery(ctx, queryRaw, "logs-elastic_agent*", client) } @@ -375,21 +406,17 @@ func CheckForErrorsInLogs(ctx context.Context, client elastictransport.Interface // CheckForErrorsInLogsWithContext checks to see if any error-level lines exist // excludeStrings can be used to remove any particular error strings from logs func CheckForErrorsInLogsWithContext(ctx context.Context, client elastictransport.Interface, namespace string, excludeStrings []string) (Documents, error) { - queryRaw := map[string]interface{}{ - "query": map[string]interface{}{ - "bool": map[string]interface{}{ - "must": []map[string]interface{}{ - { - "match": map[string]interface{}{ - "log.level": "error", - }, - }, - { - "term": map[string]interface{}{ - "data_stream.namespace": map[string]interface{}{ - "value": namespace, - }, - }, + filters := map[string]interface{}{ + "must": []map[string]interface{}{ + { + "match": map[string]interface{}{ + "log.level": "error", + }, + }, + { + "term": map[string]interface{}{ + "data_stream.namespace": map[string]interface{}{ + "value": namespace, }, }, }, @@ -405,27 +432,14 @@ func CheckForErrorsInLogsWithContext(ctx context.Context, client elastictranspor }, }) } - queryRaw = map[string]interface{}{ - "query": map[string]interface{}{ - "bool": map[string]interface{}{ - "must": []map[string]interface{}{ - { - "match": map[string]interface{}{ - "log.level": "error", - }, - }, - { - "term": map[string]interface{}{ - "data_stream.namespace": map[string]interface{}{ - "value": namespace, - }, - }, - }, - }, - "must_not": excludeStatements, - }, - }, - } + + filters["must_not"] = excludeStatements + } + + queryRaw := map[string]interface{}{ + "query": map[string]interface{}{ + "bool": filters, + }, } var buf bytes.Buffer @@ -434,7 +448,7 @@ func CheckForErrorsInLogsWithContext(ctx context.Context, client elastictranspor return Documents{}, fmt.Errorf("error creating ES query: %w", err) } - return performQueryForRawQuery(ctx, queryRaw, "logs-elastic_agent*", client) + return PerformQueryForRawQuery(ctx, queryRaw, "logs-elastic_agent*", client) } // GetLogsForDataset returns any logs associated with the datastream @@ -525,7 +539,7 @@ func GetLogsForDatasetWithContext(ctx context.Context, client elastictransport.I }, } - return performQueryForRawQuery(ctx, indexQuery, "logs-elastic_agent*", client) + return PerformQueryForRawQuery(ctx, indexQuery, "logs-elastic_agent*", client) } // GetLogsForIndexWithContext returns any logs that match the given condition @@ -536,7 +550,7 @@ func GetLogsForIndexWithContext(ctx context.Context, client elastictransport.Int }, } - return performQueryForRawQuery(ctx, indexQuery, index, client) + return PerformQueryForRawQuery(ctx, indexQuery, index, client) } // GetPing performs a basic ping and returns ES config info @@ -561,7 +575,8 @@ func GetPing(ctx context.Context, client elastictransport.Interface) (Ping, erro } -func performQueryForRawQuery(ctx context.Context, queryRaw map[string]interface{}, index string, client elastictransport.Interface) (Documents, error) { +// PerformQueryForRawQuery executes the ES query specified by queryRaw +func PerformQueryForRawQuery(ctx context.Context, queryRaw map[string]interface{}, index string, client elastictransport.Interface) (Documents, error) { var buf bytes.Buffer err := json.NewEncoder(&buf).Encode(queryRaw) if err != nil { @@ -576,6 +591,7 @@ func performQueryForRawQuery(ctx context.Context, queryRaw map[string]interface{ es.Search.WithTrackTotalHits(true), es.Search.WithPretty(), es.Search.WithContext(ctx), + es.Search.WithSize(300), ) if err != nil { return Documents{}, fmt.Errorf("error performing ES search: %w", err) @@ -613,7 +629,7 @@ func FindMatchingLogLinesForAgentWithContext(ctx context.Context, client elastic return Documents{}, fmt.Errorf("error creating ES query: %w", err) } - return performQueryForRawQuery(ctx, queryRaw, "logs-elastic_agent*", client) + return PerformQueryForRawQuery(ctx, queryRaw, "logs-elastic_agent*", client) } // GetLogsForDatastream returns any logs associated with the datastream diff --git a/pkg/testing/tools/git/git.go b/pkg/testing/tools/git/git.go index fb406fe6ae7..5e6fec2d6a6 100644 --- a/pkg/testing/tools/git/git.go +++ b/pkg/testing/tools/git/git.go @@ -6,65 +6,126 @@ package git import ( "bufio" + "bytes" "context" + "errors" "fmt" + "io" "os/exec" "regexp" ) var ( + ErrNotReleaseBranch = errors.New("this is not a release branch") releaseBranchRegexp = regexp.MustCompile(`.*(\d+\.\d+)$`) ) +type outputReader func(io.Reader) error + // GetReleaseBranches returns a list of release branches of the // current repository ordered descending by creation date. // e.g. 8.13, 8.12, etc. func GetReleaseBranches(ctx context.Context) ([]string, error) { - var seen = map[string]struct{}{} - branchList := []string{} - c := exec.CommandContext(ctx, "git", "branch", "-r", "--list", "*/[0-9]*.*[0-9]", "--sort=-creatordate") - r, err := c.StdoutPipe() + branchList := []string{} + err := runCommand(c, releaseBranchReader(&branchList)) if err != nil { - return nil, fmt.Errorf("failed to create the stdout pipe: %w", err) + return nil, err } - defer r.Close() - err = c.Start() + return branchList, nil +} + +// GetCurrentReleaseBranch returns the current branch of the repository +func GetCurrentReleaseBranch(ctx context.Context) (string, error) { + c := exec.CommandContext(ctx, "git", "symbolic-ref", "--short", "HEAD") + + var branch string + err := runCommand(c, fullOutputReader(&branch)) if err != nil { - return nil, fmt.Errorf("failed to start git command: %w", err) + return "", err } - scanner := bufio.NewScanner(r) - for scanner.Scan() { - branch := scanner.Text() - if !releaseBranchRegexp.MatchString(branch) { - continue + // in the APIs the release branch is still called `master` + if branch == "main" { + return "master", nil + } + + return extractReleaseBranch(branch) +} + +func fullOutputReader(out *string) outputReader { + return func(r io.Reader) error { + b, err := io.ReadAll(r) + if err != nil { + return fmt.Errorf("failed to read the entire output: %w", err) } + *out = string(bytes.TrimSpace(b)) + return nil + } +} - matches := releaseBranchRegexp.FindStringSubmatch(branch) - if len(matches) != 2 { - continue +func releaseBranchReader(out *[]string) outputReader { + return func(r io.Reader) error { + var seen = map[string]struct{}{} + scanner := bufio.NewScanner(r) + for scanner.Scan() { + branch := scanner.Text() + branch, err := extractReleaseBranch(branch) + if err != nil { + continue + } + _, exists := seen[branch] + if exists { + continue + } + seen[branch] = struct{}{} + // appending to the list right away instead of + // collecting from the map later preserves the order + *out = append(*out, branch) } - branch = matches[1] - _, exists := seen[branch] - if exists { - continue + if scanner.Err() != nil { + return fmt.Errorf("failed to scan the output: %w", scanner.Err()) } - seen[branch] = struct{}{} - // appending to the list right away instead of - // collecting from the map later preserves the order - branchList = append(branchList, branch) + + return nil } - if scanner.Err() != nil { - return nil, fmt.Errorf("failed to scan the output: %w", err) +} + +func extractReleaseBranch(branch string) (string, error) { + if !releaseBranchRegexp.MatchString(branch) { + return "", fmt.Errorf("failed to process branch %q: %w", branch, ErrNotReleaseBranch) + } + + matches := releaseBranchRegexp.FindStringSubmatch(branch) + if len(matches) != 2 { + return "", fmt.Errorf("failed to process branch %q: expected 2 matches, got %d", branch, len(matches)) + } + return matches[1], nil +} + +func runCommand(c *exec.Cmd, or outputReader) error { + r, err := c.StdoutPipe() + if err != nil { + return fmt.Errorf("failed to create the stdout pipe: %w", err) + } + defer r.Close() + + err = c.Start() + if err != nil { + return fmt.Errorf("failed to start git command: %w", err) + } + + err = or(r) + if err != nil { + return fmt.Errorf("failed to process the git command output: %w", err) } err = c.Wait() if err != nil { - return nil, fmt.Errorf("failed to wait for the git command to finish: %w", err) + return fmt.Errorf("failed to wait for the git command to finish: %w", err) } - return branchList, nil + return nil } diff --git a/pkg/testing/tools/kibana.go b/pkg/testing/tools/kibana.go index bfb804c6177..4addc9746ef 100644 --- a/pkg/testing/tools/kibana.go +++ b/pkg/testing/tools/kibana.go @@ -10,6 +10,7 @@ import ( "fmt" "net/http" "net/url" + "os" "time" "github.com/elastic/elastic-agent-libs/kibana" @@ -89,3 +90,34 @@ func GetDashboards(ctx context.Context, client *kibana.Client) ([]Dashboard, err return dashboards, nil } + +// InstallPackageFromDefaultFile allows for a test ideom where a JSON policy file can be loaded, and then updated with variables that are specific to a given test. +// This can allow a single JSON policy file to be reused across multiple tests. +// existingPolicyID should be the ID of an agent policy that was already created with InstallAgentWithPolicy() +func InstallPackageFromDefaultFile(ctx context.Context, client *kibana.Client, packagePolicyName string, packageVersion string, policyJsonPath string, policyUUID string, existingPolicyID string) (kibana.PackagePolicyResponse, error) { + installPackage := kibana.PackagePolicyRequest{} + + jsonRaw, err := os.ReadFile(policyJsonPath) + if err != nil { + return kibana.PackagePolicyResponse{}, fmt.Errorf("error reading JSON policy file: %w", err) + } + + err = json.Unmarshal(jsonRaw, &installPackage) + if err != nil { + return kibana.PackagePolicyResponse{}, fmt.Errorf("error unmarshaling json: %w", err) + } + + installPackage.Package.Version = packageVersion + installPackage.ID = policyUUID + installPackage.PolicyID = existingPolicyID + installPackage.Namespace = "default" + installPackage.Name = fmt.Sprintf("%s-test-%s", packagePolicyName, policyUUID) + installPackage.Vars = map[string]interface{}{} + + resp, err := client.InstallFleetPackage(ctx, installPackage) + if err != nil { + return kibana.PackagePolicyResponse{}, fmt.Errorf("error installing fleet package: %w", err) + } + + return resp, nil +} diff --git a/pkg/utils/perm_windows.go b/pkg/utils/perm_windows.go index 6b6ac0fd1b8..16d66c09a25 100644 --- a/pkg/utils/perm_windows.go +++ b/pkg/utils/perm_windows.go @@ -6,11 +6,17 @@ package utils +import ( + "os/user" +) + const ( // AdministratorSID is the SID for the Administrator user. AdministratorSID = "S-1-5-32-544" // SystemSID is the SID for the SYSTEM user. SystemSID = "S-1-5-32-544" + // EveryoneSID is the SID for Everyone. + EveryoneSID = "S-1-1-0" ) // FileOwner is the ownership a file should have. @@ -20,11 +26,19 @@ type FileOwner struct { } // CurrentFileOwner returns the executing UID and GID of the current process. +// +// Note: Very unlikely for this to panic if this function is unable to get the current +// user. Not being able to get the current user, is a critical problem and nothing +// can continue so a panic is appropriate. func CurrentFileOwner() FileOwner { - // TODO(blakerouse): Make this return the current user and group on Windows. + u, err := user.Current() + if err != nil { + // should not fail; if it does then there is a big problem + panic(err) + } return FileOwner{ - UID: AdministratorSID, - GID: SystemSID, + UID: u.Uid, + GID: u.Gid, } } diff --git a/pkg/version/version_parser.go b/pkg/version/version_parser.go index a06b1c0533f..ac9e8a2248e 100644 --- a/pkg/version/version_parser.go +++ b/pkg/version/version_parser.go @@ -8,16 +8,21 @@ import ( "errors" "fmt" "regexp" + "slices" "strconv" "strings" ) // regexp taken from https://semver.org/ (see the FAQ section/Is there a suggested regular expression (RegEx) to check a SemVer string?) const semVerFormat = `^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$` +const numericPrereleaseTokenFormat = `\d+` const preReleaseSeparator = "-" const metadataSeparator = "+" +const prereleaseTokenSeparator = "." +const snapshotPrereleaseToken = "SNAPSHOT" var semVerFmtRegEx *regexp.Regexp +var numericPrereleaseTokenRegEx *regexp.Regexp var namedGroups map[string]int func init() { @@ -28,6 +33,9 @@ func init() { for i, groupName := range groups { namedGroups[groupName] = i } + + // compile the numeric prerelease token regex + numericPrereleaseTokenRegEx = regexp.MustCompile(numericPrereleaseTokenFormat) } var ErrNoMatch = errors.New("version string does not match expected format") @@ -65,6 +73,14 @@ func (psv ParsedSemVer) Prerelease() string { return psv.prerelease } +func (psv ParsedSemVer) PrereleaseTokens() []string { + if len(psv.prerelease) == 0 { + return nil + } + + return strings.Split(psv.Prerelease(), prereleaseTokenSeparator) +} + func (psv ParsedSemVer) BuildMetadata() string { return psv.buildMetadata } @@ -73,14 +89,44 @@ func (psv ParsedSemVer) VersionWithPrerelease() string { b := new(strings.Builder) b.WriteString(psv.CoreVersion()) if psv.prerelease != "" { - b.WriteString("-") + b.WriteString(preReleaseSeparator) b.WriteString(psv.prerelease) } return b.String() } +func (psv ParsedSemVer) ExtractSnapshotFromVersionString() (string, bool) { + + b := new(strings.Builder) + b.WriteString(psv.CoreVersion()) + + prereleaseTokens := psv.PrereleaseTokens() + isSnapshot := false + + for i, t := range prereleaseTokens { + if t == snapshotPrereleaseToken { + // we found the snapshot prerelease qualifier (we assume there's only 1) + isSnapshot = true + prereleaseTokens = append(prereleaseTokens[:i], prereleaseTokens[i+1:]...) + break + } + } + + if len(prereleaseTokens) > 0 { + b.WriteString(preReleaseSeparator) + b.WriteString(assemblePrereleaseStringFromTokens(prereleaseTokens)) + } + + if len(psv.buildMetadata) > 0 { + b.WriteString(metadataSeparator) + b.WriteString(psv.buildMetadata) + } + return b.String(), isSnapshot +} + func (psv ParsedSemVer) IsSnapshot() bool { - return psv.prerelease == "SNAPSHOT" || strings.HasSuffix(psv.prerelease, "-SNAPSHOT") + prereleaseTokens := psv.PrereleaseTokens() + return slices.Contains(prereleaseTokens, snapshotPrereleaseToken) } func (psv ParsedSemVer) Less(other ParsedSemVer) bool { @@ -99,34 +145,66 @@ func (psv ParsedSemVer) Less(other ParsedSemVer) bool { return psv.patch < other.patch } - // last resort check if one is prereleas and the other isn't + // compare prerelease strings as major.minor.patch are equal + return psv.comparePrerelease(other) +} + +// comparePrerelease compares the prerelease part of 2 ParsedSemVer objects +// the return value must conform to psv.prerelease < other.prerelease following comparison rules from https://semver.org/ +func (psv ParsedSemVer) comparePrerelease(other ParsedSemVer) bool { + // last resort before parsing prerelease: check if one is prerelease and the other isn't if psv.prerelease != "" && other.prerelease == "" { return true } - return false -} + if psv.prerelease == "" && other.prerelease != "" { + return false + } -func (psv ParsedSemVer) GetPreviousMinor() (*ParsedSemVer, error) { - major := psv.Major() - minor := psv.Minor() + // tokenize prereleases and compare them + prereleaseTokens := strings.Split(psv.prerelease, prereleaseTokenSeparator) + otherPrereleaseTokens := strings.Split(other.prerelease, prereleaseTokenSeparator) - if minor > 0 { - // We have at least one previous minor version in the current - // major version series. Set the patch to zero to guarnatee the - // version exists, the number of patch releases varies. - return NewParsedSemVer(major, minor-1, 0, psv.Prerelease(), psv.BuildMetadata()), nil + // compute the min amount of tokens + minPrereleaseTokens := len(prereleaseTokens) + if len(otherPrereleaseTokens) < minPrereleaseTokens { + minPrereleaseTokens = len(otherPrereleaseTokens) } - // We are at the first minor of the current major version series. To - // figure out the previous minor, we need to rely on knowledge of - // the release versions from the past major series'. - switch major { - case 8: - return NewParsedSemVer(7, 17, 10, psv.Prerelease(), psv.BuildMetadata()), nil + for i := 0; i < minPrereleaseTokens; i++ { + token := prereleaseTokens[i] + otherToken := otherPrereleaseTokens[i] + + isTokenNumeric := numericPrereleaseTokenRegEx.MatchString(token) + isOtherTokenNumeric := numericPrereleaseTokenRegEx.MatchString(otherToken) + + // numeric identifiers always have lower precedence than non-numeric identifiers + if isTokenNumeric && !isOtherTokenNumeric { + return true + } + + if !isTokenNumeric && isOtherTokenNumeric { + return false + } + + // prerelease tokens are of the same type: check if we have to compare them as numbers or strings + if isTokenNumeric { + // we can ignore the error as the regex we are using is even more restrictive than a generic integer regex + numericToken, _ := strconv.Atoi(token) + otherNumericToken, _ := strconv.Atoi(otherToken) + if numericToken != otherNumericToken { + return numericToken < otherNumericToken + } + } else { + // compare them as strings + if token != otherToken { + return token < otherToken + } + } } - return nil, fmt.Errorf("unable to determine previous minor version for [%s]", psv.String()) + // the minimum number of tokens is the same across the two versions, check if one of the two have more tokens + return len(prereleaseTokens) < len(otherPrereleaseTokens) } func (psv ParsedSemVer) String() string { @@ -183,6 +261,17 @@ func ParseVersion(version string) (*ParsedSemVer, error) { }, nil } +func assemblePrereleaseStringFromTokens(tokens []string) string { + builder := new(strings.Builder) + for _, t := range tokens { + if builder.Len() > 0 { + builder.WriteString(prereleaseTokenSeparator) + } + builder.WriteString(t) + } + return builder.String() +} + type SortableParsedVersions []*ParsedSemVer func (spv SortableParsedVersions) Len() int { return len(spv) } diff --git a/pkg/version/version_parser_test.go b/pkg/version/version_parser_test.go index c7df78f5e63..31dbde762b4 100644 --- a/pkg/version/version_parser_test.go +++ b/pkg/version/version_parser_test.go @@ -274,7 +274,12 @@ func TestIsSnapshot(t *testing.T) { }, { name: "Emergency release snapshot is actually a snapshot", - input: "8.8.0-er.1-SNAPSHOT ", + input: "8.8.0-SNAPSHOT.er.1 ", + snapshot: true, + }, + { + name: "Emergency release with snapshot in the middle is a snapshot", + input: "8.8.0-er.SNAPSHOT.1 ", snapshot: true, }, } @@ -291,6 +296,78 @@ func TestIsSnapshot(t *testing.T) { } +func TestExtractSnapshotFromVersionString(t *testing.T) { + testcases := []struct { + name string + inputVersion string + outputVersion string + snapshot bool + }{ + { + name: "Simple snapshot", + inputVersion: "8.8.0-SNAPSHOT", + outputVersion: "8.8.0", + snapshot: true, + }, + { + name: "Snapshot with build meta", + inputVersion: "8.8.0-SNAPSHOT+abcdef", + outputVersion: "8.8.0+abcdef", + snapshot: true, + }, + { + name: "Snapshot comparison is case sensitive", + inputVersion: "8.8.0-sNapShOt", + outputVersion: "8.8.0-sNapShOt", + snapshot: false, + }, + { + name: "Only major minor patch", + inputVersion: "8.8.0", + outputVersion: "8.8.0", + snapshot: false, + }, + { + name: "Alpha prerelease is not snapshot", + inputVersion: "8.8.0-alpha", + outputVersion: "8.8.0-alpha", + snapshot: false, + }, + { + name: "Emergency release is not snapshot", + inputVersion: "8.8.0-er.1", + outputVersion: "8.8.0-er.1", + snapshot: false, + }, + { + name: "Emergency release snapshot is actually a snapshot", + inputVersion: "8.8.0-SNAPSHOT.er.1 ", + outputVersion: "8.8.0-er.1", + snapshot: true, + }, + { + name: "Emergency release with SNAPSHOT in the middle is a snapshot", + inputVersion: "8.8.0-er.SNAPSHOT.1 ", + outputVersion: "8.8.0-er.1", + snapshot: true, + }, + } + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + psv, err := ParseVersion(tc.inputVersion) + require.NoErrorf(t, err, "error parsing version %q", tc.inputVersion) + require.NotNil(t, psv, "parsed semver should not be nil with no errors returned from ParseVersion") + actualOutputVersion, actualIsSnapshot := psv.ExtractSnapshotFromVersionString() + assert.Equalf(t, tc.outputVersion, actualOutputVersion, "(%q).ExtractSnapshotFromVersionString() is expected to return version: %q", tc.inputVersion, tc.outputVersion) + assert.Equalf(t, tc.snapshot, actualIsSnapshot, "(%q).ExtractSnapshotFromVersionString() is expected to return snapshot: %v", tc.inputVersion, tc.snapshot) + // make sure that the actual snapshot flag is coherent with isSnapshot() + flagFromIsSnapshot := psv.IsSnapshot() + assert.Equalf(t, flagFromIsSnapshot, actualIsSnapshot, "(%q).ExtractSnapshotFromVersionString() is expected to return same snapshot flag value as (%q).IsSnapshot()=%v", tc.inputVersion, tc.inputVersion, flagFromIsSnapshot) + + }) + } +} + func TestLess(t *testing.T) { testcases := []struct { name string @@ -298,6 +375,7 @@ func TestLess(t *testing.T) { rightVersion string less bool }{ + // major, minor, patch section { name: "major version less than ours", leftVersion: "7.17.10", @@ -316,6 +394,7 @@ func TestLess(t *testing.T) { rightVersion: "8.7.1", less: true, }, + // prerelease section { name: "prerelease is always less than non-prerelease", leftVersion: "8.9.0-SNAPSHOT", @@ -323,17 +402,24 @@ func TestLess(t *testing.T) { less: true, }, { - name: "2 prereleases have no specific order", + name: "2 prereleases are compared by their tokens", leftVersion: "8.9.0-SNAPSHOT", rightVersion: "8.9.0-er1", less: false, }, { - name: "2 prereleases have no specific order, reversed", + name: "2 prereleases are compared by their tokens, reversed", leftVersion: "8.9.0-er1", rightVersion: "8.9.0-SNAPSHOT", + less: true, + }, + { + name: "2 prereleases have no specific order", + leftVersion: "8.9.0-SNAPSHOT", + rightVersion: "8.9.0-er1", less: false, }, + // build metadata (these have no impact on precedence) { name: "build metadata have no influence on precedence", leftVersion: "8.9.0-SNAPSHOT+aaaaaa", @@ -346,68 +432,61 @@ func TestLess(t *testing.T) { rightVersion: "8.9.0-SNAPSHOT+aaaaaa", less: false, }, - } - - for _, tc := range testcases { - t.Run(tc.name, func(t *testing.T) { - left, err := ParseVersion(tc.leftVersion) - require.NoError(t, err) - require.NotNil(t, left) - right, err := ParseVersion(tc.rightVersion) - require.NoError(t, err) - require.NotNil(t, right) - assert.Equal(t, left.Less(*right), tc.less) - }) - } -} - -func TestPreviousMinor(t *testing.T) { - testcases := []struct { - name string - version string - prevMinorVersion string - }{ + // testcases taken from semver.org + // 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0. + { + name: "prerelease with fewer tokens is less than same prerelease with extra tokens", + leftVersion: "1.0.0-alpha", + rightVersion: "1.0.0-alpha.1", + less: true, + }, { - name: "basic release version", - version: "8.7.0", - prevMinorVersion: "8.6.0", + name: "numeric identifiers always have lower precedence than non-numeric identifiers", + leftVersion: "1.0.0-alpha.1", + rightVersion: "1.0.0-alpha.beta", + less: true, }, { - name: "snapshot release version", - version: "8.9.3-SNAPSHOT", - prevMinorVersion: "8.8.0-SNAPSHOT", + name: "minimum number of prerelease string tokens must be compared alphabetically", + leftVersion: "1.0.0-alpha.beta", + rightVersion: "1.0.0-beta", + less: true, }, { - name: "emergency release version", - version: "8.9.0-er1", - prevMinorVersion: "8.8.0-er1", + name: "prerelease with fewer tokens is less than same prerelease with extra tokens #2", + leftVersion: "1.0.0-beta", + rightVersion: "1.0.0-beta.2", + less: true, }, { - name: "previous major version", - version: "8.0.0", - prevMinorVersion: "7.17.10", + name: "numeric identifiers must be compared numerically", + leftVersion: "1.0.0-beta.2", + rightVersion: "1.0.0-beta.11", + less: true, }, { - name: "previous major snapshot", - version: "8.0.0-SNAPSHOT", - prevMinorVersion: "7.17.10-SNAPSHOT", + name: "string identifiers are compared lexically", + leftVersion: "1.0.0-beta.11", + rightVersion: "1.0.0-rc.1", + less: true, }, { - name: "snapshot version with metadata", - version: "8.9.1-SNAPSHOT+aaaaaa", - prevMinorVersion: "8.8.0-SNAPSHOT+aaaaaa", + name: "prerelease versions have lower precedence than non-prerelease version ", + leftVersion: "1.0.0-rc.1", + rightVersion: "1.0.0", + less: true, }, } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - parsed, err := ParseVersion(tc.version) + left, err := ParseVersion(tc.leftVersion) require.NoError(t, err) - require.NotNil(t, parsed) - - prev, err := parsed.GetPreviousMinor() + require.NotNil(t, left) + right, err := ParseVersion(tc.rightVersion) require.NoError(t, err) - require.Equal(t, tc.prevMinorVersion, prev.String()) + require.NotNil(t, right) + assert.Equalf(t, tc.less, left.Less(*right), "Expected %s < %s = %v", tc.leftVersion, tc.rightVersion, tc.less) }) } } diff --git a/specs/auditbeat.spec.yml b/specs/auditbeat.spec.yml deleted file mode 100644 index 00b374896dd..00000000000 --- a/specs/auditbeat.spec.yml +++ /dev/null @@ -1,49 +0,0 @@ -version: 2 -inputs: - - name: audit/auditd - description: "Auditd" - platforms: &platforms - - linux/amd64 - - linux/arm64 - - darwin/amd64 - - darwin/arm64 - - windows/amd64 - - container/amd64 - - container/arm64 - outputs: &outputs - - elasticsearch - - kafka - - logstash - - redis - command: &command - restart_monitoring_period: 5s - maximum_restarts_per_period: 1 - timeouts: - restart: 1s - args: - - "-E" - - "setup.ilm.enabled=false" - - "-E" - - "setup.template.enabled=false" - - "-E" - - "management.enabled=true" - - "-E" - - "management.restart_on_output_change=true" - - "-E" - - "logging.level=info" - - "-E" - - "logging.to_stderr=true" - - "-E" - - "gc_percent=${AUDITBEAT_GOGC:100}" - - "-E" - - "auditbeat.config.modules.enabled=false" - - name: audit/file_integrity - description: "Audit File Integrity" - platforms: *platforms - outputs: *outputs - command: *command - - name: audit/system - description: "Audit System" - platforms: *platforms - outputs: *outputs - command: *command diff --git a/specs/cloudbeat.spec.yml b/specs/cloudbeat.spec.yml index 966bd445ca9..d6464f59f85 100644 --- a/specs/cloudbeat.spec.yml +++ b/specs/cloudbeat.spec.yml @@ -7,7 +7,6 @@ inputs: - linux/arm64 - darwin/amd64 - darwin/arm64 - - windows/amd64 - container/amd64 - container/arm64 outputs: &outputs @@ -15,6 +14,9 @@ inputs: - kafka - logstash - redis + # Introduced for isolated units tests, not used by cloudbeat + shippers: &shippers + - shipper command: &command restart_monitoring_period: 5s maximum_restarts_per_period: 1 @@ -35,33 +37,57 @@ inputs: - "logging.to_stderr=true" - "-E" - "gc_percent=${CLOUDBEAT_GOGC:100}" + - "-E" + - "logging.event_data.to_stderr=true" + - "-E" + - "logging.event_data.to_files=false" + isolate_units: true - name: cloudbeat/cis_k8s description: "CIS Kubernetes monitoring" platforms: *platforms outputs: *outputs + shippers: *shippers command: *command + isolate_units: true - name: cloudbeat/cis_eks description: "CIS elastic Kubernetes monitoring" platforms: *platforms outputs: *outputs + shippers: *shippers command: *command + isolate_units: true - name: cloudbeat/cis_aws description: "CIS AWS monitoring" platforms: *platforms outputs: *outputs + shippers: *shippers command: *command + isolate_units: true - name: cloudbeat/cis_gcp description: "CIS GCP monitoring" platforms: *platforms outputs: *outputs + shippers: *shippers command: *command + isolate_units: true - name: cloudbeat/cis_azure description: "CIS AZURE monitoring" platforms: *platforms outputs: *outputs + shippers: *shippers command: *command + isolate_units: true - name: cloudbeat/vuln_mgmt_aws description: "AWS Vulnerabilities management" platforms: *platforms outputs: *outputs + shippers: *shippers + command: *command + isolate_units: true + - name: cloudbeat/asset_inventory_aws + description: "AWS Asset Inventory Discovery" + platforms: *platforms + outputs: *outputs + shippers: *shippers command: *command + isolate_units: true diff --git a/specs/endpoint-security.spec.yml b/specs/endpoint-security.spec.yml index 02c0c6d1c2a..a91da9bea32 100644 --- a/specs/endpoint-security.spec.yml +++ b/specs/endpoint-security.spec.yml @@ -14,7 +14,7 @@ inputs: - UPGRADE runtime: preventions: - - condition: ${runtime.arch} == 'arm64' and ${runtime.family} == 'redhat' and ${runtime.major} == '7' + - condition: ${runtime.arch} == 'arm64' and ${runtime.family} == 'redhat' and ${runtime.major} == 7 message: "Elastic Defend doesn't support RHEL7 on arm64" - condition: ${user.root} == false message: "Elastic Defend requires Elastic Agent be running as root" @@ -22,6 +22,7 @@ inputs: message: "Elastic Defend requires Elastic Agent be installed at the default installation path" service: &service cport: 6788 + csocket: ".eaci.sock" log: path: "/opt/Elastic/Endpoint/state/log/endpoint-*.log" operations: &operations @@ -62,6 +63,7 @@ inputs: message: "Elastic Defend requires Elastic Agent be installed at the default installation path" service: cport: 6788 + csocket: ".eaci.sock" log: path: "/Library/Elastic/Endpoint/state/log/endpoint-*.log" operations: *operations @@ -79,8 +81,11 @@ inputs: message: "Elastic Defend requires Elastic Agent be installed at the default installation path" - condition: ${runtime.native_arch} != '' and ${runtime.native_arch} != 'amd64' message: "Elastic Defend cannot be installed on Windows running on non-AMD64 CPU" + - condition: ${runtime.major} <= 6 + message: "Elastic Defend requires Windows 10 / Server 2016 or newer." service: cport: 6788 + csocket: ".eaci.sock" log: path: "C:\\Program Files\\Elastic\\Endpoint\\state\\log\\endpoint-*.log" operations: *operations @@ -93,7 +98,7 @@ inputs: proxied_actions: *proxied_actions runtime: preventions: - - condition: ${runtime.arch} == 'arm64' and ${runtime.family} == 'redhat' and ${runtime.major} == '7' + - condition: ${runtime.arch} == 'arm64' and ${runtime.family} == 'redhat' and ${runtime.major} == 7 message: "No support for RHEL7 on arm64" - condition: ${user.root} == false message: "Elastic Agent must be running as root" diff --git a/specs/heartbeat.spec.yml b/specs/heartbeat.spec.yml deleted file mode 100644 index b7cc46c490a..00000000000 --- a/specs/heartbeat.spec.yml +++ /dev/null @@ -1,49 +0,0 @@ -version: 2 -inputs: - - name: synthetics/browser - description: "Synthetics Browser Monitor" - platforms: &platforms - - linux/amd64 - - linux/arm64 - - darwin/amd64 - - darwin/arm64 - - windows/amd64 - - container/amd64 - - container/arm64 - outputs: &outputs - - elasticsearch - command: &command - restart_monitoring_period: 5s - maximum_restarts_per_period: 1 - timeouts: - restart: 1s - args: - - "-E" - - "setup.ilm.enabled=false" - - "-E" - - "setup.template.enabled=false" - - "-E" - - "management.enabled=true" - - "-E" - - "management.restart_on_output_change=true" - - "-E" - - "logging.level=info" - - "-E" - - "logging.to_stderr=true" - - "-E" - - "gc_percent=${HEARTBEAT_GOGC:100}" - - name: synthetics/http - description: "Synthetics HTTP Monitor" - platforms: *platforms - outputs: *outputs - command: *command - - name: synthetics/icmp - description: "Synthetics ICMP Monitor" - platforms: *platforms - outputs: *outputs - command: *command - - name: synthetics/tcp - description: "Synthetics TCP Monitor" - platforms: *platforms - outputs: *outputs - command: *command diff --git a/specs/metricbeat.spec.yml b/specs/metricbeat.spec.yml deleted file mode 100644 index 10e4a073e5e..00000000000 --- a/specs/metricbeat.spec.yml +++ /dev/null @@ -1,293 +0,0 @@ -version: 2 -inputs: - - name: beat/metrics - description: "Beat metrics" - platforms: &platforms - - linux/amd64 - - linux/arm64 - - darwin/amd64 - - darwin/arm64 - - windows/amd64 - - container/amd64 - - container/arm64 - outputs: &outputs - - elasticsearch - - kafka - - logstash - - redis - shippers: &shippers - - shipper - command: &command - restart_monitoring_period: 5s - maximum_restarts_per_period: 1 - timeouts: - restart: 1s - args: - - "-E" - - "setup.ilm.enabled=false" - - "-E" - - "setup.template.enabled=false" - - "-E" - - "management.enabled=true" - - "-E" - - "management.restart_on_output_change=true" - - "-E" - - "logging.level=info" - - "-E" - - "logging.to_stderr=true" - - "-E" - - "gc_percent=${METRICBEAT_GOGC:100}" - - "-E" - - "metricbeat.config.modules.enabled=false" - - name: docker/metrics - description: "Docker metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: elasticsearch/metrics - description: "Elasticsearch metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: enterprisesearch/metrics - description: "Enterprise search metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: kibana/metrics - description: "Kibana metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: kubernetes/metrics - description: "Kubernetes metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: linux/metrics - description: "Linux metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: logstash/metrics - description: "Logstash metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: mongodb/metrics - description: "Mongodb metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: mysql/metrics - description: "MySQL metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: postgresql/metrics - description: "PostgreSQL metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: redis/metrics - description: "Redis metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: system/metrics - description: "System metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: uwsgi/metrics - description: "UWSGI metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: windows/metrics - description: "Windows metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: aws/metrics - description: "AWS metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: awsfargate/metrics - description: "AWS Fargate metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: azure/metrics - description: "Azure metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: cloudfoundry/metrics - description: "PCF Cloudfoundry metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: containerd/metrics - description: "Containerd metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: mssql/metrics - description: "Microsoft SQL Server metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: oracle/metrics - description: "Oracle Database metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: syncgateway/metrics - description: "Couchbase Sync Gateway metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: http/metrics - description: "HTTP metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: activemq/metrics - description: "ActiveMQ metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: apache/metrics - description: "Apache metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: etcd/metrics - description: "Etcd metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: gcp/metrics - description: "GCP metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: haproxy/metrics - description: "HAProxy metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: iis/metrics - description: "IIS metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: jolokia/metrics - description: "Jolokia metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: kafka/metrics - description: "Kafka metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: memcached/metrics - description: "Memcached metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: nats/metrics - description: "NATS metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: nginx/metrics - description: "NGINX metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: prometheus/metrics - description: "Prometheus metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: rabbitmq/metrics - description: "RabbitMQ metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: sql/metrics - description: "SQL metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: stan/metrics - description: "Stan metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: statsd/metrics - description: "Statsd metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: traefik/metrics - description: "Traefik metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: vsphere/metrics - description: "VSphere metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command - - name: zookeeper/metrics - description: "ZooKeeper metrics" - platforms: *platforms - outputs: *outputs - shippers: *shippers - command: *command diff --git a/specs/osquerybeat.spec.yml b/specs/osquerybeat.spec.yml deleted file mode 100644 index 1cb1ef60f77..00000000000 --- a/specs/osquerybeat.spec.yml +++ /dev/null @@ -1,36 +0,0 @@ -version: 2 -inputs: - - name: osquery - description: "Osquery" - platforms: - - linux/amd64 - - linux/arm64 - - darwin/amd64 - - darwin/arm64 - - windows/amd64 - - container/amd64 - - container/arm64 - outputs: - - elasticsearch - - logstash - - kafka - command: - restart_monitoring_period: 5s - maximum_restarts_per_period: 1 - timeouts: - restart: 1s - args: - - "-E" - - "setup.ilm.enabled=false" - - "-E" - - "setup.template.enabled=false" - - "-E" - - "management.enabled=true" - - "-E" - - "management.restart_on_output_change=true" - - "-E" - - "logging.level=info" - - "-E" - - "logging.to_stderr=true" - - "-E" - - "gc_percent=${OSQUERYBEAT_GOGC:100}" diff --git a/specs/packetbeat.spec.yml b/specs/packetbeat.spec.yml deleted file mode 100644 index 13e0683b5ca..00000000000 --- a/specs/packetbeat.spec.yml +++ /dev/null @@ -1,37 +0,0 @@ -version: 2 -inputs: - - name: packet - description: "Packet Capture" - platforms: - - linux/amd64 - - linux/arm64 - - darwin/amd64 - - darwin/arm64 - - windows/amd64 - - container/amd64 - - container/arm64 - outputs: - - elasticsearch - - kafka - - logstash - - redis - command: - restart_monitoring_period: 5s - maximum_restarts_per_period: 1 - timeouts: - restart: 1s - args: - - "-E" - - "setup.ilm.enabled=false" - - "-E" - - "setup.template.enabled=false" - - "-E" - - "management.enabled=true" - - "-E" - - "management.restart_on_output_change=true" - - "-E" - - "logging.level=info" - - "-E" - - "logging.to_stderr=true" - - "-E" - - "gc_percent=${PACKETBEAT_GOGC:100}" diff --git a/specs/filebeat.spec.yml b/specs/testbeat.spec.yml similarity index 95% rename from specs/filebeat.spec.yml rename to specs/testbeat.spec.yml index 435b02919dd..c84f52cdcd9 100644 --- a/specs/filebeat.spec.yml +++ b/specs/testbeat.spec.yml @@ -1,3 +1,4 @@ +# Test Beat spec file based on the contents of the Filebeat 8.12.0 spec file when agentbeat was introduced. version: 2 inputs: - name: aws-cloudwatch @@ -39,6 +40,10 @@ inputs: - "gc_percent=${FILEBEAT_GOGC:100}" - "-E" - "filebeat.config.modules.enabled=false" + - "-E" + - "logging.event_data.to_stderr=true" + - "-E" + - "logging.event_data.to_files=false" - name: aws-s3 description: "AWS S3" platforms: *platforms diff --git a/testing/fleetservertest/checkin.go b/testing/fleetservertest/checkin.go index 8a9ff0c4f08..57b3bb2b25f 100644 --- a/testing/fleetservertest/checkin.go +++ b/testing/fleetservertest/checkin.go @@ -5,23 +5,32 @@ package fleetservertest import ( + "encoding/json" "fmt" "strings" "text/template" ) +type SSL struct { + Renegotiation string `json:"renegotiation,omitempty"` + VerificationMode string `json:"verification_mode,omitempty"` + CertificateAuthorities []string `json:"certificate_authorities,omitempty"` + Certificate string `json:"certificate,omitempty"` + Key string `json:"key,omitempty"` +} + // TmplPolicy is all the data used to create a policy. Therefore, all the properties // should be populated with valid JSON without the surrounding double quotes. // Check the actionPolicyChangeFakeComponentTmpl for details. type TmplPolicy struct { AgentID string PolicyID string - // FleetHosts should be a JSON array without the square brackets: - // - `"host1", "host2"` - // - `"host"` - FleetHosts string + // FleetHosts should be a regular string array containing fleet hosts + // []string{"host1", "host2"} + FleetHosts []string // AddFleetProxyURL bool FleetProxyURL *string + SSL *SSL SourceURI string CreatedAt string Output struct { @@ -40,8 +49,8 @@ func NewCheckinResponse(ackToken string, actions ...string) string { // NewEmptyPolicy returns an policy without any input and monitoring disabled. func NewEmptyPolicy(data TmplPolicy) (string, error) { - t := template.Must(template.New("policyEmpryTmpl"). - Parse(policyEmpryTmpl)) + t := template.Must(template.New("policyEmptyTmpl").Funcs(funcMap). + Parse(policyEmptyTmpl)) buf := &strings.Builder{} err := t.Execute(buf, data) @@ -102,7 +111,7 @@ func NewAction(data ActionTmpl) (AckableAction, error) { // integration uses the fake component. All variable data in the policy // comes from the data parameter. func NewActionPolicyChangeWithFakeComponent(actionID string, data TmplPolicy) (AckableAction, error) { - t := template.Must(template.New("actionPolicyChangeFakeComponentTmpl"). + t := template.Must(template.New("actionPolicyChangeFakeComponentTmpl").Funcs(funcMap). Parse(actionPolicyChangeFakeComponentTmpl)) buf := &strings.Builder{} @@ -119,6 +128,16 @@ func NewActionPolicyChangeWithFakeComponent(actionID string, data TmplPolicy) (A }) } +// template functions +var funcMap = map[string]any{"toJson": toJson} + +func toJson(v any) (string, error) { + b := new(strings.Builder) + encoder := json.NewEncoder(b) + err := encoder.Encode(v) + return b.String(), err +} + const ( checkinResponseJSON = ` { @@ -149,7 +168,10 @@ const ( } }, "fleet": { - "hosts": [{{.FleetHosts}}] + {{ if ne .SSL nil }} + "ssl": {{ toJson .SSL}}, + {{ end }} + "hosts": {{ toJson .FleetHosts }} }, "id": "{{.PolicyID}}", "inputs": [ @@ -191,7 +213,7 @@ const ( } }` - policyEmpryTmpl = ` + policyEmptyTmpl = ` { "policy": { "agent": { @@ -216,7 +238,10 @@ const ( {{ if ne .FleetProxyURL nil }} "proxy_url": "{{.FleetProxyURL}}", {{ end }} - "hosts": [{{.FleetHosts}}] + {{ if ne .SSL nil }} + "ssl": {{ toJson .SSL}}, + {{ end }} + "hosts": {{ toJson .FleetHosts }} }, "id": "{{.PolicyID}}", "inputs": [], diff --git a/testing/fleetservertest/fleetserver_test.go b/testing/fleetservertest/fleetserver_test.go index a96c1df3606..aaccb2d415f 100644 --- a/testing/fleetservertest/fleetserver_test.go +++ b/testing/fleetservertest/fleetserver_test.go @@ -11,6 +11,7 @@ import ( "io" "net/http" "net/url" + "strings" "sync" "testing" "time" @@ -43,7 +44,7 @@ func TestRunFleetServer(t *testing.T) { // address from it. // If you want to predefine an address for the server to listen on, pass // WithAddress(addr) to NewServer. - fleetHosts := "host1" + fleetHosts := []string{"host1"} var actionsIdx int tmpl := TmplPolicy{ @@ -55,7 +56,7 @@ func TestRunFleetServer(t *testing.T) { // get the port the server is listening on. Therefore, the action generator // captures the 'fleetHosts' variable, so it can read the real fleet-server // address from it. - FleetHosts: `"host1", "host2"`, + FleetHosts: []string{"host1", "host2"}, SourceURI: "http://source.uri", CreatedAt: "2023-05-31T11:37:50.607Z", Output: struct { @@ -104,7 +105,7 @@ func TestRunFleetServer(t *testing.T) { WithRequestLog(t.Logf)) defer ts.Close() - fleetHosts = fmt.Sprintf(`"%s"`, ts.URL) + fleetHosts = []string{fmt.Sprintf(`"%s"`, ts.URL)} fmt.Println("listening on:", fleetHosts) //nolint:forbidigo // it's a test fmt.Println("press CTRL + C or kill the test to stop") //nolint:forbidigo // it's a test @@ -173,6 +174,128 @@ func ExampleNewServer_checkin() { // [action_id: anActionID, type: POLICY_CHANGE] } +func ExampleNewServer_checkin_fleetConnectionParams() { + agentID := "agentID" + tmpl := TmplPolicy{ + FleetHosts: []string{"https://fleet.somehost.somedomain"}, + SSL: &SSL{ + Renegotiation: "never", + VerificationMode: "", + CertificateAuthorities: []string{"/path/to/CA1", "/path/to/CA2"}, + Certificate: "/path/to/certificate", + Key: "/path/to/key", + }, + } + + actions, err := NewActionPolicyChangeWithFakeComponent("anActionID", tmpl) + if err != nil { + panic(fmt.Sprintf("failed to get new actions: %v", err)) + } + + // NewHandlerCheckin + ts := NewServer(&Handlers{ + CheckinFn: NewHandlerCheckin(func() (CheckinAction, *HTTPError) { + return CheckinAction{Actions: []string{actions.data}}, nil + })}, + WithAgentID(agentID)) + + cmd := fleetapi.NewCheckinCmd( + agentInfo(agentID), sender{url: ts.URL, path: NewPathCheckin(agentID)}) + + got, _, err := cmd.Execute(context.Background(), &fleetapi.CheckinRequest{}) + if err != nil { + panic(fmt.Sprintf("ExampleNewServer_checkin_fleetConnectionParams failed executing checkin: %v", err)) + } + + fmt.Println(got.Actions) + if len(got.Actions) > 0 { + policy := got.Actions[0].(*fleetapi.ActionPolicyChange).Policy + b := new(strings.Builder) + encoder := json.NewEncoder(b) + encoder.SetIndent("", " ") + err = encoder.Encode(policy) + if err != nil { + panic(fmt.Sprintf("Error marshaling received policy: %v", err)) + } + fmt.Println(b.String()) + } + + // Output: + // [action_id: anActionID, type: POLICY_CHANGE] + // { + // "agent": { + // "download": { + // "sourceURI": "" + // }, + // "features": {}, + // "monitoring": { + // "enabled": true, + // "logs": true, + // "metrics": true, + // "namespace": "default", + // "use_output": "default" + // }, + // "protection": { + // "enabled": false, + // "signing_key": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQ9BPoHUCyLyElVpfwvKeFdUt6U9wBb+QlZNf4cy5eAwK9Xh4D8fClgciPeRs3j62i6IEeGyvOs9U3+fElyUigg==", + // "uninstall_token_hash": "lORSaDIQq4nglUMJwWjKrwexj4IDRJA+FtoQeeqKH/I=" + // } + // }, + // "fleet": { + // "hosts": [ + // "https://fleet.somehost.somedomain" + // ], + // "ssl": { + // "certificate": "/path/to/certificate", + // "certificate_authorities": [ + // "/path/to/CA1", + // "/path/to/CA2" + // ], + // "key": "/path/to/key", + // "renegotiation": "never" + // } + // }, + // "id": "", + // "inputs": [ + // { + // "data_stream": { + // "namespace": "default" + // }, + // "id": "fake-input", + // "meta": { + // "package": { + // "name": "fake-input", + // "version": "0.0.1" + // } + // }, + // "name": "fake-input", + // "package_policy_id": "", + // "revision": 1, + // "streams": [], + // "type": "fake-input", + // "use_output": "default" + // } + // ], + // "output_permissions": { + // "default": {} + // }, + // "outputs": { + // "default": { + // "api_key": "", + // "hosts": [], + // "type": "" + // } + // }, + // "revision": 2, + // "secret_references": [], + // "signed": { + // "data": "eyJpZCI6IjI0ZTRkMDMwLWZmYTctMTFlZC1iMDQwLTlkZWJhYTVmZWNiOCIsImFnZW50Ijp7InByb3RlY3Rpb24iOnsiZW5hYmxlZCI6ZmFsc2UsInVuaW5zdGFsbF90b2tlbl9oYXNoIjoibE9SU2FESVFxNG5nbFVNSndXaktyd2V4ajRJRFJKQStGdG9RZWVxS0gvST0iLCJzaWduaW5nX2tleSI6Ik1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVE5QlBvSFVDeUx5RWxWcGZ3dktlRmRVdDZVOXdCYitRbFpOZjRjeTVlQXdLOVhoNEQ4ZkNsZ2NpUGVSczNqNjJpNklFZUd5dk9zOVUzK2ZFbHlVaWdnPT0ifX19", + // "signature": "MEUCIQCfS6wPj/AvfFA79dwKATnvyFl/ZeyA8eKOLHg1XuA9NgIgNdhjIT+G/GZFqsVoWk5jThONhpqPhfiHLE5OkTdrwT0=" + // } + // } + +} + func ExampleNewServer_ack() { agentID := "agentID" actionID := "actionID" @@ -274,6 +397,7 @@ func ExampleNewServer_enroll() { // "id": "agentID", // "log_level": "", // "snapshot": false, + // "unprivileged": false, // "upgradeable": false, // "version": "" // } @@ -295,7 +419,7 @@ func ExampleNewServer_checkin_fakeComponent() { tmpl := TmplPolicy{ AgentID: "AgentID", PolicyID: policyID, - FleetHosts: `"host1", "host2"`, + FleetHosts: []string{"host1", "host2"}, SourceURI: "http://source.uri", CreatedAt: "2023-05-31T11:37:50.607Z", Output: struct { @@ -339,7 +463,7 @@ func ExampleNewServer_checkin_fakeComponent() { fmt.Println(resp.Actions) // 2nd subsequent call to nextAction() will return an error. - resp, _, err = cmd.Execute(context.Background(), &fleetapi.CheckinRequest{}) + _, _, err = cmd.Execute(context.Background(), &fleetapi.CheckinRequest{}) if err == nil { panic("expected an error, got none") } @@ -364,7 +488,7 @@ func ExampleNewServer_checkin_withDelay() { tmpl := TmplPolicy{ AgentID: "AgentID", PolicyID: policyID, - FleetHosts: `"host1", "host2"`, + FleetHosts: []string{"host1", "host2"}, SourceURI: "http://source.uri", CreatedAt: "2023-05-31T11:37:50.607Z", Output: struct { @@ -507,7 +631,7 @@ func ExampleNewServer_checkin_and_ackWithAcker() { tmpl := TmplPolicy{ AgentID: agentID, PolicyID: policyID, - FleetHosts: `"host1", "host2"`, + FleetHosts: []string{"host1", "host2"}, SourceURI: "http://source.uri", CreatedAt: "2023-05-31T11:37:50.607Z", Output: struct { @@ -622,7 +746,7 @@ func ExampleNewServer_checkin_and_ackWithAcker() { fmt.Printf("[2nd ack] %#v\n", respAck) // 2nd checkin: it will fail. - respCheckin, _, err = cmdCheckin.Execute(context.Background(), &fleetapi.CheckinRequest{}) + _, _, err = cmdCheckin.Execute(context.Background(), &fleetapi.CheckinRequest{}) if err == nil { panic("expected an error, got none") } diff --git a/testing/installtest/checks.go b/testing/installtest/checks.go new file mode 100644 index 00000000000..6160658b28a --- /dev/null +++ b/testing/installtest/checks.go @@ -0,0 +1,83 @@ +// 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 installtest + +import ( + "context" + "fmt" + "os" + "path/filepath" + "runtime" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + atesting "github.com/elastic/elastic-agent/pkg/testing" + "github.com/elastic/elastic-agent/pkg/testing/define" +) + +func defaultBasePath() string { + var defaultBasePath string + switch runtime.GOOS { + case "darwin": + defaultBasePath = `/Library` + case "linux": + defaultBasePath = `/opt` + case "windows": + defaultBasePath = `C:\Program Files` + } + return defaultBasePath +} + +func DefaultTopPath() string { + return filepath.Join(defaultBasePath(), "Elastic", "Agent") +} + +func NamespaceTopPath(namespace string) string { + return filepath.Join(defaultBasePath(), "Elastic", paths.InstallDirNameForNamespace(namespace)) +} + +type CheckOpts struct { + Privileged bool + Namespace string +} + +func CheckSuccess(ctx context.Context, f *atesting.Fixture, topPath string, opts *CheckOpts) error { + // Use default topPath if one not defined. + if topPath == "" { + topPath = DefaultTopPath() + } + + _, err := os.Stat(topPath) + if err != nil { + return fmt.Errorf("%s missing: %w", topPath, err) + } + + // Check that a few expected installed files are present + installedBinPath := filepath.Join(topPath, exeOnWindows("elastic-agent")) + installedDataPath := filepath.Join(topPath, "data") + installMarkerPath := filepath.Join(topPath, paths.MarkerFileName) + + _, err = os.Stat(installedBinPath) + if err != nil { + return fmt.Errorf("%s missing: %w", installedBinPath, err) + } + _, err = os.Stat(installedDataPath) + if err != nil { + return fmt.Errorf("%s missing: %w", installedDataPath, err) + } + _, err = os.Stat(installMarkerPath) + if err != nil { + return fmt.Errorf("%s missing: %w", installMarkerPath, err) + } + + // Specific checks depending on the platform. + return checkPlatform(ctx, f, topPath, opts) +} + +func exeOnWindows(filename string) string { + if runtime.GOOS == define.Windows { + return filename + ".exe" + } + return filename +} diff --git a/testing/installtest/checks_unix.go b/testing/installtest/checks_unix.go new file mode 100644 index 00000000000..1cba1fd0925 --- /dev/null +++ b/testing/installtest/checks_unix.go @@ -0,0 +1,154 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build !windows + +package installtest + +import ( + "context" + "fmt" + "os" + "os/exec" + "path/filepath" + "syscall" + "time" + + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" + "github.com/elastic/elastic-agent/internal/pkg/agent/install" + atesting "github.com/elastic/elastic-agent/pkg/testing" +) + +func checkPlatform(ctx context.Context, _ *atesting.Fixture, topPath string, opts *CheckOpts) error { + if !opts.Privileged { + // Check that the elastic-agent user/group exist. + uid, err := install.FindUID(install.ElasticUsername) + if err != nil { + return fmt.Errorf("failed to find %s user: %w", install.ElasticUsername, err) + } + gid, err := install.FindGID(install.ElasticGroupName) + if err != nil { + return fmt.Errorf("failed to find %s group: %w", install.ElasticGroupName, err) + } + + // Ensure entire installation tree has the correct permissions. + err = validateFileTree(topPath, uint32(uid), uint32(gid)) + if err != nil { + // context already added + return err + } + + // Check that the socket is created with the correct permissions. + socketPath := filepath.Join(topPath, paths.ControlSocketName) + err = waitForNoError(ctx, func(_ context.Context) error { + _, err = os.Stat(socketPath) + if err != nil { + return fmt.Errorf("failed to stat socket path %s: %w", socketPath, err) + } + return nil + }, 3*time.Minute, 1*time.Second) + info, err := os.Stat(socketPath) + if err != nil { + return fmt.Errorf("failed to stat socket path %s: %w", socketPath, err) + } + fs, ok := info.Sys().(*syscall.Stat_t) + if !ok { + return fmt.Errorf("failed to convert info.Sys() into *syscall.Stat_t") + } + if fs.Uid != uint32(uid) { + return fmt.Errorf("%s not owned by %s user", socketPath, install.ElasticUsername) + } + if fs.Gid != uint32(gid) { + return fmt.Errorf("%s not owned by %s group", socketPath, install.ElasticGroupName) + } + + // Executing `elastic-agent status` as the `elastic-agent-user` user should work. + shellWrapperName := "elastic-agent" + if opts.Namespace != "" { + shellWrapperName = paths.ShellWrapperPathForNamespace(opts.Namespace) + } + + var output []byte + err = waitForNoError(ctx, func(_ context.Context) error { + // #nosec G204 -- user cannot inject any parameters to this command + cmd := exec.Command("sudo", "-u", install.ElasticUsername, shellWrapperName, "status") + output, err = cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("elastic-agent status failed: %w (output: %s)", err, output) + } + return nil + }, 3*time.Minute, 1*time.Second) + + // Executing `elastic-agent status` as the original user should fail, because that + // user is not in the 'elastic-agent' group. + originalUser := os.Getenv("SUDO_USER") + if originalUser != "" { + // #nosec G204 -- user cannot inject any parameters to this command + cmd := exec.Command("sudo", "-u", originalUser, shellWrapperName, "status") + output, err := cmd.CombinedOutput() + if err == nil { + return fmt.Errorf("sudo -u %s elastic-agent didn't fail: got output: %s", originalUser, output) + } + } + } else { + // Ensure entire installation tree has the correct permissions. + err := validateFileTree(topPath, 0, 0) + if err != nil { + // context already added + return err + } + } + return nil +} + +func validateFileTree(dir string, uid uint32, gid uint32) error { + return filepath.Walk(dir, func(file string, info os.FileInfo, err error) error { + if err != nil { + return fmt.Errorf("error traversing the file tree: %w", err) + } + if info.Mode().Type() == os.ModeSymlink { + // symlink don't check permissions + return nil + } + fs, ok := info.Sys().(*syscall.Stat_t) + if !ok { + return fmt.Errorf("failed to convert info.Sys() into *syscall.Stat_t") + } + if fs.Uid != uid { + return fmt.Errorf("%s doesn't have correct uid: has %d (expected %d)", file, fs.Uid, uid) + } + if fs.Gid != gid { + return fmt.Errorf("%s doesn't have correct gid: has %d (expected %d)", file, fs.Gid, gid) + } + if fs.Mode&0007 != 0 { + return fmt.Errorf("%s has world access", file) + } + return nil + }) +} + +func waitForNoError(ctx context.Context, fun func(ctx context.Context) error, timeout time.Duration, interval time.Duration) error { + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + t := time.NewTicker(interval) + defer t.Stop() + + var lastErr error + for { + select { + case <-ctx.Done(): + if lastErr != nil { + return lastErr + } + return ctx.Err() + case <-t.C: + err := fun(ctx) + if err == nil { + return nil + } + lastErr = err + } + } +} diff --git a/testing/installtest/checks_windows.go b/testing/installtest/checks_windows.go new file mode 100644 index 00000000000..6a87f43f173 --- /dev/null +++ b/testing/installtest/checks_windows.go @@ -0,0 +1,160 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build windows + +package installtest + +import ( + "context" + "fmt" + "reflect" + "syscall" + "unsafe" + + "golang.org/x/sys/windows" + + "github.com/elastic/elastic-agent/internal/pkg/agent/install" + atesting "github.com/elastic/elastic-agent/pkg/testing" +) + +const ACCESS_ALLOWED_ACE_TYPE = 0 +const ACCESS_DENIED_ACE_TYPE = 1 + +var ( + advapi32 = syscall.NewLazyDLL("advapi32.dll") + + procGetAce = advapi32.NewProc("GetAce") +) + +type accessAllowedAce struct { + AceType uint8 + AceFlags uint8 + AceSize uint16 + AccessMask uint32 + SidStart uint32 +} + +func checkPlatform(ctx context.Context, f *atesting.Fixture, topPath string, opts *CheckOpts) error { + secInfo, err := windows.GetNamedSecurityInfo(topPath, windows.SE_FILE_OBJECT, windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION) + if err != nil { + return fmt.Errorf("GetNamedSecurityInfo failed for %s: %w", topPath, err) + } + if !secInfo.IsValid() { + return fmt.Errorf("GetNamedSecurityInfo result is not valid for %s: %w", topPath, err) + } + owner, _, err := secInfo.Owner() + if err != nil { + return fmt.Errorf("secInfo.Owner() failed for %s: %w", topPath, err) + } + sids, err := getAllowedSIDs(secInfo) + if err != nil { + return fmt.Errorf("failed to get allowed SID's for %s: %w", topPath, err) + } + if !opts.Privileged { + // Check that the elastic-agent user/group exist. + uid, err := install.FindUID(install.ElasticUsername) + if err != nil { + return fmt.Errorf("failed to find %s user: %w", install.ElasticUsername, err) + } + uidSID, err := windows.StringToSid(uid) + if err != nil { + return fmt.Errorf("failed to convert string to windows.SID %s: %w", uid, err) + } + gid, err := install.FindGID(install.ElasticGroupName) + if err != nil { + return fmt.Errorf("failed to find %s group: %w", install.ElasticGroupName, err) + } + gidSID, err := windows.StringToSid(gid) + if err != nil { + return fmt.Errorf("failed to convert string to windows.SID %s: %w", uid, err) + } + if !owner.Equals(uidSID) { + return fmt.Errorf("%s not owned by %s user", topPath, install.ElasticUsername) + } + if !hasSID(sids, uidSID) { + return fmt.Errorf("path %s should have ACE for %s user", topPath, install.ElasticUsername) + } + if !hasSID(sids, gidSID) { + return fmt.Errorf("path %s should have ACE for %s group", topPath, install.ElasticGroupName) + } + // administrators should have access as well + if !hasWellKnownSID(sids, windows.WinBuiltinAdministratorsSid) { + return fmt.Errorf("path %s should have ACE for Administrators", topPath) + } + // that is 3 unique SID's, it should not have anymore + if len(sids) > 3 { + return fmt.Errorf("DACL has more than allowed ACE for %s", topPath) + } + } else { + if !owner.IsWellKnown(windows.WinBuiltinAdministratorsSid) { + return fmt.Errorf("%s not owned by Administrators", topPath) + } + // that is 1 unique SID, it should not have anymore + if len(sids) > 1 { + return fmt.Errorf("DACL has more than allowed ACE for %s", topPath) + } + } + return nil +} + +func hasSID(sids []*windows.SID, m *windows.SID) bool { + for _, s := range sids { + if s.Equals(m) { + return true + } + } + return false +} + +func appendSID(sids []*windows.SID, a *windows.SID) []*windows.SID { + if hasSID(sids, a) { + return sids + } + return append(sids, a) +} + +func hasWellKnownSID(sids []*windows.SID, m windows.WELL_KNOWN_SID_TYPE) bool { + for _, s := range sids { + if s.IsWellKnown(m) { + return true + } + } + return false +} + +func getAllowedSIDs(secInfo *windows.SECURITY_DESCRIPTOR) ([]*windows.SID, error) { + dacl, _, err := secInfo.DACL() + if err != nil { + return nil, fmt.Errorf("secInfo.DACL() failed: %w", err) + } + if dacl == nil { + return nil, fmt.Errorf("no DACL set") + } + + var sids []*windows.SID + + // sadly the ACL information is not exported so reflect is needed to get the aceCount + // it's always field #3 because it's defined by the Windows API (so no real need to worry about it changing) + rs := reflect.ValueOf(dacl).Elem() + aceCount := rs.Field(3).Uint() + for i := uint64(0); i < aceCount; i++ { + ace := &accessAllowedAce{} + ret, _, _ := procGetAce.Call(uintptr(unsafe.Pointer(dacl)), uintptr(i), uintptr(unsafe.Pointer(&ace))) + if ret == 0 { + return nil, fmt.Errorf("while getting ACE: %w", windows.GetLastError()) + } + if ace.AceType == ACCESS_DENIED_ACE_TYPE { + // we never set denied ACE, something is wrong + return nil, fmt.Errorf("denied ACE found (should not be set)") + } + if ace.AceType != ACCESS_ALLOWED_ACE_TYPE { + // unknown ace type + return nil, fmt.Errorf("unknown AceType: %d", ace.AceType) + } + aceSid := (*windows.SID)(unsafe.Pointer(&ace.SidStart)) + sids = appendSID(sids, aceSid) + } + return sids, nil +} diff --git a/testing/integration/agent_long_running_leak_test.go b/testing/integration/agent_long_running_leak_test.go index b599d5e26ff..1fb12aa545c 100644 --- a/testing/integration/agent_long_running_leak_test.go +++ b/testing/integration/agent_long_running_leak_test.go @@ -9,7 +9,6 @@ package integration import ( "context" "encoding/json" - "fmt" "io" "net" "net/http" @@ -98,14 +97,13 @@ func (runner *ExtendedRunner) SetupSuite() { require.NoError(runner.T(), err, "got out: %s", string(out)) policyUUID := uuid.New().String() - unpr := false installOpts := atesting.InstallOpts{ NonInteractive: true, Force: true, - Unprivileged: &unpr, + Privileged: true, } - fixture, err := define.NewFixture(runner.T(), define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(runner.T(), define.Version()) require.NoError(runner.T(), err) runner.agentFixture = fixture @@ -122,33 +120,12 @@ func (runner *ExtendedRunner) SetupSuite() { policyResp, err := tools.InstallAgentWithPolicy(ctx, runner.T(), installOpts, runner.agentFixture, runner.info.KibanaClient, basePolicy) require.NoError(runner.T(), err) - // install system package - runner.InstallPackage(ctx, "system", "1.53.1", "agent_long_test_base_system_integ.json", uuid.New().String(), policyResp.ID) - - // install cef - runner.InstallPackage(ctx, "apache", "1.17.0", "agent_long_test_apache.json", uuid.New().String(), policyResp.ID) - -} - -func (runner *ExtendedRunner) InstallPackage(ctx context.Context, name string, version string, cfgFile string, policyUUID string, policyID string) { - installPackage := kibana.PackagePolicyRequest{} - - jsonRaw, err := os.ReadFile(cfgFile) + _, err = tools.InstallPackageFromDefaultFile(ctx, runner.info.KibanaClient, "system", "1.53.1", "agent_long_test_base_system_integ.json", uuid.New().String(), policyResp.ID) require.NoError(runner.T(), err) - err = json.Unmarshal(jsonRaw, &installPackage) + _, err = tools.InstallPackageFromDefaultFile(ctx, runner.info.KibanaClient, "apache", "1.17.0", "agent_long_test_apache.json", uuid.New().String(), policyResp.ID) require.NoError(runner.T(), err) - installPackage.Package.Version = version - installPackage.ID = policyUUID - installPackage.PolicyID = policyID - installPackage.Namespace = "default" - installPackage.Name = fmt.Sprintf("%s-long-test-%s", name, policyUUID) - installPackage.Vars = map[string]interface{}{} - - runner.T().Logf("Installing %s package....", name) - _, err = runner.info.KibanaClient.InstallFleetPackage(ctx, installPackage) - require.NoError(runner.T(), err, "error creating fleet package") } func (runner *ExtendedRunner) TestHandleLeak() { @@ -196,7 +173,7 @@ func (runner *ExtendedRunner) TestHandleLeak() { // if the slope is increasing above a certain rate, fail the test // A number of factors can change the slope during a test; shortened runtime (lots of handles allocated in the first few seconds, producing an upward slope), // filebeat trying to open a large number of log files, etc - //handleSlopeFailure := 0.1 + // handleSlopeFailure := 0.1 for _, mon := range runner.resourceWatchers { handleSlopeFailure := 0.1 @@ -343,7 +320,7 @@ func (gm *goroutinesMonitor) Update(t *testing.T, fixture *atesting.Fixture) { } func (gm *goroutinesMonitor) GetSlopeHandlers() []tools.Slope { - //handleSlopeFailure := 0.1 + // handleSlopeFailure := 0.1 slopes := []tools.Slope{} for _, handle := range gm.handles { slopes = append(slopes, handle.regGoroutines) diff --git a/testing/integration/apm_propagation_test.go b/testing/integration/apm_propagation_test.go index 83b76e7db34..2554d0ebc66 100644 --- a/testing/integration/apm_propagation_test.go +++ b/testing/integration/apm_propagation_test.go @@ -56,7 +56,7 @@ func TestAPMConfig(t *testing.T) { Group: Default, Stack: &define.Stack{}, }) - f, err := define.NewFixture(t, define.Version()) + f, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) deadline := time.Now().Add(10 * time.Minute) @@ -88,7 +88,7 @@ func TestAPMConfig(t *testing.T) { return count > 0 }, 1*time.Minute, time.Second) - //change the configuration with a new environment and check that the update has been processed + // change the configuration with a new environment and check that the update has been processed environment = environment + "-changed" modifiedAgentConfig := generateAgentConfigForAPM(t, agentConfigTemplateString, info, environment) t.Logf("Rendered agent modified config:\n%s", modifiedAgentConfig) @@ -178,8 +178,8 @@ func countAPMTraces(ctx context.Context, t *testing.T, esClient *elasticsearch.C Count int } - //decoder := json.NewDecoder(response.Body) - //err = decoder.Decode(&body) + // decoder := json.NewDecoder(response.Body) + // err = decoder.Decode(&body) bodyBytes, _ := io.ReadAll(response.Body) t.Logf("received ES response: %s", bodyBytes) diff --git a/testing/integration/container_cmd_test.go b/testing/integration/container_cmd_test.go index 27bcf9eecdf..fa20c65e27f 100644 --- a/testing/integration/container_cmd_test.go +++ b/testing/integration/container_cmd_test.go @@ -10,6 +10,8 @@ import ( "context" "fmt" "os" + "os/exec" + "path/filepath" "strings" "testing" "time" @@ -18,29 +20,12 @@ import ( "github.com/stretchr/testify/require" "github.com/elastic/elastic-agent-libs/kibana" + atesting "github.com/elastic/elastic-agent/pkg/testing" "github.com/elastic/elastic-agent/pkg/testing/define" "github.com/elastic/elastic-agent/pkg/testing/tools/fleettools" ) -func TestContainerCMD(t *testing.T) { - info := define.Require(t, define.Requirements{ - Stack: &define.Stack{}, - Local: false, - Sudo: true, - OS: []define.OS{ - {Type: define.Linux}, - }, - // This test runs the command we use when executing inside a container - // which leaves files under /usr/share/elastic-agent. Run it isolated - // to avoid interfering with other tests and better simulate a container - // environment we run it in isolation - Group: "container", - }) - ctx := context.Background() - - agentFixture, err := define.NewFixture(t, define.Version()) - require.NoError(t, err) - +func createPolicy(t *testing.T, ctx context.Context, agentFixture *atesting.Fixture, info *define.Info) string { createPolicyReq := kibana.AgentPolicy{ Name: fmt.Sprintf("test-policy-enroll-%s", uuid.New().String()), Namespace: info.Namespace, @@ -74,13 +59,10 @@ func TestContainerCMD(t *testing.T) { t.Fatalf("unable to create enrolment API key: %s", err) } - fleetURL, err := fleettools.DefaultURL(ctx, info.KibanaClient) - if err != nil { - t.Fatalf("could not get Fleet URL: %s", err) - } + return enrollmentToken.APIKey +} - ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) - defer cancel() +func prepareContainerCMD(t *testing.T, ctx context.Context, agentFixture *atesting.Fixture, info *define.Info, env []string) *exec.Cmd { cmd, err := agentFixture.PrepareAgentCommand(ctx, []string{"container"}) if err != nil { t.Fatalf("could not prepare agent command: %s", err) @@ -92,6 +74,18 @@ func TestContainerCMD(t *testing.T) { if err := cmd.Process.Kill(); err != nil { t.Fatalf("could not kill Elastic-Agent process: %s", err) } + + // Kill does not wait for the process to finish, so we wait here + state, err := cmd.Process.Wait() + if err != nil { + t.Errorf("Elastic-Agent exited with error after kill signal: %s", err) + t.Errorf("Elastic-Agent exited with status %d", state.ExitCode()) + out, err := cmd.CombinedOutput() + if err == nil { + t.Log(string(out)) + } + } + return } t.Log(">> cleaning up: no process to kill") @@ -100,22 +94,52 @@ func TestContainerCMD(t *testing.T) { agentOutput := strings.Builder{} cmd.Stderr = &agentOutput cmd.Stdout = &agentOutput - cmd.Env = append(os.Environ(), + cmd.Env = append(os.Environ(), env...) + return cmd +} + +func TestContainerCMD(t *testing.T) { + info := define.Require(t, define.Requirements{ + Stack: &define.Stack{}, + Local: false, + Sudo: true, + OS: []define.OS{ + {Type: define.Linux}, + }, + Group: "container", + }) + + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) + defer cancel() + + agentFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + fleetURL, err := fleettools.DefaultURL(ctx, info.KibanaClient) + if err != nil { + t.Fatalf("could not get Fleet URL: %s", err) + } + + enrollmentToken := createPolicy(t, ctx, agentFixture, info) + env := []string{ "FLEET_ENROLL=1", - "FLEET_URL="+fleetURL, - "FLEET_ENROLLMENT_TOKEN="+enrollmentToken.APIKey, + "FLEET_URL=" + fleetURL, + "FLEET_ENROLLMENT_TOKEN=" + enrollmentToken, // As the agent isn't built for a container, it's upgradable, triggering // the start of the upgrade watcher. If `STATE_PATH` isn't set, the // upgrade watcher will commence from a different path within the // container, distinct from the current execution path. - "STATE_PATH="+agentFixture.WorkDir(), - ) + "STATE_PATH=" + agentFixture.WorkDir(), + } + cmd := prepareContainerCMD(t, ctx, agentFixture, info, env) t.Logf(">> running binary with: %v", cmd.Args) if err := cmd.Start(); err != nil { t.Fatalf("error running container cmd: %s", err) } + agentOutput := cmd.Stderr.(*strings.Builder) + 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 @@ -128,6 +152,109 @@ func TestContainerCMD(t *testing.T) { }, 5*time.Minute, time.Second, "Elastic-Agent did not report healthy. Agent status error: \"%v\", Agent logs\n%s", - err, &agentOutput, + err, agentOutput, ) } + +func TestContainerCMDWithAVeryLongStatePath(t *testing.T) { + info := define.Require(t, define.Requirements{ + Stack: &define.Stack{}, + Local: false, + Sudo: true, + OS: []define.OS{ + {Type: define.Linux}, + }, + Group: "container", + }) + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) + defer cancel() + + fleetURL, err := fleettools.DefaultURL(ctx, info.KibanaClient) + if err != nil { + t.Fatalf("could not get Fleet URL: %s", err) + } + + testCases := map[string]struct { + statePath string + expectedStatePath string + expectedSocketPath string + expectError bool + }{ + "small path": { // Use the set path + statePath: filepath.Join(os.TempDir(), "foo", "bar"), + expectedStatePath: filepath.Join(os.TempDir(), "foo", "bar"), + expectedSocketPath: "/tmp/foo/bar/data/smp7BzlzcwgrLK4PUxpu7G1O5UwV4adr.sock", + }, + "no path set": { // Use the default path + statePath: "", + expectedStatePath: "/usr/share/elastic-agent/state", + expectedSocketPath: "/usr/share/elastic-agent/state/data/Td8I7R-Zby36_zF_IOd9QVNlFblNEro3.sock", + }, + "long path": { // Path too long to create a unix socket, it will use /tmp/elastic-agent + statePath: "/tmp/ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + expectedStatePath: "/tmp/ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + expectedSocketPath: "/tmp/elastic-agent/Xegnlbb8QDcqNLPzyf2l8PhVHjWvlQgZ.sock", + }, + } + + for name, tc := range testCases { + t.Run(name, func(t *testing.T) { + agentFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + enrollmentToken := createPolicy(t, ctx, agentFixture, info) + env := []string{ + "FLEET_ENROLL=1", + "FLEET_URL=" + fleetURL, + "FLEET_ENROLLMENT_TOKEN=" + enrollmentToken, + "STATE_PATH=" + tc.statePath, + } + + cmd := prepareContainerCMD(t, ctx, agentFixture, info, env) + t.Logf(">> running binary with: %v", cmd.Args) + if err := cmd.Start(); err != nil { + t.Fatalf("error running container cmd: %s", err) + } + agentOutput := cmd.Stderr.(*strings.Builder) + + 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 = agentFixture.IsHealthy(ctx) + return err == nil + }, + 1*time.Minute, time.Second, + "Elastic-Agent did not report healthy. Agent status error: \"%v\", Agent logs\n%s", + err, agentOutput, + ) + + t.Cleanup(func() { + _ = os.RemoveAll(tc.expectedStatePath) + }) + + // Now that the Elastic-Agent is healthy, check that the control socket path + // is the expected one + if _, err := os.Stat(tc.expectedStatePath); err != nil { + t.Errorf("cannot stat expected state path ('%s'): %s", tc.expectedStatePath, err) + } + if _, err := os.Stat(tc.expectedSocketPath); err != nil { + t.Errorf("cannot stat expected socket path ('%s'): %s", tc.expectedSocketPath, err) + } + + if t.Failed() { + containerPaths, err := os.ReadFile(filepath.Join(agentFixture.WorkDir(), "container-paths.yml")) + if err != nil { + t.Fatalf("could not read container-paths.yml: %s", err) + } + + t.Log("contents of 'container-paths-yml'") + t.Log(string(containerPaths)) + } + }) + } +} diff --git a/testing/integration/delay_enroll_test.go b/testing/integration/delay_enroll_test.go index 5e0175dee6e..59e0abd10c6 100644 --- a/testing/integration/delay_enroll_test.go +++ b/testing/integration/delay_enroll_test.go @@ -9,7 +9,6 @@ package integration import ( "context" "fmt" - "os/exec" "testing" "time" @@ -17,6 +16,7 @@ import ( "github.com/stretchr/testify/require" "github.com/elastic/elastic-agent-libs/kibana" + "github.com/elastic/elastic-agent/internal/pkg/agent/install" atesting "github.com/elastic/elastic-agent/pkg/testing" "github.com/elastic/elastic-agent/pkg/testing/define" "github.com/elastic/elastic-agent/pkg/testing/tools" @@ -30,13 +30,12 @@ func TestDelayEnroll(t *testing.T) { Stack: &define.Stack{}, Local: false, Sudo: true, - OS: []define.OS{{Type: define.Linux}}, }) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) defer cancel() - agentFixture, err := define.NewFixture(t, define.Version()) + agentFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) // 1. Create a policy in Fleet with monitoring enabled. @@ -64,6 +63,7 @@ func TestDelayEnroll(t *testing.T) { NonInteractive: true, Force: true, DelayEnroll: true, + Privileged: false, } // Install the Elastic-Agent with the policy that was just // created. @@ -77,11 +77,69 @@ func TestDelayEnroll(t *testing.T) { require.NoError(t, err) // Start elastic-agent via service, this should do the enrollment - cmd := exec.Command("/usr/bin/systemctl", "start", "elastic-agent") - stdErrStdout, err := cmd.CombinedOutput() - require.NoErrorf(t, err, "systemctl start elastic-agent output was %s", stdErrStdout) + err = install.StartService("") // topPath can be blank as this is only starting the service + require.NoErrorf(t, err, "failed to start service") // check to make sure enroll worked check.ConnectedToFleet(ctx, t, agentFixture, 5*time.Minute) +} + +func TestDelayEnrollUnprivileged(t *testing.T) { + info := define.Require(t, define.Requirements{ + Group: Fleet, + Stack: &define.Stack{}, + Local: false, + Sudo: true, + }) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + agentFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + // 1. Create a policy in Fleet with monitoring enabled. + // To ensure there are no conflicts with previous test runs against + // the same ESS stack, we add a UUID at the end of the policy + // name. This policy does not contain any integration. + t.Log("Enrolling agent in Fleet with a test policy") + createPolicyReq := kibana.AgentPolicy{ + Name: fmt.Sprintf("test-policy-enroll-%s", uuid.New().String()), + Namespace: info.Namespace, + Description: "test policy for agent enrollment", + MonitoringEnabled: []kibana.MonitoringEnabledOption{ + kibana.MonitoringEnabledLogs, + kibana.MonitoringEnabledMetrics, + }, + AgentFeatures: []map[string]interface{}{ + { + "name": "test_enroll", + "enabled": true, + }, + }, + } + + installOpts := atesting.InstallOpts{ + NonInteractive: true, + Force: true, + DelayEnroll: true, + Privileged: false, + } + // Install the Elastic-Agent with the policy that was just + // created. + _, err = tools.InstallAgentWithPolicy( + ctx, + t, + installOpts, + agentFixture, + info.KibanaClient, + createPolicyReq) + require.NoError(t, err) + + // Start elastic-agent via service, this should do the enrollment + err = install.StartService("") // topPath can be blank as this is only starting the service + require.NoErrorf(t, err, "failed to start service") + + // check to make sure enroll worked + check.ConnectedToFleet(ctx, t, agentFixture, 5*time.Minute) } diff --git a/testing/integration/diagnostics_test.go b/testing/integration/diagnostics_test.go index de10c1dc761..dc8b3c1a3c5 100644 --- a/testing/integration/diagnostics_test.go +++ b/testing/integration/diagnostics_test.go @@ -31,6 +31,7 @@ const diagnosticsArchiveGlobPattern = "elastic-agent-diagnostics-*.zip" var diagnosticsFiles = []string{ "package.version", + "agent-info.yaml", "allocs.pprof.gz", "block.pprof.gz", "components-actual.yaml", @@ -82,6 +83,45 @@ var componentSetup = map[string]integrationtest.ComponentState{ }, } +var isolatedUnitsComponentSetup = map[string]integrationtest.ComponentState{ + "fake-isolated-units-default-fake-isolated-units": { + State: integrationtest.NewClientState(client.Healthy), + Units: map[integrationtest.ComponentUnitKey]integrationtest.ComponentUnitState{ + integrationtest.ComponentUnitKey{UnitType: client.UnitTypeOutput, UnitID: "fake-isolated-units-default-fake-isolated-units"}: { + State: integrationtest.NewClientState(client.Healthy), + }, + integrationtest.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units-unit"}: { + State: integrationtest.NewClientState(client.Healthy), + }, + }, + }, + "fake-isolated-units-default-fake-isolated-units-1": { + State: integrationtest.NewClientState(client.Healthy), + Units: map[integrationtest.ComponentUnitKey]integrationtest.ComponentUnitState{ + integrationtest.ComponentUnitKey{UnitType: client.UnitTypeOutput, UnitID: "fake-isolated-units-default-fake-isolated-units-1"}: { + State: integrationtest.NewClientState(client.Healthy), + }, + integrationtest.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units-1-unit"}: { + State: integrationtest.NewClientState(client.Healthy), + }, + }, + }, + "fake-shipper-default": { + State: integrationtest.NewClientState(client.Healthy), + Units: map[integrationtest.ComponentUnitKey]integrationtest.ComponentUnitState{ + integrationtest.ComponentUnitKey{UnitType: client.UnitTypeOutput, UnitID: "fake-shipper-default"}: { + State: integrationtest.NewClientState(client.Healthy), + }, + integrationtest.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units"}: { + State: integrationtest.NewClientState(client.Healthy), + }, + integrationtest.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units-1"}: { + State: integrationtest.NewClientState(client.Healthy), + }, + }, + }, +} + type componentAndUnitNames struct { name string unitNames []string @@ -93,7 +133,7 @@ func TestDiagnosticsOptionalValues(t *testing.T) { Local: false, }) - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) @@ -108,9 +148,35 @@ func TestDiagnosticsOptionalValues(t *testing.T) { Configure: simpleConfig2, AgentState: integrationtest.NewClientState(client.Healthy), Components: componentSetup, - After: testDiagnosticsFactory(t, diagpprof, diagCompPprof, fixture, []string{"diagnostics", "-p"}), + After: testDiagnosticsFactory(t, componentSetup, diagpprof, diagCompPprof, fixture, []string{"diagnostics", "-p"}), }) + require.NoError(t, err) +} + +func TestIsolatedUnitsDiagnosticsOptionalValues(t *testing.T) { + define.Require(t, define.Requirements{ + Group: Default, + Local: false, + }) + + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + err = fixture.Prepare(ctx, fakeComponent, fakeShipper) + require.NoError(t, err) + + diagpprof := append(diagnosticsFiles, "cpu.pprof") + diagCompPprof := append(compDiagnosticsFiles, "cpu.pprof") + + err = fixture.Run(ctx, integrationtest.State{ + Configure: complexIsolatedUnitsConfig, + AgentState: integrationtest.NewClientState(client.Healthy), + Components: isolatedUnitsComponentSetup, + After: testDiagnosticsFactory(t, isolatedUnitsComponentSetup, diagpprof, diagCompPprof, fixture, []string{"diagnostics", "-p"}), + }) + require.NoError(t, err) } func TestDiagnosticsCommand(t *testing.T) { @@ -119,7 +185,7 @@ func TestDiagnosticsCommand(t *testing.T) { Local: false, }) - f, err := define.NewFixture(t, define.Version()) + f, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) @@ -131,12 +197,35 @@ func TestDiagnosticsCommand(t *testing.T) { Configure: simpleConfig2, AgentState: integrationtest.NewClientState(client.Healthy), Components: componentSetup, - After: testDiagnosticsFactory(t, diagnosticsFiles, compDiagnosticsFiles, f, []string{"diagnostics", "collect"}), + After: testDiagnosticsFactory(t, componentSetup, diagnosticsFiles, compDiagnosticsFiles, f, []string{"diagnostics", "collect"}), + }) + assert.NoError(t, err) +} + +func TestIsolatedUnitsDiagnosticsCommand(t *testing.T) { + define.Require(t, define.Requirements{ + Group: Default, + Local: false, + }) + + f, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + err = f.Prepare(ctx, fakeComponent, fakeShipper) + require.NoError(t, err) + + err = f.Run(ctx, integrationtest.State{ + Configure: complexIsolatedUnitsConfig, + AgentState: integrationtest.NewClientState(client.Healthy), + Components: isolatedUnitsComponentSetup, + After: testDiagnosticsFactory(t, isolatedUnitsComponentSetup, diagnosticsFiles, compDiagnosticsFiles, f, []string{"diagnostics", "collect"}), }) assert.NoError(t, err) } -func testDiagnosticsFactory(t *testing.T, diagFiles []string, diagCompFiles []string, fix *integrationtest.Fixture, cmd []string) func(ctx context.Context) error { +func testDiagnosticsFactory(t *testing.T, compSetup map[string]integrationtest.ComponentState, diagFiles []string, diagCompFiles []string, fix *integrationtest.Fixture, cmd []string) func(ctx context.Context) error { return func(ctx context.Context) error { diagZip, err := fix.ExecDiagnostics(ctx, cmd...) @@ -144,13 +233,13 @@ func testDiagnosticsFactory(t *testing.T, diagFiles []string, diagCompFiles []st avi, err := getRunningAgentVersion(ctx, fix) require.NoError(t, err) - verifyDiagnosticArchive(t, diagZip, diagFiles, diagCompFiles, avi) + verifyDiagnosticArchive(t, compSetup, diagZip, diagFiles, diagCompFiles, avi) return nil } } -func verifyDiagnosticArchive(t *testing.T, diagArchive string, diagFiles []string, diagCompFiles []string, avi *client.Version) { +func verifyDiagnosticArchive(t *testing.T, compSetup map[string]integrationtest.ComponentState, diagArchive string, diagFiles []string, diagCompFiles []string, avi *client.Version) { // check that the archive is not an empty file stat, err := os.Stat(diagArchive) require.NoErrorf(t, err, "stat file %q failed", diagArchive) @@ -161,16 +250,8 @@ func verifyDiagnosticArchive(t *testing.T, diagArchive string, diagFiles []strin extractZipArchive(t, diagArchive, extractionDir) - expectedDiagArchiveFilePatterns := compileExpectedDiagnosticFilePatterns(avi, diagFiles, diagCompFiles, []componentAndUnitNames{ - { - name: "fake-default", - unitNames: []string{"fake-default", "fake"}, - }, - { - name: "fake-shipper-default", - unitNames: []string{"fake-shipper-default", "fake-default"}, - }, - }) + compAndUnitNames := extractComponentAndUnitNames(compSetup) + expectedDiagArchiveFilePatterns := compileExpectedDiagnosticFilePatterns(avi, diagFiles, diagCompFiles, compAndUnitNames) expectedExtractedFiles := map[string]struct{}{} for _, filePattern := range expectedDiagArchiveFilePatterns { @@ -205,6 +286,21 @@ func verifyDiagnosticArchive(t *testing.T, diagArchive string, diagFiles []strin assert.ElementsMatch(t, extractKeysFromMap(expectedExtractedFiles), extractKeysFromMap(actualExtractedDiagFiles)) } +func extractComponentAndUnitNames(compSetup map[string]integrationtest.ComponentState) []componentAndUnitNames { + comps := make([]componentAndUnitNames, 0, len(compSetup)) + for compName, compState := range compSetup { + unitNames := make([]string, 0, len(compState.Units)) + for unitKey := range compState.Units { + unitNames = append(unitNames, unitKey.UnitID) + } + comps = append(comps, componentAndUnitNames{ + name: compName, + unitNames: unitNames, + }) + } + return comps +} + func extractZipArchive(t *testing.T, zipFile string, dst string) { t.Helper() diff --git a/testing/integration/endpoint_security_test.go b/testing/integration/endpoint_security_test.go index 146615d4b8b..c0a1bc47dee 100644 --- a/testing/integration/endpoint_security_test.go +++ b/testing/integration/endpoint_security_test.go @@ -8,10 +8,8 @@ package integration import ( "archive/zip" - "bytes" "context" - _ "embed" - "encoding/json" + "fmt" "io/fs" "os" @@ -20,7 +18,6 @@ import ( "slices" "strings" "testing" - "text/template" "time" "github.com/google/uuid" @@ -39,21 +36,9 @@ import ( ) const ( - // TODO: Setup a GitHub Action to update this for each release of https://github.com/elastic/endpoint-package - endpointPackageVersion = "8.11.0" endpointHealthPollingTimeout = 2 * time.Minute ) -//go:embed endpoint_security_package.json.tmpl -var endpointPackagePolicyTemplate string - -type endpointPackageTemplateVars struct { - ID string - Name string - PolicyID string - Version string -} - var protectionTests = []struct { name string protected bool @@ -166,7 +151,7 @@ func testInstallAndCLIUninstallWithEndpointSecurity(t *testing.T, info *define.I defer cancel() // Get path to agent executable. - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err, "could not create agent fixture") t.Log("Enrolling the agent in Fleet") @@ -188,7 +173,7 @@ func testInstallAndCLIUninstallWithEndpointSecurity(t *testing.T, info *define.I installOpts := atesting.InstallOpts{ NonInteractive: true, Force: true, - Unprivileged: atesting.NewBool(false), + Privileged: true, } policy, err := tools.InstallAgentWithPolicy(ctx, t, @@ -226,7 +211,7 @@ func testInstallAndCLIUninstallWithEndpointSecurity(t *testing.T, info *define.I func testInstallAndUnenrollWithEndpointSecurity(t *testing.T, info *define.Info, protected bool) { // Get path to agent executable. - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) t.Log("Enrolling the agent in Fleet") @@ -247,7 +232,7 @@ func testInstallAndUnenrollWithEndpointSecurity(t *testing.T, info *define.Info, installOpts := atesting.InstallOpts{ NonInteractive: true, Force: true, - Unprivileged: atesting.NewBool(false), + Privileged: true, } ctx, cn := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) @@ -339,7 +324,7 @@ func testInstallAndUnenrollWithEndpointSecurity(t *testing.T, info *define.Info, func testInstallWithEndpointSecurityAndRemoveEndpointIntegration(t *testing.T, info *define.Info, protected bool) { // Get path to agent executable. - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) t.Log("Enrolling the agent in Fleet") @@ -360,7 +345,7 @@ func testInstallWithEndpointSecurityAndRemoveEndpointIntegration(t *testing.T, i installOpts := atesting.InstallOpts{ NonInteractive: true, Force: true, - Unprivileged: atesting.NewBool(false), + Privileged: true, } ctx, cn := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) @@ -451,52 +436,6 @@ type agentPolicyUpdateRequest struct { IsProtected bool `json:"is_protected"` } -// Installs the Elastic Defend package to cause the agent to install the endpoint-security service. -func installElasticDefendPackage(t *testing.T, info *define.Info, policyID string) (r kibana.PackagePolicyResponse, err error) { - t.Helper() - - t.Log("Templating endpoint package policy request") - tmpl, err := template.New("pkgpolicy").Parse(endpointPackagePolicyTemplate) - if err != nil { - return r, fmt.Errorf("error creating new template: %w", err) - } - - packagePolicyID := uuid.New().String() - var pkgPolicyBuf bytes.Buffer - - // Need unique name for Endpoint integration otherwise on multiple runs on the same instance you get - // http error response with code 409: {StatusCode:409 Error:Conflict Message:An integration policy with the name Defend-cbomziz4uvn5fov9t1gsrcvdwn2p1s7tefnvgsye already exists. Please rename it or choose a different name.} - err = tmpl.Execute(&pkgPolicyBuf, endpointPackageTemplateVars{ - ID: packagePolicyID, - Name: "Defend-" + packagePolicyID, - PolicyID: policyID, - Version: endpointPackageVersion, - }) - if err != nil { - return r, fmt.Errorf("error executing template: %w", err) - } - - // Make sure the templated value is actually valid JSON before making the API request. - // Using json.Unmarshal will give us the actual syntax error, calling json.Valid() would not. - packagePolicyReq := kibana.PackagePolicyRequest{} - err = json.Unmarshal(pkgPolicyBuf.Bytes(), &packagePolicyReq) - if err != nil { - return r, fmt.Errorf("templated package policy is not valid JSON: %s, %w", pkgPolicyBuf.String(), err) - } - - t.Log("POST /api/fleet/package_policies") - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) - defer cancel() - - pkgResp, err := info.KibanaClient.InstallFleetPackage(ctx, packagePolicyReq) - if err != nil { - t.Logf("Error installing fleet package: %v", err) - return r, fmt.Errorf("error installing fleet package: %w", err) - } - t.Logf("Endpoint package Policy Response:\n%+v", pkgResp) - return pkgResp, err -} - // Tests that install of Elastic Defend fails if Agent is installed in a base // path other than default func TestEndpointSecurityNonDefaultBasePath(t *testing.T) { @@ -511,7 +450,7 @@ func TestEndpointSecurityNonDefaultBasePath(t *testing.T) { defer cn() // Get path to agent executable. - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) t.Log("Enrolling the agent in Fleet") @@ -528,7 +467,7 @@ func TestEndpointSecurityNonDefaultBasePath(t *testing.T) { installOpts := atesting.InstallOpts{ NonInteractive: true, Force: true, - Unprivileged: atesting.NewBool(false), + Privileged: true, BasePath: filepath.Join(paths.DefaultBasePath, "not_default"), } policyResp, err := tools.InstallAgentWithPolicy(ctx, t, installOpts, fixture, info.KibanaClient, createPolicyReq) @@ -589,7 +528,7 @@ func TestEndpointSecurityUnprivileged(t *testing.T) { defer cn() // Get path to agent executable. - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) t.Log("Enrolling the agent in Fleet") @@ -606,7 +545,7 @@ func TestEndpointSecurityUnprivileged(t *testing.T) { installOpts := atesting.InstallOpts{ NonInteractive: true, Force: true, - Unprivileged: atesting.NewBool(true), // ensure always unprivileged + Privileged: false, // ensure always unprivileged } policyResp, err := tools.InstallAgentWithPolicy(ctx, t, installOpts, fixture, info.KibanaClient, createPolicyReq) require.NoErrorf(t, err, "Policy Response was: %v", policyResp) @@ -649,6 +588,76 @@ func TestEndpointSecurityUnprivileged(t *testing.T) { }, 2*time.Minute, 10*time.Second, "Agent never became DEGRADED with root/Administrator install message") } +// Tests that trying to switch from privileged to unprivileged with Elastic Defend fails. +func TestEndpointSecurityCannotSwitchToUnprivileged(t *testing.T) { + info := define.Require(t, define.Requirements{ + Group: Fleet, + Stack: &define.Stack{}, + Local: false, // requires Agent installation + Sudo: true, // requires Agent installation + + // Only supports Linux at the moment. + OS: []define.OS{ + { + Type: define.Linux, + }, + }, + }) + + ctx, cn := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cn() + + // Get path to agent executable. + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + t.Log("Enrolling the agent in Fleet") + policyUUID := uuid.New().String() + createPolicyReq := kibana.AgentPolicy{ + Name: "test-policy-" + policyUUID, + Namespace: "default", + Description: "Test policy " + policyUUID, + MonitoringEnabled: []kibana.MonitoringEnabledOption{ + kibana.MonitoringEnabledLogs, + kibana.MonitoringEnabledMetrics, + }, + } + installOpts := atesting.InstallOpts{ + NonInteractive: true, + Force: true, + Privileged: true, // ensure always privileged + } + policyResp, err := tools.InstallAgentWithPolicy(ctx, t, installOpts, fixture, info.KibanaClient, createPolicyReq) + require.NoErrorf(t, err, "Policy Response was: %v", policyResp) + + t.Log("Installing Elastic Defend") + pkgPolicyResp, err := installElasticDefendPackage(t, info, policyResp.ID) + require.NoErrorf(t, err, "Policy Response was: %v", pkgPolicyResp) + + t.Log("Polling for endpoint-security to become Healthy") + healthyCtx, cancel := context.WithTimeout(ctx, endpointHealthPollingTimeout) + defer cancel() + + agentClient := fixture.Client() + err = agentClient.Connect(healthyCtx) + require.NoError(t, err) + + require.Eventually(t, + func() bool { return agentAndEndpointAreHealthy(t, healthyCtx, agentClient) }, + endpointHealthPollingTimeout, + time.Second, + "Endpoint component or units are not healthy.", + ) + t.Log("Verified endpoint component and units are healthy") + + performSwitchCtx, cancel := context.WithTimeout(ctx, 2*time.Minute) + defer cancel() + output, err := fixture.Exec(performSwitchCtx, []string{"unprivileged", "-f"}) + require.Errorf(t, err, "unprivileged command should have failed") + assert.Contains(t, string(output), "unable to switch to unprivileged mode due to the following service based components having issues") + assert.Contains(t, string(output), "endpoint") +} + // TestEndpointLogsAreCollectedInDiagnostics tests that diagnostics archive contain endpoint logs func TestEndpointLogsAreCollectedInDiagnostics(t *testing.T) { info := define.Require(t, define.Requirements{ @@ -665,7 +674,7 @@ func TestEndpointLogsAreCollectedInDiagnostics(t *testing.T) { defer cn() // Get path to agent executable. - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) t.Log("Enrolling the agent in Fleet") @@ -682,7 +691,7 @@ func TestEndpointLogsAreCollectedInDiagnostics(t *testing.T) { installOpts := atesting.InstallOpts{ NonInteractive: true, Force: true, - Unprivileged: atesting.NewBool(false), + Privileged: true, } policyResp, err := tools.InstallAgentWithPolicy(ctx, t, installOpts, fixture, info.KibanaClient, createPolicyReq) @@ -813,55 +822,6 @@ func checkDiagnosticsForEndpointFiles(t *testing.T, diagsPath string, endpointCo } } -func agentAndEndpointAreHealthy(t *testing.T, ctx context.Context, agentClient client.Client) bool { - t.Helper() - - state, err := agentClient.State(ctx) - if err != nil { - t.Logf("Error getting agent state: %s", err) - return false - } - - if state.State != client.Healthy { - t.Logf("local Agent is not Healthy: current state: %+v", state) - return false - } - - foundEndpointInputUnit := false - foundEndpointOutputUnit := false - for _, comp := range state.Components { - isEndpointComponent := strings.Contains(comp.Name, "endpoint") - if comp.State != client.Healthy { - t.Logf("endpoint component is not Healthy: current state: %+v", comp) - return false - } - - for _, unit := range comp.Units { - if isEndpointComponent { - if unit.UnitType == client.UnitTypeInput { - foundEndpointInputUnit = true - } - if unit.UnitType == client.UnitTypeOutput { - foundEndpointOutputUnit = true - } - } - - if unit.State != client.Healthy { - t.Logf("unit %q is not Healthy\n%+v", unit.UnitID, unit) - return false - } - } - } - - // Ensure both the endpoint input and output units were found and healthy. - if !foundEndpointInputUnit || !foundEndpointOutputUnit { - t.Logf("State did not contain endpoint units (input: %v/output: %v) state: %+v. ", foundEndpointInputUnit, foundEndpointOutputUnit, state) - return false - } - - return true -} - func agentIsHealthyNoEndpoint(t *testing.T, ctx context.Context, agentClient client.Client) bool { t.Helper() diff --git a/testing/integration/endpoint_test_tools.go b/testing/integration/endpoint_test_tools.go new file mode 100644 index 00000000000..db924be4845 --- /dev/null +++ b/testing/integration/endpoint_test_tools.go @@ -0,0 +1,133 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build integration + +package integration + +import ( + "bytes" + "context" + _ "embed" + "encoding/json" + "fmt" + "strings" + "testing" + "text/template" + "time" + + "github.com/google/uuid" + + "github.com/elastic/elastic-agent-libs/kibana" + "github.com/elastic/elastic-agent/pkg/control/v2/client" + "github.com/elastic/elastic-agent/pkg/testing/define" +) + +//go:embed endpoint_security_package.json.tmpl +var endpointPackagePolicyTemplate string + +type endpointPackageTemplateVars struct { + ID string + Name string + PolicyID string + Version string +} + +// TODO: Setup a GitHub Action to update this for each release of https://github.com/elastic/endpoint-package +const endpointPackageVersion = "8.11.0" + +func agentAndEndpointAreHealthy(t *testing.T, ctx context.Context, agentClient client.Client) bool { + t.Helper() + + state, err := agentClient.State(ctx) + if err != nil { + t.Logf("Error getting agent state: %s", err) + return false + } + + if state.State != client.Healthy { + t.Logf("local Agent is not Healthy: current state: %+v", state) + return false + } + + foundEndpointInputUnit := false + foundEndpointOutputUnit := false + for _, comp := range state.Components { + isEndpointComponent := strings.Contains(comp.Name, "endpoint") + if comp.State != client.Healthy { + t.Logf("endpoint component is not Healthy: current state: %+v", comp) + return false + } + + for _, unit := range comp.Units { + if isEndpointComponent { + if unit.UnitType == client.UnitTypeInput { + foundEndpointInputUnit = true + } + if unit.UnitType == client.UnitTypeOutput { + foundEndpointOutputUnit = true + } + } + + if unit.State != client.Healthy { + t.Logf("unit %q is not Healthy\n%+v", unit.UnitID, unit) + return false + } + } + } + + // Ensure both the endpoint input and output units were found and healthy. + if !foundEndpointInputUnit || !foundEndpointOutputUnit { + t.Logf("State did not contain endpoint units (input: %v/output: %v) state: %+v. ", foundEndpointInputUnit, foundEndpointOutputUnit, state) + return false + } + + return true +} + +// Installs the Elastic Defend package to cause the agent to install the endpoint-security service. +func installElasticDefendPackage(t *testing.T, info *define.Info, policyID string) (r kibana.PackagePolicyResponse, err error) { + t.Helper() + + t.Log("Templating endpoint package policy request") + tmpl, err := template.New("pkgpolicy").Parse(endpointPackagePolicyTemplate) + if err != nil { + return r, fmt.Errorf("error creating new template: %w", err) + } + + packagePolicyID := uuid.New().String() + var pkgPolicyBuf bytes.Buffer + + // Need unique name for Endpoint integration otherwise on multiple runs on the same instance you get + // http error response with code 409: {StatusCode:409 Error:Conflict Message:An integration policy with the name Defend-cbomziz4uvn5fov9t1gsrcvdwn2p1s7tefnvgsye already exists. Please rename it or choose a different name.} + err = tmpl.Execute(&pkgPolicyBuf, endpointPackageTemplateVars{ + ID: packagePolicyID, + Name: "Defend-" + packagePolicyID, + PolicyID: policyID, + Version: endpointPackageVersion, + }) + if err != nil { + return r, fmt.Errorf("error executing template: %w", err) + } + + // Make sure the templated value is actually valid JSON before making the API request. + // Using json.Unmarshal will give us the actual syntax error, calling json.Valid() would not. + packagePolicyReq := kibana.PackagePolicyRequest{} + err = json.Unmarshal(pkgPolicyBuf.Bytes(), &packagePolicyReq) + if err != nil { + return r, fmt.Errorf("templated package policy is not valid JSON: %s, %w", pkgPolicyBuf.String(), err) + } + + t.Log("POST /api/fleet/package_policies") + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + defer cancel() + + pkgResp, err := info.KibanaClient.InstallFleetPackage(ctx, packagePolicyReq) + if err != nil { + t.Logf("Error installing fleet package: %v", err) + return r, fmt.Errorf("error installing fleet package: %w", err) + } + t.Logf("Endpoint package Policy Response:\n%+v", pkgResp) + return pkgResp, err +} diff --git a/testing/integration/fake_test.go b/testing/integration/fake_test.go index dc9cf5ecaa6..bb6d8478ead 100644 --- a/testing/integration/fake_test.go +++ b/testing/integration/fake_test.go @@ -43,13 +43,41 @@ inputs: message: Healthy ` +var simpleIsolatedUnitsConfig = ` +outputs: + default: + type: fake-action-output + shipper.enabled: true +inputs: + - id: fake-isolated-units + type: fake-isolated-units + state: 1 + message: Configuring +` + +var complexIsolatedUnitsConfig = ` +outputs: + default: + type: fake-action-output + shipper.enabled: true +inputs: + - id: fake-isolated-units + type: fake-isolated-units + state: 2 + message: Healthy + - id: fake-isolated-units-1 + type: fake-isolated-units + state: 2 + message: Healthy +` + func TestFakeComponent(t *testing.T) { define.Require(t, define.Requirements{ Group: Default, Local: true, }) - f, err := define.NewFixture(t, define.Version()) + f, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) @@ -103,3 +131,78 @@ func TestFakeComponent(t *testing.T) { }) require.NoError(t, err) } + +func TestFakeIsolatedUnitsComponent(t *testing.T) { + define.Require(t, define.Requirements{ + Group: Default, + Local: true, + }) + + f, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + err = f.Prepare(ctx, fakeComponent, fakeShipper) + require.NoError(t, err) + + err = f.Run(ctx, atesting.State{ + Configure: simpleIsolatedUnitsConfig, + AgentState: atesting.NewClientState(client.Healthy), + Components: map[string]atesting.ComponentState{ + "fake-isolated-units-default-fake-isolated-units": { + State: atesting.NewClientState(client.Healthy), + Units: map[atesting.ComponentUnitKey]atesting.ComponentUnitState{ + atesting.ComponentUnitKey{UnitType: client.UnitTypeOutput, UnitID: "fake-isolated-units-default-fake-isolated-units"}: { + State: atesting.NewClientState(client.Healthy), + }, + atesting.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units-unit"}: { + State: atesting.NewClientState(client.Configuring), + }, + }, + }, + }, + }, atesting.State{ + Configure: complexIsolatedUnitsConfig, + AgentState: atesting.NewClientState(client.Healthy), + Components: map[string]atesting.ComponentState{ + "fake-isolated-units-default-fake-isolated-units": { + State: atesting.NewClientState(client.Healthy), + Units: map[atesting.ComponentUnitKey]atesting.ComponentUnitState{ + atesting.ComponentUnitKey{UnitType: client.UnitTypeOutput, UnitID: "fake-isolated-units-default-fake-isolated-units"}: { + State: atesting.NewClientState(client.Healthy), + }, + atesting.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units-unit"}: { + State: atesting.NewClientState(client.Healthy), + }, + }, + }, + "fake-isolated-units-default-fake-isolated-units-1": { + State: atesting.NewClientState(client.Healthy), + Units: map[atesting.ComponentUnitKey]atesting.ComponentUnitState{ + atesting.ComponentUnitKey{UnitType: client.UnitTypeOutput, UnitID: "fake-isolated-units-default-fake-isolated-units-1"}: { + State: atesting.NewClientState(client.Healthy), + }, + atesting.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units-1-unit"}: { + State: atesting.NewClientState(client.Healthy), + }, + }, + }, + "fake-shipper-default": { + State: atesting.NewClientState(client.Healthy), + Units: map[atesting.ComponentUnitKey]atesting.ComponentUnitState{ + atesting.ComponentUnitKey{UnitType: client.UnitTypeOutput, UnitID: "fake-shipper-default"}: { + State: atesting.NewClientState(client.Healthy), + }, + atesting.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units"}: { + State: atesting.NewClientState(client.Healthy), + }, + atesting.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "fake-isolated-units-default-fake-isolated-units-1"}: { + State: atesting.NewClientState(client.Healthy), + }, + }, + }, + }, + }) + require.NoError(t, err) +} diff --git a/testing/integration/fakes.go b/testing/integration/fakes.go index 2364b06580d..15977e2e2d4 100644 --- a/testing/integration/fakes.go +++ b/testing/integration/fakes.go @@ -61,6 +61,16 @@ var fakeComponent = atesting.UsableComponent{ }, }, }, + { + Name: "fake-isolated-units", + Description: "A fake isolated units input", + Platforms: fakeComponentPltfs, + Shippers: []string{ + fakeShipperName, + }, + Command: &component.CommandSpec{}, + IsolateUnits: true, + }, }, }, } diff --git a/testing/integration/fleet-server.json b/testing/integration/fleet-server.json new file mode 100644 index 00000000000..1daaa97c8dd --- /dev/null +++ b/testing/integration/fleet-server.json @@ -0,0 +1,38 @@ +{ + "id": "3434b864-d135-4d03-a944-29ee7ad61ddd", + "version": "WzMwNywxXQ==", + "name": "fleet_server-1", + "namespace": "", + "description": "", + "package": { + "name": "fleet_server", + "title": "Fleet Server", + "version": "1.5.0" + }, + "enabled": true, + "inputs": [ + { + "type": "fleet-server", + "policy_template": "fleet_server", + "enabled": true, + "streams": [], + "vars": { + "max_agents": { + "type": "integer" + }, + "max_connections": { + "type": "integer" + }, + "custom": { + "value": "", + "type": "yaml" + } + } + } + ], + "revision": 1, + "created_at": "2024-05-22T16:13:09.177Z", + "created_by": "system", + "updated_at": "2024-05-22T16:13:09.177Z", + "updated_by": "system" +} diff --git a/testing/integration/fleetserver_test.go b/testing/integration/fleetserver_test.go new file mode 100644 index 00000000000..0c3c377c612 --- /dev/null +++ b/testing/integration/fleetserver_test.go @@ -0,0 +1,166 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build integration + +package integration + +import ( + "context" + "crypto/tls" + "net/http" + "net/url" + "os" + "path/filepath" + "runtime" + "testing" + "time" + + "github.com/google/uuid" + "github.com/stretchr/testify/require" + + "github.com/elastic/elastic-agent-libs/kibana" + atesting "github.com/elastic/elastic-agent/pkg/testing" + "github.com/elastic/elastic-agent/pkg/testing/define" + "github.com/elastic/elastic-agent/pkg/testing/tools" + "github.com/elastic/elastic-agent/pkg/testing/tools/estools" + "github.com/elastic/elastic-agent/pkg/testing/tools/testcontext" +) + +func fleetPolicy() kibana.AgentPolicy { + policyUUID := uuid.New().String() + + return kibana.AgentPolicy{ + ID: "test-fleet-policy-" + policyUUID, + Name: "test-fleet-policy-" + policyUUID, + Namespace: "default", + Description: "Test fleet policy " + policyUUID, + } +} + +func TestInstallFleetServerBootstrap(t *testing.T) { + info := define.Require(t, define.Requirements{ + Group: FleetPrivileged, + Stack: &define.Stack{}, + Sudo: true, + Local: false, + }) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + + // Get path to Elastic Agent executable + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + err = fixture.Prepare(ctx) + require.NoError(t, err) + + t.Log("Ensure base path is clean") + var defaultBasePath string + switch runtime.GOOS { + case "darwin": + defaultBasePath = `/Library` + case "linux": + defaultBasePath = `/opt` + case "windows": + defaultBasePath = `C:\Program Files` + } + + topPath := filepath.Join(defaultBasePath, "Elastic", "Agent") + err = os.RemoveAll(topPath) + require.NoError(t, err, "failed to remove %q. The test requires this path not to exist.") + + t.Log("Create fleet-server policy...") + policyResp, err := info.KibanaClient.CreatePolicy(ctx, fleetPolicy()) + require.NoError(t, err, "failed creating policy") + policy := policyResp.AgentPolicy + _, err = tools.InstallPackageFromDefaultFile(ctx, info.KibanaClient, "fleet-server", "1.5.0", "fleet-server.json", uuid.New().String(), policy.ID) + require.NoError(t, err, "failed creating fleet-server integration") + + t.Log("Get fleet-server service token...") + serviceToken, err := estools.CreateServiceToken(ctx, info.ESClient, "fleet-server") + require.NoError(t, err, "failed creating service token") + + esHost, ok := os.LookupEnv("ELASTICSEARCH_HOST") + require.True(t, ok, "environment var ELASTICSEARCH_HOST is empty") + u, err := url.Parse(esHost) + require.NoError(t, err, "could not parse %q as a URL", esHost) + if u.Port() == "" { + switch u.Scheme { + case "": + u.Host += ":80" + u.Scheme = "http" + case "http": + u.Host += ":80" + case "https": + u.Host += ":443" + default: + require.Failf(t, "elasticsearch host has unknown scheme: %s", u.Scheme) + } + esHost = u.String() + } + + t.Logf("fleet-server will enroll with es host: %q", esHost) + + // Run `elastic-agent install` with fleet-server bootstrap options. + // We use `--force` to prevent interactive execution. + opts := &atesting.InstallOpts{ + Force: true, + Privileged: true, + FleetBootstrapOpts: atesting.FleetBootstrapOpts{ + ESHost: esHost, + ServiceToken: serviceToken, + Policy: policy.ID, + Port: 8220, + }, + } + out, err := fixture.Install(ctx, opts) + if err != nil { + t.Logf("Install output: %s", out) + require.NoError(t, err, "unable to install elastic-agent with fleet-server bootstrap options") + } + + // checkInstallSuccess(t, fixture, topPath, true) // FIXME fails to build if this is uncommented, but the method is part of install_test.go + t.Run("check agent package version", testAgentPackageVersion(ctx, fixture, true)) + + // elastic-agent will self sign a cert to use with fleet-server if one is not passed + // in order to interact with the API we need to ignore the cert. + client := &http.Client{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + }, + } + fleetOK := false + for i := 0; i < 10; i++ { + t.Log("Checking fleet-server status") + resp, err := client.Get("https://localhost:8220/api/status") + if err != nil { + t.Logf("fleet-server status check returned error: %v, retry in 10s...", err) + time.Sleep(10 * time.Second) + continue + } + if resp.StatusCode == http.StatusOK { + fleetOK = true + break + } + t.Logf("fleet-server status check returned incorrect status: %d, retry in 10s", resp.StatusCode) + time.Sleep(10 * time.Second) + continue + } + require.True(t, fleetOK, "expected fleet-server /api/status to return 200") + + // Make sure uninstall from within the topPath fails on Windows + if runtime.GOOS == "windows" { + cwd, err := os.Getwd() + require.NoErrorf(t, err, "GetWd failed: %s", err) + err = os.Chdir(topPath) + require.NoErrorf(t, err, "Chdir to topPath failed: %s", err) + t.Cleanup(func() { + _ = os.Chdir(cwd) + }) + out, err = fixture.Uninstall(ctx, &atesting.UninstallOpts{Force: true}) + require.Error(t, err, "uninstall should have failed") + require.Containsf(t, string(out), "uninstall must be run from outside the installed path", "expected error string not found in: %s err: %s", out, err) + } +} diff --git a/testing/integration/fqdn_test.go b/testing/integration/fqdn_test.go index 373f8536f8a..9449f052041 100644 --- a/testing/integration/fqdn_test.go +++ b/testing/integration/fqdn_test.go @@ -42,7 +42,7 @@ func TestFQDN(t *testing.T) { Sudo: true, }) - agentFixture, err := define.NewFixture(t, define.Version()) + agentFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) externalIP, err := getExternalIP() diff --git a/testing/integration/groups_test.go b/testing/integration/groups_test.go index 2c0f38b7e53..b4bb4500dad 100644 --- a/testing/integration/groups_test.go +++ b/testing/integration/groups_test.go @@ -33,4 +33,7 @@ const ( // Deb group of tests. Used for testing .deb packages install & upgrades Deb = "deb" + + // RPM group of tests. Used for testing .rpm packages install & upgrades + RPM = "rpm" ) diff --git a/testing/integration/install_privileged_test.go b/testing/integration/install_privileged_test.go deleted file mode 100644 index 9cc8db6b09e..00000000000 --- a/testing/integration/install_privileged_test.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. - -//go:build integration - -package integration - -import ( - "context" - "os" - "path/filepath" - "runtime" - "strings" - "testing" - "time" - - atesting "github.com/elastic/elastic-agent/pkg/testing" - "github.com/elastic/elastic-agent/pkg/testing/define" - "github.com/elastic/elastic-agent/pkg/testing/tools/testcontext" - - "github.com/stretchr/testify/require" -) - -func TestInstallPrivilegedWithoutBasePath(t *testing.T) { - define.Require(t, define.Requirements{ - Group: Default, - // We require sudo for this test to run - // `elastic-agent install`. - Sudo: true, - - // It's not safe to run this test locally as it - // installs Elastic Agent. - Local: false, - }) - - // Get path to Elastic Agent executable - fixture, err := define.NewFixture(t, define.Version()) - require.NoError(t, err) - - ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) - defer cancel() - - // Prepare the Elastic Agent so the binary is extracted and ready to use. - err = fixture.Prepare(ctx) - require.NoError(t, err) - - // Check that default base path is clean - var defaultBasePath string - switch runtime.GOOS { - case "darwin": - defaultBasePath = `/Library` - case "linux": - defaultBasePath = `/opt` - case "windows": - defaultBasePath = `C:\Program Files` - } - - topPath := filepath.Join(defaultBasePath, "Elastic", "Agent") - err = os.RemoveAll(topPath) - require.NoError(t, err, "failed to remove %q. The test requires this path not to exist.") - - // Run `elastic-agent install`. We use `--force` to prevent interactive - // execution. - opts := &atesting.InstallOpts{Force: true, Unprivileged: atesting.NewBool(false)} - out, err := fixture.Install(ctx, opts) - if err != nil { - t.Logf("install output: %s", out) - require.NoError(t, err) - } - - // Check that Agent was installed in default base path - checkInstallSuccess(t, topPath, opts.IsUnprivileged(runtime.GOOS)) - t.Run("check agent package version", testAgentPackageVersion(ctx, fixture, true)) -} - -func TestInstallPrivilegedWithBasePath(t *testing.T) { - define.Require(t, define.Requirements{ - Group: Default, - // We require sudo for this test to run - // `elastic-agent install`. - Sudo: true, - - // It's not safe to run this test locally as it - // installs Elastic Agent. - Local: false, - }) - - // Get path to Elastic Agent executable - fixture, err := define.NewFixture(t, define.Version()) - require.NoError(t, err) - - ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) - defer cancel() - - // Prepare the Elastic Agent so the binary is extracted and ready to use. - err = fixture.Prepare(ctx) - require.NoError(t, err) - - // Set up random temporary directory to serve as base path for Elastic Agent - // installation. - tmpDir := t.TempDir() - randomBasePath := filepath.Join(tmpDir, strings.ToLower(randStr(8))) - - // Run `elastic-agent install`. We use `--force` to prevent interactive - // execution. - opts := &atesting.InstallOpts{ - BasePath: randomBasePath, - Force: true, - Unprivileged: atesting.NewBool(false), - } - out, err := fixture.Install(ctx, opts) - if err != nil { - t.Logf("install output: %s", out) - require.NoError(t, err) - } - - // Check that Agent was installed in the custom base path - topPath := filepath.Join(randomBasePath, "Elastic", "Agent") - checkInstallSuccess(t, topPath, opts.IsUnprivileged(runtime.GOOS)) - t.Run("check agent package version", testAgentPackageVersion(ctx, fixture, true)) -} diff --git a/testing/integration/install_test.go b/testing/integration/install_test.go index 2d447ca6975..f2159752943 100644 --- a/testing/integration/install_test.go +++ b/testing/integration/install_test.go @@ -11,7 +11,6 @@ import ( "fmt" "math/rand" "os" - "os/exec" "path/filepath" "runtime" "strings" @@ -20,9 +19,11 @@ import ( "github.com/stretchr/testify/require" + "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" atesting "github.com/elastic/elastic-agent/pkg/testing" "github.com/elastic/elastic-agent/pkg/testing/define" "github.com/elastic/elastic-agent/pkg/testing/tools/testcontext" + "github.com/elastic/elastic-agent/testing/installtest" ) func TestInstallWithoutBasePath(t *testing.T) { @@ -39,7 +40,7 @@ func TestInstallWithoutBasePath(t *testing.T) { }) // Get path to Elastic Agent executable - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) @@ -49,33 +50,22 @@ func TestInstallWithoutBasePath(t *testing.T) { err = fixture.Prepare(ctx) require.NoError(t, err) - // Check that default base path is clean - var defaultBasePath string - switch runtime.GOOS { - case "darwin": - defaultBasePath = `/Library` - case "linux": - defaultBasePath = `/opt` - case "windows": - defaultBasePath = `C:\Program Files` - } - - topPath := filepath.Join(defaultBasePath, "Elastic", "Agent") - err = os.RemoveAll(topPath) - require.NoError(t, err, "failed to remove %q. The test requires this path not to exist.") - // Run `elastic-agent install`. We use `--force` to prevent interactive // execution. - opts := &atesting.InstallOpts{Force: true} - out, err := fixture.Install(ctx, opts) + opts := atesting.InstallOpts{Force: true, Privileged: false} + out, err := fixture.Install(ctx, &opts) if err != nil { t.Logf("install output: %s", out) require.NoError(t, err) } // Check that Agent was installed in default base path - checkInstallSuccess(t, topPath, opts.IsUnprivileged(runtime.GOOS)) + topPath := installtest.DefaultTopPath() + require.NoError(t, installtest.CheckSuccess(ctx, fixture, topPath, &installtest.CheckOpts{Privileged: opts.Privileged})) + t.Run("check agent package version", testAgentPackageVersion(ctx, fixture, true)) + t.Run("check second agent installs with --develop", testSecondAgentCanInstall(ctx, fixture, "", true, opts)) + // Make sure uninstall from within the topPath fails on Windows if runtime.GOOS == "windows" { cwd, err := os.Getwd() @@ -89,7 +79,6 @@ func TestInstallWithoutBasePath(t *testing.T) { require.Error(t, err, "uninstall should have failed") require.Containsf(t, string(out), "uninstall must be run from outside the installed path", "expected error string not found in: %s err: %s", out, err) } - } func TestInstallWithBasePath(t *testing.T) { @@ -106,7 +95,7 @@ func TestInstallWithBasePath(t *testing.T) { }) // Get path to Elastic Agent executable - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) @@ -116,34 +105,33 @@ func TestInstallWithBasePath(t *testing.T) { err = fixture.Prepare(ctx) require.NoError(t, err) - // Set up random temporary directory to serve as base path for Elastic Agent - // installation. - tmpDir := t.TempDir() - basePath := filepath.Join(tmpDir, strings.ToLower(randStr(8))) + // When installing with unprivileged using a base path the + // base needs to be accessible by the `elastic-agent-user` user that will be + // executing the process, but is not created yet. Using a base that exists + // and is known to be accessible by standard users, ensures this tests + // works correctly and will not hit a permission issue when spawning the + // elastic-agent service. + var basePath string + switch runtime.GOOS { + case define.Linux: + basePath = `/usr` + case define.Windows: + basePath = `C:\` + default: + // Set up random temporary directory to serve as base path for Elastic Agent + // installation. + tmpDir := t.TempDir() + basePath = filepath.Join(tmpDir, strings.ToLower(randStr(8))) + } // Run `elastic-agent install`. We use `--force` to prevent interactive // execution. - opts := &atesting.InstallOpts{ - BasePath: basePath, - Force: true, + opts := atesting.InstallOpts{ + BasePath: basePath, + Force: true, + Privileged: false, } - if opts.IsUnprivileged(runtime.GOOS) { - switch runtime.GOOS { - case define.Linux: - // When installing with unprivileged using a base path the - // base needs to be accessible by the `elastic-agent` user that will be - // executing the process, but is not created yet. Using a base that exists - // and is known to be accessible by standard users, ensures this tests - // works correctly and will not hit a permission issue when spawning the - // elastic-agent service. - basePath = `/usr` - default: - t.Fatalf("only Linux supports unprivileged mode") - } - opts.BasePath = basePath - } - - out, err := fixture.Install(ctx, opts) + out, err := fixture.Install(ctx, &opts) if err != nil { t.Logf("install output: %s", out) require.NoError(t, err) @@ -151,8 +139,11 @@ func TestInstallWithBasePath(t *testing.T) { // Check that Agent was installed in the custom base path topPath := filepath.Join(basePath, "Elastic", "Agent") - checkInstallSuccess(t, topPath, opts.IsUnprivileged(runtime.GOOS)) + require.NoError(t, installtest.CheckSuccess(ctx, fixture, topPath, &installtest.CheckOpts{Privileged: opts.Privileged})) + t.Run("check agent package version", testAgentPackageVersion(ctx, fixture, true)) + t.Run("check second agent installs with --namespace", testSecondAgentCanInstall(ctx, fixture, basePath, false, opts)) + // Make sure uninstall from within the topPath fails on Windows if runtime.GOOS == "windows" { cwd, err := os.Getwd() @@ -168,6 +159,129 @@ func TestInstallWithBasePath(t *testing.T) { } } +func TestInstallPrivilegedWithoutBasePath(t *testing.T) { + define.Require(t, define.Requirements{ + Group: Default, + // We require sudo for this test to run + // `elastic-agent install`. + Sudo: true, + + // It's not safe to run this test locally as it + // installs Elastic Agent. + Local: false, + }) + + // Get path to Elastic Agent executable + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + + // Prepare the Elastic Agent so the binary is extracted and ready to use. + err = fixture.Prepare(ctx) + require.NoError(t, err) + + // Run `elastic-agent install`. We use `--force` to prevent interactive + // execution. + opts := atesting.InstallOpts{Force: true, Privileged: true} + out, err := fixture.Install(ctx, &opts) + if err != nil { + t.Logf("install output: %s", out) + require.NoError(t, err) + } + + // Check that Agent was installed in default base path + require.NoError(t, installtest.CheckSuccess(ctx, fixture, opts.BasePath, &installtest.CheckOpts{Privileged: opts.Privileged})) + + t.Run("check agent package version", testAgentPackageVersion(ctx, fixture, true)) + t.Run("check second agent installs with --namespace", testSecondAgentCanInstall(ctx, fixture, "", false, opts)) +} + +func TestInstallPrivilegedWithBasePath(t *testing.T) { + define.Require(t, define.Requirements{ + Group: Default, + // We require sudo for this test to run + // `elastic-agent install`. + Sudo: true, + + // It's not safe to run this test locally as it + // installs Elastic Agent. + Local: false, + }) + + // Get path to Elastic Agent executable + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + + // Prepare the Elastic Agent so the binary is extracted and ready to use. + err = fixture.Prepare(ctx) + require.NoError(t, err) + + // Set up random temporary directory to serve as base path for Elastic Agent + // installation. + tmpDir := t.TempDir() + randomBasePath := filepath.Join(tmpDir, strings.ToLower(randStr(8))) + + // Run `elastic-agent install`. We use `--force` to prevent interactive + // execution. + opts := atesting.InstallOpts{ + BasePath: randomBasePath, + Force: true, + Privileged: true, + } + out, err := fixture.Install(ctx, &opts) + if err != nil { + t.Logf("install output: %s", out) + require.NoError(t, err) + } + + // Check that Agent was installed in the custom base path + topPath := filepath.Join(randomBasePath, "Elastic", "Agent") + require.NoError(t, installtest.CheckSuccess(ctx, fixture, topPath, &installtest.CheckOpts{Privileged: opts.Privileged})) + t.Run("check agent package version", testAgentPackageVersion(ctx, fixture, true)) + t.Run("check second agent installs with --develop", testSecondAgentCanInstall(ctx, fixture, randomBasePath, true, opts)) +} + +// Tests that a second agent can be installed in an isolated namespace, using either --develop or --namespace. +func testSecondAgentCanInstall(ctx context.Context, fixture *atesting.Fixture, basePath string, develop bool, installOpts atesting.InstallOpts) func(*testing.T) { + return func(t *testing.T) { + // Get path to Elastic Agent executable + devFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + // Prepare the Elastic Agent so the binary is extracted and ready to use. + err = devFixture.Prepare(ctx) + require.NoError(t, err) + + // If development mode was requested, the namespace will be automatically set to Development after Install(). + // Otherwise, install into a test namespace. + installOpts.Develop = develop + if !installOpts.Develop { + installOpts.Namespace = "Testing" + } + + devOut, err := devFixture.Install(ctx, &installOpts) + if err != nil { + t.Logf("install output: %s", devOut) + require.NoError(t, err) + } + + topPath := installtest.NamespaceTopPath(installOpts.Namespace) + if basePath != "" { + topPath = filepath.Join(basePath, "Elastic", paths.InstallDirNameForNamespace(installOpts.Namespace)) + } + + require.NoError(t, installtest.CheckSuccess(ctx, fixture, topPath, &installtest.CheckOpts{ + Privileged: installOpts.Privileged, + Namespace: installOpts.Namespace, + })) + } +} + // TestRepeatedInstallUninstall will install then uninstall the agent // repeatedly. This test exists because of a number of race // conditions that have occurred in the uninstall process. Current @@ -190,19 +304,8 @@ func TestRepeatedInstallUninstall(t *testing.T) { for i := 0; i < iterations; i++ { t.Run(fmt.Sprintf("%s-%d", t.Name(), i), func(t *testing.T) { - var defaultBasePath string - switch runtime.GOOS { - case "darwin": - defaultBasePath = `/Library` - case "linux": - defaultBasePath = `/opt` - case "windows": - defaultBasePath = `C:\Program Files` - } - - topPath := filepath.Join(defaultBasePath, "Elastic", "Agent") // Get path to Elastic Agent executable - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(maxRunTime)) @@ -222,7 +325,7 @@ func TestRepeatedInstallUninstall(t *testing.T) { } // Check that Agent was installed in default base path - checkInstallSuccess(t, topPath, opts.IsUnprivileged(runtime.GOOS)) + require.NoError(t, installtest.CheckSuccess(ctx, fixture, opts.BasePath, &installtest.CheckOpts{Privileged: opts.Privileged})) t.Run("check agent package version", testAgentPackageVersion(ctx, fixture, true)) out, err = fixture.Uninstall(ctx, &atesting.UninstallOpts{Force: true}) require.NoErrorf(t, err, "uninstall failed: %s", err) @@ -230,46 +333,6 @@ func TestRepeatedInstallUninstall(t *testing.T) { } } -func checkInstallSuccess(t *testing.T, topPath string, unprivileged bool) { - t.Helper() - _, err := os.Stat(topPath) - require.NoError(t, err) - - // Check that a few expected installed files are present - installedBinPath := filepath.Join(topPath, exeOnWindows("elastic-agent")) - installedDataPath := filepath.Join(topPath, "data") - installMarkerPath := filepath.Join(topPath, ".installed") - - _, err = os.Stat(installedBinPath) - require.NoError(t, err) - _, err = os.Stat(installedDataPath) - require.NoError(t, err) - _, err = os.Stat(installMarkerPath) - require.NoError(t, err) - - if unprivileged { - // Specific checks depending on the platform. - checkPlatformUnprivileged(t, topPath) - - // Executing `elastic-agent status` as the `elastic-agent` user should work. - var output []byte - require.Eventuallyf(t, func() bool { - cmd := exec.Command("sudo", "-u", "elastic-agent", "elastic-agent", "status") - output, err = cmd.CombinedOutput() - return err == nil - }, 3*time.Minute, 1*time.Second, "status never successful: %s (output: %s)", err, output) - - // Executing `elastic-agent status` as the original user should fail, because that - // user is not in the 'elastic-agent' group. - originalUser := os.Getenv("SUDO_USER") - if originalUser != "" { - cmd := exec.Command("sudo", "-u", originalUser, "elastic-agent", "status") - output, err := cmd.CombinedOutput() - require.Error(t, err, "running sudo -u %s elastic-agent status should have failed: %s", originalUser, output) - } - } -} - func randStr(length int) string { rand.Seed(time.Now().UnixNano()) var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") @@ -281,10 +344,3 @@ func randStr(length int) string { return string(runes) } - -func exeOnWindows(filename string) string { - if runtime.GOOS == define.Windows { - return filename + ".exe" - } - return filename -} diff --git a/testing/integration/install_unix_test.go b/testing/integration/install_unix_test.go deleted file mode 100644 index 302c6a6b218..00000000000 --- a/testing/integration/install_unix_test.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. - -//go:build integration && !windows - -package integration - -import ( - "os" - "path/filepath" - "syscall" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/elastic/elastic-agent/internal/pkg/agent/application/paths" - "github.com/elastic/elastic-agent/internal/pkg/agent/install" -) - -func checkPlatformUnprivileged(t *testing.T, topPath string) { - // Check that the elastic-agent user/group exist. - uid, err := install.FindUID("elastic-agent") - require.NoError(t, err) - gid, err := install.FindGID("elastic-agent") - require.NoError(t, err) - - // Path should now exist as well as be owned by the correct user/group. - info, err := os.Stat(topPath) - require.NoError(t, err) - fs, ok := info.Sys().(*syscall.Stat_t) - require.True(t, ok) - require.Equalf(t, fs.Uid, uint32(uid), "%s not owned by elastic-agent user", topPath) - require.Equalf(t, fs.Gid, uint32(gid), "%s not owned by elastic-agent group", topPath) - - // Check that the socket is created with the correct permissions. - socketPath := filepath.Join(topPath, paths.ControlSocketName) - require.Eventuallyf(t, func() bool { - _, err = os.Stat(socketPath) - return err == nil - }, 3*time.Minute, 1*time.Second, "%s socket never created: %s", socketPath, err) - info, err = os.Stat(socketPath) - require.NoError(t, err) - fs, ok = info.Sys().(*syscall.Stat_t) - require.True(t, ok) - require.Equalf(t, fs.Uid, uint32(uid), "%s not owned by elastic-agent user", socketPath) - require.Equalf(t, fs.Gid, uint32(gid), "%s not owned by elastic-agent group", socketPath) -} diff --git a/testing/integration/log_level_test.go b/testing/integration/log_level_test.go new file mode 100644 index 00000000000..4e1dc6940bd --- /dev/null +++ b/testing/integration/log_level_test.go @@ -0,0 +1,392 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build integration + +package integration + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + "testing" + "text/template" + "time" + + "github.com/google/uuid" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/elastic/elastic-agent-libs/kibana" + "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/elastic-agent/pkg/control/v2/cproto" + "github.com/elastic/elastic-agent/pkg/core/logger" + atesting "github.com/elastic/elastic-agent/pkg/testing" + "github.com/elastic/elastic-agent/pkg/testing/define" + "github.com/elastic/elastic-agent/pkg/testing/tools/fleettools" + "github.com/elastic/elastic-agent/pkg/testing/tools/testcontext" + "github.com/elastic/elastic-agent/pkg/utils" +) + +func TestSetLogLevelFleetManaged(t *testing.T) { + info := define.Require(t, define.Requirements{ + Group: Fleet, + Stack: &define.Stack{}, + Sudo: true, + }) + + deadline := time.Now().Add(10 * time.Minute) + ctx, cancel := testcontext.WithDeadline(t, context.Background(), deadline) + defer cancel() + + f, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err, "failed creating agent fixture") + + policyResp, enrollmentTokenResp := createPolicyAndEnrollmentToken(ctx, t, info.KibanaClient, createBasicPolicy()) + t.Logf("Created policy %+v", policyResp.AgentPolicy) + + t.Log("Getting default Fleet Server URL...") + fleetServerURL, err := fleettools.DefaultURL(ctx, info.KibanaClient) + require.NoError(t, err, "failed getting Fleet Server URL") + + installOutput, err := f.Install(ctx, &atesting.InstallOpts{ + NonInteractive: true, + Force: true, + EnrollOpts: atesting.EnrollOpts{ + URL: fleetServerURL, + EnrollmentToken: enrollmentTokenResp.APIKey, + }, + }) + + assert.NoErrorf(t, err, "Error installing agent. Install output:\n%s\n", string(installOutput)) + + require.Eventuallyf(t, func() bool { + return waitForAgentAndFleetHealthy(ctx, t, f) + }, time.Minute, time.Second, "agent never became healthy or connected to Fleet") + + // get the agent ID + agentID, err := getAgentID(ctx, f) + require.NoError(t, err, "error getting the agent ID") + + testLogLevelSetViaFleet(ctx, f, agentID, t, info, policyResp) +} + +func testLogLevelSetViaFleet(ctx context.Context, f *atesting.Fixture, agentID string, t *testing.T, info *define.Info, policyResp kibana.PolicyResponse) { + + // Step 0: get the initial log level reported by agent + initialLogLevel, err := getLogLevelFromInspectOutput(ctx, f) + require.NoError(t, err, "error retrieving agent log level") + assert.Equal(t, logger.DefaultLogLevel.String(), initialLogLevel, "unexpected default log level at agent startup") + + // Step 1: set a different log level in Fleet policy + policyLogLevel := logp.ErrorLevel + + t.Logf("Setting policy log level to %q", policyLogLevel.String()) + // make sure we are changing something + require.NotEqualf(t, logger.DefaultLogLevel, policyLogLevel, "Policy log level %s should be different than agent default log level", policyLogLevel) + // set policy log level and verify that eventually the agent sets it + err = updatePolicyLogLevel(ctx, t, info.KibanaClient, policyResp.AgentPolicy, policyLogLevel.String()) + require.NoError(t, err, "error updating policy log level") + + // assert `elastic-agent inspect` eventually reports the new log level + // TODO re-enable inspect assertion after https://github.com/elastic/elastic-agent/issues/4870 is solved + //assert.Eventuallyf(t, func() bool { + // agentLogLevel, err := getLogLevelFromInspectOutput(ctx, f) + // if err != nil { + // t.Logf("error getting log level from agent: %v", err) + // return false + // } + // t.Logf("Agent log level: %q policy log level: %q", agentLogLevel, policyLogLevel) + // return agentLogLevel == policyLogLevel.String() + //}, 30*time.Second, time.Second, "agent never received expected log level %q", policyLogLevel) + + // assert Fleet eventually receives the new log level from agent through checkin + assert.Eventuallyf(t, func() bool { + fleetMetadataLogLevel, err := getLogLevelFromFleetMetadata(ctx, t, info.KibanaClient, agentID) + if err != nil { + t.Logf("error getting log level for agent %q from Fleet metadata: %v", agentID, err) + return false + } + t.Logf("Fleet metadata log level for agent %q: %q policy log level: %q", agentID, fleetMetadataLogLevel, policyLogLevel) + return fleetMetadataLogLevel == policyLogLevel.String() + }, 30*time.Second, time.Second, "agent never communicated policy log level %q to Fleet", policyLogLevel) + + // Step 2: set a different log level for the specific agent using Settings action + // set agent log level and verify that it takes precedence over the policy one + agentLogLevel := logp.DebugLevel.String() + + t.Logf("Setting agent log level to %q", agentLogLevel) + + err = updateAgentLogLevel(ctx, t, info.KibanaClient, agentID, agentLogLevel) + require.NoError(t, err, "error updating agent log level") + + // TODO re-enable inspect assertion after https://github.com/elastic/elastic-agent/issues/4870 is solved + //assert.Eventuallyf(t, func() bool { + // actualAgentLogLevel, err := getLogLevelFromInspectOutput(ctx, f) + // if err != nil { + // t.Logf("error getting log level from agent: %v", err) + // return false + // } + // t.Logf("Agent log level: %q, expected level: %q", actualAgentLogLevel, agentLogLevel) + // return actualAgentLogLevel == agentLogLevel + //}, 2*time.Minute, time.Second, "agent never received agent-specific log level %q", agentLogLevel) + + // assert Fleet eventually receives the new log level from agent through checkin + assert.Eventuallyf(t, func() bool { + fleetMetadataLogLevel, err := getLogLevelFromFleetMetadata(ctx, t, info.KibanaClient, agentID) + if err != nil { + t.Logf("error getting log level for agent %q from Fleet metadata: %v", agentID, err) + return false + } + t.Logf("Fleet metadata log level for agent %q: %q agent log level: %q", agentID, fleetMetadataLogLevel, agentLogLevel) + return fleetMetadataLogLevel == agentLogLevel + }, 30*time.Second, time.Second, "agent never communicated agent-specific log level %q to Fleet", agentLogLevel) + + // Step 3: Clear the agent-specific log level override, verify that we revert to policy log level + t.Logf("Clearing agent log level, expecting log level to revert back to %q", policyLogLevel) + err = updateAgentLogLevel(ctx, t, info.KibanaClient, agentID, "") + require.NoError(t, err, "error clearing agent log level") + + // assert `elastic-agent inspect` eventually reports the new log level + // TODO re-enable inspect assertion after https://github.com/elastic/elastic-agent/issues/4870 is solved + //assert.Eventuallyf(t, func() bool { + // actualAgentLogLevel, err := getLogLevelFromInspectOutput(ctx, f) + // if err != nil { + // t.Logf("error getting log level from agent: %v", err) + // return false + // } + // t.Logf("Agent log level: %q policy log level: %q", actualAgentLogLevel, policyLogLevel) + // return actualAgentLogLevel == policyLogLevel.String() + //}, 30*time.Second, time.Second, "agent never reverted to policy log level %q", policyLogLevel) + + // assert Fleet eventually receives the new log level from agent through checkin + assert.Eventuallyf(t, func() bool { + fleetMetadataLogLevel, err := getLogLevelFromFleetMetadata(ctx, t, info.KibanaClient, agentID) + if err != nil { + t.Logf("error getting log level for agent %q from Fleet metadata: %v", agentID, err) + return false + } + t.Logf("Fleet metadata log level for agent %q: %q policy log level: %q", agentID, fleetMetadataLogLevel, policyLogLevel) + return fleetMetadataLogLevel == policyLogLevel.String() + }, 30*time.Second, time.Second, "agent never communicated reverting to policy log level %q to Fleet", policyLogLevel) + + // Step 4: Clear the log level in policy and verify that agent reverts to the initial log level + t.Logf("Clearing policy log level, expecting log level to revert back to %q", initialLogLevel) + err = updatePolicyLogLevel(ctx, t, info.KibanaClient, policyResp.AgentPolicy, "") + require.NoError(t, err, "error clearing policy log level") + + // assert `elastic-agent inspect` eventually reports the initial log level + // TODO re-enable inspect assertion after https://github.com/elastic/elastic-agent/issues/4870 is solved + //assert.Eventuallyf(t, func() bool { + // actualAgentLogLevel, err := getLogLevelFromInspectOutput(ctx, f) + // if err != nil { + // t.Logf("error getting log level from agent: %v", err) + // return false + // } + // t.Logf("Agent log level: %q initial log level: %q", actualAgentLogLevel, initialLogLevel) + // return actualAgentLogLevel == initialLogLevel + //}, 2*time.Minute, time.Second, "agent never reverted to initial log level %q", initialLogLevel) + + // assert Fleet eventually receives the new log level from agent through checkin + assert.Eventuallyf(t, func() bool { + fleetMetadataLogLevel, err := getLogLevelFromFleetMetadata(ctx, t, info.KibanaClient, agentID) + if err != nil { + t.Logf("error getting log level for agent %q from Fleet metadata: %v", agentID, err) + return false + } + t.Logf("Fleet metadata log level for agent %q: %q initial log level: %q", agentID, fleetMetadataLogLevel, initialLogLevel) + return fleetMetadataLogLevel == initialLogLevel + }, 30*time.Second, time.Second, "agent never communicated initial log level %q to Fleet", initialLogLevel) +} + +func waitForAgentAndFleetHealthy(ctx context.Context, t *testing.T, f *atesting.Fixture) bool { + status, err := f.ExecStatus(ctx) + if err != nil { + t.Logf("error fetching agent status: %v", err) + return false + } + + statusBuffer := new(strings.Builder) + err = json.NewEncoder(statusBuffer).Encode(status) + if err != nil { + t.Logf("error marshaling agent status: %v", err) + } else { + t.Logf("agent status: %v", statusBuffer.String()) + } + + return status.State == int(cproto.State_HEALTHY) && status.FleetState == int(cproto.State_HEALTHY) +} + +func updateAgentLogLevel(ctx context.Context, t *testing.T, kibanaClient *kibana.Client, agentID string, logLevel string) error { + updateLogLevelTemplateString := `{ + "action": { + "type": "SETTINGS", + "data": { + "log_level": {{ .logLevel }} + } + } + }` + updateLogLevelTemplate, err := template.New("updatePolicyLogLevel").Parse(updateLogLevelTemplateString) + if err != nil { + return fmt.Errorf("error parsing update log level request template: %w", err) + } + + buf := new(bytes.Buffer) + templateData := map[string]string{} + if logLevel != "" { + templateData["logLevel"] = `"` + logLevel + `"` + } else { + templateData["logLevel"] = "null" + } + + err = updateLogLevelTemplate.Execute(buf, templateData) + t.Logf("Updating agent-specific log level to %q", logLevel) + _, err = kibanaClient.SendWithContext(ctx, http.MethodPost, "/api/fleet/agents/"+agentID+"/actions", nil, nil, buf) + if err != nil { + return fmt.Errorf("error executing fleet request: %w", err) + } + + // The log below is a bit spammy but it can be useful for debugging + //respDump, err := httputil.DumpResponse(fleetResp, true) + //if err != nil { + // t.Logf("Error dumping Fleet response to updating agent-specific log level: %v", err) + //} else { + // t.Logf("Fleet response to updating agent-specific log level:\n----- BEGIN RESPONSE DUMP -----\n%s\n----- END RESPONSE DUMP -----\n", string(respDump)) + //} + + return nil +} + +func updatePolicyLogLevel(ctx context.Context, t *testing.T, kibanaClient *kibana.Client, policy kibana.AgentPolicy, newPolicyLogLevel string) error { + // The request we would need is the one below, but at the time of writing there is no way to set overrides with fleet api definition in elastic-agent-libs, need to update + // info.KibanaClient.UpdatePolicy(ctx, policyResp.ID, kibana.AgentPolicyUpdateRequest{}) + // Let's do a generic HTTP request + + updateLogLevelTemplateString := `{ + "name": "{{ .policyName }}", + "namespace": "{{ .namespace }}", + "advanced_settings": { + "agent_logging_level": {{ .logLevel }} + } + }` + updateLogLevelTemplate, err := template.New("updatePolicyLogLevel").Parse(updateLogLevelTemplateString) + if err != nil { + return fmt.Errorf("error parsing update log level request template: %w", err) + } + + buf := new(bytes.Buffer) + templateData := map[string]string{"policyName": policy.Name, "namespace": policy.Namespace} + if newPolicyLogLevel == "" { + // to reset the log level we have to set it to null + templateData["logLevel"] = "null" + } else { + templateData["logLevel"] = `"` + newPolicyLogLevel + `"` + } + + err = updateLogLevelTemplate.Execute(buf, templateData) + if err != nil { + return fmt.Errorf("error rendering policy update template: %w", err) + } + + _, err = kibanaClient.SendWithContext(ctx, http.MethodPut, "/api/fleet/agent_policies/"+policy.ID, nil, nil, buf) + + if err != nil { + return fmt.Errorf("error executing fleet request: %w", err) + } + + // The log below is a bit spammy but it can be useful for debugging + //respDump, err := httputil.DumpResponse(fleetResp, true) + //if err != nil { + // t.Logf("Error dumping Fleet response to updating policy log level: %v", err) + //} else { + // t.Logf("Fleet response to updating policy log level:\n----- BEGIN RESPONSE DUMP -----\n%s\n----- END RESPONSE DUMP -----\n", string(respDump)) + //} + + return nil +} + +func getAgentID(ctx context.Context, f *atesting.Fixture) (string, error) { + agentInspectOutput, err := f.ExecInspect(ctx) + if err != nil { + return "", fmt.Errorf("executing elastic-agent inspect: %w", err) + } + + return agentInspectOutput.Agent.ID, nil +} + +func getLogLevelFromInspectOutput(ctx context.Context, f *atesting.Fixture) (string, error) { + agentInspectOutput, err := f.ExecInspect(ctx) + if err != nil { + return "", fmt.Errorf("executing elastic-agent inspect: %w", err) + } + + return agentInspectOutput.Agent.Logging.Level, nil +} + +func getLogLevelFromFleetMetadata(ctx context.Context, t *testing.T, kibanaClient *kibana.Client, agentID string) (string, error) { + // The request we would need is kibanaClient.GetAgent(), but at the time of writing there is no way to get loglevel with fleet api definition in elastic-agent-libs, need to update + // kibana.AgentCommon struct to pick up log level from `local_metadata` + // Let's do a generic HTTP request + + response, err := kibanaClient.SendWithContext(ctx, http.MethodGet, "/api/fleet/agents/"+agentID, nil, nil, nil) + if err != nil { + return "", fmt.Errorf("getting agent from Fleet: %w", err) + } + defer response.Body.Close() + + // The log below is a bit spammy but it can be useful for debugging + //dumpResponse, err := httputil.DumpResponse(response, true) + //if err != nil { + // t.Logf(" error dumping agent metadata fleet response: %v", err) + //} else { + // t.Logf("agent metadata fleet response:\n----- BEGIN RESPONSE DUMP -----\n%s\n----- END RESPONSE DUMP -----", dumpResponse) + //} + + responseBodyBytes, err := io.ReadAll(response.Body) + if err != nil { + return "", fmt.Errorf("reading response body from Fleet: %w", err) + } + + rawJson := map[string]any{} + err = json.Unmarshal(responseBodyBytes, &rawJson) + if err != nil { + return "", fmt.Errorf("unmarshalling Fleet response: %w", err) + } + rawLogLevel, err := utils.GetNestedMap(rawJson, "item", "local_metadata", "elastic", "agent", "log_level") + if err != nil { + return "", fmt.Errorf("looking for item/local_metadata/elastic/agent/log_level key in Fleet response: %w", err) + } + + if logLevel, ok := rawLogLevel.(string); ok { + return logLevel, nil + } + return "", fmt.Errorf("loglevel from Fleet output is not a string: %T", rawLogLevel) +} + +func createPolicyAndEnrollmentToken(ctx context.Context, t *testing.T, kibClient *kibana.Client, policy kibana.AgentPolicy) (kibana.PolicyResponse, kibana.CreateEnrollmentAPIKeyResponse) { + t.Log("Creating Agent policy...") + policyResp, err := kibClient.CreatePolicy(ctx, policy) + require.NoError(t, err, "failed creating policy") + + t.Log("Creating Agent enrollment API key...") + createEnrollmentApiKeyReq := kibana.CreateEnrollmentAPIKeyRequest{ + PolicyID: policyResp.ID, + } + enrollmentToken, err := kibClient.CreateEnrollmentAPIKey(ctx, createEnrollmentApiKeyReq) + require.NoError(t, err, "failed creating enrollment API key") + return policyResp, enrollmentToken +} +func createBasicPolicy() kibana.AgentPolicy { + policyUUID := uuid.New().String() + return kibana.AgentPolicy{ + Name: "testloglevel-policy-" + policyUUID, + Namespace: "default", + Description: "Test Log Level Policy " + policyUUID, + MonitoringEnabled: []kibana.MonitoringEnabledOption{}, + } +} diff --git a/testing/integration/logs_ingestion_test.go b/testing/integration/logs_ingestion_test.go index 5a31b21d95c..718581d2035 100644 --- a/testing/integration/logs_ingestion_test.go +++ b/testing/integration/logs_ingestion_test.go @@ -12,8 +12,10 @@ import ( "encoding/json" "fmt" "net/http" + "net/http/httptest" "net/http/httputil" "os" + "path" "path/filepath" "regexp" "strings" @@ -22,8 +24,7 @@ import ( "time" "github.com/google/uuid" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" + "github.com/hectane/go-acl" "github.com/elastic/elastic-agent-libs/kibana" "github.com/elastic/elastic-agent/pkg/control/v2/client" @@ -34,7 +35,14 @@ import ( "github.com/elastic/elastic-agent/pkg/testing/tools/estools" "github.com/elastic/elastic-agent/pkg/testing/tools/fleettools" "github.com/elastic/elastic-agent/pkg/testing/tools/testcontext" + "github.com/elastic/elastic-agent/testing/installtest" "github.com/elastic/elastic-transport-go/v8/elastictransport" + + "github.com/rcrowley/go-metrics" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + mockes "github.com/elastic/mock-es/pkg/api" ) func TestLogIngestionFleetManaged(t *testing.T) { @@ -48,7 +56,7 @@ func TestLogIngestionFleetManaged(t *testing.T) { ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) defer cancel() - agentFixture, err := define.NewFixture(t, define.Version()) + agentFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) // 1. Create a policy in Fleet with monitoring enabled. @@ -90,6 +98,9 @@ func TestLogIngestionFleetManaged(t *testing.T) { t.Logf("created policy: %s", policy.ID) check.ConnectedToFleet(ctx, t, agentFixture, 5*time.Minute) + // 3. Ensure installation is correct. + require.NoError(t, installtest.CheckSuccess(ctx, agentFixture, installOpts.BasePath, &installtest.CheckOpts{Privileged: installOpts.Privileged})) + t.Run("Monitoring logs are shipped", func(t *testing.T) { testMonitoringLogsAreShipped(t, ctx, info, agentFixture, policy) }) @@ -116,7 +127,7 @@ func TestDebLogIngestFleetManaged(t *testing.T) { ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) defer cancel() - agentFixture, err := define.NewFixture(t, define.Version(), atesting.WithPackageFormat("deb")) + agentFixture, err := define.NewFixtureFromLocalBuild(t, define.Version(), atesting.WithPackageFormat("deb")) require.NoError(t, err) // 1. Create a policy in Fleet with monitoring enabled. @@ -125,7 +136,7 @@ func TestDebLogIngestFleetManaged(t *testing.T) { // name. This policy does not contain any integration. t.Log("Enrolling agent in Fleet with a test policy") createPolicyReq := kibana.AgentPolicy{ - Name: fmt.Sprintf("test-policy-enroll-%d", time.Now().Unix()), + Name: fmt.Sprintf("test-policy-enroll-%s", uuid.New().String()), Namespace: info.Namespace, Description: "test policy for agent enrollment", MonitoringEnabled: []kibana.MonitoringEnabledOption{ @@ -167,6 +178,306 @@ func TestDebLogIngestFleetManaged(t *testing.T) { }) } +func TestRpmLogIngestFleetManaged(t *testing.T) { + info := define.Require(t, define.Requirements{ + Group: RPM, + Stack: &define.Stack{}, + OS: []define.OS{ + { + Type: define.Linux, + Distro: "rhel", + }, + }, + Local: false, + Sudo: true, + }) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + + agentFixture, err := define.NewFixtureFromLocalBuild(t, define.Version(), atesting.WithPackageFormat("rpm")) + require.NoError(t, err) + + // 1. Create a policy in Fleet with monitoring enabled. + // To ensure there are no conflicts with previous test runs against + // the same ESS stack, we add the current time at the end of the policy + // name. This policy does not contain any integration. + t.Log("Enrolling agent in Fleet with a test policy") + createPolicyReq := kibana.AgentPolicy{ + Name: fmt.Sprintf("test-policy-enroll-%s", uuid.New().String()), + Namespace: info.Namespace, + Description: "test policy for agent enrollment", + MonitoringEnabled: []kibana.MonitoringEnabledOption{ + kibana.MonitoringEnabledLogs, + kibana.MonitoringEnabledMetrics, + }, + AgentFeatures: []map[string]interface{}{ + { + "name": "test_enroll", + "enabled": true, + }, + }, + } + + installOpts := atesting.InstallOpts{ + NonInteractive: true, + Force: true, + } + + // 2. Install the Elastic-Agent with the policy that + // was just created. + policy, err := tools.InstallAgentWithPolicy( + ctx, + t, + installOpts, + agentFixture, + info.KibanaClient, + createPolicyReq) + require.NoError(t, err) + t.Logf("created policy: %s", policy.ID) + check.ConnectedToFleet(ctx, t, agentFixture, 5*time.Minute) + + t.Run("Monitoring logs are shipped", func(t *testing.T) { + testMonitoringLogsAreShipped(t, ctx, info, agentFixture, policy) + }) + + t.Run("Normal logs with flattened data_stream are shipped", func(t *testing.T) { + testFlattenedDatastreamFleetPolicy(t, ctx, info, policy) + }) +} + +var eventLogConfig = ` +outputs: + default: + type: elasticsearch + hosts: + - %s + protocol: http + preset: balanced + +inputs: + - type: filestream + id: your-input-id + streams: + - id: your-filestream-stream-id + data_stream: + dataset: generic + paths: + - %s + +# Disable monitoring so there are less Beats running and less logs being generated. +agent.monitoring: + enabled: false + logs: false + metrics: false + pprof.enabled: false + use_output: default + +# Needed if you already have an Elastic-Agent running on your machine +# That's very helpful for running the tests locally +agent.monitoring: + http: + enabled: false + port: 7002 +agent.grpc: + address: localhost + port: 7001 +` + +func TestEventLogFile(t *testing.T) { + _ = define.Require(t, define.Requirements{ + Group: Default, + Stack: &define.Stack{}, + Local: true, + Sudo: false, + }) + + ctx, cancel := testcontext.WithDeadline( + t, + context.Background(), + time.Now().Add(10*time.Minute)) + defer cancel() + + agentFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + esURL := startMockES(t) + + logFilepath := path.Join(t.TempDir(), t.Name()) + generateLogFile(t, logFilepath, time.Millisecond*100, 1) + + cfg := fmt.Sprintf(eventLogConfig, esURL, logFilepath) + + if err := agentFixture.Prepare(ctx); err != nil { + t.Fatalf("cannot prepare Elastic-Agent fixture: %s", err) + } + + if err := agentFixture.Configure(ctx, []byte(cfg)); err != nil { + t.Fatalf("cannot configure Elastic-Agent fixture: %s", err) + } + + cmd, err := agentFixture.PrepareAgentCommand(ctx, nil) + if err != nil { + t.Fatalf("cannot prepare Elastic-Agent command: %s", err) + } + + output := strings.Builder{} + cmd.Stderr = &output + cmd.Stdout = &output + + if err := cmd.Start(); err != nil { + t.Fatalf("could not start Elastic-Agent: %s", err) + } + + // Make sure the Elastic-Agent process is not running before + // exiting the test + t.Cleanup(func() { + // Ignore the error because we cancelled the context, + // and that always returns an error + _ = cmd.Wait() + if t.Failed() { + t.Log("Elastic-Agent output:") + t.Log(output.String()) + } + }) + + // Now the Elastic-Agent is running, so validate the Event log file. + // Because the path changes based on the Elastic-Agent version, we + // use glob to find the file + var logFileName string + require.Eventually(t, func() bool { + // We ignore this error because the folder might not be there. + // Once the folder and file are there, then this call should succeed + // and we can read the file. + glob := filepath.Join( + agentFixture.WorkDir(), + "data", "elastic-agent-*", "logs", "events", "*") + files, err := filepath.Glob(glob) + if err != nil { + t.Fatalf("could not scan for the events log file: %s", err) + } + + if len(files) == 1 { + logFileName = files[0] + return true + } + + return false + + }, time.Minute, time.Second, "could not find event log file") + + logEntryBytes, err := os.ReadFile(logFileName) + if err != nil { + t.Fatalf("cannot read file '%s': %s", logFileName, err) + } + + logEntry := string(logEntryBytes) + expectedStr := "Cannot index event publisher.Event" + if !strings.Contains(logEntry, expectedStr) { + t.Errorf( + "did not find the expected log entry ('%s') in the events log file", + expectedStr) + t.Log("Event log file contents:") + t.Log(logEntry) + } + + // The diagnostics command is already tested by another test, + // here we just want to validate the events log behaviour + // extract the zip file into a temp folder + expectedLogFiles, expectedEventLogFiles := getLogFilenames( + t, + filepath.Join(agentFixture.WorkDir(), + "data", + "elastic-agent-*", + "logs")) + + collectDiagnosticsAndVeriflyLogs( + t, + ctx, + agentFixture, + []string{"diagnostics", "collect"}, + append(expectedLogFiles, expectedEventLogFiles...)) + + collectDiagnosticsAndVeriflyLogs( + t, + ctx, + agentFixture, + []string{"diagnostics", "collect", "--exclude-events"}, + expectedLogFiles) +} + +func collectDiagnosticsAndVeriflyLogs( + t *testing.T, + ctx context.Context, + agentFixture *atesting.Fixture, + cmd, + expectedFiles []string) { + + diagPath, err := agentFixture.ExecDiagnostics(ctx, cmd...) + if err != nil { + t.Fatalf("could not execute diagnostics excluding events log: %s", err) + } + + extractionDir := t.TempDir() + extractZipArchive(t, diagPath, extractionDir) + diagLogFiles, diagEventLogFiles := getLogFilenames( + t, + filepath.Join(extractionDir, "logs", "elastic-agent*")) + allLogs := append(diagLogFiles, diagEventLogFiles...) + + require.ElementsMatch( + t, + expectedFiles, + allLogs, + "expected: 'listA', got: 'listB'") +} + +func getLogFilenames( + t *testing.T, + basepath string, +) (logFiles, eventLogFiles []string) { + + logFilesGlob := filepath.Join(basepath, "*.ndjson") + logFilesPath, err := filepath.Glob(logFilesGlob) + if err != nil { + t.Fatalf("could not get log file names:%s", err) + } + + for _, f := range logFilesPath { + logFiles = append(logFiles, filepath.Base(f)) + } + + eventLogFilesGlob := filepath.Join(basepath, "events", "*.ndjson") + eventLogFilesPath, err := filepath.Glob(eventLogFilesGlob) + if err != nil { + t.Fatalf("could not get log file names:%s", err) + } + + for _, f := range eventLogFilesPath { + eventLogFiles = append(eventLogFiles, filepath.Base(f)) + } + + return logFiles, eventLogFiles +} + +func startMockES(t *testing.T) string { + registry := metrics.NewRegistry() + uid := uuid.New() + clusterUUID := uuid.New().String() + + mux := http.NewServeMux() + mux.Handle("/", mockes.NewAPIHandler( + uid, + clusterUUID, + registry, + time.Now().Add(time.Hour), 0, 0, 100, 0)) + + s := httptest.NewServer(mux) + t.Cleanup(s.Close) + + return s.URL +} + func testMonitoringLogsAreShipped( t *testing.T, ctx context.Context, @@ -205,20 +516,28 @@ func testMonitoringLogsAreShipped( "Failed to initialize artifact", "Failed to apply initial policy from on disk configuration", "elastic-agent-client error: rpc error: code = Canceled desc = context canceled", // can happen on restart - "add_cloud_metadata: received error failed requesting openstack metadata: Get \\\"https://169.254.169.254/2009-04-04/meta-data/instance-id\\\": dial tcp 169.254.169.254:443: connect: connection refused", // okay for the openstack metadata to not work - "add_cloud_metadata: received error failed requesting openstack metadata: Get \\\"https://169.254.169.254/2009-04-04/meta-data/hostname\\\": dial tcp 169.254.169.254:443: connect: connection refused", // okay for the cloud metadata to not work - "add_cloud_metadata: received error failed requesting openstack metadata: Get \\\"https://169.254.169.254/2009-04-04/meta-data/placement/availability-zone\\\": dial tcp 169.254.169.254:443: connect: connection refused", // okay for the cloud metadata to not work - "add_cloud_metadata: received error failed requesting openstack metadata: Get \\\"https://169.254.169.254/2009-04-04/meta-data/instance-type\\\": dial tcp 169.254.169.254:443: connect: connection refused", // okay for the cloud metadata to not work - "add_cloud_metadata: received error failed with http status code 404", // okay for the cloud metadata to not work - "add_cloud_metadata: received error failed fetching EC2 Identity Document: operation error ec2imds: GetInstanceIdentityDocument, http response error StatusCode: 404, request to EC2 IMDS failed", // okay for the cloud metadata to not work - "failed to invoke rollback watcher: failed to start Upgrade Watcher: fork/exec /var/lib/elastic-agent/elastic-agent: no such file or directory", //on debian this happens probably need to fix. + "add_cloud_metadata: received error failed requesting openstack metadata", // okay for the cloud metadata to not work + "add_cloud_metadata: received error failed with http status code 404", // okay for the cloud metadata to not work + "add_cloud_metadata: received error failed fetching EC2 Identity Document", // okay for the cloud metadata to not work + "failed to invoke rollback watcher: failed to start Upgrade Watcher", // on debian this happens probably need to fix. + "falling back to IMDSv1: operation error ec2imds: getToken", // okay for the cloud metadata to not work }) }) t.Logf("error logs: Got %d documents", len(docs.Hits.Hits)) + messages := make([]string, 0, len(docs.Hits.Hits)) for _, doc := range docs.Hits.Hits { t.Logf("%#v", doc.Source) + message, ok := doc.Source["message"] + if !ok { + continue + } + messageStr, ok := message.(string) + if !ok { + continue + } + messages = append(messages, messageStr) } - require.Empty(t, docs.Hits.Hits) + require.Emptyf(t, docs.Hits.Hits, "list of error messages is expected to be empty, found:\n%s", strings.Join(messages, ", \n")) // Stage 3: Make sure we have message confirming central management is running t.Log("Making sure we have message confirming central management is running") @@ -333,7 +652,7 @@ func testFlattenedDatastreamFleetPolicy( if err != nil { t.Fatalf("failed to create temp directory: %s", err) } - err = os.Chmod(tempDir, 0o755) + err = acl.Chmod(tempDir, 0o755) // `acl.Chmod` is used to ensure unprivileged mode on Windows works if err != nil { t.Fatalf("failed to chmod temp directory %s: %s", tempDir, err) } @@ -439,7 +758,7 @@ func generateLogFile(t *testing.T, fullPath string, tick time.Duration, events i if err != nil { t.Fatalf("could not create file '%s': %s", fullPath, err) } - err = os.Chmod(fullPath, 0o644) + err = acl.Chmod(fullPath, 0o644) // `acl.Chmod` is used to ensure unprivileged mode on Windows works if err != nil { t.Fatalf("failed to chmod file '%s': %s", fullPath, err) } diff --git a/testing/integration/metrics_monitoring_test.go b/testing/integration/metrics_monitoring_test.go new file mode 100644 index 00000000000..7b7c93e03f0 --- /dev/null +++ b/testing/integration/metrics_monitoring_test.go @@ -0,0 +1,146 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build integration + +package integration + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/google/uuid" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/elastic/elastic-agent-libs/kibana" + atesting "github.com/elastic/elastic-agent/pkg/testing" + "github.com/elastic/elastic-agent/pkg/testing/define" + "github.com/elastic/elastic-agent/pkg/testing/tools" + "github.com/elastic/elastic-agent/pkg/testing/tools/estools" +) + +type MetricsRunner struct { + suite.Suite + info *define.Info + agentFixture *atesting.Fixture + + ESHost string +} + +func TestMetricsMonitoringCorrectBinaries(t *testing.T) { + info := define.Require(t, define.Requirements{ + Group: Fleet, + Stack: &define.Stack{}, + Local: false, // requires Agent installation + Sudo: true, // requires Agent installation + OS: []define.OS{ + {Type: define.Linux}, + {Type: define.Windows}, + }, + }) + + suite.Run(t, &MetricsRunner{info: info}) +} + +func (runner *MetricsRunner) SetupSuite() { + fixture, err := define.NewFixtureFromLocalBuild(runner.T(), define.Version()) + require.NoError(runner.T(), err) + runner.agentFixture = fixture + + policyUUID := uuid.New().String() + basePolicy := kibana.AgentPolicy{ + Name: "test-policy-" + policyUUID, + Namespace: "default", + Description: "Test policy " + policyUUID, + MonitoringEnabled: []kibana.MonitoringEnabledOption{ + kibana.MonitoringEnabledLogs, + kibana.MonitoringEnabledMetrics, + }, + } + + installOpts := atesting.InstallOpts{ + NonInteractive: true, + Force: true, + Privileged: true, + } + + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute) + defer cancel() + + policyResp, err := tools.InstallAgentWithPolicy(ctx, runner.T(), installOpts, runner.agentFixture, runner.info.KibanaClient, basePolicy) + require.NoError(runner.T(), err) + + _, err = tools.InstallPackageFromDefaultFile(ctx, runner.info.KibanaClient, "system", "1.53.1", "system_integration_setup.json", uuid.New().String(), policyResp.ID) + require.NoError(runner.T(), err) + +} + +func (runner *MetricsRunner) TestBeatsMetrics() { + UnitOutputName := "default" + ctx, cancel := context.WithTimeout(context.Background(), time.Minute*20) + defer cancel() + agentStatus, err := runner.agentFixture.ExecStatus(ctx) + require.NoError(runner.T(), err) + + componentIds := []string{ + fmt.Sprintf("system/metrics-%s", UnitOutputName), + fmt.Sprintf("log-%s", UnitOutputName), + "beat/metrics-monitoring", + "elastic-agent", + "http/metrics-monitoring", + "filestream-monitoring", + } + + require.Eventually(runner.T(), func() bool { + for _, cid := range componentIds { + query := genESQuery(agentStatus.Info.ID, cid) + res, err := estools.PerformQueryForRawQuery(ctx, query, "metrics-elastic_agent*", runner.info.ESClient) + require.NoError(runner.T(), err) + runner.T().Logf("Fetched metrics for %s, got %d hits", cid, res.Hits.Total.Value) + if res.Hits.Total.Value < 1 { + return false + } + + } + return true + }, time.Minute*10, time.Second*10, "could not fetch metrics for all known beats in default install: %v", componentIds) +} + +func genESQuery(agentID string, componentID string) map[string]interface{} { + // see https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/server/services/agents/agent_metrics.ts + queryRaw := map[string]interface{}{ + "query": map[string]interface{}{ + "bool": map[string]interface{}{ + "must": []map[string]interface{}{ + { + "match": map[string]interface{}{ + "agent.id": agentID, + }, + }, + { + "match": map[string]interface{}{ + "component.id": componentID, + }, + }, + // make sure we fetch documents that have the metric field used by fleet monitoring + { + "exists": map[string]interface{}{ + "field": "system.process.cpu.total.value", + }, + }, + { + "exists": map[string]interface{}{ + "field": "system.process.memory.size", + }, + }, + }, + }, + }, + } + + return queryRaw +} diff --git a/testing/integration/monitoring_endpoint_test.go b/testing/integration/monitoring_endpoint_test.go new file mode 100644 index 00000000000..b91a0fe55fe --- /dev/null +++ b/testing/integration/monitoring_endpoint_test.go @@ -0,0 +1,266 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build integration + +package integration + +import ( + "context" + "os/exec" + "runtime" + "testing" + "time" + + "github.com/google/uuid" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/elastic/elastic-agent-libs/kibana" + atesting "github.com/elastic/elastic-agent/pkg/testing" + "github.com/elastic/elastic-agent/pkg/testing/define" + "github.com/elastic/elastic-agent/pkg/testing/tools" + "github.com/elastic/elastic-agent/pkg/testing/tools/estools" + "github.com/elastic/elastic-agent/pkg/testing/tools/testcontext" +) + +type EndpointMetricsMonRunner struct { + suite.Suite + info *define.Info + fixture *atesting.Fixture + endpointID string +} + +func TestEndpointAgentServiceMonitoring(t *testing.T) { + info := define.Require(t, define.Requirements{ + Group: Fleet, + Stack: &define.Stack{}, + Local: false, // requires Agent installation + Sudo: true, // requires Agent installation + OS: []define.OS{ + {Type: define.Linux}, + }, + }) + + // Get path to agent executable. + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err, "could not create agent fixture") + + runner := &EndpointMetricsMonRunner{ + info: info, + fixture: fixture, + endpointID: "endpoint-default", + } + + suite.Run(t, runner) +} + +func (runner *EndpointMetricsMonRunner) SetupSuite() { + deadline := time.Now().Add(10 * time.Minute) + ctx, cancel := testcontext.WithDeadline(runner.T(), context.Background(), deadline) + defer cancel() + + runner.T().Log("Enrolling the agent in Fleet") + policyUUID := uuid.New().String() + + createPolicyReq := kibana.AgentPolicy{ + Name: "test-policy-" + policyUUID, + Namespace: "default", + Description: "Test policy " + policyUUID, + MonitoringEnabled: []kibana.MonitoringEnabledOption{ + kibana.MonitoringEnabledLogs, + kibana.MonitoringEnabledMetrics, + }, + } + + installOpts := atesting.InstallOpts{ + NonInteractive: true, + Force: true, + Privileged: true, + } + + policy, err := tools.InstallAgentWithPolicy(ctx, runner.T(), + installOpts, runner.fixture, runner.info.KibanaClient, createPolicyReq) + require.NoError(runner.T(), err, "failed to install agent with policy") + + runner.T().Log("Installing Elastic Defend") + pkgPolicyResp, err := installElasticDefendPackage(runner.T(), runner.info, policy.ID) + require.NoErrorf(runner.T(), err, "Policy Response was: %v", pkgPolicyResp) + + runner.T().Log("Polling for endpoint-security to become Healthy") + ctx, cancel = context.WithTimeout(ctx, time.Minute*3) + defer cancel() + + agentClient := runner.fixture.Client() + err = agentClient.Connect(ctx) + require.NoError(runner.T(), err, "could not connect to local agent") + + require.Eventually(runner.T(), + func() bool { return agentAndEndpointAreHealthy(runner.T(), ctx, agentClient) }, + time.Minute*3, + time.Second, + "Endpoint component or units are not healthy.", + ) + +} + +func (runner *EndpointMetricsMonRunner) TestEndpointMetrics() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute*15) + defer cancel() + + agentStatus, err := runner.fixture.ExecStatus(ctx) + require.NoError(runner.T(), err) + + require.Eventually(runner.T(), func() bool { + + query := genESQueryByBinary(agentStatus.Info.ID, runner.endpointID) + res, err := estools.PerformQueryForRawQuery(ctx, query, "metrics-elastic_agent*", runner.info.ESClient) + require.NoError(runner.T(), err) + runner.T().Logf("Fetched metrics for %s, got %d hits", runner.endpointID, res.Hits.Total.Value) + return res.Hits.Total.Value >= 1 + }, time.Minute*10, time.Second*10, "could not fetch component metricsets for endpoint with ID %s and agent ID %s", runner.endpointID, agentStatus.Info.ID) + +} + +func (runner *EndpointMetricsMonRunner) TestEndpointMetricsAfterRestart() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute*15) + defer cancel() + // once we've gotten the first round of metrics,forcably restart endpoint, see if we still get metrics + // This makes sure that the backend coordinator can deal with properly updating the metrics handlers if there's unexpected state changes + + // confine this to linux; the behavior is platform-agnostic, and this way we have `pgrep` + if runtime.GOOS != "linux" { + return + } + + // kill endpoint + cmd := exec.Command("pgrep", "-f", "endpoint") + pgrep, err := cmd.CombinedOutput() + runner.T().Logf("killing pid: %s", string(pgrep)) + + cmd = exec.Command("pkill", "--signal", "SIGKILL", "-f", "endpoint") + _, err = cmd.CombinedOutput() + require.NoError(runner.T(), err) + + // wait for endpoint to come back up. We use `pgrep` + // since the agent health status won't imidately register that the endpoint process itself is gone. + require.Eventually(runner.T(), func() bool { + cmd := exec.Command("pgrep", "-f", "endpoint") + pgrep, err := cmd.CombinedOutput() + runner.T().Logf("found pid: %s", string(pgrep)) + if err == nil { + return true + } + return false + }, time.Minute*2, time.Second) + + // make sure agent still says we're healthy + agentClient := runner.fixture.Client() + err = agentClient.Connect(ctx) + require.NoError(runner.T(), err, "could not connect to local agent") + + require.Eventually(runner.T(), + func() bool { return agentAndEndpointAreHealthy(runner.T(), ctx, agentClient) }, + time.Minute*3, + time.Second, + "Endpoint component or units are not healthy.", + ) + + // catch the time endpoint is restarted, so we can filter for documents after a given time + endpointRestarted := time.Now() + + agentStatus, err := runner.fixture.ExecStatus(ctx) + require.NoError(runner.T(), err) + + // now query again, but make sure we're getting new metrics + require.Eventually(runner.T(), func() bool { + query := genESQueryByDate(agentStatus.Info.ID, runner.endpointID, endpointRestarted.Format(time.RFC3339)) + res, err := estools.PerformQueryForRawQuery(ctx, query, "metrics-elastic_agent*", runner.info.ESClient) + require.NoError(runner.T(), err) + runner.T().Logf("Fetched metrics for %s, got %d hits", runner.endpointID, res.Hits.Total.Value) + return res.Hits.Total.Value >= 1 + }, time.Minute*10, time.Second*10, "could not fetch component metricsets for endpoint with ID %s and agent ID %s", runner.endpointID, agentStatus.Info.ID) +} + +func genESQueryByDate(agentID string, componentID string, dateAfter string) map[string]interface{} { + queryRaw := map[string]interface{}{ + "query": map[string]interface{}{ + "bool": map[string]interface{}{ + "must": []map[string]interface{}{ + { + "match": map[string]interface{}{ + "agent.id": agentID, + }, + }, + { + "match": map[string]interface{}{ + "component.id": componentID, + }, + }, + { + "range": map[string]interface{}{ + "@timestamp": map[string]interface{}{ + "gte": dateAfter, + }, + }, + }, + { + "range": map[string]interface{}{ + "system.process.cpu.total.value": map[string]interface{}{ + "gt": 0, + }, + }, + }, + { + "range": map[string]interface{}{ + "system.process.memory.size": map[string]interface{}{ + "gt": 0, + }, + }, + }, + }, + }, + }, + } + + return queryRaw +} + +func genESQueryByBinary(agentID string, componentID string) map[string]interface{} { + // see https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/server/services/agents/agent_metrics.ts + queryRaw := map[string]interface{}{ + "query": map[string]interface{}{ + "bool": map[string]interface{}{ + "must": []map[string]interface{}{ + { + "match": map[string]interface{}{ + "agent.id": agentID, + }, + }, + { + "match": map[string]interface{}{ + "component.id": componentID, + }, + }, + { + "range": map[string]interface{}{ + "system.process.cpu.total.value": map[string]interface{}{ + "gt": 0, + }, + }, + }, + { + "range": map[string]interface{}{ + "system.process.memory.size": map[string]interface{}{ + "gt": 0, + }, + }, + }, + }, + }, + }, + } + + return queryRaw +} diff --git a/testing/integration/monitoring_probe_preserve_text_cfg_test.go b/testing/integration/monitoring_probe_preserve_text_cfg_test.go new file mode 100644 index 00000000000..55082796105 --- /dev/null +++ b/testing/integration/monitoring_probe_preserve_text_cfg_test.go @@ -0,0 +1,202 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build integration + +package integration + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "net/http" + "testing" + "time" + + "github.com/google/uuid" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/elastic/elastic-agent-libs/kibana" + "github.com/elastic/elastic-agent/pkg/control/v2/cproto" + atesting "github.com/elastic/elastic-agent/pkg/testing" + "github.com/elastic/elastic-agent/pkg/testing/define" + "github.com/elastic/elastic-agent/pkg/testing/tools" +) + +var defaultTextCfg = ` +outputs: + default: + type: elasticsearch + hosts: [127.0.0.1:9200] + api_key: "example-key" + preset: balanced + allow_older_versions: true + +inputs: + - type: system/metrics + id: unique-system-metrics-input + data_stream.namespace: default + use_output: default + streams: + - metricsets: + - cpu + data_stream.dataset: system.cpu + - metricsets: + - memory + data_stream.dataset: system.memory + - metricsets: + - network + data_stream.dataset: system.network + - metricsets: + - filesystem + data_stream.dataset: system.filesystem +agent.monitoring: + http: + enabled: true + port: 6791 +agent.logging.level: debug +agent.logging.to_stderr: true +` + +type MonitoringTextRunner struct { + suite.Suite + info *define.Info + agentFixture *atesting.Fixture + + ESHost string + + healthCheckTime time.Duration + healthCheckRefreshTime time.Duration + + policyID string + policyName string +} + +func TestMonitoringPreserveTextConfig(t *testing.T) { + info := define.Require(t, define.Requirements{ + Group: "fleet", + Stack: &define.Stack{}, + Local: false, // requires Agent installation + Sudo: true, // requires Agent installation + OS: []define.OS{ + {Type: define.Linux}, + {Type: define.Windows}, + }, + }) + + suite.Run(t, &MonitoringTextRunner{info: info, healthCheckTime: time.Minute * 5, healthCheckRefreshTime: time.Second * 5}) +} + +func (runner *MonitoringTextRunner) SetupSuite() { + fixture, err := define.NewFixtureFromLocalBuild(runner.T(), define.Version()) + require.NoError(runner.T(), err) + runner.agentFixture = fixture + + policyUUID := uuid.New().String() + basePolicy := kibana.AgentPolicy{ + Name: "test-policy-" + policyUUID, + Namespace: "default", + Description: "Test policy " + policyUUID, + MonitoringEnabled: []kibana.MonitoringEnabledOption{ + kibana.MonitoringEnabledLogs, + kibana.MonitoringEnabledMetrics, + }, + } + + installOpts := atesting.InstallOpts{ + NonInteractive: true, + Force: true, + Privileged: true, + } + + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute) + defer cancel() + + // write a default config file that enables monitoring + err = runner.agentFixture.WriteFileToWorkDir(ctx, defaultTextCfg, "elastic-agent.yml") + require.NoError(runner.T(), err) + + policyResp, err := tools.InstallAgentWithPolicy(ctx, runner.T(), installOpts, runner.agentFixture, runner.info.KibanaClient, basePolicy) + require.NoError(runner.T(), err) + + runner.policyID = policyResp.ID + runner.policyName = basePolicy.Name + + _, err = tools.InstallPackageFromDefaultFile(ctx, runner.info.KibanaClient, "system", "1.53.1", "system_integration_setup.json", uuid.New().String(), policyResp.ID) + require.NoError(runner.T(), err) +} + +func (runner *MonitoringTextRunner) TestMonitoringLiveness() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute*10) + defer cancel() + + runner.AllComponentsHealthy(ctx) + + client := http.Client{Timeout: time.Second * 4} + endpoint := "http://localhost:6791/processes" + // first stage: ensure the HTTP config has remained up post-install + req, err := http.NewRequestWithContext(ctx, "GET", endpoint, nil) + require.NoError(runner.T(), err) + + initResp, err := client.Do(req) + require.NoError(runner.T(), err) + require.Equal(runner.T(), http.StatusOK, initResp.StatusCode) + + // use the fleet override API to change the port that we're running on. + override := map[string]interface{}{ + "name": runner.policyName, + "namespace": "default", + "overrides": map[string]interface{}{ + "agent": map[string]interface{}{ + "monitoring": map[string]interface{}{ + "http": map[string]interface{}{ + "enabled": true, + "host": "localhost", + "port": 6792, + }, + }, + }, + }, + } + + raw, err := json.Marshal(override) + require.NoError(runner.T(), err) + reader := bytes.NewBuffer(raw) + overrideEndpoint := fmt.Sprintf("/api/fleet/agent_policies/%s", runner.policyID) + statusCode, overrideResp, err := runner.info.KibanaClient.Request("PUT", overrideEndpoint, nil, nil, reader) + require.NoError(runner.T(), err) + require.Equal(runner.T(), http.StatusOK, statusCode, "non-200 status code; got response: %s", string(overrideResp)) + + runner.AllComponentsHealthy(ctx) + + updatedEndpoint := "http://localhost:6792/processes" + // second stage: ensure the HTTP config has updated + req, err = http.NewRequestWithContext(ctx, "GET", updatedEndpoint, nil) + require.NoError(runner.T(), err) + + initResp, err = client.Do(req) + require.NoError(runner.T(), err) + require.Equal(runner.T(), http.StatusOK, initResp.StatusCode) +} + +// AllComponentsHealthy ensures all the beats and agent are healthy and working before we continue +func (runner *MonitoringTextRunner) AllComponentsHealthy(ctx context.Context) { + compDebugName := "" + require.Eventually(runner.T(), func() bool { + allHealthy := true + status, err := runner.agentFixture.ExecStatus(ctx) + + require.NoError(runner.T(), err) + for _, comp := range status.Components { + runner.T().Logf("component state: %s", comp.Message) + if comp.State != int(cproto.State_HEALTHY) { + compDebugName = comp.Name + allHealthy = false + } + } + return allHealthy + }, runner.healthCheckTime, runner.healthCheckRefreshTime, "install never became healthy: components did not return a healthy state: %s", compDebugName) +} diff --git a/testing/integration/monitoring_probe_reload_test.go b/testing/integration/monitoring_probe_reload_test.go new file mode 100644 index 00000000000..9957ce80dde --- /dev/null +++ b/testing/integration/monitoring_probe_reload_test.go @@ -0,0 +1,180 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build integration + +package integration + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "net/http" + "testing" + "time" + + "github.com/google/uuid" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/elastic/elastic-agent-libs/kibana" + "github.com/elastic/elastic-agent/pkg/control/v2/cproto" + atesting "github.com/elastic/elastic-agent/pkg/testing" + "github.com/elastic/elastic-agent/pkg/testing/define" + "github.com/elastic/elastic-agent/pkg/testing/tools" +) + +type MonitoringRunner struct { + suite.Suite + info *define.Info + agentFixture *atesting.Fixture + + ESHost string + + healthCheckTime time.Duration + healthCheckRefreshTime time.Duration + + policyID string + policyName string +} + +func TestMonitoringLivenessReloadable(t *testing.T) { + info := define.Require(t, define.Requirements{ + Group: "fleet", + Stack: &define.Stack{}, + Local: false, // requires Agent installation + Sudo: true, // requires Agent installation + OS: []define.OS{ + {Type: define.Linux}, + {Type: define.Windows}, + }, + }) + + suite.Run(t, &MonitoringRunner{info: info, healthCheckTime: time.Minute * 5, healthCheckRefreshTime: time.Second * 5}) +} + +func (runner *MonitoringRunner) SetupSuite() { + fixture, err := define.NewFixtureFromLocalBuild(runner.T(), define.Version()) + require.NoError(runner.T(), err) + runner.agentFixture = fixture + + policyUUID := uuid.New().String() + basePolicy := kibana.AgentPolicy{ + Name: "test-policy-" + policyUUID, + Namespace: "default", + Description: "Test policy " + policyUUID, + MonitoringEnabled: []kibana.MonitoringEnabledOption{ + kibana.MonitoringEnabledLogs, + kibana.MonitoringEnabledMetrics, + }, + } + + installOpts := atesting.InstallOpts{ + NonInteractive: true, + Force: true, + Privileged: true, + } + + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute) + defer cancel() + + policyResp, err := tools.InstallAgentWithPolicy(ctx, runner.T(), installOpts, runner.agentFixture, runner.info.KibanaClient, basePolicy) + require.NoError(runner.T(), err) + + runner.policyID = policyResp.ID + runner.policyName = basePolicy.Name + + _, err = tools.InstallPackageFromDefaultFile(ctx, runner.info.KibanaClient, "system", "1.53.1", "system_integration_setup.json", uuid.New().String(), policyResp.ID) + require.NoError(runner.T(), err) +} + +func (runner *MonitoringRunner) TestMonitoringLiveness() { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute*10) + defer cancel() + + runner.AllComponentsHealthy(ctx) + + client := http.Client{Timeout: time.Second * 4} + endpoint := "http://localhost:6792/liveness" + // first stage: ensure the default behavior, http monitoring is off. This should return an error + req, err := http.NewRequestWithContext(ctx, "GET", endpoint, nil) + require.NoError(runner.T(), err) + + _, err = client.Do(req) + require.Error(runner.T(), err) + + // use the fleet override API to enable http monitoring. + // This tests both the http server itself, and tests that the agent reloader actually reloads the agent config. + override := map[string]interface{}{ + "name": runner.policyName, + "namespace": "default", + "overrides": map[string]interface{}{ + "agent": map[string]interface{}{ + "monitoring": map[string]interface{}{ + "http": map[string]interface{}{ + "enabled": true, + "host": "localhost", + "port": 6792, + }, + }, + }, + }, + } + + raw, err := json.Marshal(override) + require.NoError(runner.T(), err) + reader := bytes.NewBuffer(raw) + overrideEndpoint := fmt.Sprintf("/api/fleet/agent_policies/%s", runner.policyID) + statusCode, overrideResp, err := runner.info.KibanaClient.Request("PUT", overrideEndpoint, nil, nil, reader) + require.NoError(runner.T(), err) + require.Equal(runner.T(), http.StatusOK, statusCode, "non-200 status code; got response: %s", string(overrideResp)) + + runner.AllComponentsHealthy(ctx) + + // check to make sure that we now have a liveness probe response + req, err = http.NewRequestWithContext(ctx, "GET", endpoint, nil) + require.NoError(runner.T(), err) + + // second check: the /liveness endpoint should now be responding + runner.CheckResponse(ctx, endpoint) + + runner.CheckResponse(ctx, fmt.Sprintf("%s?failon=degraded", endpoint)) + + runner.CheckResponse(ctx, fmt.Sprintf("%s?failon=failed", endpoint)) + + runner.CheckResponse(ctx, fmt.Sprintf("%s?failon=heartbeat", endpoint)) +} + +// CheckResponse checks to see if the liveness probe returns a 200 +func (runner *MonitoringRunner) CheckResponse(ctx context.Context, endpoint string) { + req, err := http.NewRequestWithContext(ctx, "GET", endpoint, nil) + require.NoError(runner.T(), err) + + client := http.Client{Timeout: time.Second * 4} + + livenessResp, err := client.Do(req) + require.NoError(runner.T(), err) + defer livenessResp.Body.Close() + require.Equal(runner.T(), http.StatusOK, livenessResp.StatusCode) // this is effectively the check for the test +} + +// AllComponentsHealthy ensures all the beats and agent are healthy and working before we continue +func (runner *MonitoringRunner) AllComponentsHealthy(ctx context.Context) { + compDebugName := "" + require.Eventually(runner.T(), func() bool { + allHealthy := true + status, err := runner.agentFixture.ExecStatus(ctx) + + require.NoError(runner.T(), err) + for _, comp := range status.Components { + runner.T().Logf("component state: %s", comp.Message) + if comp.State != int(cproto.State_HEALTHY) { + compDebugName = comp.Name + allHealthy = false + } + } + return allHealthy + }, runner.healthCheckTime, runner.healthCheckRefreshTime, "install never became healthy: components did not return a healthy state: %s", compDebugName) +} diff --git a/testing/integration/otel_test.go b/testing/integration/otel_test.go index 362050bf431..962f0feba04 100644 --- a/testing/integration/otel_test.go +++ b/testing/integration/otel_test.go @@ -128,7 +128,7 @@ func TestOtelFileProcessing(t *testing.T) { cfgFilePath := filepath.Join(tempDir, "otel.yml") require.NoError(t, os.WriteFile(cfgFilePath, []byte(fileProcessingConfig), 0600)) - fixture, err := define.NewFixture(t, define.Version(), aTesting.WithAdditionalArgs([]string{"--config", cfgFilePath})) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version(), aTesting.WithAdditionalArgs([]string{"--config", cfgFilePath})) require.NoError(t, err) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) @@ -136,6 +136,9 @@ func TestOtelFileProcessing(t *testing.T) { err = fixture.Prepare(ctx, fakeComponent, fakeShipper) require.NoError(t, err) + // remove elastic-agent.yml, otel should be independent + require.NoError(t, os.Remove(filepath.Join(fixture.WorkDir(), "elastic-agent.yml"))) + var fixtureWg sync.WaitGroup fixtureWg.Add(1) go func() { @@ -199,12 +202,14 @@ func validateCommandIsWorking(t *testing.T, ctx context.Context, fixture *aTesti require.NoError(t, os.WriteFile(cfgFilePath, []byte(fileProcessingConfig), 0600)) // check `elastic-agent otel validate` command works for otel config - out, err := fixture.Exec(ctx, []string{"otel", "validate", "--config", cfgFilePath}) + cmd, err := fixture.PrepareAgentCommand(ctx, []string{"otel", "validate", "--config", cfgFilePath}) + require.NoError(t, err) + + err = cmd.Run() require.NoError(t, err) - require.Equal(t, 0, len(out)) // no error printed out // check feature gate works - out, err = fixture.Exec(ctx, []string{"otel", "validate", "--config", cfgFilePath, "--feature-gates", "foo.bar"}) + out, err := fixture.Exec(ctx, []string{"otel", "validate", "--config", cfgFilePath, "--feature-gates", "foo.bar"}) require.Error(t, err) require.Contains(t, string(out), `no such feature gate "foo.bar"`) @@ -245,7 +250,7 @@ func TestOtelAPMIngestion(t *testing.T) { require.NoError(t, os.WriteFile(cfgFilePath, []byte(apmConfig), 0600)) require.NoError(t, os.WriteFile(filepath.Join(tempDir, fileName), []byte{}, 0600)) - fixture, err := define.NewFixture(t, define.Version(), aTesting.WithAdditionalArgs([]string{"--config", cfgFilePath})) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version(), aTesting.WithAdditionalArgs([]string{"--config", cfgFilePath})) require.NoError(t, err) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) diff --git a/testing/integration/package_version_test.go b/testing/integration/package_version_test.go index ce465c8bf6a..575b0cd99a3 100644 --- a/testing/integration/package_version_test.go +++ b/testing/integration/package_version_test.go @@ -37,7 +37,7 @@ func TestPackageVersion(t *testing.T) { Local: true, }) - f, err := define.NewFixture(t, define.Version()) + f, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) @@ -68,7 +68,7 @@ func TestComponentBuildHashInDiagnostics(t *testing.T) { }) ctx := context.Background() - f, err := define.NewFixture(t, define.Version()) + f, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err, "could not create new fixture") err = f.Prepare(ctx) @@ -124,25 +124,25 @@ func TestComponentBuildHashInDiagnostics(t *testing.T) { 5*time.Minute, 10*time.Second, "agent never became healthy. Last status: %v", &stateBuff) - filebeat := "filebeat" + agentbeat := "agentbeat" if runtime.GOOS == "windows" { - filebeat += ".exe" + agentbeat += ".exe" } wd := f.WorkDir() - glob := filepath.Join(wd, "data", "elastic-agent-*", "components", filebeat) + glob := filepath.Join(wd, "data", "elastic-agent-*", "components", agentbeat) compPaths, err := filepath.Glob(glob) - require.NoErrorf(t, err, "failed to glob filebeat path pattern %q", glob) + require.NoErrorf(t, err, "failed to glob agentbeat path pattern %q", glob) require.Lenf(t, compPaths, 1, - "glob pattern \"%s\": found %d paths to filebeat, can only have 1", + "glob pattern \"%s\": found %d paths to agentbeat, can only have 1", glob, len(compPaths)) - cmdVer := exec.Command(compPaths[0], "version") + cmdVer := exec.Command(compPaths[0], "filebeat", "version") output, err = cmdVer.CombinedOutput() require.NoError(t, err, "failed to get filebeat version") outStr := string(output) // version output example: - // filebeat version 8.13.0 (amd64), libbeat 8.13.0 [0baedd2518bd7e5b78e2280684580cbfdcab5ae8 built 2024-01-23 06:57:37 +0000 UTC + // filebeat version 8.14.0 (arm64), libbeat 8.14.0 [ab27a657e4f15976c181cf44c529bba6159f2c64 built 2024-04-17 18:13:16 +0000 UTC] t.Log("parsing commit hash from filebeat version: ", outStr) splits := strings.Split(outStr, "[") require.Lenf(t, splits, 2, @@ -160,8 +160,13 @@ func TestComponentBuildHashInDiagnostics(t *testing.T) { diag := t.TempDir() extractZipArchive(t, diagZip, diag) - stateYAML, err := os.Open(filepath.Join(diag, "state.yaml")) + stateFilePath := filepath.Join(diag, "state.yaml") + stateYAML, err := os.Open(stateFilePath) require.NoError(t, err, "could not open diagnostics state.yaml") + defer func(stateYAML *os.File) { + err := stateYAML.Close() + assert.NoErrorf(t, err, "error closing %q", stateFilePath) + }(stateYAML) state := struct { Components []struct { diff --git a/testing/integration/proxy_url_test.go b/testing/integration/proxy_url_test.go index 8ef29cecd2a..bca27fcf406 100644 --- a/testing/integration/proxy_url_test.go +++ b/testing/integration/proxy_url_test.go @@ -8,431 +8,772 @@ package integration import ( "context" - "errors" - "fmt" + "crypto/tls" + "crypto/x509" + "net" + "net/url" + "os" + "path/filepath" + "runtime" "strings" "testing" "time" + "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gopkg.in/yaml.v2" + "github.com/elastic/elastic-agent-libs/testing/certutil" integrationtest "github.com/elastic/elastic-agent/pkg/testing" "github.com/elastic/elastic-agent/pkg/testing/define" "github.com/elastic/elastic-agent/pkg/testing/tools/check" "github.com/elastic/elastic-agent/pkg/testing/tools/testcontext" "github.com/elastic/elastic-agent/testing/fleetservertest" "github.com/elastic/elastic-agent/testing/proxytest" - "github.com/elastic/elastic-agent/version" ) -type ProxyURL struct { - fixture *integrationtest.Fixture - - agentVersion string - fleet *fleetservertest.Server - // fleetNeedsProxyHost is the fleetHost to be set on the agent's enroll. - // It uses an invalid host so the agent won't be able to connect to fleet - // unless it's using a proxy. - fleetNeedsProxyHost string - proxy1 *proxytest.Proxy - proxy2 *proxytest.Proxy - checkinWithAcker *fleetservertest.CheckinActionsWithAcker - policyData fleetservertest.TmplPolicy -} - -func SetupTest(t *testing.T) *ProxyURL { - t.Helper() - p := &ProxyURL{agentVersion: version.Agent + "-SNAPSHOT"} - fleetHost := "fleet.elastic.co" - - p.fleetNeedsProxyHost = "http://" + fleetHost - p.setupFleet(t, p.fleetNeedsProxyHost) - - p.proxy1 = proxytest.New(t, - proxytest.WithRewrite(fleetHost, "localhost:"+p.fleet.Port), - proxytest.WithRequestLog("proxy-1", t.Logf), - proxytest.WithVerboseLog()) - p.proxy2 = proxytest.New(t, - proxytest.WithRewrite(fleetHost, "localhost:"+p.fleet.Port), - proxytest.WithRequestLog("proxy-2", t.Logf), - proxytest.WithVerboseLog()) - - f, err := define.NewFixture(t, - p.agentVersion, - integrationtest.WithAllowErrors(), - integrationtest.WithLogOutput()) - require.NoError(t, err, "SetupTest: NewFixture failed") - - ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) - defer cancel() - - err = f.Prepare(ctx) - require.NoError(t, err, "SetupTest: fixture.Prepare failed") - - p.fixture = f - return p -} - -func TearDownTest(t *testing.T, p *ProxyURL) { - t.Helper() - if p.fixture == nil { - return // nothing to do - } - - ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) - defer cancel() - - out, err := p.fixture.Uninstall(ctx, - &integrationtest.UninstallOpts{Force: true}) - if err != nil && - !errors.Is(err, integrationtest.ErrNotInstalled) && - !strings.Contains(err.Error(), "no such file or directory") { - t.Log(string(out)) - require.NoError(t, err, "TearDownTest: failed to uninstall agent") - } -} - -func TestProxyURL_EnrollProxyAndNoProxyInThePolicy(t *testing.T) { +func TestProxyURL(t *testing.T) { _ = define.Require(t, define.Requirements{ Group: Fleet, Local: false, Sudo: true, }) - t.Skip("Flaky test: https://github.com/elastic/elastic-agent/issues/3154") - - p := SetupTest(t) - t.Cleanup(func() { - TearDownTest(t, p) - }) - ackToken := "ackToken-AckTokenTestNoProxyInThePolicy" - - // now that we have fleet and the proxy running, we can add actions which - // depend on them. - action, err := fleetservertest.NewActionWithEmptyPolicyChange( - "actionID-TestNoProxyInThePolicyActionID", p.policyData) - require.NoError(t, err, "could not generate action with policy") - p.checkinWithAcker.AddCheckin( - ackToken, - 0, - action, - ) - - ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) - defer cancel() - - out, err := p.fixture.Install( - ctx, - &integrationtest.InstallOpts{ - Force: true, - NonInteractive: true, - Insecure: true, - ProxyURL: p.proxy1.LocalhostURL, - EnrollOpts: integrationtest.EnrollOpts{ - URL: p.fleetNeedsProxyHost, - EnrollmentToken: "anythingWillDO", - }}) - if err != nil { - t.Log(string(out)) - require.NoError(t, err, "failed to install agent") + // Setup proxies and fake fleet server host we are gonna rewrite + unreachableFleetHost := "fleet.elastic.co" + unreachableFleetHttpURL := "http://" + unreachableFleetHost + unreachableFleetHttpsURL := "https://" + unreachableFleetHost + + // mockFleetComponents is a struct that holds all the mock fleet stuff in a nice single unit (easier to pass around). + // all the fields are initialized in the main test loop + type mockFleetComponents struct { + fleetServer *fleetservertest.Server + policyData *fleetservertest.TmplPolicy + checkinWithAcker *fleetservertest.CheckinActionsWithAcker } - check.ConnectedToFleet(ctx, t, p.fixture, 5*time.Minute) -} - -func TestProxyURL_EnrollProxyAndEmptyProxyInThePolicy(t *testing.T) { - _ = define.Require(t, define.Requirements{ - Group: Fleet, - Local: false, - Sudo: true, - }) - t.Skip("Flaky test: https://github.com/elastic/elastic-agent/issues/3154") - - p := SetupTest(t) - t.Cleanup(func() { - TearDownTest(t, p) - }) - - ackToken := "AckToken-TestEmptyProxyInThePolicy" - - p.policyData.FleetProxyURL = new(string) - *p.policyData.FleetProxyURL = "" - // now that we have fleet and the proxy running, we can add actions which - // depend on them. - action, err := fleetservertest.NewActionWithEmptyPolicyChange( - "actionID-TestEmptyProxyInThePolicy", p.policyData) - require.NoError(t, err, "could not generate action with policy") - p.checkinWithAcker.AddCheckin( - ackToken, - 0, - action, - ) - - ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) - defer cancel() - - out, err := p.fixture.Install( - ctx, - &integrationtest.InstallOpts{ - Force: true, - NonInteractive: true, - Insecure: true, - ProxyURL: p.proxy1.LocalhostURL, - EnrollOpts: integrationtest.EnrollOpts{ - URL: p.fleetNeedsProxyHost, - EnrollmentToken: "anythingWillDO", - }}) - if err != nil { - t.Log(string(out)) - require.NoError(t, err, "failed to install agent") + type installArgs struct { + insecure bool + enrollmentURL string + certificateAuthorities []string + certificate string + key string + proxyURL string } - check.ConnectedToFleet(ctx, t, p.fixture, 5*time.Minute) -} - -func TestProxyURL_ProxyInThePolicyTakesPrecedence(t *testing.T) { - _ = define.Require(t, define.Requirements{ - Group: Fleet, - Local: false, - Sudo: true, - }) - t.Skip("Flaky test: https://github.com/elastic/elastic-agent/issues/3154") + // setupFunc is a hook used by testcases to set up proxies and add data/behaviors to fleet policy and checkinAcker + // the test will use the installArgs to pass arguments to the elastic-agent install command + type setupFunc func(t *testing.T, mockFleet *mockFleetComponents) (proxies map[string]*proxytest.Proxy, enrollArgs installArgs) - p := SetupTest(t) - t.Cleanup(func() { - TearDownTest(t, p) - }) + // assertFunc is the hook the main test loop calls for performing assertions after the agent has been installed and is healthy + type assertFunc func(ctx context.Context, t *testing.T, fixture *integrationtest.Fixture, proxies map[string]*proxytest.Proxy, mockFleet *mockFleetComponents) - ackToken := "AckToken-TestValidProxyInThePolicy" - - p.policyData.FleetProxyURL = new(string) - *p.policyData.FleetProxyURL = p.proxy2.LocalhostURL - // now that we have fleet and the proxy running, we can add actions which - // depend on them. - action, err := fleetservertest.NewActionWithEmptyPolicyChange( - "actionID-TestValidProxyInThePolicy", p.policyData) - require.NoError(t, err, "could not generate action with policy") - p.checkinWithAcker.AddCheckin( - ackToken, - 0, - action, - ) - - ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) - defer cancel() - - out, err := p.fixture.Install( - ctx, - &integrationtest.InstallOpts{ - Force: true, - NonInteractive: true, - Insecure: true, - ProxyURL: p.proxy1.LocalhostURL, - EnrollOpts: integrationtest.EnrollOpts{ - URL: p.fleetNeedsProxyHost, - EnrollmentToken: "anythingWillDO", - }}) - if err != nil { - t.Log(string(out)) - require.NoError(t, err, "failed to install agent") + type testcase struct { + name string + setup setupFunc + wantErr assert.ErrorAssertionFunc + assertFunc assertFunc } - check.ConnectedToFleet(ctx, t, p.fixture, 5*time.Minute) + testcases := []testcase{ + { + name: "EnrollWithProxy-NoProxyInPolicy", + setup: func(t *testing.T, mockFleet *mockFleetComponents) (proxies map[string]*proxytest.Proxy, enrollArgs installArgs) { + + // Create and start fake proxy + proxy := proxytest.New(t, + proxytest.WithRewrite(unreachableFleetHost, "localhost:"+mockFleet.fleetServer.Port), + proxytest.WithRequestLog("proxy", t.Logf), + proxytest.WithVerboseLog()) + err := proxy.Start() + require.NoError(t, err, "error starting proxy") + t.Cleanup(proxy.Close) + + // now that we have fleet and the proxy running, we can add actions which + // depend on them. + action, err := fleetservertest.NewActionWithEmptyPolicyChange( + "actionID-TestNoProxyInThePolicyActionID", *mockFleet.policyData) + require.NoError(t, err, "could not generate action with policy") + + // Create checkin action with respective ack token + ackToken := "ackToken-AckTokenTestNoProxyInThePolicy" + mockFleet.checkinWithAcker.AddCheckin( + ackToken, + 0, + action, + ) + + return map[string]*proxytest.Proxy{"proxy": proxy}, installArgs{insecure: true, proxyURL: proxy.LocalhostURL, enrollmentURL: unreachableFleetHttpURL} + }, + wantErr: assert.NoError, + assertFunc: func(ctx context.Context, t *testing.T, fixture *integrationtest.Fixture, _ map[string]*proxytest.Proxy, _ *mockFleetComponents) { + check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute) + }, + }, + { + name: "EnrollWithProxy-EmptyProxyInPolicy", + setup: func(t *testing.T, mockFleet *mockFleetComponents) (proxies map[string]*proxytest.Proxy, enrollArgs installArgs) { + + // set FleetProxyURL to empty string in the policy + mockFleet.policyData.FleetProxyURL = new(string) + // FIXME: this reassignment is pointless ? + *mockFleet.policyData.FleetProxyURL = "" + + // Create and start fake proxy + proxy := proxytest.New(t, + proxytest.WithRewrite(unreachableFleetHost, "localhost:"+mockFleet.fleetServer.Port), + proxytest.WithRequestLog("proxy", t.Logf), + proxytest.WithVerboseLog()) + err := proxy.Start() + require.NoError(t, err, "error starting proxy") + t.Cleanup(proxy.Close) + + // now that we have fleet and the proxy running, we can add actions which + // depend on them. + ackToken := "ackToken-AckTokenTestNoProxyInThePolicy" + action, err := fleetservertest.NewActionWithEmptyPolicyChange( + "actionID-TestNoProxyInThePolicyActionID", *mockFleet.policyData) + require.NoError(t, err, "could not generate action with policy") + mockFleet.checkinWithAcker.AddCheckin( + ackToken, + 0, + action, + ) + + return map[string]*proxytest.Proxy{"proxy": proxy}, installArgs{insecure: true, proxyURL: proxy.LocalhostURL, enrollmentURL: unreachableFleetHttpURL} + }, + wantErr: assert.NoError, + assertFunc: func(ctx context.Context, t *testing.T, fixture *integrationtest.Fixture, proxies map[string]*proxytest.Proxy, mockFleet *mockFleetComponents) { + check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute) + }, + }, + { + name: "EnrollWithProxy-PolicyProxyTakesPrecedence", + setup: func(t *testing.T, mockFleet *mockFleetComponents) (proxies map[string]*proxytest.Proxy, enrollArgs installArgs) { + + // We need 2 proxies: one for the initial enroll and another to specify in the policy + proxyEnroll := proxytest.New(t, + proxytest.WithRewrite(unreachableFleetHost, "localhost:"+mockFleet.fleetServer.Port), + proxytest.WithRequestLog("proxy-enroll", t.Logf), + proxytest.WithVerboseLog()) + proxyEnroll.Start() + t.Cleanup(proxyEnroll.Close) + proxyFleetPolicy := proxytest.New(t, + proxytest.WithRewrite(unreachableFleetHost, "localhost:"+mockFleet.fleetServer.Port), + proxytest.WithRequestLog("proxy-fleet-policy", t.Logf), + proxytest.WithVerboseLog()) + proxyFleetPolicy.Start() + t.Cleanup(proxyFleetPolicy.Close) + + // set the proxy URL in policy to proxyFleetPolicy + mockFleet.policyData.FleetProxyURL = new(string) + *mockFleet.policyData.FleetProxyURL = proxyFleetPolicy.LocalhostURL + + // now that we have fleet and the proxy running, we can add actions which + // depend on them. + action, err := fleetservertest.NewActionWithEmptyPolicyChange( + "actionID-TestValidProxyInThePolicy", *mockFleet.policyData) + require.NoError(t, err, "could not generate action with policy") + + ackToken := "AckToken-TestValidProxyInThePolicy" + mockFleet.checkinWithAcker.AddCheckin( + ackToken, + 0, + action, + ) + + return map[string]*proxytest.Proxy{"enroll": proxyEnroll, "policy": proxyFleetPolicy}, installArgs{insecure: true, enrollmentURL: unreachableFleetHttpURL, proxyURL: proxyEnroll.LocalhostURL} + }, + wantErr: assert.NoError, + assertFunc: func(ctx context.Context, t *testing.T, fixture *integrationtest.Fixture, proxies map[string]*proxytest.Proxy, mockFleet *mockFleetComponents) { + check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute) + + // ensure the agent is communicating through the proxy set in the policy + want := fleetservertest.NewPathCheckin(mockFleet.policyData.AgentID) + assert.Eventually(t, func() bool { + for _, r := range proxies["policy"].ProxiedRequests() { + if strings.Contains(r, want) { + return true + } + } + + return false + }, 5*time.Minute, 5*time.Second, + "did not find requests to the proxy defined in the policy. Want [%s] on %v", + proxies["policy"].LocalhostURL, proxies["policy"].ProxiedRequests()) + }, + }, + { + name: "NoEnrollProxy-ProxyInThePolicy", + setup: func(t *testing.T, mockFleet *mockFleetComponents) (proxies map[string]*proxytest.Proxy, enrollArgs installArgs) { + + // Create a fake proxy to be used in fleet policy + proxyFleetPolicy := proxytest.New(t, + proxytest.WithRewrite(unreachableFleetHost, "localhost:"+mockFleet.fleetServer.Port), // this is needed as we pass an unreachable host in policy + proxytest.WithRequestLog("proxy-fleet-policy", t.Logf), + proxytest.WithVerboseLog()) + proxyFleetPolicy.Start() + t.Cleanup(proxyFleetPolicy.Close) + + s := proxyFleetPolicy.LocalhostURL + mockFleet.policyData.FleetProxyURL = &s + // now that we have fleet and the proxy running, we can add actions which + // depend on them. + action, err := fleetservertest.NewActionWithEmptyPolicyChange( + "actionID-TestValidProxyInThePolicy", *mockFleet.policyData) + require.NoError(t, err, "could not generate action with policy") + + ackToken := "AckToken-TestValidProxyInThePolicy" + mockFleet.checkinWithAcker.AddCheckin( + ackToken, + 0, + action, + ) + return map[string]*proxytest.Proxy{"proxyFleetPolicy": proxyFleetPolicy}, installArgs{insecure: true, enrollmentURL: mockFleet.fleetServer.LocalhostURL} + }, + wantErr: assert.NoError, + assertFunc: func(ctx context.Context, t *testing.T, fixture *integrationtest.Fixture, proxies map[string]*proxytest.Proxy, mockFleet *mockFleetComponents) { + check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute) + + // ensure the agent is communicating through the new proxy + if !assert.Eventually(t, func() bool { + proxy := proxies["proxyFleetPolicy"] + for _, r := range proxy.ProxiedRequests() { + if strings.Contains( + r, + fleetservertest.NewPathCheckin(mockFleet.policyData.AgentID)) { + return true + } + } + + return false + }, 5*time.Minute, 5*time.Second) { + t.Errorf("did not find requests to the proxy defined in the policy") + } + }, + }, + { + name: "NoEnrollProxy-RemoveProxyFromThePolicy", + setup: func(t *testing.T, mockFleet *mockFleetComponents) (proxies map[string]*proxytest.Proxy, enrollArgs installArgs) { + // Create a fake proxy to use in initial fleet policy + proxyFleetPolicy := proxytest.New(t, + proxytest.WithRewrite(unreachableFleetHost, "localhost:"+mockFleet.fleetServer.Port), + proxytest.WithRequestLog("proxy-fleet-policy", t.Logf), + proxytest.WithVerboseLog()) + proxyFleetPolicy.Start() + t.Cleanup(proxyFleetPolicy.Close) + + mockFleet.policyData.FleetProxyURL = new(string) + *mockFleet.policyData.FleetProxyURL = proxyFleetPolicy.LocalhostURL + + // now that we have fleet and the proxy running, we can add actions which + // depend on them. + action, err := fleetservertest.NewActionWithEmptyPolicyChange( + "actionID-TestRemoveProxyFromThePolicy", *mockFleet.policyData) + require.NoError(t, err, "could not generate action with policy") + + ackToken := "AckToken-TestRemoveProxyFromThePolicy" + mockFleet.checkinWithAcker.AddCheckin( + ackToken, + 0, + action, + ) + + return map[string]*proxytest.Proxy{"fleetProxy": proxyFleetPolicy}, installArgs{insecure: true, enrollmentURL: mockFleet.fleetServer.LocalhostURL} + }, + wantErr: assert.NoError, + assertFunc: func(ctx context.Context, t *testing.T, fixture *integrationtest.Fixture, proxies map[string]*proxytest.Proxy, mockFleet *mockFleetComponents) { + // assert the agent is actually connected to fleet. + check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute) + + // ensure the agent is communicating through the proxy set in the policy + if !assert.Eventually(t, func() bool { + for _, r := range proxies["fleetProxy"].ProxiedRequests() { + if strings.Contains( + r, + fleetservertest.NewPathCheckin(mockFleet.policyData.AgentID)) { + return true + } + } + + return false + }, 5*time.Minute, 5*time.Second) { + t.Errorf("did not find requests to the proxy defined in the policy") + } + + // Assert the proxy is set on the agent + inspect, err := fixture.ExecInspect(ctx) + require.NoError(t, err) + assert.Equal(t, *mockFleet.policyData.FleetProxyURL, inspect.Fleet.ProxyURL) + + // remove proxy from the policy + want := *mockFleet.policyData.FleetProxyURL + mockFleet.policyData.FleetProxyURL = nil + actionIDRemoveProxyFromPolicy := "actionIDRemoveProxyFromPolicy-actionID-TestRemoveProxyFromThePolicy" + action, err := fleetservertest.NewActionWithEmptyPolicyChange( + actionIDRemoveProxyFromPolicy, *mockFleet.policyData) + require.NoError(t, err, "could not generate action with policy") + + ackToken := "AckToken-TestRemovedProxyFromThePolicy" + mockFleet.checkinWithAcker.AddCheckin( + ackToken, + 0, + action, + ) + + // ensures the agent acked the action sending a policy without proxy + require.Eventually(t, func() bool { + return mockFleet.checkinWithAcker.Acked(actionIDRemoveProxyFromPolicy) + }, + 30*time.Second, 5*time.Second) + inspect, err = fixture.ExecInspect(ctx) + require.NoError(t, err) + assert.Equal(t, inspect.Fleet.ProxyURL, want) + + // assert, again, the agent is actually connected to fleet. + check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute) + }, + }, + { + name: "NoEnrollProxy-TLSProxyWithCAInThePolicy", + setup: func(t *testing.T, mockFleet *mockFleetComponents) (proxies map[string]*proxytest.Proxy, enrollArgs installArgs) { + tmpDir := createTempDir(t) + + caKey, caCert, pair, err := certutil.NewRootCA() + require.NoError(t, err, "failed creating CA root") + + caCertFile := filepath.Join(tmpDir, "ca.cert") + err = os.WriteFile(caCertFile, pair.Cert, 0o644&os.ModePerm) + require.NoError(t, err, "failed writing CA cert file %q", caCertFile) + + caCertPool := x509.NewCertPool() + caCertPool.AddCert(caCert) + + proxyCert, _, err := certutil.GenerateChildCert("localhost", []net.IP{net.IPv6loopback, net.IPv6zero, net.ParseIP("127.0.0.1")}, caKey, caCert) + + // Create a fake proxy with TLS config to be used in fleet policy + proxyFleetPolicy := proxytest.New(t, + proxytest.WithRewrite(unreachableFleetHost, "localhost:"+mockFleet.fleetServer.Port), + proxytest.WithRequestLog("proxy-fleet-policy", t.Logf), + proxytest.WithVerboseLog(), + proxytest.WithServerTLSConfig(&tls.Config{ + RootCAs: caCertPool, + Certificates: []tls.Certificate{ + { + Certificate: proxyCert.Certificate, + PrivateKey: proxyCert.PrivateKey, + Leaf: proxyCert.Leaf, + }, + }, + })) + err = proxyFleetPolicy.StartTLS() + require.NoError(t, err, "error starting TLS-enabled proxy") + t.Cleanup(proxyFleetPolicy.Close) + + mockFleet.policyData.FleetProxyURL = &proxyFleetPolicy.LocalhostURL + mockFleet.policyData.SSL = &fleetservertest.SSL{ + CertificateAuthorities: []string{caCertFile}, + Renegotiation: "never", + } + // now that we have fleet and the proxy running, we can add actions which + // depend on them. + action, err := fleetservertest.NewActionWithEmptyPolicyChange( + "actionID-TestValidProxyInThePolicy", *mockFleet.policyData) + require.NoError(t, err, "could not generate action with policy") + + ackToken := "AckToken-TestValidProxyInThePolicy" + mockFleet.checkinWithAcker.AddCheckin( + ackToken, + 0, + action, + ) + return map[string]*proxytest.Proxy{"proxyFleetPolicy": proxyFleetPolicy}, installArgs{insecure: true, enrollmentURL: mockFleet.fleetServer.LocalhostURL} + }, + wantErr: assert.NoError, + assertFunc: func(ctx context.Context, t *testing.T, fixture *integrationtest.Fixture, proxies map[string]*proxytest.Proxy, mockFleet *mockFleetComponents) { + // assert the agent is actually connected to fleet. + check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute) + + // ensure the agent is communicating through the proxy set in the policy + if !assert.Eventually(t, func() bool { + for _, r := range proxies["proxyFleetPolicy"].ProxiedRequests() { + if strings.Contains( + r, + fleetservertest.NewPathCheckin(mockFleet.policyData.AgentID)) { + return true + } + } + + return false + }, 5*time.Minute, 5*time.Second) { + t.Errorf("did not find requests to the proxy defined in the policy") + } + + inspectOutput, err := fixture.Exec(ctx, []string{"inspect"}) + assert.NoError(t, err, "error running elastic-agent inspect") + t.Logf("elastic-agent inspect output:\n%s\n", string(inspectOutput)) + }, + }, + { + name: "NoEnrollProxy-mTLSProxyInThePolicy", + setup: func(t *testing.T, mockFleet *mockFleetComponents) (proxies map[string]*proxytest.Proxy, enrollArgs installArgs) { + + tmpDir := createTempDir(t) + + serverCAKey, serverCACert, serverPair, err := certutil.NewRootCA() + require.NoError(t, err, "failed creating root CA") + + serverCACertFile := filepath.Join(tmpDir, "server_ca.cert") + err = os.WriteFile(serverCACertFile, serverPair.Cert, 0o644&os.ModePerm) + require.NoError(t, err, "failed writing Server CA cert file %q", serverCACertFile) + + clientCAKey, clientCACert, clientPair, err := certutil.NewRootCA() + require.NoError(t, err, "failed creating root CA") + + clientCACertFile := filepath.Join(tmpDir, "client_ca.cert") + err = os.WriteFile(clientCACertFile, clientPair.Cert, 0o644&os.ModePerm) + require.NoError(t, err, "failed writing Client CA cert file %q", clientCACertFile) + + // server CA certpool + serverCACertPool := x509.NewCertPool() + serverCACertPool.AddCert(serverCACert) + + // the server must trust the client CA + clientCACertPool := x509.NewCertPool() + clientCACertPool.AddCert(clientCACert) + + proxyCert, _, err := certutil.GenerateChildCert("localhost", []net.IP{net.IPv6loopback, net.IPv6zero, net.ParseIP("127.0.0.1")}, serverCAKey, serverCACert) + + // Create a fake proxy with mTLS config to be used in fleet policy + proxyFleetPolicy := proxytest.New(t, + proxytest.WithRewrite(unreachableFleetHost, "localhost:"+mockFleet.fleetServer.Port), + proxytest.WithRequestLog("proxy-fleet-policy", t.Logf), + proxytest.WithVerboseLog(), + proxytest.WithServerTLSConfig(&tls.Config{ + Certificates: []tls.Certificate{ + { + Certificate: proxyCert.Certificate, + PrivateKey: proxyCert.PrivateKey, + Leaf: proxyCert.Leaf, + }, + }, + // require client auth with a trusted Cert + ClientAuth: tls.RequireAndVerifyClientCert, + ClientCAs: clientCACertPool, + RootCAs: serverCACertPool, + })) + err = proxyFleetPolicy.StartTLS() + require.NoError(t, err, "error starting TLS-enabled proxy") + t.Cleanup(proxyFleetPolicy.Close) + + // generate a certificate for elastic-agent from the client CA + _, agentPair, err := certutil.GenerateChildCert("localhost", []net.IP{net.IPv6loopback, net.IPv6zero, net.ParseIP("127.0.0.1")}, clientCAKey, clientCACert) + + mockFleet.policyData.FleetProxyURL = &proxyFleetPolicy.LocalhostURL + mockFleet.policyData.SSL = &fleetservertest.SSL{ + CertificateAuthorities: []string{string(serverPair.Cert)}, + Renegotiation: "never", + Certificate: string(agentPair.Cert), + Key: string(agentPair.Key), + } + // now that we have fleet and the proxy running, we can add actions which + // depend on them. + action, err := fleetservertest.NewActionWithEmptyPolicyChange( + "actionID-TestValidProxyInThePolicy", *mockFleet.policyData) + require.NoError(t, err, "could not generate action with policy") + + ackToken := "AckToken-TestValidProxyInThePolicy" + mockFleet.checkinWithAcker.AddCheckin( + ackToken, + 0, + action, + ) + return map[string]*proxytest.Proxy{"proxyFleetPolicy": proxyFleetPolicy}, installArgs{insecure: true, enrollmentURL: mockFleet.fleetServer.LocalhostURL} + }, + wantErr: assert.NoError, + assertFunc: func(ctx context.Context, t *testing.T, fixture *integrationtest.Fixture, proxies map[string]*proxytest.Proxy, mockFleet *mockFleetComponents) { + // assert the agent is actually connected to fleet. + check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute) + + // ensure the agent is communicating through the proxy set in the policy + if !assert.Eventually(t, func() bool { + for _, r := range proxies["proxyFleetPolicy"].ProxiedRequests() { + if strings.Contains( + r, + fleetservertest.NewPathCheckin(mockFleet.policyData.AgentID)) { + return true + } + } + + return false + }, 5*time.Minute, 5*time.Second) { + t.Errorf("did not find requests to the proxy defined in the policy") + } + + inspectOutput, err := fixture.ExecInspect(ctx) + if assert.NoError(t, err, "error running elastic-agent inspect") { + inspectYaml, _ := yaml.Marshal(inspectOutput) + t.Logf("elastic-agent inspect output:\n%s\n", string(inspectYaml)) + } + + }, + }, + { + name: "TLSEnrollProxy-mTLSProxyInThePolicy", + setup: func(t *testing.T, mockFleet *mockFleetComponents) (proxies map[string]*proxytest.Proxy, enrollArgs installArgs) { + + t.Skip("Currently skipped due to https proxy -> http fleet issues. See issues https://github.com/elastic/elastic-agent/issues/4896 and https://github.com/elastic/elastic-agent/issues/4903") + + tmpDir := createTempDir(t) + + // Setups 2 proxies: + // - 1 enroll proxy with simple TLS enabled to be used for enrolling with certificate from enroll CA + // - 1 fleet proxy with mTLS enabled from policy CA to be included in the Policy along with the CAs, agent certificate and key + + // enroll proxy CA + enrollProxyCAKey, enrollProxyCACert, enrollProxyPair, err := certutil.NewRootCA() + require.NoError(t, err, "failed creating enroll proxy root CA") + + enrollProxyCACertFile := filepath.Join(tmpDir, "enroll_proxy_ca.cert") + err = os.WriteFile(enrollProxyCACertFile, enrollProxyPair.Cert, 0o644&os.ModePerm) + require.NoError(t, err, "failed writing enroll proxy CA cert file %q", enrollProxyCACertFile) + + // Create a fake proxy with TLS config to be used during enroll + enrollProxyCert, _, err := certutil.GenerateChildCert("localhost", []net.IP{net.IPv6loopback, net.IPv6zero, net.ParseIP("127.0.0.1")}, enrollProxyCAKey, enrollProxyCACert) + require.NoError(t, err, "failed generating enroll proxy certificate") + proxyEnroll := proxytest.New(t, + proxytest.WithRewriteFn(func(u *url.URL) { + t.Logf("received URL: %+v", u) + if u.Host == unreachableFleetHost+":443" { + // mock fleet server works in http + u.Scheme = "http" + u.Host = "localhost:" + mockFleet.fleetServer.Port + } + }), + proxytest.WithRequestLog("enroll", t.Logf), + proxytest.WithVerboseLog(), + proxytest.WithServerTLSConfig(&tls.Config{ + Certificates: []tls.Certificate{ + { + Certificate: enrollProxyCert.Certificate, + PrivateKey: enrollProxyCert.PrivateKey, + Leaf: enrollProxyCert.Leaf, + }, + }, + })) + err = proxyEnroll.StartTLS() + require.NoError(t, err, "error starting TLS-enabled enroll proxy") + t.Cleanup(proxyEnroll.Close) + + // fleet proxy CA + fleetProxyCAKey, fleetProxyCACert, fleetProxyPair, err := certutil.NewRootCA() + require.NoError(t, err, "failed creating fleet proxy root CA") + + // client CA + clientCAKey, clientCACert, _, err := certutil.NewRootCA() + require.NoError(t, err, "failed creating root CA") + + // the server must trust the client CA + clientCACertPool := x509.NewCertPool() + clientCACertPool.AddCert(clientCACert) + + // Create a fake proxy with mTLS config to be used in fleet policy + fleetProxyCert, _, err := certutil.GenerateChildCert("localhost", []net.IP{net.IPv6loopback, net.IPv6zero, net.ParseIP("127.0.0.1")}, fleetProxyCAKey, fleetProxyCACert) + require.NoError(t, err, "failed generating fleet proxy certificate") + proxyFleetPolicy := proxytest.New(t, + proxytest.WithRewriteFn(func(u *url.URL) { + if u.Host == unreachableFleetHost+":443" { + // mock fleet server works in http + u.Scheme = "http" + u.Host = "localhost:" + mockFleet.fleetServer.Port + } + }), + proxytest.WithRequestLog("proxy-fleet-policy", t.Logf), + proxytest.WithVerboseLog(), + proxytest.WithServerTLSConfig(&tls.Config{ + Certificates: []tls.Certificate{ + { + Certificate: fleetProxyCert.Certificate, + PrivateKey: fleetProxyCert.PrivateKey, + Leaf: fleetProxyCert.Leaf, + }, + }, + // require client auth with a trusted Cert + ClientAuth: tls.RequireAndVerifyClientCert, + ClientCAs: clientCACertPool, + })) + err = proxyFleetPolicy.StartTLS() + require.NoError(t, err, "error starting mTLS-enabled fleet proxy") + t.Cleanup(proxyFleetPolicy.Close) + + // generate a certificate for elastic-agent from the client CA + _, agentPair, err := certutil.GenerateChildCert("localhost", []net.IP{net.IPv6loopback, net.IPv6zero, net.ParseIP("127.0.0.1")}, clientCAKey, clientCACert) + + mockFleet.policyData.FleetProxyURL = &proxyFleetPolicy.LocalhostURL + mockFleet.policyData.SSL = &fleetservertest.SSL{ + CertificateAuthorities: []string{string(enrollProxyPair.Cert), string(fleetProxyPair.Cert)}, + Renegotiation: "never", + Certificate: string(agentPair.Cert), + Key: string(agentPair.Key), + } + // now that we have fleet and the proxy running, we can add actions which + // depend on them. + action, err := fleetservertest.NewActionWithEmptyPolicyChange( + "actionID-TestValidProxyInThePolicy", *mockFleet.policyData) + require.NoError(t, err, "could not generate action with policy") + + ackToken := "AckToken-TestValidProxyInThePolicy" + mockFleet.checkinWithAcker.AddCheckin( + ackToken, + 0, + action, + ) + return map[string]*proxytest.Proxy{"enroll": proxyEnroll, "proxyFleetPolicy": proxyFleetPolicy}, + installArgs{ + enrollmentURL: unreachableFleetHttpsURL, + proxyURL: proxyEnroll.LocalhostURL, + certificateAuthorities: []string{enrollProxyCACertFile}, + } + }, + wantErr: assert.NoError, + assertFunc: func(ctx context.Context, t *testing.T, fixture *integrationtest.Fixture, proxies map[string]*proxytest.Proxy, mockFleet *mockFleetComponents) { + // assert the agent is actually connected to fleet. + check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute) + + // ensure the agent is communicating through the proxy set in the policy + if !assert.Eventually(t, func() bool { + for _, r := range proxies["proxyFleetPolicy"].ProxiedRequests() { + if strings.Contains( + r, + fleetservertest.NewPathCheckin(mockFleet.policyData.AgentID)) { + return true + } + } + + return false + }, 5*time.Minute, 5*time.Second) { + t.Errorf("did not find requests to the proxy defined in the policy") + } + + inspectOutput, err := fixture.ExecInspect(ctx) + if assert.NoError(t, err, "error running elastic-agent inspect") { + inspectYaml, _ := yaml.Marshal(inspectOutput) + t.Logf("elastic-agent inspect output:\n%s\n", string(inspectYaml)) + } + + }, + }, + } - // ensure the agent is communicating through the proxy set in the policy - want := fleetservertest.NewPathCheckin(p.policyData.AgentID) - assert.Eventually(t, func() bool { - for _, r := range p.proxy2.ProxiedRequests() { - if strings.Contains(r, want) { - return true + for _, tt := range testcases { + + t.Run(tt.name, func(t *testing.T) { + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + + // create API Key and basic Fleet Policy + apiKey, policyData := createBasicFleetPolicyData(t, unreachableFleetHost) + + // Create a checkin and ack handler + checkinWithAcker := fleetservertest.NewCheckinActionsWithAcker() + + // Start fake fleet server + enrollmentToken := "enrollmentToken" + fleet := fleetservertest.NewServerWithHandlers( + apiKey, + enrollmentToken, + policyData.AgentID, + policyData.PolicyID, + checkinWithAcker.ActionsGenerator(), + checkinWithAcker.Acker(), + fleetservertest.WithRequestLog(t.Logf), + ) + t.Cleanup(fleet.Close) + + mockFleet := &mockFleetComponents{ + fleetServer: fleet, + policyData: &policyData, + checkinWithAcker: &checkinWithAcker, } - } - - return false - }, 5*time.Minute, 5*time.Second, - "did not find requests to the proxy defined in the policy. Want [%s] on %v", - p.proxy2.LocalhostURL, p.proxy2.ProxiedRequests()) -} -func TestProxyURL_NoEnrollProxyAndProxyInThePolicy(t *testing.T) { - _ = define.Require(t, define.Requirements{ - Group: Fleet, - Local: false, - Sudo: true, - }) - t.Skip("Flaky test: https://github.com/elastic/elastic-agent/issues/3154") + // Specific testcase setup and map of created proxies + proxies, args := tt.setup(t, mockFleet) - p := SetupTest(t) - t.Cleanup(func() { - TearDownTest(t, p) - }) - ackToken := "AckToken-TestValidProxyInThePolicy" - - p.policyData.FleetHosts = fmt.Sprintf(`"%s"`, p.fleet.LocalhostURL) - p.policyData.FleetProxyURL = new(string) - *p.policyData.FleetProxyURL = p.proxy2.LocalhostURL - // now that we have fleet and the proxy running, we can add actions which - // depend on them. - action, err := fleetservertest.NewActionWithEmptyPolicyChange( - "actionID-TestValidProxyInThePolicy", p.policyData) - require.NoError(t, err, "could not generate action with policy") - p.checkinWithAcker.AddCheckin( - ackToken, - 0, - action, - ) - - ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) - defer cancel() - - t.Logf("fleet: %s, proxy1: %s, proxy2: %s", - p.fleet.LocalhostURL, - p.proxy1.LocalhostURL, - p.proxy2.LocalhostURL) - out, err := p.fixture.Install( - ctx, - &integrationtest.InstallOpts{ - Force: true, - NonInteractive: true, - Insecure: true, - EnrollOpts: integrationtest.EnrollOpts{ - URL: p.fleet.LocalhostURL, - EnrollmentToken: "anythingWillDO", - }}) - if err != nil { - t.Log(string(out)) - require.NoError(t, err, "failed to install agent") - } + fixture, err := define.NewFixtureFromLocalBuild(t, + define.Version(), + integrationtest.WithAllowErrors(), + integrationtest.WithLogOutput()) + require.NoError(t, err, "SetupTest: NewFixtureFromLocalBuild failed") - check.ConnectedToFleet(ctx, t, p.fixture, 5*time.Minute) + err = fixture.EnsurePrepared(ctx) + require.NoError(t, err, "SetupTest: fixture.Prepare failed") - // ensure the agent is communicating through the new proxy - if !assert.Eventually(t, func() bool { - for _, r := range p.proxy2.ProxiedRequests() { - if strings.Contains( - r, - fleetservertest.NewPathCheckin(p.policyData.AgentID)) { - return true + privileged := false + if runtime.GOOS == "windows" { + // On windows installing + enrolling mode leads to access denied error when updating fleet.enc (regardless of privileged/unprivileged) + // See https://github.com/elastic/elastic-agent/issues/4913 + t.Skip("Skipped on windows until https://github.com/elastic/elastic-agent/issues/4913 is resolved") } - } - return false - }, 5*time.Minute, 5*time.Second) { - t.Errorf("did not find requests to the proxy defined in the policy") + out, err := fixture.Install( + ctx, + &integrationtest.InstallOpts{ + Force: true, + NonInteractive: true, + Insecure: args.insecure, + ProxyURL: args.proxyURL, + Privileged: privileged, + EnrollOpts: integrationtest.EnrollOpts{ + URL: args.enrollmentURL, + EnrollmentToken: "anythingWillDO", + CertificateAuthorities: args.certificateAuthorities, + Certificate: args.certificate, + Key: args.key, + }}) + t.Logf("elastic-agent install output: \n%s\n", string(out)) + if tt.wantErr(t, err, "elastic-agent install returned an unexpected error") { + tt.assertFunc(ctx, t, fixture, proxies, mockFleet) + } + }) } -} -func TestProxyURL_RemoveProxyFromThePolicy(t *testing.T) { - _ = define.Require(t, define.Requirements{ - Group: Fleet, - Local: false, - Sudo: true, - }) - t.Skip("Flaky test: https://github.com/elastic/elastic-agent/issues/3154") +} - p := SetupTest(t) +func createTempDir(t *testing.T) string { + // use os.MkdirTemp since we are installing agent unprivileged and t.TempDir() does not guarantee that the elastic-agent user has access + baseDir := "" + if runtime.GOOS == "windows" { + baseDir = "C:\\" + } + tmpDir, err := os.MkdirTemp(baseDir, strings.ReplaceAll(t.Name(), "/", "-")+"*") + require.NoError(t, err, "error creating temp dir for TLS files") t.Cleanup(func() { - TearDownTest(t, p) + cleanupErr := os.RemoveAll(tmpDir) + assert.NoErrorf(t, cleanupErr, "error cleaning up directory %q", tmpDir) }) - ackToken := "AckToken-TestRemoveProxyFromThePolicy" - - p.policyData.FleetProxyURL = new(string) - *p.policyData.FleetProxyURL = p.proxy2.LocalhostURL - // now that we have fleet and the proxy running, we can add actions which - // depend on them. - action, err := fleetservertest.NewActionWithEmptyPolicyChange( - "actionID-TestRemoveProxyFromThePolicy", p.policyData) - require.NoError(t, err, "could not generate action with policy") - p.checkinWithAcker.AddCheckin( - ackToken, - 0, - action, - ) - - ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) - defer cancel() - - out, err := p.fixture.Install( - ctx, - &integrationtest.InstallOpts{ - Force: true, - NonInteractive: true, - Insecure: true, - ProxyURL: p.proxy1.LocalhostURL, - EnrollOpts: integrationtest.EnrollOpts{ - URL: p.fleetNeedsProxyHost, - EnrollmentToken: "anythingWillDO", - }}) - if err != nil { - t.Log(string(out)) - require.NoError(t, err, "failed to install agent") - } - - // assert the agent is actually connected to fleet. - check.ConnectedToFleet(ctx, t, p.fixture, 5*time.Minute) - - // ensure the agent is communicating through the proxy set in the policy - if !assert.Eventually(t, func() bool { - for _, r := range p.proxy2.ProxiedRequests() { - if strings.Contains( - r, - fleetservertest.NewPathCheckin(p.policyData.AgentID)) { - return true - } - } - - return false - }, 5*time.Minute, 5*time.Second) { - t.Errorf("did not find requests to the proxy defined in the policy") - } - - // Assert the proxy is set on the agent - inspect, err := p.fixture.ExecInspect(ctx) - require.NoError(t, err) - assert.Equal(t, *p.policyData.FleetProxyURL, inspect.Fleet.ProxyURL) - - // remove proxy from the policy - pp := p.policyData - want := *pp.FleetProxyURL - pp.FleetProxyURL = nil - actionIDRemoveProxyFromPolicy := "actionIDRemoveProxyFromPolicy-actionID-TestRemoveProxyFromThePolicy" - action, err = fleetservertest.NewActionWithEmptyPolicyChange( - actionIDRemoveProxyFromPolicy, pp) - require.NoError(t, err, "could not generate action with policy") - p.checkinWithAcker.AddCheckin( - ackToken, - 0, - action, - ) - - // ensures the agent acked the action sending a policy without proxy - require.Eventually(t, func() bool { - return p.checkinWithAcker.Acked(actionIDRemoveProxyFromPolicy) - }, - 30*time.Second, 5*time.Second) - inspect, err = p.fixture.ExecInspect(ctx) - require.NoError(t, err) - assert.Equal(t, inspect.Fleet.ProxyURL, want) - - // assert, again, the agent is actually connected to fleet. - check.ConnectedToFleet(ctx, t, p.fixture, 5*time.Minute) + // fix permissions on temp dir + err = os.Chmod(tmpDir, 0o755&os.ModePerm) + require.NoError(t, err, "error setting temporary dir %q as world-readable", tmpDir) + return tmpDir } -func (p *ProxyURL) setupFleet(t *testing.T, fleetHost string) { - agentID := "proxy-url-agent-id" - policyID := "bedf2f42-a252-40bb-ab2b-8a7e1b874c7a" - enrollmentToken := "enrollmentToken" +func createBasicFleetPolicyData(t *testing.T, fleetHost string) (fleetservertest.APIKey, fleetservertest.TmplPolicy) { apiKey := fleetservertest.APIKey{ ID: "apiKeyID", Key: "apiKeyKey", } - p.policyData = fleetservertest.TmplPolicy{ + agentID := strings.Replace(t.Name(), "/", "-", -1) + "-agent-id" + policyUUID, err := uuid.NewUUID() + require.NoError(t, err, "error generating UUID for policy") + + policyID := policyUUID.String() + policyData := fleetservertest.TmplPolicy{ AgentID: agentID, - PolicyID: policyID, - FleetHosts: fmt.Sprintf("%q", fleetHost), + PolicyID: t.Name() + policyID, + FleetHosts: []string{fleetHost}, SourceURI: "http://source.uri", CreatedAt: time.Now().Format(time.RFC3339), Output: struct { @@ -444,20 +785,5 @@ func (p *ProxyURL) setupFleet(t *testing.T, fleetHost string) { Hosts: `"https://my.clould.elstc.co:443"`, Type: "elasticsearch"}, } - - checkin := fleetservertest.NewCheckinActionsWithAcker() - - fleet := fleetservertest.NewServerWithHandlers( - apiKey, - enrollmentToken, - agentID, - policyID, - checkin.ActionsGenerator(), - checkin.Acker(), - fleetservertest.WithRequestLog(t.Logf), - ) - p.fleet = fleet - p.checkinWithAcker = &checkin - - return + return apiKey, policyData } diff --git a/testing/integration/switch_privileged_test.go b/testing/integration/switch_privileged_test.go new file mode 100644 index 00000000000..e11c3a1438c --- /dev/null +++ b/testing/integration/switch_privileged_test.go @@ -0,0 +1,139 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build integration + +package integration + +import ( + "context" + "path/filepath" + "runtime" + "strings" + "testing" + "time" + + atesting "github.com/elastic/elastic-agent/pkg/testing" + "github.com/elastic/elastic-agent/pkg/testing/define" + "github.com/elastic/elastic-agent/pkg/testing/tools/testcontext" + "github.com/elastic/elastic-agent/testing/installtest" + + "github.com/stretchr/testify/require" +) + +func TestSwitchPrivilegedWithoutBasePath(t *testing.T) { + define.Require(t, define.Requirements{ + Group: Default, + // We require sudo for this test to run + // `elastic-agent install`. + Sudo: true, + + // It's not safe to run this test locally as it + // installs Elastic Agent. + Local: false, + }) + + // Get path to Elastic Agent executable + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + + // Prepare the Elastic Agent so the binary is extracted and ready to use. + err = fixture.Prepare(ctx) + require.NoError(t, err) + + // Run `elastic-agent install`. We use `--force` to prevent interactive + // execution. + opts := &atesting.InstallOpts{Force: true, Privileged: false} + out, err := fixture.Install(ctx, opts) + if err != nil { + t.Logf("install output: %s", out) + require.NoError(t, err) + } + + // Check that Agent was installed in default base path in unprivileged mode + require.NoError(t, installtest.CheckSuccess(ctx, fixture, opts.BasePath, &installtest.CheckOpts{Privileged: false})) + + // Switch to privileged mode + out, err = fixture.Exec(ctx, []string{"privileged", "-f"}) + if err != nil { + t.Logf("privileged output: %s", out) + require.NoError(t, err) + } + + // Check that Agent is running in default base path in privileged mode + require.NoError(t, installtest.CheckSuccess(ctx, fixture, opts.BasePath, &installtest.CheckOpts{Privileged: true})) +} + +func TestSwitchPrivilegedWithBasePath(t *testing.T) { + define.Require(t, define.Requirements{ + Group: Default, + // We require sudo for this test to run + // `elastic-agent install`. + Sudo: true, + + // It's not safe to run this test locally as it + // installs Elastic Agent. + Local: false, + }) + + // Get path to Elastic Agent executable + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + + // Prepare the Elastic Agent so the binary is extracted and ready to use. + err = fixture.Prepare(ctx) + require.NoError(t, err) + + // When running in unprivileged using a base path the + // base needs to be accessible by the `elastic-agent-user` user that will be + // executing the process, but is not created yet. Using a base that exists + // and is known to be accessible by standard users, ensures this tests + // works correctly and will not hit a permission issue when spawning the + // elastic-agent service. + var basePath string + switch runtime.GOOS { + case define.Linux: + basePath = `/usr` + case define.Windows: + basePath = `C:\` + default: + // Set up random temporary directory to serve as base path for Elastic Agent + // installation. + tmpDir := t.TempDir() + basePath = filepath.Join(tmpDir, strings.ToLower(randStr(8))) + } + + // Run `elastic-agent install`. We use `--force` to prevent interactive + // execution. + opts := &atesting.InstallOpts{ + BasePath: basePath, + Force: true, + Privileged: false, + } + out, err := fixture.Install(ctx, opts) + if err != nil { + t.Logf("install output: %s", out) + require.NoError(t, err) + } + + // Check that Agent was installed in the custom base path in unprivileged mode + topPath := filepath.Join(basePath, "Elastic", "Agent") + require.NoError(t, installtest.CheckSuccess(ctx, fixture, topPath, &installtest.CheckOpts{Privileged: false})) + + // Switch to privileged mode + out, err = fixture.Exec(ctx, []string{"privileged", "-f"}) + if err != nil { + t.Logf("privileged output: %s", out) + require.NoError(t, err) + } + + // Check that Agent is running in the custom base path in privileged mode + require.NoError(t, installtest.CheckSuccess(ctx, fixture, topPath, &installtest.CheckOpts{Privileged: true})) +} diff --git a/testing/integration/switch_unprivileged_test.go b/testing/integration/switch_unprivileged_test.go new file mode 100644 index 00000000000..ea2fdcc060f --- /dev/null +++ b/testing/integration/switch_unprivileged_test.go @@ -0,0 +1,139 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build integration + +package integration + +import ( + "context" + "path/filepath" + "runtime" + "strings" + "testing" + "time" + + atesting "github.com/elastic/elastic-agent/pkg/testing" + "github.com/elastic/elastic-agent/pkg/testing/define" + "github.com/elastic/elastic-agent/pkg/testing/tools/testcontext" + "github.com/elastic/elastic-agent/testing/installtest" + + "github.com/stretchr/testify/require" +) + +func TestSwitchUnprivilegedWithoutBasePath(t *testing.T) { + define.Require(t, define.Requirements{ + Group: Default, + // We require sudo for this test to run + // `elastic-agent install`. + Sudo: true, + + // It's not safe to run this test locally as it + // installs Elastic Agent. + Local: false, + }) + + // Get path to Elastic Agent executable + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + + // Prepare the Elastic Agent so the binary is extracted and ready to use. + err = fixture.Prepare(ctx) + require.NoError(t, err) + + // Run `elastic-agent install`. We use `--force` to prevent interactive + // execution. + opts := &atesting.InstallOpts{Force: true, Privileged: true} + out, err := fixture.Install(ctx, opts) + if err != nil { + t.Logf("install output: %s", out) + require.NoError(t, err) + } + + // Check that Agent was installed in default base path in privileged mode + require.NoError(t, installtest.CheckSuccess(ctx, fixture, opts.BasePath, &installtest.CheckOpts{Privileged: true})) + + // Switch to unprivileged mode + out, err = fixture.Exec(ctx, []string{"unprivileged", "-f"}) + if err != nil { + t.Logf("unprivileged output: %s", out) + require.NoError(t, err) + } + + // Check that Agent is running in default base path in unprivileged mode + require.NoError(t, installtest.CheckSuccess(ctx, fixture, opts.BasePath, &installtest.CheckOpts{Privileged: false})) +} + +func TestSwitchUnprivilegedWithBasePath(t *testing.T) { + define.Require(t, define.Requirements{ + Group: Default, + // We require sudo for this test to run + // `elastic-agent install`. + Sudo: true, + + // It's not safe to run this test locally as it + // installs Elastic Agent. + Local: false, + }) + + // Get path to Elastic Agent executable + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) + require.NoError(t, err) + + ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) + defer cancel() + + // Prepare the Elastic Agent so the binary is extracted and ready to use. + err = fixture.Prepare(ctx) + require.NoError(t, err) + + // When running in unprivileged using a base path the + // base needs to be accessible by the `elastic-agent-user` user that will be + // executing the process, but is not created yet. Using a base that exists + // and is known to be accessible by standard users, ensures this tests + // works correctly and will not hit a permission issue when spawning the + // elastic-agent service. + var basePath string + switch runtime.GOOS { + case define.Linux: + basePath = `/usr` + case define.Windows: + basePath = `C:\` + default: + // Set up random temporary directory to serve as base path for Elastic Agent + // installation. + tmpDir := t.TempDir() + basePath = filepath.Join(tmpDir, strings.ToLower(randStr(8))) + } + + // Run `elastic-agent install`. We use `--force` to prevent interactive + // execution. + opts := &atesting.InstallOpts{ + BasePath: basePath, + Force: true, + Privileged: true, + } + out, err := fixture.Install(ctx, opts) + if err != nil { + t.Logf("install output: %s", out) + require.NoError(t, err) + } + + // Check that Agent was installed in the custom base path in privileged mode + topPath := filepath.Join(basePath, "Elastic", "Agent") + require.NoError(t, installtest.CheckSuccess(ctx, fixture, topPath, &installtest.CheckOpts{Privileged: true})) + + // Switch to unprivileged mode + out, err = fixture.Exec(ctx, []string{"unprivileged", "-f"}) + if err != nil { + t.Logf("unprivileged output: %s", out) + require.NoError(t, err) + } + + // Check that Agent is running in the custom base path in unprivileged mode + require.NoError(t, installtest.CheckSuccess(ctx, fixture, topPath, &installtest.CheckOpts{Privileged: false})) +} diff --git a/testing/integration/system_integration_setup.json b/testing/integration/system_integration_setup.json new file mode 100644 index 00000000000..1f202d51f0f --- /dev/null +++ b/testing/integration/system_integration_setup.json @@ -0,0 +1,789 @@ +{ + "id": "9bf446fc-58d4-4767-b42d-3450815d5d3d", + "version": "WzYzMSwxXQ==", + "name": "system-1", + "namespace": "default", + "package": { + "name": "system", + "title": "System", + "version": "1.53.0" + }, + "enabled": true, + "policy_id": "0a4f6c12-446a-401a-b0eb-96afea6ca92d", + "inputs": [ + { + "type": "logfile", + "policy_template": "system", + "enabled": true, + "streams": [ + { + "enabled": true, + "data_stream": { + "type": "logs", + "dataset": "system.auth" + }, + "vars": { + "ignore_older": { + "value": "72h", + "type": "text" + }, + "paths": { + "value": [ + "/var/log/auth.log*", + "/var/log/secure*" + ], + "type": "text" + }, + "preserve_original_event": { + "value": false, + "type": "bool" + }, + "tags": { + "value": [ + "system-auth" + ], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "logfile-system.auth-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "ignore_older": "72h", + "paths": [ + "/var/log/auth.log*", + "/var/log/secure*" + ], + "exclude_files": [ + ".gz$" + ], + "multiline": { + "pattern": "^\\s", + "match": "after" + }, + "tags": [ + "system-auth" + ], + "processors": [ + { + "add_locale": null + }, + { + "rename": { + "fields": [ + { + "from": "message", + "to": "event.original" + } + ], + "ignore_missing": true, + "fail_on_error": false + } + }, + { + "syslog": { + "field": "event.original", + "ignore_missing": true, + "ignore_failure": true + } + } + ] + } + }, + { + "enabled": true, + "data_stream": { + "type": "logs", + "dataset": "system.syslog" + }, + "vars": { + "paths": { + "value": [ + "/var/log/messages*", + "/var/log/syslog*", + "/var/log/system*" + ], + "type": "text" + }, + "preserve_original_event": { + "value": false, + "type": "bool" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + }, + "ignore_older": { + "value": "72h", + "type": "text" + }, + "exclude_files": { + "value": [ + "\\.gz$" + ], + "type": "text" + } + }, + "id": "logfile-system.syslog-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "paths": [ + "/var/log/messages*", + "/var/log/syslog*", + "/var/log/system*" + ], + "exclude_files": [ + "\\.gz$" + ], + "multiline": { + "pattern": "^\\s", + "match": "after" + }, + "processors": [ + { + "add_locale": null + } + ], + "tags": null, + "ignore_older": "72h" + } + } + ] + }, + { + "type": "winlog", + "policy_template": "system", + "enabled": true, + "streams": [ + { + "enabled": true, + "data_stream": { + "type": "logs", + "dataset": "system.application" + }, + "vars": { + "preserve_original_event": { + "value": false, + "type": "bool" + }, + "event_id": { + "type": "text" + }, + "ignore_older": { + "value": "72h", + "type": "text" + }, + "language": { + "value": 0, + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "winlog-system.application-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "name": "Application", + "condition": "${host.platform} == 'windows'", + "ignore_older": "72h" + } + }, + { + "enabled": true, + "data_stream": { + "type": "logs", + "dataset": "system.security" + }, + "vars": { + "preserve_original_event": { + "value": false, + "type": "bool" + }, + "event_id": { + "type": "text" + }, + "ignore_older": { + "value": "72h", + "type": "text" + }, + "language": { + "value": 0, + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "winlog-system.security-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "name": "Security", + "condition": "${host.platform} == 'windows'", + "ignore_older": "72h" + } + }, + { + "enabled": true, + "data_stream": { + "type": "logs", + "dataset": "system.system" + }, + "vars": { + "preserve_original_event": { + "value": false, + "type": "bool" + }, + "event_id": { + "type": "text" + }, + "ignore_older": { + "value": "72h", + "type": "text" + }, + "language": { + "value": 0, + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "winlog-system.system-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "name": "System", + "condition": "${host.platform} == 'windows'", + "ignore_older": "72h" + } + } + ] + }, + { + "type": "system/metrics", + "policy_template": "system", + "enabled": true, + "streams": [ + { + "enabled": false, + "data_stream": { + "type": "metrics", + "dataset": "system.core" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "core.metrics": { + "value": [ + "percentages" + ], + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "system/metrics-system.core-9bf446fc-58d4-4767-b42d-3450815d5d3d" + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.cpu" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "cpu.metrics": { + "value": [ + "percentages", + "normalized_percentages" + ], + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "system/metrics-system.cpu-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "cpu" + ], + "cpu.metrics": [ + "percentages", + "normalized_percentages" + ], + "period": "1s" + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.diskio" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "diskio.include_devices": { + "value": [], + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + } + }, + "id": "system/metrics-system.diskio-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "diskio" + ], + "diskio.include_devices": null, + "period": "1s" + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.filesystem" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "filesystem.ignore_types": { + "value": [], + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "value": "\"\"", + "type": "yaml" + } + }, + "id": "system/metrics-system.filesystem-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "filesystem" + ], + "period": "1s", + "processors": [ + { + "drop_event.when.regexp": { + "system.filesystem.mount_point": "^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)" + } + } + ] + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.fsstat" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "value": "\"\"", + "type": "yaml" + } + }, + "id": "system/metrics-system.fsstat-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "fsstat" + ], + "period": "1s", + "processors": [ + { + "drop_event.when.regexp": { + "system.fsstat.mount_point": "^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)" + } + } + ] + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.load" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "system/metrics-system.load-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "load" + ], + "condition": "${host.platform} != 'windows'", + "period": "1s" + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.memory" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "system/metrics-system.memory-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "memory" + ], + "period": "1s" + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.network" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "network.interfaces": { + "value": [], + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "system/metrics-system.network-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "network" + ], + "period": "1s", + "network.interfaces": null + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.process" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "process.include_top_n.by_cpu": { + "value": 5, + "type": "integer" + }, + "process.include_top_n.by_memory": { + "value": 5, + "type": "integer" + }, + "process.cmdline.cache.enabled": { + "value": true, + "type": "bool" + }, + "process.cgroups.enabled": { + "value": false, + "type": "bool" + }, + "process.env.whitelist": { + "value": [], + "type": "text" + }, + "process.include_cpu_ticks": { + "value": false, + "type": "bool" + }, + "processes": { + "value": [ + ".*" + ], + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "system/metrics-system.process-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "process" + ], + "period": "1s", + "process.include_top_n.by_cpu": 5, + "process.include_top_n.by_memory": 5, + "process.cmdline.cache.enabled": true, + "process.cgroups.enabled": false, + "process.include_cpu_ticks": false, + "processes": [ + ".*" + ] + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.process.summary" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "system/metrics-system.process.summary-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "process_summary" + ], + "period": "1s" + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.socket_summary" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "system/metrics-system.socket_summary-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "socket_summary" + ], + "period": "1s" + } + }, + { + "enabled": true, + "data_stream": { + "type": "metrics", + "dataset": "system.uptime" + }, + "vars": { + "period": { + "value": "1s", + "type": "text" + }, + "tags": { + "value": [], + "type": "text" + }, + "processors": { + "type": "yaml" + } + }, + "id": "system/metrics-system.uptime-9bf446fc-58d4-4767-b42d-3450815d5d3d", + "compiled_stream": { + "metricsets": [ + "uptime" + ], + "period": "1s" + } + } + ], + "vars": { + "system.hostfs": { + "type": "text" + } + } + }, + { + "type": "httpjson", + "policy_template": "system", + "enabled": false, + "streams": [ + { + "enabled": false, + "data_stream": { + "type": "logs", + "dataset": "system.application" + }, + "vars": { + "interval": { + "value": "1s", + "type": "text" + }, + "search": { + "value": "search sourcetype=\"XmlWinEventLog:Application\"", + "type": "text" + }, + "tags": { + "value": [ + "forwarded" + ], + "type": "text" + } + }, + "id": "httpjson-system.application-9bf446fc-58d4-4767-b42d-3450815d5d3d" + }, + { + "enabled": false, + "data_stream": { + "type": "logs", + "dataset": "system.security" + }, + "vars": { + "interval": { + "value": "1s", + "type": "text" + }, + "search": { + "value": "search sourcetype=\"XmlWinEventLog:Security\"", + "type": "text" + }, + "tags": { + "value": [ + "forwarded" + ], + "type": "text" + } + }, + "id": "httpjson-system.security-9bf446fc-58d4-4767-b42d-3450815d5d3d" + }, + { + "enabled": false, + "data_stream": { + "type": "logs", + "dataset": "system.system" + }, + "vars": { + "interval": { + "value": "1s", + "type": "text" + }, + "search": { + "value": "search sourcetype=\"XmlWinEventLog:System\"", + "type": "text" + }, + "tags": { + "value": [ + "forwarded" + ], + "type": "text" + } + }, + "id": "httpjson-system.system-9bf446fc-58d4-4767-b42d-3450815d5d3d" + } + ], + "vars": { + "url": { + "value": "https://server.example.com:8089", + "type": "text" + }, + "enable_request_tracer": { + "type": "bool" + }, + "username": { + "type": "text" + }, + "password": { + "type": "password" + }, + "token": { + "type": "password" + }, + "preserve_original_event": { + "value": false, + "type": "bool" + } + } + } + ] + } \ No newline at end of file diff --git a/testing/integration/upgrade_broken_package_test.go b/testing/integration/upgrade_broken_package_test.go index d416da24f41..964989465f3 100644 --- a/testing/integration/upgrade_broken_package_test.go +++ b/testing/integration/upgrade_broken_package_test.go @@ -37,7 +37,7 @@ func TestUpgradeBrokenPackageVersion(t *testing.T) { // 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()) + startFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) // Upgrade to an old build. diff --git a/testing/integration/upgrade_downgrade_test.go b/testing/integration/upgrade_downgrade_test.go index 29872f1a5e9..c7478a3fc05 100644 --- a/testing/integration/upgrade_downgrade_test.go +++ b/testing/integration/upgrade_downgrade_test.go @@ -47,7 +47,7 @@ func TestStandaloneDowngradeToSpecificSnapshotBuild(t *testing.T) { // 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()) + startFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) startVersion, err := startFixture.ExecVersion(ctx) require.NoError(t, err) diff --git a/testing/integration/upgrade_fleet_test.go b/testing/integration/upgrade_fleet_test.go index 28d1e7d7e8e..185431cfdd5 100644 --- a/testing/integration/upgrade_fleet_test.go +++ b/testing/integration/upgrade_fleet_test.go @@ -69,7 +69,7 @@ func testFleetManagedUpgrade(t *testing.T, info *define.Info, unprivileged bool) // 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()) + startFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) err = startFixture.Prepare(ctx) require.NoError(t, err) @@ -171,7 +171,7 @@ func testFleetAirGappedUpgrade(t *testing.T, stack *define.Info, unprivileged bo "It should not affect the connection to the stack. Host: %s, response body: %s", stack.KibanaClient.URL, host, body) - fixture, err := define.NewFixture(t, define.Version()) + fixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) err = fixture.Prepare(ctx) require.NoError(t, err) @@ -215,14 +215,8 @@ func testUpgradeFleetManagedElasticAgent( require.NoError(t, err) if unprivileged { - if startParsedVersion.Less(*upgradetest.Version_8_13_0) { - t.Skipf("Starting version %s is less than 8.13 and doesn't support --unprivileged", startParsedVersion.String()) - } - if endParsedVersion.Less(*upgradetest.Version_8_13_0) { - t.Skipf("Ending version %s is less than 8.13 and doesn't support --unprivileged", endParsedVersion.String()) - } - if runtime.GOOS != define.Linux { - t.Skip("Unprivileged mode is currently only supported on Linux") + if !upgradetest.SupportsUnprivileged(startParsedVersion, endParsedVersion) { + t.Skipf("Either starting version %s or ending version %s doesn't support --unprivileged", startParsedVersion.String(), endParsedVersion.String()) } } @@ -259,7 +253,7 @@ func testUpgradeFleetManagedElasticAgent( URL: fleetServerURL, EnrollmentToken: enrollmentToken.APIKey, }, - Unprivileged: atesting.NewBool(unprivileged), + Privileged: !unprivileged, } output, err := startFixture.Install(ctx, &installOpts) require.NoError(t, err, "failed to install start agent [output: %s]", string(output)) diff --git a/testing/integration/upgrade_gpg_test.go b/testing/integration/upgrade_gpg_test.go index f08d61b9b17..61705765bae 100644 --- a/testing/integration/upgrade_gpg_test.go +++ b/testing/integration/upgrade_gpg_test.go @@ -42,7 +42,7 @@ func TestStandaloneUpgradeWithGPGFallback(t *testing.T) { // 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()) + startFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) startVersionInfo, err := startFixture.ExecVersion(ctx) require.NoError(t, err) @@ -111,7 +111,7 @@ func TestStandaloneUpgradeWithGPGFallbackOneRemoteFailing(t *testing.T) { // 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()) + startFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) // Upgrade to an old build. diff --git a/testing/integration/upgrade_rollback_test.go b/testing/integration/upgrade_rollback_test.go index 37b845fec85..b27f74d0b22 100644 --- a/testing/integration/upgrade_rollback_test.go +++ b/testing/integration/upgrade_rollback_test.go @@ -63,7 +63,7 @@ func TestStandaloneUpgradeRollback(t *testing.T) { require.NoError(t, err, "failed to get start agent build version info") // Upgrade to the build under test. - endFixture, err := define.NewFixture(t, define.Version()) + endFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) t.Logf("Testing Elastic Agent upgrade from %s to %s...", upgradeFromVersion, define.Version()) @@ -178,7 +178,7 @@ func TestStandaloneUpgradeRollbackOnRestarts(t *testing.T) { require.NoError(t, err, "failed to get start agent build version info") // Upgrade to the build under test. - endFixture, err := define.NewFixture(t, define.Version()) + endFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) t.Logf("Testing Elastic Agent upgrade from %s to %s...", upgradeFromVersion, define.Version()) @@ -205,7 +205,7 @@ func TestStandaloneUpgradeRollbackOnRestarts(t *testing.T) { topPath := paths.Top() t.Logf("Stopping agent via service to simulate crashing") - err = install.StopService(topPath) + err = install.StopService(topPath, install.DefaultStopTimeout, install.DefaultStopInterval) if err != nil && runtime.GOOS == define.Windows && strings.Contains(err.Error(), "The service has not been started.") { // Due to the quick restarts every 10 seconds its possible that this is faster than Windows // can handle. Decrementing restartIdx means that the loop will occur again. diff --git a/testing/integration/upgrade_standalone_inprogress_test.go b/testing/integration/upgrade_standalone_inprogress_test.go index 5edadeed1dd..93358733237 100644 --- a/testing/integration/upgrade_standalone_inprogress_test.go +++ b/testing/integration/upgrade_standalone_inprogress_test.go @@ -48,7 +48,7 @@ func TestStandaloneUpgradeFailsWhenUpgradeIsInProgress(t *testing.T) { ) require.NoError(t, err, "error creating previous agent fixture") - endFixture, err := define.NewFixture(t, define.Version()) + endFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) endVersionInfo, err := endFixture.ExecVersion(ctx) require.NoError(t, err) diff --git a/testing/integration/upgrade_standalone_retry_test.go b/testing/integration/upgrade_standalone_retry_test.go index a062dd14d24..3c7feb35ea9 100644 --- a/testing/integration/upgrade_standalone_retry_test.go +++ b/testing/integration/upgrade_standalone_retry_test.go @@ -38,7 +38,7 @@ func TestStandaloneUpgradeRetryDownload(t *testing.T) { // 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()) + startFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) // The end version does not matter much but it must not match diff --git a/testing/integration/upgrade_standalone_same_commit_test.go b/testing/integration/upgrade_standalone_same_commit_test.go index 4da4af6ae7e..16d468bc0b9 100644 --- a/testing/integration/upgrade_standalone_same_commit_test.go +++ b/testing/integration/upgrade_standalone_same_commit_test.go @@ -18,7 +18,6 @@ import ( "os" "path" "path/filepath" - "runtime" "strings" "testing" "time" @@ -52,17 +51,10 @@ func TestStandaloneUpgradeSameCommit(t *testing.T) { t.Skipf("Minimum version for running this test is %q, current version: %q", *upgradetest.Version_8_13_0_SNAPSHOT, currentVersion) } - unprivilegedAvailable := true - if runtime.GOOS != define.Linux { - // only available on Linux at the moment - unprivilegedAvailable = false + unprivilegedAvailable := false + if upgradetest.SupportsUnprivileged(currentVersion) { + unprivilegedAvailable = true } - // This is probably redundant: see the skip statement above - if unprivilegedAvailable && currentVersion.Less(*upgradetest.Version_8_13_0) { - // only available if both versions are 8.13+ - unprivilegedAvailable = false - } - unPrivilegedString := "unprivileged" if !unprivilegedAvailable { unPrivilegedString = "privileged" @@ -73,7 +65,7 @@ func TestStandaloneUpgradeSameCommit(t *testing.T) { defer cancel() // ensure we use the same package version - startFixture, err := define.NewFixture( + startFixture, err := define.NewFixtureFromLocalBuild( t, currentVersion.String(), ) @@ -89,7 +81,7 @@ func TestStandaloneUpgradeSameCommit(t *testing.T) { ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) defer cancel() - startFixture, err := define.NewFixture( + startFixture, err := define.NewFixtureFromLocalBuild( t, currentVersion.String(), ) @@ -231,7 +223,7 @@ func hackTarGzPackage(t *testing.T, reader *tar.Reader, writer *tar.Writer, oldT // tar format uses forward slash as path separator, make sure we use only "path" package for checking and manipulation switch path.Base(f.Name) { case v1.ManifestFileName: - //read old content and generate the new manifest based on that + // read old content and generate the new manifest based on that newManifest := generateNewManifestContent(t, reader, newVersion) newManifestBytes := []byte(newManifest) @@ -317,7 +309,7 @@ func hackZipPackage(t *testing.T, reader *zip.ReadCloser, writer *zip.Writer, ol // zip format uses forward slash as path separator, make sure we use only "path" package for checking and manipulation switch path.Base(zippedFile.Name) { case v1.ManifestFileName: - //read old content + // read old content manifestReader, err := zippedFile.Open() require.NoError(t, err, "error opening manifest file in zipped package") diff --git a/testing/integration/upgrade_standalone_test.go b/testing/integration/upgrade_standalone_test.go index 9be5344e2c3..8e7d98e40d6 100644 --- a/testing/integration/upgrade_standalone_test.go +++ b/testing/integration/upgrade_standalone_test.go @@ -9,7 +9,6 @@ package integration import ( "context" "fmt" - "runtime" "testing" "time" @@ -36,14 +35,9 @@ func TestStandaloneUpgrade(t *testing.T) { require.NoError(t, err) for _, startVersion := range versionList { - unprivilegedAvailable := true - if runtime.GOOS != define.Linux { - // only available on Linux at the moment - unprivilegedAvailable = false - } - if unprivilegedAvailable && (startVersion.Less(*upgradetest.Version_8_13_0) || endVersion.Less(*upgradetest.Version_8_13_0)) { - // only available if both versions are 8.13+ - unprivilegedAvailable = false + unprivilegedAvailable := false + if upgradetest.SupportsUnprivileged(startVersion, endVersion) { + unprivilegedAvailable = true } t.Run(fmt.Sprintf("Upgrade %s to %s (privileged)", startVersion, define.Version()), func(t *testing.T) { testStandaloneUpgrade(t, startVersion, define.Version(), false) @@ -67,7 +61,7 @@ func testStandaloneUpgrade(t *testing.T, startVersion *version.ParsedSemVer, end ) require.NoError(t, err, "error creating previous agent fixture") - endFixture, err := define.NewFixture(t, endVersion) + endFixture, err := define.NewFixtureFromLocalBuild(t, endVersion) require.NoError(t, err) startVersionInfo, err := startFixture.ExecVersion(ctx) diff --git a/testing/integration/upgrade_uninstall_test.go b/testing/integration/upgrade_uninstall_test.go index d7ad0964d4f..31356d93dc2 100644 --- a/testing/integration/upgrade_uninstall_test.go +++ b/testing/integration/upgrade_uninstall_test.go @@ -40,7 +40,7 @@ func TestStandaloneUpgradeUninstallKillWatcher(t *testing.T) { defer cancel() // Upgrades to build under test. - endFixture, err := define.NewFixture(t, define.Version()) + endFixture, err := define.NewFixtureFromLocalBuild(t, define.Version()) require.NoError(t, err) endVersionInfo, err := endFixture.ExecVersion(ctx) require.NoError(t, err, "failed to get end agent build version info") diff --git a/internal/pkg/agent/application/actions/handlers/mocks/diagnostics_provider.go b/testing/mocks/internal_/pkg/agent/application/actions/handlers/diagnostics_provider_mock.go similarity index 94% rename from internal/pkg/agent/application/actions/handlers/mocks/diagnostics_provider.go rename to testing/mocks/internal_/pkg/agent/application/actions/handlers/diagnostics_provider_mock.go index 19c2c1ef27f..9ade60bd480 100644 --- a/internal/pkg/agent/application/actions/handlers/mocks/diagnostics_provider.go +++ b/testing/mocks/internal_/pkg/agent/application/actions/handlers/diagnostics_provider_mock.go @@ -2,13 +2,9 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated by mockery v2.23.1. DO NOT EDIT. +// Code generated by mockery v2.42.2. DO NOT EDIT. -// 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 mocks +package handlers import ( context "context" @@ -41,6 +37,10 @@ func (_m *DiagnosticsProvider) EXPECT() *DiagnosticsProvider_Expecter { func (_m *DiagnosticsProvider) DiagnosticHooks() diagnostics.Hooks { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for DiagnosticHooks") + } + var r0 diagnostics.Hooks if rf, ok := ret.Get(0).(func() diagnostics.Hooks); ok { r0 = rf() @@ -91,6 +91,10 @@ func (_m *DiagnosticsProvider) PerformComponentDiagnostics(ctx context.Context, _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for PerformComponentDiagnostics") + } + var r0 []runtime.ComponentDiagnostic var r1 error if rf, ok := ret.Get(0).(func(context.Context, []cproto.AdditionalDiagnosticRequest, ...component.Component) ([]runtime.ComponentDiagnostic, error)); ok { @@ -161,6 +165,10 @@ func (_m *DiagnosticsProvider) PerformDiagnostics(ctx context.Context, req ...ru _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for PerformDiagnostics") + } + var r0 []runtime.ComponentUnitDiagnostic if rf, ok := ret.Get(0).(func(context.Context, ...runtime.ComponentUnitDiagnosticRequest) []runtime.ComponentUnitDiagnostic); ok { r0 = rf(ctx, req...) @@ -209,13 +217,12 @@ func (_c *DiagnosticsProvider_PerformDiagnostics_Call) RunAndReturn(run func(con return _c } -type mockConstructorTestingTNewDiagnosticsProvider interface { +// NewDiagnosticsProvider creates a new instance of DiagnosticsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewDiagnosticsProvider(t interface { mock.TestingT Cleanup(func()) -} - -// NewDiagnosticsProvider creates a new instance of DiagnosticsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewDiagnosticsProvider(t mockConstructorTestingTNewDiagnosticsProvider) *DiagnosticsProvider { +}) *DiagnosticsProvider { mock := &DiagnosticsProvider{} mock.Mock.Test(t) diff --git a/testing/mocks/internal_/pkg/agent/application/actions/handlers/log_level_setter_mock.go b/testing/mocks/internal_/pkg/agent/application/actions/handlers/log_level_setter_mock.go new file mode 100644 index 00000000000..910dea5e027 --- /dev/null +++ b/testing/mocks/internal_/pkg/agent/application/actions/handlers/log_level_setter_mock.go @@ -0,0 +1,89 @@ +// 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. + +// Code generated by mockery v2.42.2. DO NOT EDIT. + +package handlers + +import ( + context "context" + + logp "github.com/elastic/elastic-agent-libs/logp" + + mock "github.com/stretchr/testify/mock" +) + +// LogLevelSetter is an autogenerated mock type for the logLevelSetter type +type LogLevelSetter struct { + mock.Mock +} + +type LogLevelSetter_Expecter struct { + mock *mock.Mock +} + +func (_m *LogLevelSetter) EXPECT() *LogLevelSetter_Expecter { + return &LogLevelSetter_Expecter{mock: &_m.Mock} +} + +// SetLogLevel provides a mock function with given fields: ctx, lvl +func (_m *LogLevelSetter) SetLogLevel(ctx context.Context, lvl *logp.Level) error { + ret := _m.Called(ctx, lvl) + + if len(ret) == 0 { + panic("no return value specified for SetLogLevel") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *logp.Level) error); ok { + r0 = rf(ctx, lvl) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// LogLevelSetter_SetLogLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLogLevel' +type LogLevelSetter_SetLogLevel_Call struct { + *mock.Call +} + +// SetLogLevel is a helper method to define mock.On call +// - ctx context.Context +// - lvl *logp.Level +func (_e *LogLevelSetter_Expecter) SetLogLevel(ctx interface{}, lvl interface{}) *LogLevelSetter_SetLogLevel_Call { + return &LogLevelSetter_SetLogLevel_Call{Call: _e.mock.On("SetLogLevel", ctx, lvl)} +} + +func (_c *LogLevelSetter_SetLogLevel_Call) Run(run func(ctx context.Context, lvl *logp.Level)) *LogLevelSetter_SetLogLevel_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*logp.Level)) + }) + return _c +} + +func (_c *LogLevelSetter_SetLogLevel_Call) Return(_a0 error) *LogLevelSetter_SetLogLevel_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LogLevelSetter_SetLogLevel_Call) RunAndReturn(run func(context.Context, *logp.Level) error) *LogLevelSetter_SetLogLevel_Call { + _c.Call.Return(run) + return _c +} + +// NewLogLevelSetter creates a new instance of LogLevelSetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewLogLevelSetter(t interface { + mock.TestingT + Cleanup(func()) +}) *LogLevelSetter { + mock := &LogLevelSetter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internal/pkg/agent/application/actions/handlers/mocks/uploader.go b/testing/mocks/internal_/pkg/agent/application/actions/handlers/uploader_mock.go similarity index 87% rename from internal/pkg/agent/application/actions/handlers/mocks/uploader.go rename to testing/mocks/internal_/pkg/agent/application/actions/handlers/uploader_mock.go index e7aa6215826..f8e00212661 100644 --- a/internal/pkg/agent/application/actions/handlers/mocks/uploader.go +++ b/testing/mocks/internal_/pkg/agent/application/actions/handlers/uploader_mock.go @@ -2,13 +2,9 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated by mockery v2.23.1. DO NOT EDIT. +// Code generated by mockery v2.42.2. DO NOT EDIT. -// 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 mocks +package handlers import ( context "context" @@ -35,6 +31,10 @@ func (_m *Uploader) EXPECT() *Uploader_Expecter { func (_m *Uploader) UploadDiagnostics(_a0 context.Context, _a1 string, _a2 string, _a3 int64, _a4 io.Reader) (string, error) { ret := _m.Called(_a0, _a1, _a2, _a3, _a4) + if len(ret) == 0 { + panic("no return value specified for UploadDiagnostics") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string, int64, io.Reader) (string, error)); ok { @@ -87,13 +87,12 @@ func (_c *Uploader_UploadDiagnostics_Call) RunAndReturn(run func(context.Context return _c } -type mockConstructorTestingTNewUploader interface { +// NewUploader creates a new instance of Uploader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewUploader(t interface { mock.TestingT Cleanup(func()) -} - -// NewUploader creates a new instance of Uploader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewUploader(t mockConstructorTestingTNewUploader) *Uploader { +}) *Uploader { mock := &Uploader{} mock.Mock.Test(t) diff --git a/testing/mocks/internal_/pkg/agent/application/info/agent_mock.go b/testing/mocks/internal_/pkg/agent/application/info/agent_mock.go new file mode 100644 index 00000000000..c0bb8972dfc --- /dev/null +++ b/testing/mocks/internal_/pkg/agent/application/info/agent_mock.go @@ -0,0 +1,495 @@ +// 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. + +// Code generated by mockery v2.42.2. DO NOT EDIT. + +package info + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// Agent is an autogenerated mock type for the Agent type +type Agent struct { + mock.Mock +} + +type Agent_Expecter struct { + mock *mock.Mock +} + +func (_m *Agent) EXPECT() *Agent_Expecter { + return &Agent_Expecter{mock: &_m.Mock} +} + +// AgentID provides a mock function with given fields: +func (_m *Agent) AgentID() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AgentID") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Agent_AgentID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentID' +type Agent_AgentID_Call struct { + *mock.Call +} + +// AgentID is a helper method to define mock.On call +func (_e *Agent_Expecter) AgentID() *Agent_AgentID_Call { + return &Agent_AgentID_Call{Call: _e.mock.On("AgentID")} +} + +func (_c *Agent_AgentID_Call) Run(run func()) *Agent_AgentID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Agent_AgentID_Call) Return(_a0 string) *Agent_AgentID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_AgentID_Call) RunAndReturn(run func() string) *Agent_AgentID_Call { + _c.Call.Return(run) + return _c +} + +// Headers provides a mock function with given fields: +func (_m *Agent) Headers() map[string]string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Headers") + } + + var r0 map[string]string + if rf, ok := ret.Get(0).(func() map[string]string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + + return r0 +} + +// Agent_Headers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Headers' +type Agent_Headers_Call struct { + *mock.Call +} + +// Headers is a helper method to define mock.On call +func (_e *Agent_Expecter) Headers() *Agent_Headers_Call { + return &Agent_Headers_Call{Call: _e.mock.On("Headers")} +} + +func (_c *Agent_Headers_Call) Run(run func()) *Agent_Headers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Agent_Headers_Call) Return(_a0 map[string]string) *Agent_Headers_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_Headers_Call) RunAndReturn(run func() map[string]string) *Agent_Headers_Call { + _c.Call.Return(run) + return _c +} + +// IsStandalone provides a mock function with given fields: +func (_m *Agent) IsStandalone() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsStandalone") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Agent_IsStandalone_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsStandalone' +type Agent_IsStandalone_Call struct { + *mock.Call +} + +// IsStandalone is a helper method to define mock.On call +func (_e *Agent_Expecter) IsStandalone() *Agent_IsStandalone_Call { + return &Agent_IsStandalone_Call{Call: _e.mock.On("IsStandalone")} +} + +func (_c *Agent_IsStandalone_Call) Run(run func()) *Agent_IsStandalone_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Agent_IsStandalone_Call) Return(_a0 bool) *Agent_IsStandalone_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_IsStandalone_Call) RunAndReturn(run func() bool) *Agent_IsStandalone_Call { + _c.Call.Return(run) + return _c +} + +// LogLevel provides a mock function with given fields: +func (_m *Agent) LogLevel() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for LogLevel") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Agent_LogLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogLevel' +type Agent_LogLevel_Call struct { + *mock.Call +} + +// LogLevel is a helper method to define mock.On call +func (_e *Agent_Expecter) LogLevel() *Agent_LogLevel_Call { + return &Agent_LogLevel_Call{Call: _e.mock.On("LogLevel")} +} + +func (_c *Agent_LogLevel_Call) Run(run func()) *Agent_LogLevel_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Agent_LogLevel_Call) Return(_a0 string) *Agent_LogLevel_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_LogLevel_Call) RunAndReturn(run func() string) *Agent_LogLevel_Call { + _c.Call.Return(run) + return _c +} + +// RawLogLevel provides a mock function with given fields: +func (_m *Agent) RawLogLevel() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for RawLogLevel") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Agent_RawLogLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RawLogLevel' +type Agent_RawLogLevel_Call struct { + *mock.Call +} + +// RawLogLevel is a helper method to define mock.On call +func (_e *Agent_Expecter) RawLogLevel() *Agent_RawLogLevel_Call { + return &Agent_RawLogLevel_Call{Call: _e.mock.On("RawLogLevel")} +} + +func (_c *Agent_RawLogLevel_Call) Run(run func()) *Agent_RawLogLevel_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Agent_RawLogLevel_Call) Return(_a0 string) *Agent_RawLogLevel_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_RawLogLevel_Call) RunAndReturn(run func() string) *Agent_RawLogLevel_Call { + _c.Call.Return(run) + return _c +} + +// ReloadID provides a mock function with given fields: ctx +func (_m *Agent) ReloadID(ctx context.Context) error { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ReloadID") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(ctx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Agent_ReloadID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReloadID' +type Agent_ReloadID_Call struct { + *mock.Call +} + +// ReloadID is a helper method to define mock.On call +// - ctx context.Context +func (_e *Agent_Expecter) ReloadID(ctx interface{}) *Agent_ReloadID_Call { + return &Agent_ReloadID_Call{Call: _e.mock.On("ReloadID", ctx)} +} + +func (_c *Agent_ReloadID_Call) Run(run func(ctx context.Context)) *Agent_ReloadID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Agent_ReloadID_Call) Return(_a0 error) *Agent_ReloadID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_ReloadID_Call) RunAndReturn(run func(context.Context) error) *Agent_ReloadID_Call { + _c.Call.Return(run) + return _c +} + +// SetLogLevel provides a mock function with given fields: ctx, level +func (_m *Agent) SetLogLevel(ctx context.Context, level string) error { + ret := _m.Called(ctx, level) + + if len(ret) == 0 { + panic("no return value specified for SetLogLevel") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, level) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Agent_SetLogLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLogLevel' +type Agent_SetLogLevel_Call struct { + *mock.Call +} + +// SetLogLevel is a helper method to define mock.On call +// - ctx context.Context +// - level string +func (_e *Agent_Expecter) SetLogLevel(ctx interface{}, level interface{}) *Agent_SetLogLevel_Call { + return &Agent_SetLogLevel_Call{Call: _e.mock.On("SetLogLevel", ctx, level)} +} + +func (_c *Agent_SetLogLevel_Call) Run(run func(ctx context.Context, level string)) *Agent_SetLogLevel_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Agent_SetLogLevel_Call) Return(_a0 error) *Agent_SetLogLevel_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_SetLogLevel_Call) RunAndReturn(run func(context.Context, string) error) *Agent_SetLogLevel_Call { + _c.Call.Return(run) + return _c +} + +// Snapshot provides a mock function with given fields: +func (_m *Agent) Snapshot() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Snapshot") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Agent_Snapshot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Snapshot' +type Agent_Snapshot_Call struct { + *mock.Call +} + +// Snapshot is a helper method to define mock.On call +func (_e *Agent_Expecter) Snapshot() *Agent_Snapshot_Call { + return &Agent_Snapshot_Call{Call: _e.mock.On("Snapshot")} +} + +func (_c *Agent_Snapshot_Call) Run(run func()) *Agent_Snapshot_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Agent_Snapshot_Call) Return(_a0 bool) *Agent_Snapshot_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_Snapshot_Call) RunAndReturn(run func() bool) *Agent_Snapshot_Call { + _c.Call.Return(run) + return _c +} + +// Unprivileged provides a mock function with given fields: +func (_m *Agent) Unprivileged() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Unprivileged") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Agent_Unprivileged_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unprivileged' +type Agent_Unprivileged_Call struct { + *mock.Call +} + +// Unprivileged is a helper method to define mock.On call +func (_e *Agent_Expecter) Unprivileged() *Agent_Unprivileged_Call { + return &Agent_Unprivileged_Call{Call: _e.mock.On("Unprivileged")} +} + +func (_c *Agent_Unprivileged_Call) Run(run func()) *Agent_Unprivileged_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Agent_Unprivileged_Call) Return(_a0 bool) *Agent_Unprivileged_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_Unprivileged_Call) RunAndReturn(run func() bool) *Agent_Unprivileged_Call { + _c.Call.Return(run) + return _c +} + +// Version provides a mock function with given fields: +func (_m *Agent) Version() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Version") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Agent_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type Agent_Version_Call struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +func (_e *Agent_Expecter) Version() *Agent_Version_Call { + return &Agent_Version_Call{Call: _e.mock.On("Version")} +} + +func (_c *Agent_Version_Call) Run(run func()) *Agent_Version_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Agent_Version_Call) Return(_a0 string) *Agent_Version_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Agent_Version_Call) RunAndReturn(run func() string) *Agent_Version_Call { + _c.Call.Return(run) + return _c +} + +// NewAgent creates a new instance of Agent. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewAgent(t interface { + mock.TestingT + Cleanup(func()) +}) *Agent { + mock := &Agent{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internal/pkg/agent/application/actions/handlers/mocks/acker.go b/testing/mocks/internal_/pkg/fleetapi/acker/acker_mock.go similarity index 88% rename from internal/pkg/agent/application/actions/handlers/mocks/acker.go rename to testing/mocks/internal_/pkg/fleetapi/acker/acker_mock.go index 4ba93c357c9..984eb6321aa 100644 --- a/internal/pkg/agent/application/actions/handlers/mocks/acker.go +++ b/testing/mocks/internal_/pkg/fleetapi/acker/acker_mock.go @@ -2,13 +2,9 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated by mockery v2.23.1. DO NOT EDIT. +// Code generated by mockery v2.42.2. DO NOT EDIT. -// 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 mocks +package acker import ( context "context" @@ -35,6 +31,10 @@ func (_m *Acker) EXPECT() *Acker_Expecter { func (_m *Acker) Ack(ctx context.Context, action fleetapi.Action) error { ret := _m.Called(ctx, action) + if len(ret) == 0 { + panic("no return value specified for Ack") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, fleetapi.Action) error); ok { r0 = rf(ctx, action) @@ -78,6 +78,10 @@ func (_c *Acker_Ack_Call) RunAndReturn(run func(context.Context, fleetapi.Action func (_m *Acker) Commit(ctx context.Context) error { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Commit") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(ctx) @@ -116,13 +120,12 @@ func (_c *Acker_Commit_Call) RunAndReturn(run func(context.Context) error) *Acke return _c } -type mockConstructorTestingTNewAcker interface { +// NewAcker creates a new instance of Acker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewAcker(t interface { mock.TestingT Cleanup(func()) -} - -// NewAcker creates a new instance of Acker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewAcker(t mockConstructorTestingTNewAcker) *Acker { +}) *Acker { mock := &Acker{} mock.Mock.Test(t) diff --git a/pkg/control/v2/client/mocks/client.go b/testing/mocks/pkg/control/v2/client/client_mock.go similarity index 96% rename from pkg/control/v2/client/mocks/client.go rename to testing/mocks/pkg/control/v2/client/client_mock.go index 1b6668798a3..e688490e67a 100644 --- a/pkg/control/v2/client/mocks/client.go +++ b/testing/mocks/pkg/control/v2/client/client_mock.go @@ -2,9 +2,9 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated by mockery v2.36.0. DO NOT EDIT. +// Code generated by mockery v2.42.2. DO NOT EDIT. -package mocks +package client import ( context "context" @@ -35,6 +35,10 @@ func (_m *Client) EXPECT() *Client_Expecter { func (_m *Client) Configure(ctx context.Context, config string) error { ret := _m.Called(ctx, config) + if len(ret) == 0 { + panic("no return value specified for Configure") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { r0 = rf(ctx, config) @@ -85,6 +89,10 @@ func (_m *Client) Connect(ctx context.Context, opts ...grpc.DialOption) error { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Connect") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, ...grpc.DialOption) error); ok { r0 = rf(ctx, opts...) @@ -135,6 +143,10 @@ func (_c *Client_Connect_Call) RunAndReturn(run func(context.Context, ...grpc.Di func (_m *Client) DiagnosticAgent(ctx context.Context, additionalDiags []cproto.AdditionalDiagnosticRequest) ([]client.DiagnosticFileResult, error) { ret := _m.Called(ctx, additionalDiags) + if len(ret) == 0 { + panic("no return value specified for DiagnosticAgent") + } + var r0 []client.DiagnosticFileResult var r1 error if rf, ok := ret.Get(0).(func(context.Context, []cproto.AdditionalDiagnosticRequest) ([]client.DiagnosticFileResult, error)); ok { @@ -197,6 +209,10 @@ func (_m *Client) DiagnosticComponents(ctx context.Context, additionalDiags []cp _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for DiagnosticComponents") + } + var r0 []client.DiagnosticComponentResult var r1 error if rf, ok := ret.Get(0).(func(context.Context, []cproto.AdditionalDiagnosticRequest, ...client.DiagnosticComponentRequest) ([]client.DiagnosticComponentResult, error)); ok { @@ -267,6 +283,10 @@ func (_m *Client) DiagnosticUnits(ctx context.Context, units ...client.Diagnosti _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for DiagnosticUnits") + } + var r0 []client.DiagnosticUnitResult var r1 error if rf, ok := ret.Get(0).(func(context.Context, ...client.DiagnosticUnitRequest) ([]client.DiagnosticUnitResult, error)); ok { @@ -361,6 +381,10 @@ func (_c *Client_Disconnect_Call) RunAndReturn(run func()) *Client_Disconnect_Ca func (_m *Client) Restart(ctx context.Context) error { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Restart") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(ctx) @@ -403,6 +427,10 @@ func (_c *Client_Restart_Call) RunAndReturn(run func(context.Context) error) *Cl func (_m *Client) State(ctx context.Context) (*client.AgentState, error) { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for State") + } + var r0 *client.AgentState var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*client.AgentState, error)); ok { @@ -457,6 +485,10 @@ func (_c *Client_State_Call) RunAndReturn(run func(context.Context) (*client.Age func (_m *Client) StateWatch(ctx context.Context) (client.ClientStateWatch, error) { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for StateWatch") + } + var r0 client.ClientStateWatch var r1 error if rf, ok := ret.Get(0).(func(context.Context) (client.ClientStateWatch, error)); ok { @@ -518,6 +550,10 @@ func (_m *Client) Upgrade(ctx context.Context, version string, sourceURI string, _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Upgrade") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string, bool, bool, ...string) (string, error)); ok { @@ -582,6 +618,10 @@ func (_c *Client_Upgrade_Call) RunAndReturn(run func(context.Context, string, st func (_m *Client) Version(ctx context.Context) (client.Version, error) { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Version") + } + var r0 client.Version var r1 error if rf, ok := ret.Get(0).(func(context.Context) (client.Version, error)); ok { diff --git a/testing/proxytest/proxytest.go b/testing/proxytest/proxytest.go index d2d33bbb3ce..520e65dccb3 100644 --- a/testing/proxytest/proxytest.go +++ b/testing/proxytest/proxytest.go @@ -5,6 +5,7 @@ package proxytest import ( + "crypto/tls" "fmt" "io" "log" @@ -25,7 +26,7 @@ type Proxy struct { // Port is the port Server is listening on. Port string - // LocalhostURL is the server URL as "http://localhost:PORT". + // LocalhostURL is the server URL as "http(s)://localhost:PORT". LocalhostURL string // proxiedRequests is a "request log" for every request the proxy receives. @@ -42,8 +43,9 @@ type options struct { rewriteHost func(string) string rewriteURL func(u *url.URL) // logFn if set will be used to log every request. - logFn func(format string, a ...any) - verbose bool + logFn func(format string, a ...any) + verbose bool + serverTLSConfig *tls.Config } // WithAddress will set the address the server will listen on. The format is as @@ -90,6 +92,12 @@ func WithRewriteFn(f func(u *url.URL)) Option { } } +func WithServerTLSConfig(tc *tls.Config) Option { + return func(o *options) { + o.serverTLSConfig = tc + } +} + // New returns a new Proxy ready for use. Use: // - WithAddress to set the proxy's address, // - WithRewrite or WithRewriteFn to rewrite the URL before forwarding the request. @@ -114,10 +122,8 @@ func New(t *testing.T, optns ...Option) *Proxy { p := Proxy{opts: opts} - p.Server = &httptest.Server{ - Listener: l, - //nolint:gosec,nolintlint // it's a test - Config: &http.Server{Handler: http.HandlerFunc(func(ww http.ResponseWriter, r *http.Request) { + p.Server = httptest.NewUnstartedServer( + http.HandlerFunc(func(ww http.ResponseWriter, r *http.Request) { w := &statusResponseWriter{w: ww} requestID := uuid.New().String() @@ -128,8 +134,13 @@ func New(t *testing.T, optns ...Option) *Proxy { opts.logFn(fmt.Sprintf("[%s] DONE %d - %s %s %s %s\n", requestID, w.statusCode, r.Method, r.URL, r.Proto, r.RemoteAddr)) - })}} - p.Start() + }), + ) + p.Server.Listener = l + + if opts.serverTLSConfig != nil { + p.Server.TLS = opts.serverTLSConfig + } u, err := url.Parse(p.URL) if err != nil { @@ -143,6 +154,34 @@ func New(t *testing.T, optns ...Option) *Proxy { return &p } +func (p *Proxy) Start() error { + p.Server.Start() + u, err := url.Parse(p.URL) + if err != nil { + return fmt.Errorf("could not parse fleet-server URL: %w", err) + } + + p.Port = u.Port() + p.LocalhostURL = "http://localhost:" + p.Port + + p.opts.logFn("running on %s -> %s", p.URL, p.LocalhostURL) + return nil +} + +func (p *Proxy) StartTLS() error { + p.Server.StartTLS() + u, err := url.Parse(p.URL) + if err != nil { + return fmt.Errorf("could not parse fleet-server URL: %w", err) + } + + p.Port = u.Port() + p.LocalhostURL = "https://localhost:" + p.Port + + p.opts.logFn("running on %s -> %s", p.URL, p.LocalhostURL) + return nil +} + func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { origURL := r.URL.String() diff --git a/testing/proxytest/proxytest_test.go b/testing/proxytest/proxytest_test.go new file mode 100644 index 00000000000..c5094d88383 --- /dev/null +++ b/testing/proxytest/proxytest_test.go @@ -0,0 +1,332 @@ +// 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 proxytest + +import ( + "context" + "crypto/rand" + "crypto/rsa" + "crypto/tls" + "crypto/x509" + "crypto/x509/pkix" + "fmt" + "io" + "math/big" + "net" + "net/http" + "net/http/httptest" + "net/url" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestProxy(t *testing.T) { + + // Eagerly create objects for TLS setup with CA and server certificate + caCertificate, _, caPrivateKey, err := createCaCertificate() + require.NoError(t, err, "error creating CA cert and key") + + serverCert, serverCertBytes, serverPrivateKey, err := createCertificateSignedByCA(caCertificate, caPrivateKey) + require.NoError(t, err, "error creating server certificate") + + caCertPool := x509.NewCertPool() + caCertPool.AddCert(caCertificate) + + type setup struct { + fakeBackendServer *httptest.Server + generateTestHttpClient func(t *testing.T, proxy *Proxy) *http.Client + } + type testRequest struct { + method string + url string + body io.Reader + } + type testcase struct { + name string + setup setup + proxyOptions []Option + proxyStartTLS bool + request testRequest + wantErr assert.ErrorAssertionFunc + assertFunc func(t *testing.T, proxy *Proxy, resp *http.Response) + } + + testcases := []testcase{ + { + name: "Basic scenario, no TLS", + setup: setup{ + fakeBackendServer: createFakeBackendServer(), + generateTestHttpClient: nil, + }, + proxyOptions: nil, + proxyStartTLS: false, + request: testRequest{ + method: http.MethodGet, + url: "http://somehost:1234/some/path/here", + body: nil, + }, + wantErr: assert.NoError, + assertFunc: func(t *testing.T, proxy *Proxy, resp *http.Response) { + assert.Equal(t, http.StatusOK, resp.StatusCode) + if assert.NotEmpty(t, proxy.ProxiedRequests(), "proxy should have captured at least 1 request") { + assert.Contains(t, proxy.ProxiedRequests()[0], "/some/path/here") + } + }, + }, + { + name: "TLS scenario, server cert validation", + setup: setup{ + fakeBackendServer: createFakeBackendServer(), + generateTestHttpClient: func(t *testing.T, proxy *Proxy) *http.Client { + proxyURL, err := url.Parse(proxy.URL) + require.NoErrorf(t, err, "failed to parse proxy URL %q", proxy.URL) + + // Client trusting the proxy cert CA + return &http.Client{ + Transport: &http.Transport{ + Proxy: http.ProxyURL(proxyURL), + TLSClientConfig: &tls.Config{ + RootCAs: caCertPool, + MinVersion: tls.VersionTLS12, + }, + }, + } + }, + }, + proxyOptions: []Option{ + WithServerTLSConfig(&tls.Config{ + ClientCAs: caCertPool, + Certificates: []tls.Certificate{{ + Certificate: [][]byte{serverCertBytes}, + PrivateKey: serverPrivateKey, + Leaf: serverCert, + }}, + MinVersion: tls.VersionTLS12, + }), + }, + proxyStartTLS: true, + request: testRequest{ + method: http.MethodGet, + url: "http://somehost:1234/some/path/here", + body: nil, + }, + wantErr: assert.NoError, + assertFunc: func(t *testing.T, proxy *Proxy, resp *http.Response) { + assert.Equal(t, http.StatusOK, resp.StatusCode) + if assert.NotEmpty(t, proxy.ProxiedRequests(), "proxy should have captured at least 1 request") { + assert.Contains(t, proxy.ProxiedRequests()[0], "/some/path/here") + } + }, + }, + { + name: "mTLS scenario, client and server cert validation", + setup: setup{ + fakeBackendServer: createFakeBackendServer(), + generateTestHttpClient: func(t *testing.T, proxy *Proxy) *http.Client { + proxyURL, err := url.Parse(proxy.URL) + require.NoErrorf(t, err, "failed to parse proxy URL %q", proxy.URL) + + // Client certificate + clientCert, clientCertBytes, clientPrivateKey, err := createCertificateSignedByCA(caCertificate, caPrivateKey) + require.NoError(t, err, "error creating client certificate") + + // Client with its own certificate and trusting the proxy cert CA + return &http.Client{ + Transport: &http.Transport{ + Proxy: http.ProxyURL(proxyURL), + TLSClientConfig: &tls.Config{ + RootCAs: caCertPool, + Certificates: []tls.Certificate{ + { + Certificate: [][]byte{clientCertBytes}, + PrivateKey: clientPrivateKey, + Leaf: clientCert, + }, + }, + MinVersion: tls.VersionTLS12, + }, + }} + }, + }, + proxyOptions: []Option{ + // require client authentication and verify cert + WithServerTLSConfig(&tls.Config{ + ClientCAs: caCertPool, + ClientAuth: tls.RequireAndVerifyClientCert, + Certificates: []tls.Certificate{{ + Certificate: [][]byte{serverCertBytes}, + PrivateKey: serverPrivateKey, + Leaf: serverCert, + }}, + MinVersion: tls.VersionTLS12, + }), + }, + proxyStartTLS: true, + request: testRequest{ + method: http.MethodGet, + url: "http://somehost:1234/some/path/here", + body: nil, + }, + wantErr: assert.NoError, + assertFunc: func(t *testing.T, proxy *Proxy, resp *http.Response) { + assert.Equal(t, http.StatusOK, resp.StatusCode) + if assert.NotEmpty(t, proxy.ProxiedRequests(), "proxy should have captured at least 1 request") { + assert.Contains(t, proxy.ProxiedRequests()[0], "/some/path/here") + } + }, + }, + } + + for _, tt := range testcases { + t.Run(tt.name, func(t *testing.T) { + var proxyOpts []Option + + if tt.setup.fakeBackendServer != nil { + defer tt.setup.fakeBackendServer.Close() + serverURL, err := url.Parse(tt.setup.fakeBackendServer.URL) + require.NoErrorf(t, err, "failed to parse test HTTP server URL %q", tt.setup.fakeBackendServer.URL) + proxyOpts = append(proxyOpts, WithRewriteFn(func(u *url.URL) { + // redirect the requests on the proxy itself + u.Host = serverURL.Host + })) + } + + proxyOpts = append(proxyOpts, tt.proxyOptions...) + proxy := New(t, proxyOpts...) + + if tt.proxyStartTLS { + t.Log("Starting proxytest with TLS") + err = proxy.StartTLS() + } else { + t.Log("Starting proxytest without TLS") + err = proxy.Start() + } + + require.NoError(t, err, "error starting proxytest") + + defer proxy.Close() + + proxyURL, err := url.Parse(proxy.URL) + require.NoErrorf(t, err, "failed to parse proxy URL %q", proxy.URL) + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + + req, err := http.NewRequestWithContext(ctx, tt.request.method, tt.request.url, tt.request.body) + require.NoError(t, err, "error creating request") + + var client *http.Client + if tt.setup.generateTestHttpClient != nil { + client = tt.setup.generateTestHttpClient(t, proxy) + } else { + // basic HTTP client using the proxy + client = &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)}} + } + + resp, err := client.Do(req) + if resp != nil { + defer resp.Body.Close() + } + if tt.wantErr(t, err, "unexpected error return value") && tt.assertFunc != nil { + tt.assertFunc(t, proxy, resp) + } + }) + } + +} + +func createFakeBackendServer() *httptest.Server { + handlerF := func(writer http.ResponseWriter, request *http.Request) { + // always return HTTP 200 + writer.WriteHeader(http.StatusOK) + } + + fakeBackendHTTPServer := httptest.NewServer(http.HandlerFunc(handlerF)) + return fakeBackendHTTPServer +} + +// utility function to create a CA cert and related key for tests. It returns certificate and key as PEM-encoded blocks +func createCaCertificate() (cert *x509.Certificate, certBytes []byte, privateKey *rsa.PrivateKey, err error) { + // set up our CA certificate + ca := &x509.Certificate{ + SerialNumber: big.NewInt(2023), + Subject: pkix.Name{ + Organization: []string{"Elastic Agent Testing Company, INC."}, + Country: []string{"US"}, + Province: []string{""}, + Locality: []string{"San Francisco"}, + StreetAddress: []string{"Golden Gate Bridge"}, + PostalCode: []string{"94016"}, + }, + NotBefore: time.Now(), + NotAfter: time.Now().AddDate(0, 0, 1), + IsCA: true, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, + KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, + BasicConstraintsValid: true, + } + + // create our private and public key + caPrivateKey, err := rsa.GenerateKey(rand.Reader, 4096) + if err != nil { + return nil, nil, nil, err + } + + // create the CA + caBytes, err := x509.CreateCertificate(rand.Reader, ca, ca, &caPrivateKey.PublicKey, caPrivateKey) + if err != nil { + return nil, nil, nil, err + } + + cert, err = x509.ParseCertificate(caBytes) + if err != nil { + return nil, nil, nil, fmt.Errorf("error parsing generated CA cert: %w", err) + } + + return cert, caBytes, caPrivateKey, nil +} + +// utility function to create a new certificate signed by a CA and related key for tests. +// Both paramenters and returned certificate and key are PEM-encoded blocks. +func createCertificateSignedByCA(caCert *x509.Certificate, caPrivateKey *rsa.PrivateKey) (cert *x509.Certificate, certBytes []byte, privateKey *rsa.PrivateKey, err error) { + certTemplate := &x509.Certificate{ + SerialNumber: big.NewInt(2024), + Subject: pkix.Name{ + Organization: []string{"Elastic Agent Testing Company, INC."}, + Country: []string{"US"}, + Province: []string{""}, + Locality: []string{"San Francisco"}, + StreetAddress: []string{"Golden Gate Bridge"}, + PostalCode: []string{"94016"}, + }, + IPAddresses: []net.IP{net.IPv4(127, 0, 0, 1), net.IPv6loopback, net.IPv6zero}, + DNSNames: []string{"localhost"}, + NotBefore: time.Now(), + NotAfter: time.Now().AddDate(0, 0, 1), + SubjectKeyId: []byte{1, 2, 3, 4, 6}, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, + KeyUsage: x509.KeyUsageDigitalSignature, + } + + certPrivKey, err := rsa.GenerateKey(rand.Reader, 4096) + if err != nil { + return nil, nil, nil, err + } + + certBytes, err = x509.CreateCertificate(rand.Reader, certTemplate, caCert, &certPrivKey.PublicKey, caPrivateKey) + if err != nil { + return nil, nil, nil, fmt.Errorf("error creating new certificate: %w", err) + } + + cert, err = x509.ParseCertificate(certBytes) + if err != nil { + return nil, nil, nil, fmt.Errorf("error parsing new certificate: %w", err) + } + + return cert, certBytes, certPrivKey, nil +} diff --git a/testing/upgradetest/upgrader.go b/testing/upgradetest/upgrader.go index 2d598dad833..b8e8f70feb3 100644 --- a/testing/upgradetest/upgrader.go +++ b/testing/upgradetest/upgrader.go @@ -12,15 +12,18 @@ import ( "os" "path/filepath" "runtime" + "strings" "time" + "github.com/elastic/elastic-agent/testing/installtest" + + "github.com/hectane/go-acl" "github.com/otiai10/copy" "github.com/elastic/elastic-agent/internal/pkg/agent/application/upgrade/details" v1client "github.com/elastic/elastic-agent/pkg/control/v1/client" v2proto "github.com/elastic/elastic-agent/pkg/control/v2/cproto" atesting "github.com/elastic/elastic-agent/pkg/testing" - "github.com/elastic/elastic-agent/pkg/testing/define" "github.com/elastic/elastic-agent/pkg/version" ) @@ -208,8 +211,7 @@ func PerformUpgrade( // in the unprivileged is unset we adjust it to use unprivileged when the version allows it // in the case that its explicitly set then we ensure the version supports it if upgradeOpts.unprivileged == nil { - if !startVersion.Less(*Version_8_13_0) && !endVersion.Less(*Version_8_13_0) && runtime.GOOS == define.Linux { - // both version support --unprivileged + if SupportsUnprivileged(startVersion, endVersion) { unprivileged := true upgradeOpts.unprivileged = &unprivileged logger.Logf("installation of Elastic Agent will use --unprivileged as both start and end version support --unprivileged mode") @@ -219,11 +221,8 @@ func PerformUpgrade( upgradeOpts.unprivileged = &unprivileged } } else if *upgradeOpts.unprivileged { - if startVersion.Less(*Version_8_13_0) { - return errors.New("cannot install starting version with --unprivileged (which is default) because the it is older than 8.13") - } - if endVersion.Less(*Version_8_13_0) { - return errors.New("cannot upgrade to ending version as end version doesn't support running with --unprivileged (which is default) because it is older than 8.13") + if !SupportsUnprivileged(startVersion, endVersion) { + return fmt.Errorf("cannot install with forced --unprivileged because either start version %s or end version %s doesn't support --unprivileged mode", startVersion.String(), endVersion.String()) } } @@ -260,7 +259,7 @@ func PerformUpgrade( installOpts := atesting.InstallOpts{ NonInteractive: nonInteractiveFlag, Force: true, - Unprivileged: upgradeOpts.unprivileged, + Privileged: !(*upgradeOpts.unprivileged), } output, err := startFixture.Install(ctx, &installOpts) if err != nil { @@ -280,6 +279,14 @@ func PerformUpgrade( return err } + // validate installation is correct + if InstallChecksAllowed(!installOpts.Privileged, startVersion) { + err = installtest.CheckSuccess(ctx, startFixture, installOpts.BasePath, &installtest.CheckOpts{Privileged: installOpts.Privileged}) + if err != nil { + return fmt.Errorf("pre-upgrade installation checks failed: %w", err) + } + } + if upgradeOpts.preUpgradeHook != nil { if err := upgradeOpts.preUpgradeHook(); err != nil { return fmt.Errorf("pre upgrade hook failed: %w", err) @@ -325,7 +332,15 @@ func PerformUpgrade( upgradeOutput, err := startFixture.Exec(ctx, upgradeCmdArgs) if err != nil { - return fmt.Errorf("failed to start agent upgrade to version %q: %w\n%s", endVersionInfo.Binary.Version, err, upgradeOutput) + // Sometimes the gRPC server shuts down before replying to the command which is expected + // we can determine this state by the EOF error coming from the server. + // If the server is just unavailable/not running, we should not succeed. + // Starting with version 8.13.2, this is handled by the upgrade command itself. + outputString := string(upgradeOutput) + isConnectionInterrupted := strings.Contains(outputString, "Unavailable") && strings.Contains(outputString, "EOF") + if !isConnectionInterrupted { + return fmt.Errorf("failed to start agent upgrade to version %q: %w\n%s", endVersionInfo.Binary.Version, err, upgradeOutput) + } } // wait for the watcher to show up @@ -395,6 +410,14 @@ func PerformUpgrade( return err } + // validate again that the installation is correct, upgrade should not have changed installation validation + if InstallChecksAllowed(!installOpts.Privileged, startVersion, endVersion) { + err = installtest.CheckSuccess(ctx, startFixture, installOpts.BasePath, &installtest.CheckOpts{Privileged: installOpts.Privileged}) + if err != nil { + return fmt.Errorf("post-upgrade installation checks failed: %w", err) + } + } + return nil } @@ -565,7 +588,19 @@ func getSourceURI(ctx context.Context, f *atesting.Fixture, unprivileged bool) ( } if unprivileged { // move the file to temp directory - dir, err := os.MkdirTemp("", "agent-upgrade-*") + baseTmp := "" + if runtime.GOOS == "windows" { + // `elastic-agent-user` needs to have access to the file, default + // will place this in C:\Users\windows\AppData\Local\Temp\ which + // `elastic-agent-user` doesn't have access. + + // create C:\Temp with world read/write to use for temp directory + baseTmp, err = windowsBaseTemp() + if err != nil { + return "", fmt.Errorf("failed to create windows base temp path: %w", err) + } + } + dir, err := os.MkdirTemp(baseTmp, "agent-upgrade-*") if err != nil { return "", fmt.Errorf("failed to create temp directory: %w", err) } @@ -587,3 +622,22 @@ func getSourceURI(ctx context.Context, f *atesting.Fixture, unprivileged bool) ( } return "file://" + filepath.Dir(srcPkg), nil } + +func windowsBaseTemp() (string, error) { + baseTmp := "C:\\Temp" + _, err := os.Stat(baseTmp) + if err != nil { + if !errors.Is(err, os.ErrNotExist) { + return "", fmt.Errorf("failed to stat %s: %w", baseTmp, err) + } + err = os.Mkdir(baseTmp, 0777) + if err != nil { + return "", fmt.Errorf("failed to mkdir %s: %w", baseTmp, err) + } + } + err = acl.Chmod(baseTmp, 0777) + if err != nil { + return "", fmt.Errorf("failed to chmod %s: %w", baseTmp, err) + } + return baseTmp, nil +} diff --git a/testing/upgradetest/versions.go b/testing/upgradetest/versions.go index cdc66666fd7..d41ff8b2057 100644 --- a/testing/upgradetest/versions.go +++ b/testing/upgradetest/versions.go @@ -11,6 +11,7 @@ import ( "fmt" "os" "path/filepath" + "runtime" "sort" "strings" @@ -35,8 +36,8 @@ var ( Version_8_11_0_SNAPSHOT = version.NewParsedSemVer(8, 11, 0, "SNAPSHOT", "") // Version_8_13_0_SNAPSHOT is the minimum version for testing upgrading agent with the same hash Version_8_13_0_SNAPSHOT = version.NewParsedSemVer(8, 13, 0, "SNAPSHOT", "") - // Version_8_13_0 is the minimum version for proper unprivileged execution - Version_8_13_0 = version.NewParsedSemVer(8, 13, 0, "", "") + // Version_8_14_0_SNAPSHOT is the minimum version for proper unprivileged execution on all platforms + Version_8_14_0_SNAPSHOT = version.NewParsedSemVer(8, 14, 0, "SNAPSHOT", "") // ErrNoSnapshot is returned when a requested snapshot is not on the version list. ErrNoSnapshot = errors.New("failed to find a snapshot on the version list") @@ -254,3 +255,41 @@ func EnsureSnapshot(version string) string { } return version } + +// SupportsUnprivileged returns true when the version supports unprivileged mode. +func SupportsUnprivileged(versions ...*version.ParsedSemVer) bool { + for _, ver := range versions { + if ver.Less(*Version_8_13_0_SNAPSHOT) { + return false + } + if runtime.GOOS != define.Linux && ver.Less(*Version_8_14_0_SNAPSHOT) { + return false + } + } + return true +} + +// InstallChecksAllowed returns true when the upgrade test should verify installation. +// +// Unprivileged mode both versions must be 8.14+. This is because the older versions do not +// create the same user that is created in 8.14+. pre-8.14 was experimental. +// +// Privileged mode requires 8.13+ because pre-8.13 didn't set the `.installed` file to not have world access. +func InstallChecksAllowed(unprivileged bool, versions ...*version.ParsedSemVer) bool { + if unprivileged { + for _, ver := range versions { + if ver.Less(*Version_8_14_0_SNAPSHOT) { + // all versions must be 8.14+ + return false + } + } + return true + } + for _, ver := range versions { + if ver.Less(*Version_8_13_0_SNAPSHOT) { + // all versions must be 8.13+ + return false + } + } + return true +} diff --git a/testing/upgradetest/watcher.go b/testing/upgradetest/watcher.go index fd34dc82a7f..ab2312874fc 100644 --- a/testing/upgradetest/watcher.go +++ b/testing/upgradetest/watcher.go @@ -101,7 +101,7 @@ func WaitForNoWatcher(ctx context.Context, timeout time.Duration, interval time. for _, pid := range pids { proc, err := os.FindProcess(pid) if err == nil { - _ = proc.Kill() + _ = killNoneChildProcess(proc) } } // next interval ticker will check for no watcher and exit diff --git a/testing/upgradetest/watcher_unix.go b/testing/upgradetest/watcher_unix.go new file mode 100644 index 00000000000..858392145d2 --- /dev/null +++ b/testing/upgradetest/watcher_unix.go @@ -0,0 +1,16 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build !windows + +package upgradetest + +import "os" + +// killNoneChildProcess provides a way of killing a process that is not started as a child of this process. +// +// On Unix systems it just calls the native golang kill. +func killNoneChildProcess(proc *os.Process) error { + return proc.Kill() +} diff --git a/testing/upgradetest/watcher_windows.go b/testing/upgradetest/watcher_windows.go new file mode 100644 index 00000000000..15716f11bfd --- /dev/null +++ b/testing/upgradetest/watcher_windows.go @@ -0,0 +1,28 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + +//go:build windows + +package upgradetest + +import ( + "os" + "syscall" +) + +// killNoneChildProcess provides a way of killing a process that is not started as a child of this process. +// +// On Windows when running in unprivileged mode the internal way that golang uses DuplicateHandle to perform the kill +// only works when the process is a child of this process. +func killNoneChildProcess(proc *os.Process) error { + h, e := syscall.OpenProcess(syscall.PROCESS_TERMINATE, false, uint32(proc.Pid)) + if e != nil { + return os.NewSyscallError("OpenProcess", e) + } + defer func() { + _ = syscall.CloseHandle(h) + }() + e = syscall.TerminateProcess(h, 1) + return os.NewSyscallError("TerminateProcess", e) +} diff --git a/version/docs/version.asciidoc b/version/docs/version.asciidoc index 4416ed67036..39274d373b7 100644 --- a/version/docs/version.asciidoc +++ b/version/docs/version.asciidoc @@ -3,7 +3,7 @@ // FIXME: once elastic.co docs have been switched over to use `main`, remove // the `doc-site-branch` line below as well as any references to it in the code. :doc-site-branch: master -:go-version: 1.21.8 +:go-version: 1.21.11 :release-state: unreleased :python: 3.7 :docker: 1.12 diff --git a/version/helper.go b/version/helper.go index 2bec8781884..966b07a967d 100644 --- a/version/helper.go +++ b/version/helper.go @@ -11,6 +11,8 @@ import ( "runtime" "strings" "time" + + "github.com/elastic/elastic-agent/pkg/version" ) // GetDefaultVersion returns the current libbeat version. @@ -23,10 +25,11 @@ func GetDefaultVersion() string { } var ( - buildTime = "unknown" - commit = "unknown" - qualifier = "" - packageVersion = "" + buildTime = "unknown" + commit = "unknown" + qualifier = "" + packageVersion = "" + parsedPackageVersion *version.ParsedSemVer ) const PackageVersionFileName = "package.version" @@ -54,14 +57,27 @@ func InitVersionInformation() error { } versionBytes, err := os.ReadFile(packageVersionFilePath) if err != nil { - // fallback to default binary version - packageVersion = GetDefaultVersion() + fallbackToDefaultVersion() return fmt.Errorf("reading package version from file %q: %w", packageVersionFilePath, err) } - packageVersion = strings.TrimSpace(string(versionBytes)) + fileVersion := strings.TrimSpace(string(versionBytes)) + // Set the version from the file content + packageVersion = fileVersion + parsedPackageVersion, err = version.ParseVersion(fileVersion) + if err != nil { + fallbackToDefaultVersion() + return fmt.Errorf("parsing version %q: %w", fileVersion, err) + } return nil } +func fallbackToDefaultVersion() { + // fallback to default binary version + packageVersion = GetDefaultVersion() + // guaranteed to be correct as it is set in code + parsedPackageVersion, _ = version.ParseVersion(GetDefaultVersion()) +} + // GetAgentPackageVersion retrieves the version saved in package.version in the same // directory as the agent executable. // This function must be called AFTER InitVersionInformation() has initialized the module vars @@ -69,6 +85,13 @@ func GetAgentPackageVersion() string { return packageVersion } +// GetParsedAgentPackageVersion retrieves the version saved in package.version in the same +// directory as the agent executable and returns it as a parsed semver object. +// This function must be called AFTER InitVersionInformation() has initialized the module vars +func GetParsedAgentPackageVersion() *version.ParsedSemVer { + return parsedPackageVersion +} + // GetAgentPackageVersionFilePath returns the path where the package version file // should be located (side by side with the currently executing binary) func GetAgentPackageVersionFilePath() (string, error) { diff --git a/version/version.go b/version/version.go index 7b092deae14..221478d33bf 100644 --- a/version/version.go +++ b/version/version.go @@ -4,5 +4,5 @@ package version -const defaultBeatVersion = "8.14.0" +const defaultBeatVersion = "8.15.0" const Agent = defaultBeatVersion