Skip to content

Commit

Permalink
Fixed project for endpoint to default project
Browse files Browse the repository at this point in the history
  • Loading branch information
kushjajal7 committed Jan 30, 2025
1 parent e2e0200 commit c57096d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions nutanix/services/selfservice/resource_nutanix_calm_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,17 @@ func createMetadata(meta interface{}) map[string]interface{} {
fmt.Println("Error while fetching projects.", err)
}

projName := "default"
projRef := map[string]interface{}{}
projRef["name"] = resp.Entities[0].Status.Name
projRef["kind"] = "project"
projRef["uuid"] = resp.Entities[0].Status.UUID

for _, entity := range resp.Entities {

if entity.Status.Name == projName {
projRef["name"] = resp.Entities[0].Status.Name
projRef["kind"] = "project"
projRef["uuid"] = resp.Entities[0].Status.UUID
}
}

metadata["project_reference"] = projRef

Expand Down

0 comments on commit c57096d

Please sign in to comment.