-
Notifications
You must be signed in to change notification settings - Fork 178
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
refactor: Adjusts search_deployment schema definitions with structure of new schema scaffolding command #1830
Conversation
… of new schema scaffolding command
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.
LGTM
"github.com/hashicorp/terraform-plugin-framework/types" | ||
) | ||
|
||
func ResourceSchema(ctx context.Context) schema.Schema { |
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.
Is creating the schema in a separate file a new convention in the repo? Is the what the scaffolding command will do?
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.
correct, scaffolding command will be adjusted to this convention of having the schema and tf models in separate files.
internal/service/searchdeployment/tfplugingen/generator_config.yml
Outdated
Show resolved
Hide resolved
"cluster_name": schema.StringAttribute{ | ||
Required: true, | ||
Description: "Label that identifies the cluster to return the search nodes for.", | ||
MarkdownDescription: "Label that identifies the cluster to return the search nodes for.", |
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.
will scaffolding be used only for new TF plugin or also for older one? just to understand if it's enough to generate MarkdownDescription or we also want to generate Description.
or maybe having an input param (defaulted to new plugin?) in the tool if we want to support both?
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.
The tool is limited to generating new TF framework code. I have left both definitions as they are both generated by the tool and provide unique value as per comments in the terraform code:
- MarkdownDescription: used in various tooling, like the documentation generator
- Description: used in various tooling, like the language server, to give practitioners more information about what this attribute is, what it's for, and how it should be used.
Co-authored-by: Andrea Angiolillo <[email protected]>
Description
Link to any related issue(s): CLOUDP-221363
The content of the schema is not changed, with the exception of including
Description
andMarkdownDescription
fields that are generated from description fields in the API Spec.Type of change:
Required Checklist:
Further comments