Skip to content

Commit

Permalink
Fix multiple miscellaneous issues (#1746)
Browse files Browse the repository at this point in the history
* Fix multiple miscellaneous issues

* Simplified update condition
  • Loading branch information
zliang-akamai authored Feb 6, 2025
1 parent aa4b814 commit a910383
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion linode/firewall/framework_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func FlattenFirewallRules(
}

for i := range knownRules {
if i > len(rules) {
if i >= len(rules) {
break
}

Expand Down
7 changes: 7 additions & 0 deletions linode/image/framework_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,13 @@ func replicateImage(
var replicaRegionWaitList []string

image, err = client.GetImage(ctx, imageID)
if err != nil {
diags.AddError(
fmt.Sprintf("Failed to get image %v", imageID),
err.Error(),
)
return nil, diags
}
for _, region := range image.Regions {
// remove pending deletion replicas from the wait list
if region.Status != linodego.ImageRegionStatusPendingDeletion {
Expand Down
2 changes: 1 addition & 1 deletion linode/objkey/framework_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func FlattenBucketAccessEntries(
}

for i := range resultEntries {
if i > len(entries) {
if i >= len(entries) {
break
}

Expand Down
9 changes: 0 additions & 9 deletions linode/rdns/framework_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,7 @@ func (r *Resource) Update(

client := r.Meta.Client

var updateOpts linodego.IPAddressUpdateOptions

resourceUpdated := false

if !state.RDNS.Equal(plan.RDNS) {
updateOpts.RDNS = plan.RDNS.ValueStringPointer()
resourceUpdated = true
}

if resourceUpdated {
ip, err := updateIPAddress(
ctx,
client,
Expand Down

0 comments on commit a910383

Please sign in to comment.