Skip to content

Commit

Permalink
debug 0.32-sb1-15
Browse files Browse the repository at this point in the history
  • Loading branch information
chlunde committed Feb 22, 2024
1 parent 7e7b7b5 commit 39e87c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
GOLANGCI_VERSION: 'v1.47.1'
DOCKER_BUILDX_VERSION: 'v0.8.2'

SB1_VERSION: "0.32-sb1-14"
SB1_VERSION: "0.32-sb1-15"

jobs:
build-image:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ require (
github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df
github.com/crossplane/crossplane-runtime v0.17.0-rc.0.0.20220616115400-a520b60f1661
github.com/crossplane/crossplane-tools v0.0.0-20220310165030-1f43fc12793e
github.com/davecgh/go-spew v1.1.1
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/go-ini/ini v1.46.0
github.com/golang/mock v1.5.0
Expand Down Expand Up @@ -67,7 +68,6 @@ require (
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/dave/jennifer v1.4.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.12.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
Expand Down
10 changes: 10 additions & 0 deletions pkg/controller/database/rdsinstance.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
awsrds "github.com/aws/aws-sdk-go-v2/service/rds"
awsrdstypes "github.com/aws/aws-sdk-go-v2/service/rds/types"
"github.com/davecgh/go-spew/spew"
"github.com/pkg/errors"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -250,19 +251,28 @@ func (e *external) Update(ctx context.Context, mg resource.Managed) (managed.Ext
}

upToDate, err := rds.IsUpToDate(ctx, e.kube, cr, rsp.DBInstances[0])
if err != nil {
return managed.ExternalUpdate{}, awsclient.Wrap(err, errDescribeFailed)
}

if len(patch.Tags) == 0 && upToDate && err == nil {
log.Println(cr.Name, "up to date after DescribeDBInstances")
return managed.ExternalUpdate{}, nil
}

log.Println(cr.Name, "not up to date after DescribeDBInstances", patch.Tags, upToDate)
spew.Dump(patch)

modify := rds.GenerateModifyDBInstanceInput(meta.GetExternalName(cr), patch, cr.Spec.ForProvider.EnableCloudwatchLogsExports, rsp.DBInstances[0].EnabledCloudwatchLogsExports)
spew.Dump(modify)
var conn managed.ConnectionDetails

pwd, changed, err := rds.GetPassword(ctx, e.kube, cr.Spec.ForProvider.MasterPasswordSecretRef, cr.Spec.WriteConnectionSecretToReference)
if err != nil {
return managed.ExternalUpdate{}, err
}
if changed {
log.Println(cr.Name, "password changed")
conn = managed.ConnectionDetails{
xpv1.ResourceCredentialsSecretPasswordKey: []byte(pwd),
}
Expand Down

0 comments on commit 39e87c0

Please sign in to comment.