Skip to content

Commit

Permalink
ensure resource args type imports are not double qualified
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid-Ajaj committed Jan 7, 2025
1 parent ec2807b commit 60cb95e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/codegen/java/gen_program.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,13 @@ func (g *generator) collectResourceImports(resource *pcl.Resource) []string {
if len(resource.Inputs) > 0 || hasCustomResourceOptions(resource) {
// import args type name
argsTypeName := g.resourceArgsTypeName(resource)
resourceArgsImport := pulumiImport(pkg, module, argsTypeName)
imports = append(imports, resourceArgsImport)
alreadyFullyQualified := strings.Contains(argsTypeName, ".")
if !alreadyFullyQualified {
resourceArgsImport := pulumiImport(pkg, module, argsTypeName)
imports = append(imports, resourceArgsImport)
} else {
imports = append(imports, argsTypeName)
}
resourceProperties := typedResourceProperties(resource)
for _, inputProperty := range resource.Inputs {
inputType := resourceProperties[inputProperty.Name]
Expand Down

0 comments on commit 60cb95e

Please sign in to comment.