Add remote_storage_location resource - #37
Conversation
10d3dba to
6df523b
Compare
f8366b4 to
f999922
Compare
| "port": 2049, | ||
| "path": "/export/path/", | ||
| "limit": "10MB", | ||
| "alert_threshold": 70, |
There was a problem hiding this comment.
do we test creation with alert_threshold, since this has a default value set?
| boolvalidator.ConflictsWith(path.MatchRoot("limit"), path.MatchRoot("alert_threshold"), path.MatchRoot("ignore_host_key_validation")), | ||
| }, | ||
| }, | ||
| "alert_threshold": schema.Int64Attribute{ |
There was a problem hiding this comment.
there is no computed defined, how is this working with the default? is it ignored or does it trigger a change?
| if c.IgnoreHostKeyValidation != nil { | ||
| ret = append(ret, resource.TestCheckResourceAttr(RscName, attrPath.AtName("ignore_host_key_validation").String(), strconv.FormatBool(*c.IgnoreHostKeyValidation))) | ||
| } | ||
| if c.AcceptHostKey { |
There was a problem hiding this comment.
AcceptHostKey does not exist on the NDFCRemoteStorageLocationTestData, or am i referring to wrong struct? Why do we not reuse to normal NDFCRemoteStorageLocation struct for this?
| // importIgnoreSensitiveFields lists the sensitive attributes that the ND | ||
| // remote storage location API does not return on GET. Imports cannot | ||
| // reconstruct them, so ImportStateVerify must skip these. | ||
| var importIgnoreSensitiveFields = []string{ |
There was a problem hiding this comment.
is acceptHostKey not also part of sensitive? will this break import? are we testing import?
| return !v.IsNull() && !v.IsUnknown() | ||
| } | ||
|
|
||
| if isConfigured(password) && isConfigured(sshKey) { |
There was a problem hiding this comment.
is not handled by the schema validator already?
| ) | ||
| } | ||
|
|
||
| if isConfigured(password) && isConfigured(passphrase) { |
There was a problem hiding this comment.
is not handled by the schema validator already?
| plan.StorageLocationType.ValueString() != "nfs" && !plan.ReadWrite.IsNull() { | ||
| plan.ReadWrite = types.BoolNull() |
There was a problem hiding this comment.
what happens when a read_write is set to a value and storage location is not nfs to plan? when this is forced to null and since it is optional could this create an unintended plan diff?
| Description: "The export path for NFS storage or the base path for SCP/SFTP storage on the remote server.", | ||
| MarkdownDescription: "The export path for NFS storage or the base path for SCP/SFTP storage on the remote server.", | ||
| }, | ||
| "port": schema.Int64Attribute{ |
There was a problem hiding this comment.
since this is computed should this attribute have useStateForUnknown, to avoid changes when null is inputted? or is this intended?
| PreConfig: func() { | ||
| helper.LogStep(t, 2, stepInfos[1].name, stepInfos[1].cfg) | ||
| t.Logf("Sleeping 90 seconds after NAS create before update to let the controller settle") | ||
| time.Sleep(90 * time.Second) |
There was a problem hiding this comment.
why enforce a time sleep? should we check the state is in correct state to continue instead of relying on arbitrary sleep? or do a retry helper function?
| v.Name = types.StringNull() | ||
| } | ||
|
|
||
| if jsonData.Description != "" { |
There was a problem hiding this comment.
why would an empty description respresent null, when description can actually be empty string?
…D in the nd_multi_cluster_connectivity resource
f999922 to
0925f09
Compare
0925f09 to
f439b87
Compare
Test result: