Commit 207b511
authored
direct: support remote state lookups (#3531)
## Changes
- Change resource API to support remote state.
- Update all resources to implement that.
- Use remote state is used to resolve ${resource.jobs.foo.some.field}
references when they cannot be resolved via config.
Based on top of #3532
## Design
There is a new required method DoRefresh() that returns remote state for
existing resource. The return type defines the schema for the remote
looks up. The method is implemented by performing get() on the resource.
A number of resources return full object as part of normal
create/update/wait operations so extra get() is wasteful. For those
cases there is alternative "WithRefresh" interface where methods return
remote state as part of normal operation. Implementation can pick for
every case individually (create/update/waitcreate/waitupdate) whether to
implement NoRefresh or WithRefresh variant.
Note, there is no attempt to match terraform field format. That would be
possible by defining custom struct for remote state that follows TF
rather than using SDK type. I think using SDK type is more natural there
and for cases where needed we can add a translation layer later.
## Tests
A couple new acceptance tests checking remote state for apps and
pipelines.
Expanded unit tests in bundle/terranova for quick sanity check of
resources against test server.1 parent f8bc3b3 commit 207b511
File tree
44 files changed
+809
-208
lines changed- acceptance/bundle
- bundle_tag/url_ref
- resource_deps
- missing_ingestion_definition
- missing_map_key_tffix
- missing_map_key
- missing_string_field
- non_existent_field
- remote_app_url
- app
- remote_pipeline
- bundle
- deployplan
- terranova
- tnresources
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+809
-208
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 0 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
0 commit comments