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

Backport of Add node id/name to config into release/1.15.x #17795

Merged

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #17750 to be assessed for backporting due to the inclusion of the label backport/1.15.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@chapmanc
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: unable to process merge commit: "896e04ed616b432abfc501526fde55f6eef983a2", automatic backport requires rebase workflow

The below text is copied from the body of the original PR.


Description

We currently don't have node name in the NewDeps call. To add it we can keep tacking on new configuration values or we can add new values to the already existing config struct that is built in the builder.

There was a mini refactor required because the cfg is also used as an interface to instantiate the metricsClient. To reduce blast radius of a very large refactor I moved the instantiation of the metricsClient out of the sink initialization and then passed in the metricClient to the sink instead of passing the cfg in as an interface which stops us from using any of the values stored in the config.

I still think we should refactor the function for NewMetricsClient to not take an interface but for now I think this is an acceptable crawl step. We should work making this code a lot simpler as we are doing quite a bit with the "config" and treating it very much not as just config.

Testing & Reproduction steps

E2E tested with real consul-telemetry gateway and E2E test with mock HCP server is showing the labels flow through:

consul-k8s/acceptance ➜  kl fake-server-79c496b6c5-x42kb 
...
2023/06/15 23:08:53 Request Headers: map[Accept-Encoding:[gzip] Authorization:[Bearer mytoken] Content-Length:[29272] Content-Type:[application/x-protobuf] User-Agent:[Go-http-client/1.1] X-Channel:[consul/1.17.0-dev] X-Hcp-Resource-Id:[organization/11eb1a35-aac0-f7c7-8fe1-0242ac110008/project/11eb1a35-ab64-d576-8fe1-0242ac110008/hashicorp.consul.global-network-manager.cluster/TEST]]
2023/06/15 23:08:53 Request Labels: map[node_id:666b2fc3-6d6f-f86d-07af-3ea2b1560cba node_name:test-enmgay-consul-server-0]

consul-k8s/acceptance ➜  kg pods
NAME                                                       READY   STATUS             RESTARTS      AGE
fake-server-79c496b6c5-x42kb                               1/1     Running            0             2m17s
test-enmgay-consul-connect-injector-644b66d6f-bqgd8        1/1     Running            0             115s
test-enmgay-consul-server-0                                1/1     Running            0             115s
test-enmgay-consul-telemetry-collector-645f69ff9f-pzwc4    2/2     Running            0             115s
test-enmgay-consul-webhook-cert-manager-5c5d676978-pnv77   1/1     Running            0             115s

Links

n/a

PR Checklist

  • updated test coverage
  • [n/a] external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved Consul Bot automated PR

@github-actions github-actions bot added the theme/config Relating to Consul Agent configuration, including reloading label Jun 16, 2023
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging June 16, 2023 18:48 Inactive
@vercel vercel bot temporarily deployed to Preview – consul June 16, 2023 18:50 Inactive
@chapmanc chapmanc force-pushed the backport/chappie/CC-5423/partly-guided-adder branch from e1a9091 to dfde1e7 Compare June 16, 2023 19:06
@chapmanc chapmanc marked this pull request as ready for review June 16, 2023 19:07
Copy link
Contributor

@chapmanc chapmanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chapmanc chapmanc enabled auto-merge (squash) June 16, 2023 19:10
@chapmanc chapmanc merged commit 9ff0f1b into release/1.15.x Jun 16, 2023
@chapmanc chapmanc deleted the backport/chappie/CC-5423/partly-guided-adder branch June 16, 2023 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/config Relating to Consul Agent configuration, including reloading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants