Skip to content

Commit

Permalink
Merge pull request #2069 from crossplane-contrib/backport-2066-to-rel…
Browse files Browse the repository at this point in the history
…ease-0.48

[Backport release-0.48] fix: add engine version for dbinstance update
  • Loading branch information
MisterMX authored Jun 11, 2024
2 parents 7a12d08 + a246523 commit 3b20f53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/clients/rds/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const (
ErrNoPasswordUpToDate = "cannot determine password up to date status"
ErrGetCachedPassword = "cannot get cached password"
ErrRetrievePasswordForUpdate = "cannot retrieve password for update"
ErrDescribe = "cannot describe dbinstance"
)

const (
Expand Down
10 changes: 10 additions & 0 deletions pkg/controller/rds/dbinstance/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,16 @@ func (e *custom) preUpdate(ctx context.Context, cr *svcapitypes.DBInstance, obj
obj.StorageThroughput = nil
}

input := GenerateDescribeDBInstancesInput(cr)

out, err := e.client.DescribeDBInstancesWithContext(ctx, input)
if err != nil {
return errors.Wrap(err, dbinstance.ErrDescribe)
}
if !isEngineVersionUpToDate(cr, out) && cr.Spec.ForProvider.EngineVersion != nil {
obj.EngineVersion = cr.Spec.ForProvider.EngineVersion // add EngineVersion if changed and no downgrade
}

return nil
}

Expand Down

0 comments on commit 3b20f53

Please sign in to comment.