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

fix(cli): sanitize type arrays #3578

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

DanielMSchmidt
Copy link
Contributor

@DanielMSchmidt DanielMSchmidt commented Apr 2, 2024

Some providers sporadically return them double leading to errors in cdktf convert and get

Fixes #3526
Fixes #3170

@DanielMSchmidt DanielMSchmidt requested a review from a team as a code owner April 2, 2024 07:53
@DanielMSchmidt DanielMSchmidt requested review from mutahhir and ansgarm and removed request for a team April 2, 2024 07:53
@DanielMSchmidt DanielMSchmidt changed the title provider-schema: sanitize type arrays fix(provider-schema): sanitize type arrays Apr 2, 2024
@DanielMSchmidt DanielMSchmidt force-pushed the fix-double-attribute-type-array-bug branch from 510e05f to 01eadc4 Compare April 2, 2024 07:57
some providers sporadically return them double leading to errors in cdktf convert and get
@DanielMSchmidt DanielMSchmidt force-pushed the fix-double-attribute-type-array-bug branch from 01eadc4 to 46386a7 Compare April 2, 2024 07:59
@DanielMSchmidt DanielMSchmidt changed the title fix(provider-schema): sanitize type arrays fix(cli): sanitize type arrays Apr 2, 2024
Copy link
Member

@mutahhir mutahhir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Did you do any smoke testing with #3526?

@DanielMSchmidt
Copy link
Contributor Author

Yeah, I just did, it worked out fine :)

$ echo 'resource "ovh_cloud_project_kube" "my_kube_cluster" {
                                                                                              name         = "my_kube_cluster_cdktf"
                                                                                              region       = "GRA7"
                                                                                            }' | /Users/dschmidt/work/cdktf/terraform-cdk/packages/cdktf-cli/bundle/bin/cdktf convert --language go --provider 'ovh/ovh'


import "github.com/aws/constructs-go/constructs"
/*
 * Provider bindings are generated by running `cdktf get`.
 * See https://cdk.tf/provider-generation for more details.
 */
import "cdk.tf/go/stack/generated/ovh/cloudprojectkube"
type myConfig struct {
        serviceName interface{}
}
type myConvertedCode struct {
        construct
}

func newMyConvertedCode(scope construct, name *string, config myConfig) *myConvertedCode {
        this := &myConvertedCode{}
        newConstruct_Override(this, scope, name)
        genprovidersovhcloudprojectkube.NewCloudProjectKube(this, jsii.String("my_kube_cluster"), &cloudProjectKubeConfig{
                name: jsii.String("my_kube_cluster_cdktf"),
                region: jsii.String("GRA7"),
                serviceName: config.serviceName,
        })
        return this
}

@DanielMSchmidt DanielMSchmidt merged commit af6d921 into main Apr 2, 2024
439 of 467 checks passed
@DanielMSchmidt DanielMSchmidt deleted the fix-double-attribute-type-array-bug branch April 2, 2024 08:41
Copy link
Contributor

github-actions bot commented May 3, 2024

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants