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: Allow aiven provider to compile without fork #742

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkg/tfbridge/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (

"github.com/gedex/inflector"
"github.com/pulumi/pulumi/sdk/v3/go/common/resource"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"

shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
)
Expand Down Expand Up @@ -102,8 +101,7 @@ func TerraformToPulumiName(name string, sch shim.Schema, ps *SchemaInfo, upper b
casingActivated := false // tolerate leading underscores
for i, c := range name {
if c == '_' && casingActivated {
// skip underscores and make sure the next one is capitalized.
contract.Assertf(!nextCap, "Unexpected duplicate underscore: %v", name)
Comment on lines -105 to -106
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Might be nice to have a comment explaining that we will ignore duplicate _.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

// any number of consecutive underscores in a string, e.g. foo__dot__bar, result in capitalization
nextCap = true
} else {
if c != '_' && !casingActivated {
Expand Down