-
Notifications
You must be signed in to change notification settings - Fork 527
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request does not have a backport label. Could you fix it @leehinman? 🙏
|
|
endorama
approved these changes
Oct 1, 2024
325d7d8
to
e66b89f
Compare
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
4ccc2b9
to
2b08f10
Compare
1pkg
approved these changes
Oct 1, 2024
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>
This was referenced Oct 7, 2024
carsonip
added a commit
to carsonip/apm-server
that referenced
this pull request
Oct 8, 2024
This reverts commit 7efa6d5.
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Without this change
cfgfile.HandleFlags
was not correctly parsing command lines like: