Skip to content

Commit

Permalink
Support update zone name (#99)
Browse files Browse the repository at this point in the history
Though quota and smb share does not support zone modification, zone name
could be renamed
Now fix bug during renaming access zone
Modify doc about persona id
  • Loading branch information
P-Cao authored Nov 21, 2023
1 parent 74abbd8 commit ce10636
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/resources/smb_share.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Required:

Optional:

- `id` (String) Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'.
- `id` (String) Specifies the serialized form of a persona using security identifier, which can be 'SID:S-1-1'.
- `name` (String) Specifies the persona name, which must be combined with a type.
- `type` (String) Specifies the type of persona, which must be combined with a name.

Expand All @@ -201,7 +201,7 @@ Optional:

Optional:

- `id` (String) Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'.
- `id` (String) Specifies the serialized form of a persona using security identifier, which can be 'SID:S-1-1'.
- `name` (String) Specifies the persona name, which must be combined with a type.
- `type` (String) Specifies the type of persona, which must be combined with a name.

Expand Down
2 changes: 1 addition & 1 deletion powerscale/provider/quota_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func (r *QuotaResource) Update(ctx context.Context, request resource.UpdateReque
tflog.Debug(ctx, "calling get quota by ID on pscale client", map[string]interface{}{
"smbQuotaID": quotaID,
})
updatedQuota, err := helper.GetQuota(ctx, r.client, quotaID, quotaState.Zone.ValueString())
updatedQuota, err := helper.GetQuota(ctx, r.client, quotaID, quotaPlan.Zone.ValueString())
if err != nil {
errStr := constants.UpdateQuotaErrorMsg + "with error: "
message := helper.GetErrorString(err, errStr)
Expand Down
10 changes: 5 additions & 5 deletions powerscale/provider/smb_share_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ func (r *SmbShareResource) Schema(ctx context.Context, req resource.SchemaReques
Required: true,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: "Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'.",
MarkdownDescription: "Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'.",
Description: "Specifies the serialized form of a persona using security identifier, which can be 'SID:S-1-1'.",
MarkdownDescription: "Specifies the serialized form of a persona using security identifier, which can be 'SID:S-1-1'.",
Optional: true,
Computed: true,
},
Expand Down Expand Up @@ -326,8 +326,8 @@ func (r *SmbShareResource) Schema(ctx context.Context, req resource.SchemaReques
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: "Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'.",
MarkdownDescription: "Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'.",
Description: "Specifies the serialized form of a persona using security identifier, which can be 'SID:S-1-1'.",
MarkdownDescription: "Specifies the serialized form of a persona using security identifier, which can be 'SID:S-1-1'.",
Optional: true,
Computed: true,
},
Expand Down Expand Up @@ -558,7 +558,7 @@ func (r SmbShareResource) Update(ctx context.Context, request resource.UpdateReq
)
return
}
err = helper.UpdateSmbShare(ctx, r.client, shareID, shareState.Zone.ValueStringPointer(), shareToUpdate)
err = helper.UpdateSmbShare(ctx, r.client, shareID, sharePlan.Zone.ValueStringPointer(), shareToUpdate)
if err != nil {
errStr := constants.UpdateSmbShareErrorMsg + "with error: "
message := helper.GetErrorString(err, errStr)
Expand Down

0 comments on commit ce10636

Please sign in to comment.