Skip to content

Commit

Permalink
service/redshift: Remove deprecated (helper/schema.ResourceData).Part…
Browse files Browse the repository at this point in the history
…ial() and (helper/schema.ResourceData).SetPartial() (#12461)

Reference: #12083
Reference: #12087

Previously:

```
aws/resource_aws_redshift_cluster.go:644:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_cluster.go:653:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_redshift_cluster.go:774:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_redshift_cluster.go:828:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_event_subscription.go:191:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_event_subscription.go:216:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_redshift_event_subscription.go:219:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_parameter_group.go:168:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_parameter_group.go:200:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_redshift_parameter_group.go:210:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_redshift_parameter_group.go:213:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_snapshot_copy_grant.go:118:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_snapshot_copy_grant.go:127:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_redshift_snapshot_copy_grant.go:130:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_snapshot_schedule.go:142:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_snapshot_schedule.go:151:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_redshift_snapshot_schedule.go:168:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_redshift_subnet_group.go:127:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_redshift_subnet_group.go:136:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_redshift_subnet_group.go:162:2: R007: deprecated (schema.ResourceData).Partial
```

Output from acceptance testing (failure present on master):

```
--- PASS: TestAccAWSRedshiftCluster_basic (374.33s)
--- PASS: TestAccAWSRedshiftCluster_changeAvailabilityZone (664.68s)
--- PASS: TestAccAWSRedshiftCluster_changeEncryption1 (2088.45s)
--- PASS: TestAccAWSRedshiftCluster_changeEncryption2 (1868.48s)
--- PASS: TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled (959.29s)
--- PASS: TestAccAWSRedshiftCluster_forceNewUsername (1672.20s)
--- PASS: TestAccAWSRedshiftCluster_iamRoles (824.30s)
--- PASS: TestAccAWSRedshiftCluster_kmsKey (1387.64s)
--- PASS: TestAccAWSRedshiftCluster_loggingEnabled (1178.50s)
--- PASS: TestAccAWSRedshiftCluster_publiclyAccessible (1435.60s)
--- PASS: TestAccAWSRedshiftCluster_snapshotCopy (434.54s)
--- PASS: TestAccAWSRedshiftCluster_tags (476.81s)
--- PASS: TestAccAWSRedshiftCluster_updateNodeCount (3699.47s)
--- PASS: TestAccAWSRedshiftCluster_updateNodeType (1911.25s)
--- PASS: TestAccAWSRedshiftCluster_withFinalSnapshot (1449.68s)

--- PASS: TestAccAWSRedshiftEventSubscription_basicUpdate (41.61s)
--- PASS: TestAccAWSRedshiftEventSubscription_categoryUpdate (51.13s)
--- PASS: TestAccAWSRedshiftEventSubscription_tagsUpdate (145.74s)
--- PASS: TestAccAWSRedshiftEventSubscription_withPrefix (44.47s)
--- PASS: TestAccAWSRedshiftEventSubscription_withSourceIds (84.82s)

--- PASS: TestAccAWSRedshiftParameterGroup_basic (44.40s)
--- PASS: TestAccAWSRedshiftParameterGroup_withoutParameters (76.56s)
--- PASS: TestAccAWSRedshiftParameterGroup_withParameters (27.47s)
--- PASS: TestAccAWSRedshiftParameterGroup_withTags (101.82s)

--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_Basic (34.09s)
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_Update (74.12s)

--- FAIL: TestAccAWSRedshiftSnapshotSchedule_withForceDestroy (314.27s)
--- PASS: TestAccAWSRedshiftSnapshotSchedule_basic (55.17s)
--- PASS: TestAccAWSRedshiftSnapshotSchedule_withDescription (48.15s)
--- PASS: TestAccAWSRedshiftSnapshotSchedule_withIdentifierPrefix (44.69s)
--- PASS: TestAccAWSRedshiftSnapshotSchedule_withMultipleDefinition (37.15s)
--- PASS: TestAccAWSRedshiftSnapshotSchedule_withTags (97.33s)

--- PASS: TestAccAWSRedshiftSubnetGroup_basic (41.15s)
--- PASS: TestAccAWSRedshiftSubnetGroup_tags (64.37s)
--- PASS: TestAccAWSRedshiftSubnetGroup_updateDescription (67.68s)
--- PASS: TestAccAWSRedshiftSubnetGroup_updateSubnetIds (59.10s)
```
  • Loading branch information
bflad authored Apr 1, 2020
1 parent 21f1ff5 commit 2dbe6c7
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 34 deletions.
7 changes: 0 additions & 7 deletions aws/resource_aws_redshift_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,16 +641,13 @@ func resourceAwsRedshiftClusterRead(d *schema.ResourceData, meta interface{}) er

func resourceAwsRedshiftClusterUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).redshiftconn
d.Partial(true)

