Skip to content

Fix Property Override Services parsing#17584

Merged
zalimeni merged 1 commit intomainfrom
zalimeni/net-4304-fix-services-parsing-int-test
Jun 6, 2023
Merged

Fix Property Override Services parsing#17584
zalimeni merged 1 commit intomainfrom
zalimeni/net-4304-fix-services-parsing-int-test

Conversation

@zalimeni
Copy link
Member

@zalimeni zalimeni commented Jun 6, 2023

Ensure that the embedded api struct is properly parsed when deserializing config containing a set ResourceFilter.Services field.

Also enhance existing integration test to guard against bugs and exercise this field.

Description

Follow-up to #17569.

PR Checklist

  • updated test coverage
  • external facing docs updated - N/A
  • appropriate backport labels added
  • not a security concern

@zalimeni zalimeni added pr/no-changelog PR does not need a corresponding .changelog entry pr/no-metrics-test pr/no-docs PR does not include docs and should not trigger reminder for cherrypicking them. pr/no-backport labels Jun 6, 2023
@zalimeni zalimeni force-pushed the zalimeni/net-4304-fix-services-parsing-int-test branch from f6db821 to c9e45a2 Compare June 6, 2023 15:42
Comment on lines 279 to 289
Copy link
Member Author

@zalimeni zalimeni Jun 6, 2023

Choose a reason for hiding this comment

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

I'd be happy to have someone highly familiar w/ this code review it, since I'm halfway between cargo culting and having a full understanding of these decoder patterns. That said, I'm pretty confident that we need both the hook and WeaklyTypedInput for this to behave, as that combo is what made the integration test pass and docs indicate WeaklyTypedInput is needed when the hook is used in prior decoding steps, which it is.

The difference between this and the prior version is the inclusion of the HookWeakDecodeFromSlice hook, which appears necessary to handle the nested []*ServiceName parsing.

Hand-testing indicates normal patching continues to work as expected.

Ensure that the embedded api struct is properly parsed when
deserializing config containing a set ResourceFilter.Services field.

Also enhance existing integration test to guard against bugs and
exercise this field.
@zalimeni zalimeni force-pushed the zalimeni/net-4304-fix-services-parsing-int-test branch from c9e45a2 to daf021f Compare June 6, 2023 15:51
@zalimeni zalimeni marked this pull request as ready for review June 6, 2023 16:03

type ServiceName struct {
api.CompoundServiceName
api.CompoundServiceName `mapstructure:",squash"`
Copy link
Member Author

Choose a reason for hiding this comment

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

@zalimeni zalimeni merged commit 2dd5551 into main Jun 6, 2023
@zalimeni zalimeni deleted the zalimeni/net-4304-fix-services-parsing-int-test branch June 6, 2023 19:40
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 pr/no-docs PR does not include docs and should not trigger reminder for cherrypicking them. pr/no-metrics-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants