Skip to content

Commit

Permalink
Merge branch 'main' into synciq-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishnan-Priyanshu authored Nov 25, 2024
2 parents b2eecaf + e2e08ff commit ec24d24
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 14 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,37 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# v1.6.0 (Nov 29, 2024)
## Release Summary
The release supports resources and data sources mentioned in the Features section for Dell PowerScale.
## Features

### Data Sources:

* `powerscale_synciq_replication_report` for reading SyncIQ Replication Report in PowerScale.
* `powerscale_nfs_alias` for reading NFS Alias in PowerScale.
* `powerscale_writable_snapshot` for reading Writeable Snapshot in PowerScale.
* `powerscale_synciq_replication_job` for reading SyncIQ Replication Job in PowerScale.


### Resources

* `powerscale_writable_snapshot` for managing Writeable Snapshots in PowerScale.
* `powerscale_snapshot_restore` for Restoring from snapshot in PowerScale.
* `powerscale_nfs_alias` for managing NFS Alias in PowerScale.
* `powerscale_synciq_replication_job` for managing SyncIQ Replication Job in PowerScale.
* `powerscale_synciq_rules` for managing SyncIQ Replication Performance Rules in PowerScale.

### Others
N/A

## Enhancements
* Selected data sources are enhanced to support additional filters.

## Bug Fixes
N/A


# v1.5.0 (Sept 27, 2024)
## Release Summary
The release supports resources and data sources mentioned in the Features section for Dell PowerScale.
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ generate:
cover:
rm -f coverage.*
go test -coverprofile=coverage.out ./...
go tool cover -html coverage.out -o coverage.html
go tool cover -html coverage.out -o coverage.html

sweep :
go test -v ./powerscale/provider -timeout 20m -sweep=all
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The Terraform Provider for Dell PowerScale is released and licensed under the MP

| **Terraform Provider** | **PowerScale Version** | **OS** | **Terraform** | **Golang** |
|------------------------|:-----------------------|:--------------------------|-----------------------------|------------|
| v1.5.0 | 9.5 <br> 9.7 <br> 9.8 | ubuntu22.04 <br> rhel9.x | 1.8.x <br> 1.9.x | 1.22 |
| v1.6.0 | 9.5 <br> 9.7 <br> 9.8 | ubuntu22.04 <br> rhel9.x | 1.8.x <br> 1.9.x | 1.22 |

## List of DataSources in Terraform Provider for Dell PowerScale
* [Cluster](docs/data-sources/cluster.md)
Expand Down Expand Up @@ -92,6 +92,10 @@ The Terraform Provider for Dell PowerScale is released and licensed under the MP
* [SyncIQ Global Settings](docs/data-sources/synciq_global_settings.md)
* [SyncIQ Rule](docs/data-sources/synciq_rule.md)
* [SyncIQ Peer Certificate](docs/data-sources/synciq_peer_certificate.md)
* [SyncIQ Replication Report](docs/data-sources/synciq_replication_report.md)
* [NFS Alias](docs/data-sources/nfs_alias.md)
* [Writeable Snapshot](docs/data-sources/writable_snapshot.md)
* [SyncIQ Replication Job](docs/data-sources/synciq_replication_job.md)

## List of Resources in Terraform Provider for Dell PowerScale
* [Access Zone](docs/resources/accesszone.md)
Expand Down Expand Up @@ -136,6 +140,12 @@ The Terraform Provider for Dell PowerScale is released and licensed under the MP
* [SyncIQ Policy](docs/resources/synciq_policy.md)
* [SyncIQ Global Settings](docs/resources/synciq_global_settings.md)
* [SyncIQ Peer Certificate](docs/resources/synciq_peer_certificate.md)
* [Support Assist](docs/resources/support_assist.md)
* [Writeable Snapshot](docs/resources/writable_snapshot.md)
* [Snapshot Restore](docs/resources/snapshot_restore.md)
* [NFS Alias](docs/resources/nfs_alias.md)
* [SyncIQ Replication Job](docs/resources/synciq_replication_job.md)
* [SyncIQ Rules](docs/resources/synciq_rules.md)

## Installation and execution of Terraform Provider for Dell PowerScale