if d.HasChange("tags") {
o, n := d.GetChange("tags")

if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Redshift Cluster (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

requestUpdate := false
Expand Down Expand Up @@ -770,8 +767,6 @@ func resourceAwsRedshiftClusterUpdate(d *schema.ResourceData, meta interface{})
if err != nil {
return fmt.Errorf("Error modifying Redshift Cluster IAM Roles (%s): %s", d.Id(), err)
}

d.SetPartial("iam_roles")
}

if requestUpdate || d.HasChange("iam_roles") {
Expand Down Expand Up @@ -825,8 +820,6 @@ func resourceAwsRedshiftClusterUpdate(d *schema.ResourceData, meta interface{})
}
}

d.Partial(false)

return resourceAwsRedshiftClusterRead(d, meta)
}

Expand Down
6 changes: 0 additions & 6 deletions aws/resource_aws_redshift_event_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ func resourceAwsRedshiftEventSubscriptionRetrieve(name string, conn *redshift.Re
func resourceAwsRedshiftEventSubscriptionUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).redshiftconn

d.Partial(true)

req := &redshift.ModifyEventSubscriptionInput{
SubscriptionName: aws.String(d.Id()),
SnsTopicArn: aws.String(d.Get("sns_topic_arn").(string)),
Expand All @@ -212,12 +210,8 @@ func resourceAwsRedshiftEventSubscriptionUpdate(d *schema.ResourceData, meta int
if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Redshift Event Subscription (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

d.Partial(false)

return nil
}

Expand Down
6 changes: 0 additions & 6 deletions aws/resource_aws_redshift_parameter_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ func resourceAwsRedshiftParameterGroupRead(d *schema.ResourceData, meta interfac
func resourceAwsRedshiftParameterGroupUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).redshiftconn

d.Partial(true)

if d.HasChange("parameter") {
o, n := d.GetChange("parameter")
if o == nil {
Expand Down Expand Up @@ -197,7 +195,6 @@ func resourceAwsRedshiftParameterGroupUpdate(d *schema.ResourceData, meta interf
return fmt.Errorf("Error modifying Redshift Parameter Group: %s", err)
}
}
d.SetPartial("parameter")
}

if d.HasChange("tags") {
Expand All @@ -206,11 +203,8 @@ func resourceAwsRedshiftParameterGroupUpdate(d *schema.ResourceData, meta interf
if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Redshift Parameter Group (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

d.Partial(false)
return resourceAwsRedshiftParameterGroupRead(d, meta)
}

Expand Down
6 changes: 0 additions & 6 deletions aws/resource_aws_redshift_snapshot_copy_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,14 @@ func resourceAwsRedshiftSnapshotCopyGrantRead(d *schema.ResourceData, meta inter
func resourceAwsRedshiftSnapshotCopyGrantUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).redshiftconn

d.Partial(true)

if d.HasChange("tags") {
o, n := d.GetChange("tags")

if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Redshift Snapshot Copy Grant (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

d.Partial(false)

return resourceAwsRedshiftSnapshotCopyGrantRead(d, meta)
}

Expand Down
4 changes: 0 additions & 4 deletions aws/resource_aws_redshift_snapshot_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,13 @@ func resourceAwsRedshiftSnapshotScheduleRead(d *schema.ResourceData, meta interf

func resourceAwsRedshiftSnapshotScheduleUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).redshiftconn
d.Partial(true)

if d.HasChange("tags") {
o, n := d.GetChange("tags")

if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Redshift Snapshot Schedule (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

if d.HasChange("definitions") {
Expand All @@ -165,7 +162,6 @@ func resourceAwsRedshiftSnapshotScheduleUpdate(d *schema.ResourceData, meta inte
if err != nil {
return fmt.Errorf("Error modifying Redshift Snapshot Schedule %s: %s", d.Id(), err)
}
d.SetPartial("definitions")
}

return resourceAwsRedshiftSnapshotScheduleRead(d, meta)
Expand Down
5 changes: 0 additions & 5 deletions aws/resource_aws_redshift_subnet_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,13 @@ func resourceAwsRedshiftSubnetGroupRead(d *schema.ResourceData, meta interface{}

func resourceAwsRedshiftSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).redshiftconn
d.Partial(true)

if d.HasChange("tags") {
o, n := d.GetChange("tags")

if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Redshift Subnet Group (%s) tags: %s", d.Get("arn").(string), err)
}

d.SetPartial("tags")
}

if d.HasChange("subnet_ids") || d.HasChange("description") {
Expand All @@ -159,8 +156,6 @@ func resourceAwsRedshiftSubnetGroupUpdate(d *schema.ResourceData, meta interface
}
}

d.Partial(false)

return resourceAwsRedshiftSubnetGroupRead(d, meta)
}

Expand Down

0 comments on commit 2dbe6c7

Please sign in to comment.