Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flag.Parse so HandleFlags works correctly #14214

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

leehinman
Copy link
Contributor

Without this change cfgfile.HandleFlags was not correctly parsing command lines like:

apm-server -E "management.enabled=true"

@leehinman leehinman requested a review from a team as a code owner September 30, 2024 18:59
Copy link
Contributor

mergify bot commented Sep 30, 2024

This pull request does not have a backport label. Could you fix it @leehinman? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.17 is the label to automatically backport to the 7.17 branch.
  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • backport-8.x is the label to automatically backport to the 8.x branch.

Copy link
Contributor

mergify bot commented Sep 30, 2024

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Sep 30, 2024
@leehinman leehinman force-pushed the management_enabled_parsing branch from 325d7d8 to e66b89f Compare October 1, 2024 15:07
@kruskall kruskall enabled auto-merge (squash) October 1, 2024 15:14
@carsonip carsonip changed the title add flag.Parse so HandlFlags works correctly add flag.Parse so HandleFlags works correctly Oct 1, 2024
leehinman and others added 2 commits October 1, 2024 17:54
Since go 1.13 testing flags are now only registered when running
a test binary, and packages that call flag.Parse during package
initialization may cause tests to fail.

To resolve this move the flag init to a proper function outside of
package init and call it explicitly
@kruskall kruskall force-pushed the management_enabled_parsing branch from 4ccc2b9 to 2b08f10 Compare October 1, 2024 15:54
@kruskall kruskall merged commit 7efa6d5 into elastic:main Oct 1, 2024
11 checks passed
mergify bot pushed a commit that referenced this pull request Oct 1, 2024
* add flag.Parse so HandlFlags works correctly

* fix: move flag init outside package initialization

Since go 1.13 testing flags are now only registered when running
a test binary, and packages that call flag.Parse during package
initialization may cause tests to fail.

To resolve this move the flag init to a proper function outside of
package init and call it explicitly

* build(deps): bump the dependencies group in /systemtest with 2 updates (#14213)

Bumps the dependencies group in /systemtest with 2 updates: [go.opentelemetry.io/collector/pdata](https://github.com/open-telemetry/opentelemetry-collector) and [go.opentelemetry.io/collector/semconv](https://github.com/open-telemetry/opentelemetry-collector).

Updates `go.opentelemetry.io/collector/pdata` from 1.15.0 to 1.16.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG-API.md)
- [Commits](open-telemetry/opentelemetry-collector@pdata/v1.15.0...pdata/v1.16.0)

Updates `go.opentelemetry.io/collector/semconv` from 0.109.0 to 0.110.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG-API.md)
- [Commits](open-telemetry/opentelemetry-collector@v0.109.0...v0.110.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/collector/pdata
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: go.opentelemetry.io/collector/semconv
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump go.elastic.co/go-licence-detector (#14212)

Bumps the dependencies group in /tools with 1 update: [go.elastic.co/go-licence-detector](https://github.com/elastic/go-licence-detector).

Updates `go.elastic.co/go-licence-detector` from 0.6.1 to 0.7.0
- [Release notes](https://github.com/elastic/go-licence-detector/releases)
- [Commits](elastic/go-licence-detector@v0.6.1...v0.7.0)

---
updated-dependencies:
- dependency-name: go.elastic.co/go-licence-detector
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kruskall <99559985+kruskall@users.noreply.github.com>

* ci: use ephemeral tokens (#14217)

* build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.2 to 0.11.3 (#14211)

* build(deps): bump github.com/elastic/elastic-agent-system-metrics

Bumps [github.com/elastic/elastic-agent-system-metrics](https://github.com/elastic/elastic-agent-system-metrics) from 0.11.2 to 0.11.3.
- [Release notes](https://github.com/elastic/elastic-agent-system-metrics/releases)
- [Commits](elastic/elastic-agent-system-metrics@v0.11.2...v0.11.3)

---
updated-dependencies:
- dependency-name: github.com/elastic/elastic-agent-system-metrics
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update NOTICE.txt

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: kruskall <99559985+kruskall@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: kruskal <99559985+kruskall@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 7efa6d5)
mergify bot added a commit that referenced this pull request Oct 1, 2024
* add flag.Parse so HandlFlags works correctly

* fix: move flag init outside package initialization

Since go 1.13 testing flags are now only registered when running
a test binary, and packages that call flag.Parse during package
initialization may cause tests to fail.

To resolve this move the flag init to a proper function outside of
package init and call it explicitly

* build(deps): bump the dependencies group in /systemtest with 2 updates (#14213)

Bumps the dependencies group in /systemtest with 2 updates: [go.opentelemetry.io/collector/pdata](https://github.com/open-telemetry/opentelemetry-collector) and [go.opentelemetry.io/collector/semconv](https://github.com/open-telemetry/opentelemetry-collector).

Updates `go.opentelemetry.io/collector/pdata` from 1.15.0 to 1.16.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG-API.md)
- [Commits](open-telemetry/opentelemetry-collector@pdata/v1.15.0...pdata/v1.16.0)

Updates `go.opentelemetry.io/collector/semconv` from 0.109.0 to 0.110.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG-API.md)
- [Commits](open-telemetry/opentelemetry-collector@v0.109.0...v0.110.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/collector/pdata
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: go.opentelemetry.io/collector/semconv
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump go.elastic.co/go-licence-detector (#14212)

Bumps the dependencies group in /tools with 1 update: [go.elastic.co/go-licence-detector](https://github.com/elastic/go-licence-detector).

Updates `go.elastic.co/go-licence-detector` from 0.6.1 to 0.7.0
- [Release notes](https://github.com/elastic/go-licence-detector/releases)
- [Commits](elastic/go-licence-detector@v0.6.1...v0.7.0)

---
updated-dependencies:
- dependency-name: go.elastic.co/go-licence-detector
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kruskall <99559985+kruskall@users.noreply.github.com>

* ci: use ephemeral tokens (#14217)

* build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.2 to 0.11.3 (#14211)

* build(deps): bump github.com/elastic/elastic-agent-system-metrics

Bumps [github.com/elastic/elastic-agent-system-metrics](https://github.com/elastic/elastic-agent-system-metrics) from 0.11.2 to 0.11.3.
- [Release notes](https://github.com/elastic/elastic-agent-system-metrics/releases)
- [Commits](elastic/elastic-agent-system-metrics@v0.11.2...v0.11.3)

---
updated-dependencies:
- dependency-name: github.com/elastic/elastic-agent-system-metrics
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update NOTICE.txt

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: kruskall <99559985+kruskall@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: kruskal <99559985+kruskall@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 7efa6d5)

Co-authored-by: Lee E Hinman <57081003+leehinman@users.noreply.github.com>
carsonip added a commit to carsonip/apm-server that referenced this pull request Oct 8, 2024
carsonip added a commit that referenced this pull request Oct 9, 2024
This reverts commit 7efa6d5.

Require beats bump / revert #14310 (8.x: #14309 )
Part of #14280
mergify bot pushed a commit that referenced this pull request Oct 9, 2024
This reverts commit 7efa6d5.

Require beats bump / revert #14310 (8.x: #14309 )
Part of #14280

(cherry picked from commit 01237c4)
mergify bot added a commit that referenced this pull request Oct 9, 2024
… (#14314)

This reverts commit 7efa6d5.

Require beats bump / revert #14310 (8.x: #14309 )
Part of #14280

(cherry picked from commit 01237c4)

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet]: Hosted fleet server gets unhealthy on 8.16 Snapshot.
4 participants