Add support for repacking and merging tls.Config structs #196
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.
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
I have commented my code, particularly in hard-to-understand areasRelated issues