Skip to content

feat(mysql): Allow to Grant permissions on specific columns in table#330

Merged
chlunde merged 4 commits into
crossplane-contrib:masterfrom
ymaniukevich:feature/mysql-grant-perms-to-column
May 14, 2026
Merged

feat(mysql): Allow to Grant permissions on specific columns in table#330
chlunde merged 4 commits into
crossplane-contrib:masterfrom
ymaniukevich:feature/mysql-grant-perms-to-column

Conversation

@ymaniukevich
Copy link
Copy Markdown
Contributor

@ymaniukevich ymaniukevich commented Feb 23, 2026

Description of your changes

Improved regexp expression for granting permission to specific columns in MySQL.

Fixes #214, #176

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

apiVersion: mysql.sql.crossplane.io/v1alpha1
kind: Grant
metadata:
  name: user-example
spec:
  forProvider:
    databaseRef:
      name: example-db
    privileges:
      - UPDATE (`status`, `updated_at`)
      - SELECT
    table: requests
    user: user-example@%
  providerConfigRef:
    name: example

@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch from ce36e61 to b41ee96 Compare February 23, 2026 08:09
@chlunde
Copy link
Copy Markdown
Collaborator

chlunde commented Feb 23, 2026

@ymaniukevich would it make sense to update the examples to get e2e coverage here? We'll also need to rebase this PR after #328 is in because e2e will fail now

@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch from b41ee96 to 21e7234 Compare February 23, 2026 16:00
@chlunde
Copy link
Copy Markdown
Collaborator

chlunde commented Feb 24, 2026

@ymaniukevich I guess this also fixes #176 ?

@ymaniukevich
Copy link
Copy Markdown
Contributor Author

@chlunde I'll add an e2e test to cover the case of granting table permissions. I've checked issue #176 — you're right, this will fix it as well.

@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch 6 times, most recently from 6fdc292 to 9c8f974 Compare February 24, 2026 21:10
@ymaniukevich
Copy link
Copy Markdown
Contributor Author

@ymaniukevich would it make sense to update the examples to get e2e coverage here?

@chlunde I've updated the examples to improve e2e coverage.

@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch 2 times, most recently from 95e20ec to 69512e6 Compare March 3, 2026 11:45
Comment thread examples/cluster/mysql/grant_table.yaml Outdated
@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch from 69512e6 to 6fdc505 Compare March 23, 2026 14:09
@ymaniukevich ymaniukevich marked this pull request as draft March 23, 2026 14:10
@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch 7 times, most recently from fd0e4fd to b833d4f Compare March 23, 2026 14:49
@ymaniukevich ymaniukevich marked this pull request as ready for review March 23, 2026 15:05
@chlunde chlunde self-requested a review March 24, 2026 19:56
@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch from b833d4f to e0725d3 Compare April 23, 2026 08:13
@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch from e0725d3 to 543c81d Compare May 5, 2026 06:41
mysql: add e2e tests to cover granting permission on table

Signed-off-by: ymaniukevich <yauheni.maniukevich@gmail.com>
Signed-off-by: Yauheni Maniukevich <yauheni.maniukevich@gmail.com>
…privilege comparison

Signed-off-by: Yauheni Maniukevich <yauheni.maniukevich@gmail.com>
@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch from 543c81d to fa0f586 Compare May 14, 2026 21:01
Signed-off-by: Yauheni Maniukevich <yauheni.maniukevich@gmail.com>
@ymaniukevich ymaniukevich force-pushed the feature/mysql-grant-perms-to-column branch from c2e0c98 to a4fd65a Compare May 14, 2026 21:06
Comment thread apis/cluster/mysql/v1alpha1/grant_types.go Outdated
Signed-off-by: Yauheni Maniukevich <yauheni.maniukevich@gmail.com>
@chlunde chlunde merged commit d6134e4 into crossplane-contrib:master May 14, 2026
8 checks passed
@chlunde
Copy link
Copy Markdown
Collaborator

chlunde commented May 14, 2026

@ymaniukevich thanks!

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.

[mysql] Unable to Grant permissions on specific columns in table

2 participants