Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[User.Sql] publish password to Connection Secret #501

Merged

Conversation

ytsarev
Copy link
Collaborator

@ytsarev ytsarev commented Apr 8, 2024

Description of your changes

To effectively use this MR within higher level abstractions like https://github.com/upbound/configuration-gcp-database and eventually https://github.com/upbound/platform-ref-gcp/ we need a reliable way to expose SQL User password through the connection secret

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

diff --git a/examples/sql/user.yaml b/examples/sql/user.yaml
index dbe3e7f9..987fb3a7 100644
--- a/examples/sql/user.yaml
+++ b/examples/sql/user.yaml
@@ -48,7 +48,7 @@ metadata:
   labels:
     testing.upbound.io/example-name: example_instance
   # ${Rand...} is not valid YAML and is used with automated testing
-  name: example-instance-${Rand.RFC1123Subdomain}
+  name: example-instance-yury-test
 spec:
   forProvider:
     region: "us-central1"


k apply -f examples/sql/user.yaml
...
 k get -f examples/sql/user.yaml
NAME                                   READY   SYNCED   EXTERNAL-NAME   AGE
user.sql.gcp.upbound.io/example-user   True    True     example-user    16m

NAME                      TYPE     DATA   AGE
secret/example-sql-user   Opaque   1      16m

NAME                                                             READY   SYNCED   EXTERNAL-NAME                AGE
databaseinstance.sql.gcp.upbound.io/example-instance-yury-test   True    True     example-instance-yury-test   16m

k view-secret -n upbound-system example-sql-db-user-secret
Multiple sub keys found. Specify another argument, one of:
-> attribute.password
-> password

 k view-secret -n upbound-system example-sql-db-user-secret password
changeme%

Plus uptest below

ytsarev added 2 commits April 8, 2024 15:37
Signed-off-by: Yury Tsarev <yury@upbound.io>
Signed-off-by: Yury Tsarev <yury@upbound.io>
@ytsarev
Copy link
Collaborator Author

ytsarev commented Apr 8, 2024

/test-examples="examples/sql/user.yaml"

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ytsarev, LGTM.

@ytsarev
Copy link
Collaborator Author

ytsarev commented Apr 15, 2024

I do not have access rights to this repo. @turkenf please feel free to merge it in. Alternatively, @jeanduplessis , feel free to give me merge access rights :D

@jeanduplessis jeanduplessis merged commit c555e7e into crossplane-contrib:main Apr 15, 2024
10 checks passed
@ytsarev ytsarev deleted the user-sql-password-to-conn-sec branch April 15, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants