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

importer: fix generated terraform schema file names #4406

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wuxu92
Copy link
Contributor

@wuxu92 wuxu92 commented Sep 11, 2024

Fixes: #4358

The Data-api tool searches for schema files in the Terraform directory with filenames like xxx-Resource-xxx-Schema.json, but the filenames generated by the importer tool did not match. This PR renames the generated schema files to align with Data-api logic:

// The Main Schema Model is in: `%s-Resource-Schema.json`
// Additional Files are in: `%s-Resource-*-Schema.json`
schemaModelFiles, err := listFilesMatching(terraformDirectory, fmt.Sprintf("%s-Resource-", resourceName), ".json")
if err != nil {
return nil, fmt.Errorf("listing Test files: %+v", err)
}

This PR successfully generates resources for the AKS Fleet Manager:

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant