Skip to content

Commit

Permalink
Merge pull request #70 from vshn/fix/wrong_cluster_name_retrieval
Browse files Browse the repository at this point in the history
Fix wrong retrieval of the cluster_name when creating a new binding
  • Loading branch information
TheBigLee authored Mar 21, 2022
2 parents 317a9f6 + 6cafb0f commit 40a58f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/crossplane/service_mariadb_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ func (msb MariadbDatabaseServiceBinder) Bind(ctx context.Context, bindingID stri
return nil, err
}

cn := msb.instance.GetClusterName()
parent := composite.New(composite.WithGroupVersionKind(mariaDBGroupVersionKind))
if err := msb.cp.client.Get(ctx, types.NamespacedName{Name: msb.instance.Labels.ParentID}, parent); err != nil {
return nil, fmt.Errorf("Could not get parent instance: %w", err)
}
cn := parent.GetLabels()["service.syn.tools/cluster"]
creds := createCredentials(endpoint, bindingID, pw, msb.instance.ID(), cn, msb.cp.config.EnableMetrics, msb.cp.config.MetricsDomain)

return creds, nil
Expand Down

0 comments on commit 40a58f0

Please sign in to comment.