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

Interpret JSON Config values #269

Merged
merged 2 commits into from
Sep 10, 2024
Merged

Interpret JSON Config values #269

merged 2 commits into from
Sep 10, 2024

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Sep 6, 2024

This PR adds a middleware to handle decoding JSON encoded config values. The middleware is marked as deprecated, since we would like to remove this functionality as soon as pulumi/pulumi#15032 closes.

Fixes #171

…emas

This is preperation for introducing a complex configuration middleware. The middleware
will impose the additional requirement that infer based providers must serve a valid
schema for CheckConfig to be called on them.
@iwahbe iwahbe requested a review from a team September 6, 2024 15:10
@iwahbe iwahbe self-assigned this Sep 6, 2024
@iwahbe iwahbe force-pushed the iwahbe/170/complex-config branch 2 times, most recently from 334fa8c to ea8d6ff Compare September 6, 2024 15:22
middleware/complexconfig/provider.go Outdated Show resolved Hide resolved
@iwahbe iwahbe force-pushed the iwahbe/170/complex-config branch 2 times, most recently from cf5b103 to bd67f7e Compare September 9, 2024 12:37
@t0yv0
Copy link
Member

t0yv0 commented Sep 9, 2024

Does this need to cover old config in DiffConfig or CheckConfig suffices? Perhaps as a follow-up.

@t0yv0 t0yv0 self-requested a review September 9, 2024 14:50
`complexconfig` is marked as deprecated so that we can safely remove it in a later version.
@iwahbe iwahbe force-pushed the iwahbe/170/complex-config branch from ed79b84 to 6a7a911 Compare September 10, 2024 09:58
@iwahbe
Copy link
Member Author

iwahbe commented Sep 10, 2024

Does this need to cover old config in DiffConfig or CheckConfig suffices? Perhaps as a follow-up.

I think it should be ok 🤞:

From provider.proto:

message DiffRequest {
    ...

    // the new input values of resource to diff, copied from CheckResponse.inputs.
    google.protobuf.Struct news = 4;

    ...
}

src

I'll double check that this applies for providers as well.

@iwahbe
Copy link
Member Author

iwahbe commented Sep 10, 2024

Check config is definitely called on new provider config before diff is called, so I think this should work by just overriding CheckConfig.

@iwahbe iwahbe merged commit 9c1bcdd into main Sep 10, 2024
6 checks passed
@iwahbe iwahbe deleted the iwahbe/170/complex-config branch September 10, 2024 10:26
@pulumi-bot
Copy link

This PR has been shipped in release v0.22.0.

@pulumi-bot
Copy link

This PR has been shipped in release v0.23.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically unmarshal complex configuration types
4 participants