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 support for repacking and merging tls.Config structs #196

Merged

Conversation

michel-laterman
Copy link
Contributor

What does this PR do?

Add support for the Unpack operation for tls.Config attributes that are specified as strings but stored as other values. The existing Unpack operations are limited to string only and these will cause issues when trying to merge previously unpacked structs.

Why is it important?

We are tying to get fleet-server instances running in agent mode to reload its output block using values retrieved from the policy. See the pr
Merging the changed output value into the existing config is needed to support this.
However we are running into an error string verification mode must be an identifier accessing 'inputs.0.server.ssl.verification_mode' accessing 'inputs.0.server.ssl' that occurs because we are working with structs that have been already unpacked.
The types that cause issue are those that are serialized as a string but represented in the struct as a numeric value.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

Related issues

Add support for the Unpack operation for tls.Config attributes that are
specified as strings but stored as other values. The existing Unpack
operations are limited to string only and these will cause issues when
trying to merge previously unpacked structs.
@michel-laterman michel-laterman added the enhancement New feature or request label Apr 10, 2024
@michel-laterman michel-laterman requested a review from a team as a code owner April 10, 2024 01:19
@michel-laterman michel-laterman requested review from ycombinator and faec and removed request for a team April 10, 2024 01:19
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

@pierrehilbert pierrehilbert added the Team:Elastic-Agent Label for the Agent team label Apr 10, 2024
@jlind23 jlind23 requested a review from cmacknz April 11, 2024 13:44
@jlind23
Copy link
Contributor

jlind23 commented Apr 11, 2024

@pierrehilbert this is pending on the Elastic Agent team, can we get some traction please?

@michel-laterman michel-laterman merged commit b82cfc5 into elastic:main Apr 11, 2024
6 checks passed
@michel-laterman michel-laterman deleted the unpack-tlsconfig-values branch April 11, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants