Skip to content

Commit

Permalink
Return the correct RDS Instance Endpoint in the ConnectionSecret
Browse files Browse the repository at this point in the history
Previously the ConnectionSecret endpoint field contained the hostname
including the port.

This is not expected behaviour and makes the ConnectionSecret unuseable
by downstream consumers of the Secret, like
https://github.com/crossplane-contrib/provider-sql, which expected
the endpoint and port to be in seperate fields.

Fixes: crossplane-contrib#778
  • Loading branch information
l0wl3vel committed Jul 22, 2023
1 parent 5edbe14 commit 75a81c3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions config/rds/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ func Configure(p *config.Provider) {
}
r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]any) (map[string][]byte, error) {
conn := map[string][]byte{}
if a, ok := attr["endpoint"].(string); ok {
conn["endpoint"] = []byte(a)
}
if a, ok := attr["address"].(string); ok {
conn["address"] = []byte(a)
conn["host"] = []byte(a)
conn["endpoint"] = []byte(a)
}
if a, ok := attr["username"].(string); ok {
conn["username"] = []byte(a)
Expand Down

0 comments on commit 75a81c3

Please sign in to comment.