pulumi/pkg/resource/deploy
Fraser Waters 3107c6f62e
Allow `import` to create empty component resources (#14467)
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->

Fixes https://github.com/pulumi/pulumi/issues/14444.

This adds two new flags to the import file to signal that a resource is
a component, and also if that is a remote (MLC) component. The import
system will create empty resources for those import descriptions, but
importantly they can then be used as parents for other resources in the
import deployment.

We need to know if it's a remote component to know if a provider should
be looked up for it. We could probably get away with _just_ knowing if
it's a component at import time and not doing any validation that the
type token is well formed and the provider exists for MLCs. That makes
import a little simpler for users (no need to set if it's remote or not)
but pushes error cases downstream to when they actually try to `up`
their program. It also means we can't lookup and fill in the default
providers for these resources, resulting in a provider diff at `up`
time.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [ ] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-11-13 17:58:35 +00:00
..
deploytest Send old inputs to Delete (#14051) 2023-10-13 14:12:26 +00:00
providers Actually disable plugin acquisition (#14134) 2023-10-14 08:32:43 +00:00
builtins.go Send old inputs to Delete (#14051) 2023-10-13 14:12:26 +00:00
deployment.go Tests and fix for --target-dependents with explicit providers (#14238) 2023-10-18 13:10:22 +00:00
deployment_executor.go Track actual error in StepExecutor (#14247) 2023-10-17 06:47:32 +00:00
deployment_executor_test.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
deployment_test.go Remove source_fixed 2022-11-08 15:55:45 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
import.go Allow `import` to create empty component resources (#14467) 2023-11-13 17:58:35 +00:00
manifest.go Split Manifest type to it's own file (#8712) 2022-01-10 12:25:24 +00:00
plan.go Move sdk/go/common/display to /pkg/display (#13954) 2023-09-18 11:01:28 +00:00
snapshot.go Fix duplicate resource error from failed delete operations (#14042) 2023-09-26 15:18:35 +00:00
snapshot_test.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
source.go Change Source.Iterate to return an error (#13996) 2023-09-20 14:34:24 +00:00
source_error.go Change Source.Iterate to return an error (#13996) 2023-09-20 14:34:24 +00:00
source_eval.go pass through property values to RunRequest (#14273) 2023-10-20 10:44:16 +00:00
source_eval_test.go Use `assert.NoError` rather than `assert.Nil` (#14233) 2023-10-13 09:46:07 +00:00
source_null.go Change Source.Iterate to return an error (#13996) 2023-09-20 14:34:24 +00:00
source_query.go Don't close LanguageRuntime in forkRun (#13914) 2023-10-18 12:28:34 +00:00
source_query_test.go Use `assert.NoError` rather than `assert.Nil` (#14233) 2023-10-13 09:46:07 +00:00
state_builder.go Fix duplicate resource error from failed delete operations (#14042) 2023-09-26 15:18:35 +00:00
state_builder_test.go When changing parents also fix URNs (#13935) 2023-09-14 19:52:27 +00:00
step.go Allow `import` to create empty component resources (#14467) 2023-11-13 17:58:35 +00:00
step_executor.go Wrap StepApplyFailed so we can see errors in tests (#14458) 2023-10-31 17:37:41 +00:00
step_executor_test.go [engine] RegisterResourceOutputs errors instead of panics when called twice (#14062) 2023-09-29 19:42:18 +00:00
step_generator.go Tests and fix for --target-dependents with explicit providers (#14238) 2023-10-18 13:10:22 +00:00
step_generator_test.go Use `assert.NoError` rather than `assert.Nil` (#14233) 2023-10-13 09:46:07 +00:00
target.go Add getOrganization to nodejs and python (#10504) 2022-08-31 10:33:29 +01:00