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

hcp.v2.TelemetryState resource and controller implementation #20257

Merged
merged 8 commits into from
Jan 31, 2024

Conversation

nickethier
Copy link
Member

@nickethier nickethier commented Jan 18, 2024

Description

This PR adds a new resource type hcp.v2.TelemetryState which is a computed resource used to signal consul-dataplane when and how to forward dataplane telemetry to HCP. When the hcp.v2.Link resource is set and the cluster has linked successfully with HCP (indicated by condition on Link resource) the TelemetryState resource is computed and written.

Followup PR will clean up some of the TODOs commented in the controller.

Testing & Reproduction steps

Controller unit tests for various input cases.

Links

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

@nickethier nickethier added pr/no-changelog PR does not need a corresponding .changelog entry pr/no-backport labels Jan 18, 2024
@nickethier nickethier self-assigned this Jan 18, 2024
An error occurred while trying to automatically change base from nickcellino/query-gnm-cluster-hcp-client to main January 19, 2024 15:02
An error occurred while trying to automatically change base from nickcellino/query-gnm-cluster-hcp-client to main January 19, 2024 15:03
@nickethier nickethier changed the title hcp.v1.TelemetryState resource and controller implementation hcp.v2.TelemetryState resource and controller implementation Jan 19, 2024
@nickethier nickethier changed the base branch from nickcellino/query-gnm-cluster-hcp-client to main January 19, 2024 23:13
@nickethier nickethier marked this pull request as ready for review January 22, 2024 21:46
@nickethier nickethier requested a review from a team as a code owner January 22, 2024 21:46
@nickethier nickethier requested a review from loshz January 22, 2024 21:47
@nickethier
Copy link
Member Author

@jjti tagged you to review the proto messages to make sure I didn't miss anything you expected

Copy link
Contributor

@jjti jjti left a comment

Choose a reason for hiding this comment

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

LGTM


// Check that the link resource indicates the cluster is linked
// If the cluster is not linked, the telemetry-state resource should not exist
if linked, reason := link.IsLinked(res.GetResource()); !linked {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a chance this code will run after the Link is created but before it is linked for the first time? In that case, I assume the TelemetryState would be created, then deleted, then recreated once the Link is linked? Maybe that is okay, I just wanted to understand if we've thought through that.

Copy link
Member Author

Choose a reason for hiding this comment

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

This reconciler fires on changes to Link and TelemetryState resources. When the a Link is created for the first time but not linked this will delete any existing TelemetryState (which there shouldn't be yet).

@NickCellino
Copy link
Contributor

This looks good to me. I mostly just want to understand if there's any possible issue of TelemetryState being repeatedly created/deleted before approving.

@loshz loshz requested a review from analogue January 24, 2024 18:19
Copy link
Contributor

@analogue analogue left a comment

Choose a reason for hiding this comment

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

Resource/controller stuff LGTM!

Comment on lines +21 to +22
// TlsInsecureSkipVerify if true will ignore server name verification when making HTTPS requests
bool tls_insecure_skip_verify = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

dev/personal-dev environment testing mostly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport pr/no-changelog PR does not need a corresponding .changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants