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

Solve bug that prevented sending StoredVmQuota and DeployedVmQuota when creating/updating Org User #445

Merged
merged 2 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions govcd/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,19 @@ func (vcd *TestVCD) Test_UserCRUD(check *C) {
check.Assert(user.User.DeployedVmQuota, Equals, userDefinition.DeployedVmQuota)
check.Assert(user.User.IsExternal, Equals, userDefinition.IsExternal)

// change DeployedVmQuota and StoredVmQuota to 0 and assert
// this will make DeployedVmQuota and StoredVmQuota unlimited
user.User.DeployedVmQuota = 0
user.User.StoredVmQuota = 0
err = user.Update()
check.Assert(err, IsNil)

// Get the user from API again
user, err = adminOrg.GetUserByHref(user.User.Href)
check.Assert(err, IsNil)
check.Assert(user.User.DeployedVmQuota, Equals, 0)
check.Assert(user.User.StoredVmQuota, Equals, 0)

err = user.Disable()
check.Assert(err, IsNil)
check.Assert(user.User.IsEnabled, Equals, false)
Expand Down
4 changes: 2 additions & 2 deletions types/v56/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2873,8 +2873,8 @@ type User struct {
IsExternal bool `xml:"IsExternal,omitempty"`
ProviderType string `xml:"ProviderType,omitempty"`
IsGroupRole bool `xml:"IsGroupRole,omitempty"`
StoredVmQuota int `xml:"StoredVmQuota,omitempty"`
DeployedVmQuota int `xml:"DeployedVmQuota,omitempty"`
StoredVmQuota int `xml:"StoredVmQuota"`
DeployedVmQuota int `xml:"DeployedVmQuota"`
Role *Reference `xml:"Role,omitempty"`
GroupReferences *GroupReference `xml:"GroupReferences,omitempty"`
Password string `xml:"Password,omitempty"`
Expand Down