Skip to content

Commit

Permalink
Support import for Team (#207)
Browse files Browse the repository at this point in the history
Fixes: #181
  • Loading branch information
komalali authored Dec 18, 2023
1 parent a467ccf commit 7f791a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Improvements

- Support `import` for the `Team` resource. [#207](https://github.com/pulumi/pulumi-pulumiservice/pull/207)

### Bug Fixes

- Fix `Read` for TeamStackPermission so resources are not deleted from state on refresh. Note: TeamStackPermission resources created before v0.17.0 will now return an error if attempting a refresh, but those (re)created with the new version will support `refresh`. [#205](https://github.com/pulumi/pulumi-pulumiservice/pull/205)
Expand Down
13 changes: 10 additions & 3 deletions provider/pkg/provider/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ func (i *PulumiServiceTeamInput) ToPropertyMap() resource.PropertyMap {
pm := resource.PropertyMap{}
pm["teamType"] = resource.NewPropertyValue(i.Type)
pm["name"] = resource.NewPropertyValue(i.Name)
pm["displayName"] = resource.NewPropertyValue(i.DisplayName)
pm["description"] = resource.NewPropertyValue(i.Description)
pm["members"] = resource.NewPropertyValue(i.Members)
pm["organizationName"] = resource.NewPropertyValue(i.OrganizationName)
pm["githubTeamId"] = resource.NewPropertyValue(i.GitHubTeamID)
if i.Description != "" {
pm["description"] = resource.NewPropertyValue(i.Description)
}
if i.GitHubTeamID != 0 {
pm["githubTeamId"] = resource.NewPropertyValue(i.GitHubTeamID)
}
if i.DisplayName != "" {
pm["displayName"] = resource.NewPropertyValue(i.DisplayName)
}
return pm
}

Expand Down Expand Up @@ -216,6 +222,7 @@ func (t *PulumiServiceTeamResource) Read(req *pulumirpc.ReadRequest) (*pulumirpc
return &pulumirpc.ReadResponse{
Id: req.Id,
Properties: props,
Inputs: props,
}, nil
}

Expand Down

0 comments on commit 7f791a4

Please sign in to comment.