Skip to content

Commit

Permalink
updates to support crossplane 42 (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjeevan-ib authored Aug 11, 2023
1 parent 48680b3 commit b7f4c49
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 230 deletions.
3 changes: 1 addition & 2 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
Expand Down Expand Up @@ -65,7 +64,7 @@ func init() {
}

func parseDBPoxySidecarConfig(configFile string) (*dbwebhook.Config, error) {
data, err := ioutil.ReadFile(configFile)
data, err := os.ReadFile(configFile)
if err != nil {
return nil, err
}
Expand Down
12 changes: 6 additions & 6 deletions controllers/databaseclaim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1271,13 +1271,13 @@ func (r *DatabaseClaimReconciler) manageDBCluster(ctx context.Context, dbHostNam
DBClusterParameterGroupNameRef: &xpv1.Reference{
Name: pgName,
},
EngineVersion: &params.EngineVersion,
},
// Items from Claim and fragmentKey
Engine: &params.Engine,
Tags: DBClaimTags(dbClaim.Spec.Tags).DBTags(),
// Items from Config
MasterUsername: &params.MasterUsername,
EngineVersion: &params.EngineVersion,
EnableIAMDatabaseAuthentication: &params.EnableIAMDatabaseAuthentication,
StorageEncrypted: &encryptStrg,
Port: &params.Port,
Expand Down Expand Up @@ -1388,6 +1388,7 @@ func (r *DatabaseClaimReconciler) managePostgresDBInstance(ctx context.Context,
},
AutogeneratePassword: true,
MasterUserPasswordSecretRef: &dbMasterSecretInstance,
EngineVersion: &params.EngineVersion,
},
// Items from Claim and fragmentKey
Engine: &params.Engine,
Expand All @@ -1397,7 +1398,6 @@ func (r *DatabaseClaimReconciler) managePostgresDBInstance(ctx context.Context,
Tags: DBClaimTags(dbClaim.Spec.Tags).DBTags(),
// Items from Config
MasterUsername: &params.MasterUsername,
EngineVersion: &params.EngineVersion,
PubliclyAccessible: &params.PubliclyAccessible,
EnableIAMDatabaseAuthentication: &params.EnableIAMDatabaseAuthentication,
EnablePerformanceInsights: &perfIns,
Expand Down Expand Up @@ -1487,14 +1487,14 @@ func (r *DatabaseClaimReconciler) manageAuroraDBInstance(ctx context.Context, db
Region: region,
CustomDBInstanceParameters: crossplanerds.CustomDBInstanceParameters{
SkipFinalSnapshot: params.SkipFinalSnapshotBeforeDeletion,
EngineVersion: &params.EngineVersion,
},
DBParameterGroupName: &pgName,
// Items from Claim and fragmentKey
Engine: &params.Engine,
DBInstanceClass: &params.Shape,
Tags: DBClaimTags(dbClaim.Spec.Tags).DBTags(),
// Items from Config
EngineVersion: &params.EngineVersion,
PubliclyAccessible: &params.PubliclyAccessible,
DBClusterIdentifier: &dbClusterIdentifier,
EnablePerformanceInsights: &perfIns,
Expand Down Expand Up @@ -1571,7 +1571,7 @@ func (r *DatabaseClaimReconciler) managePostgresParamGroup(ctx context.Context,
Engine: params.Engine,
EngineVersion: &params.EngineVersion,
},
Parameters: []crossplanerds.Parameter{
Parameters: []crossplanerds.CustomParameter{
{ParameterName: &logical,
ParameterValue: &one,
ApplyMethod: &reboot,
Expand Down Expand Up @@ -1653,7 +1653,7 @@ func (r *DatabaseClaimReconciler) manageAuroraPostgresParamGroup(ctx context.Con
Engine: params.Engine,
EngineVersion: &params.EngineVersion,
},
Parameters: []crossplanerds.Parameter{
Parameters: []crossplanerds.CustomParameter{
{ParameterName: &transactionTimeout,
ParameterValue: &transactionTimeoutValue,
ApplyMethod: &immediate,
Expand Down Expand Up @@ -1731,7 +1731,7 @@ func (r *DatabaseClaimReconciler) manageClusterParamGroup(ctx context.Context, d
Engine: params.Engine,
EngineVersion: &params.EngineVersion,
},
Parameters: []crossplanerds.Parameter{
Parameters: []crossplanerds.CustomParameter{
{ParameterName: &logical,
ParameterValue: &one,
ApplyMethod: &reboot,
Expand Down
60 changes: 25 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,43 @@ module github.com/infobloxopen/db-controller
go 1.20

require (
github.com/crossplane-contrib/provider-aws v0.35.0
github.com/crossplane/crossplane-runtime v0.19.0-rc.0.0.20220930073209-84e629b95898
github.com/crossplane-contrib/provider-aws v0.42.0
github.com/crossplane/crossplane-runtime v0.20.0-rc.0.0.20230320143010-c424c4aca5b0
github.com/onsi/gomega v1.27.1
github.com/ory/dockertest/v3 v3.10.0
github.com/prometheus/client_golang v1.12.2
github.com/prometheus/client_golang v1.14.0
github.com/sethvargo/go-password v0.2.0
github.com/spf13/viper v1.11.0
golang.org/x/net v0.11.0 // indirect
k8s.io/api v0.25.0
k8s.io/apimachinery v0.25.0
k8s.io/client-go v0.25.0
sigs.k8s.io/controller-runtime v0.13.0
k8s.io/api v0.26.1
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.1
sigs.k8s.io/controller-runtime v0.14.1
)

require (
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/armon/go-radix v1.0.0
github.com/aws/aws-sdk-go v1.44.0
github.com/aws/aws-sdk-go v1.44.174
github.com/aws/aws-sdk-go-v2 v1.16.16
github.com/aws/aws-sdk-go-v2/config v1.11.1
github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.2.1
github.com/fsnotify/fsnotify v1.5.4
github.com/fsnotify/fsnotify v1.6.0
github.com/go-logr/logr v1.2.3
github.com/infobloxopen/atlas-app-toolkit v1.1.2
github.com/lib/pq v1.10.5
github.com/onsi/ginkgo/v2 v2.8.4
go.uber.org/zap v1.21.0
go.uber.org/zap v1.24.0
gopkg.in/yaml.v2 v2.4.0
sigs.k8s.io/yaml v1.3.0
)

require (
cloud.google.com/go/compute v1.5.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.6.5 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.8.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23 // indirect
Expand All @@ -69,15 +60,14 @@ require (
github.com/docker/docker v24.0.2+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
Expand All @@ -87,7 +77,7 @@ require (
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.16 // indirect
Expand All @@ -96,7 +86,7 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.0 // indirect
Expand All @@ -110,9 +100,9 @@ require (
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
Expand All @@ -130,21 +120,21 @@ require (
golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.10.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/grpc v1.49.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.25.0 // indirect
k8s.io/component-base v0.25.0 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/component-base v0.26.1 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)
Loading

0 comments on commit b7f4c49

Please sign in to comment.