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

Component option propagation (Python SDK) #2717

Merged
merged 4 commits into from
Jan 4, 2024

Conversation

EronWright
Copy link
Contributor

@EronWright EronWright commented Dec 13, 2023

Proposed changes

Epic: #2254
Fixes: #2356

This PR standardizes the option propagation logic for the component resources in the pulumi-kubernetes Python SDK. The general approach is:

  1. In the component resource constructor, compute the child options to be propagated to any children. The child options consist of the component as parent, and with version and pluginDownloadURL if specified.
  2. Compute the invoke options by copying the child options.

Specification

The component resource is responsible for computing sub-options for invokes and for child resource declarations. This table outlines the expected behavior for each resource option when presented to a component resource.

Propagated Remarks
additionalSecretOutputs no "does not apply to component resources"
aliases no Inherited via parent-child relationship.
customTimeouts no "does not apply to component resources"
deleteBeforeReplace no
deletedWith no
dependsOn no The children implicitly wait for the dependency.
ignoreChanges no Nonsensical to apply directly to children (see discussion).
import no
parent yes The component becomes the parent.
protect no Inherited.
provider no Combined into providers map, then inherited via parent-child relationship.
providers no Inherited.
replaceOnChanges no "does not apply to component resources"
retainOnDelete no "does not apply to component resources"
transformations no Inherited.
version yes Influences default provider selection logic during invokes.
Should propagate when child resource is from the same provider type.
pluginDownloadURL yes Influences default provider selection logic during invokes.
Should propagate when child resource is from the same provider type.

Testing

A new test case is provided (test case, test program) that exercises option propagation across the component resources:

Upgrade testing must be done manually, with an emphasis on avoiding replacement due to reparenting.

Related issues (optional)

Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@EronWright EronWright enabled auto-merge (squash) January 4, 2024 01:09
@EronWright EronWright merged commit 8f44f6d into master Jan 4, 2024
18 checks passed
@EronWright EronWright deleted the eronwright/issue-2254-python branch January 4, 2024 01:39
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.

it's not possible to alias a pulumi_kubernetes.yaml.ConfigFile resource
2 participants