-
Notifications
You must be signed in to change notification settings - Fork 125
Inject cross-resource references from provider metadata #12
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
Changes from all commits
f9608f1
3f52a8d
fc1ec36
9b595c4
a0f37b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,6 +116,11 @@ type Reference struct { | |
| // Type is the type name of the CRD if it is in the same package or | ||
| // <package-path>.<type-name> if it is in a different package. | ||
| Type string | ||
| // TerraformName is the name of the Terraform resource | ||
| // which will be referenced. The supplied resource name is | ||
| // converted to a type name of the corresponding CRD using | ||
| // the configured TerraformTypeMapper. | ||
| TerraformName string | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we had discussed this at one point and realized
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like this would require having access to
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is something we had better pursue. I think the new |
||
| // Extractor is the function to be used to extract value from the | ||
| // referenced type. Defaults to getting external name. | ||
| // Optional | ||
|
|
@@ -287,6 +292,11 @@ type Resource struct { | |
| // References keeps the configuration to build cross resource references | ||
| References References | ||
|
|
||
| // SkipReferencesTo configures attributes for which | ||
| // references will not be injected. Expected format | ||
| // for each element is <Terraform resource name>.<attribute name>. | ||
| SkipReferencesTo []string | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have we seen cases where we need to skip references? For similar operations, we manipulate the schema in a configurator, which could be an option here, i.e. to remove the reference from metadata object in a configurator.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, one common case from
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about using existing configurators? |
||
|
|
||
| // Sensitive keeps the configuration to handle sensitive information | ||
| Sensitive Sensitive | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this now since we control all providers using Upjet, no need for backward compatibility or deprecation process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I also agree the new higher level API
Reference.TerraformNameis less error-prone and we can remove theReference.Typefield. I propose to do so in a further PR to decrease the impact of this PR on the existing providers asTypeis part of the configuration interface employed in those providers.