Expand All @@ -148,7 +158,7 @@ Create a file called `main.tf` in your workspace with the following contents
terraform {
required_providers {
powerscale = {
version = "1.5.0"
version = "1.6.0"
source = "registry.terraform.io/dell/powerscale"
}
}
Expand Down
2 changes: 1 addition & 1 deletion about/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Create a file called `main.tf` in your workspace with the following contents
terraform {
required_providers {
powerscale = {
version = "1.5.0"
version = "1.6.0"
source = "registry.terraform.io/dell/powerscale"
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,5 @@ Read-Only:
- `shadow_bytes` (Number) The amount of shadow bytes referred to by this snapshot.
- `size` (Number) The amount of storage in bytes used to store this snapshot.
- `state` (String) Snapshot state.
- `target_id` (Number) The ID of the snapshot pointed to if this is an alias. 18446744073709551615 (max uint64) is returned for an alias to the live filesystem.
- `target_id` (Number) The ID of the snapshot pointed to if this is an alias. An alias to the live filesystem is represented by the value -1.
- `target_name` (String) The name of the snapshot pointed to if this is an alias.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ terraform {
required_providers {
powerscale = {
source = "registry.terraform.io/dell/powerscale"
version = "1.5.0"
version = "1.6.0"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/snapshot_restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
# Restore snapshot using snaprevert job
# Restore snapshot using snaprevert job. SnapRevert domain will be deleted once `terraform destroy` is executed.
resource "powerscale_snapshot_restore" "test" {
snaprevert_params = {
allow_dup = true
Expand Down
2 changes: 1 addition & 1 deletion examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ terraform {
required_providers {
powerscale = {
source = "registry.terraform.io/dell/powerscale"
version = "1.5.0"
version = "1.6.0"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/resources/powerscale_snapshot_restore/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

# Restore snapshot using snaprevert job
# Restore snapshot using snaprevert job. SnapRevert domain will be deleted once `terraform destroy` is executed.
resource "powerscale_snapshot_restore" "test" {
snaprevert_params = {
allow_dup = true
Expand Down
3 changes: 2 additions & 1 deletion goClientZip/PowerScale_API_9.5.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -58825,7 +58825,8 @@
"description": "The ID of the snapshot pointed to if this is an alias. 18446744073709551615 (max uint64) is returned for an alias to the live filesystem.",
"maximum": 2147483646,
"minimum": 0,
"type": "integer"
"type": "integer",
"format": "unsigned64"
},
"target_name": {
"description": "The name of the snapshot pointed to if this is an alias.",
Expand Down
Binary file modified goClientZip/powerscale-go-client.zip
Binary file not shown.
6 changes: 4 additions & 2 deletions powerscale/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ import (
powerscale "dell/powerscale-go-client"
"encoding/json"
"fmt"
"golang.org/x/net/html"
"math/big"
"net/http"
"reflect"
"strings"

"golang.org/x/net/html"

"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-log/tflog"
)

// CopyFields copy the source of a struct to destination of struct with terraform types.
// Unsigned integers are not properly handled.
func CopyFields(ctx context.Context, source, destination interface{}) error {
tflog.Debug(ctx, "Copy fields", map[string]interface{}{
"source": source,
Expand Down Expand Up @@ -94,7 +96,7 @@ func CopyFields(ctx context.Context, source, destination interface{}) error {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
destinationFieldValue = types.Int64Value(sourceField.Int())
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
destinationFieldValue = types.Int64Value(sourceField.Int())
destinationFieldValue = types.Int64Value(int64(sourceField.Uint()))
case reflect.Float32, reflect.Float64:
// destinationFieldValue = types.Float64Value(sourceField.Float())
destinationFieldValue = types.NumberValue(big.NewFloat(sourceField.Float()))
Expand Down
8 changes: 8 additions & 0 deletions powerscale/helper/snapshot_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ func SnapshotDetailMapper(ctx context.Context, snap powerscale.V1SnapshotSnapsho
return model, err
}
model.ID = types.StringValue(fmt.Sprint(snap.Id))
// Max uint64 is returned when aliasing to live filesystem
// Other than that, valid targetIDs have a max value of max int64
// In Terraform, we shall represent by -1 live system alias by -1
if snap.TargetId == 18446744073709551615 {
model.TargetID = types.Int64Value(-1)
} else {
model.TargetID = types.Int64Value(int64(snap.TargetId))
}
model.TargetID = types.Int64Value(int64(snap.TargetId))
model.SetExpires = types.StringNull()
return model, nil
Expand Down
4 changes: 2 additions & 2 deletions powerscale/provider/snapshot_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ func (d *SnapshotDataSource) Schema(ctx context.Context, req datasource.SchemaRe
Computed: true,
},
"target_id": schema.Int64Attribute{
Description: "The ID of the snapshot pointed to if this is an alias. 18446744073709551615 (max uint64) is returned for an alias to the live filesystem.",
MarkdownDescription: "The ID of the snapshot pointed to if this is an alias. 18446744073709551615 (max uint64) is returned for an alias to the live filesystem.",
Description: "The ID of the snapshot pointed to if this is an alias. An alias to the live filesystem is represented by the value -1.",
MarkdownDescription: "The ID of the snapshot pointed to if this is an alias. An alias to the live filesystem is represented by the value -1.",
Computed: true,
},
"target_name": schema.StringAttribute{
Expand Down

0 comments on commit ec24d24

Please sign in to comment.