crossplane-contrib / crossplane-contrib/provider-sql

PostgreSQL Grant accepts mutually exclusive fields without validation

Open
#406 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
154
Forks
119
Avg merge
6d 17h
Merged PRs (30d)
8

Description

### What happened?

PostgreSQL Grant resources accept both `memberOf` and `database` fields (including their ref/selector variants) simultaneously. These represent fundamentally different grant types (ROLE_MEMBER vs database-level privileges) and cannot coexist, but the API schema does not prevent it.

The error is only surfaced at runtime by the reconciler:

```
cannot set privileges or database in the same grant as memberOf
```

### How can we reproduce it?

- grant.postgresql.sql.m.crossplane.io (namespaced)
- grant.postgresql.sql.crossplane.io (cluster)

with both a `databaseSelector` and `memberOf` filled in.

### What environment did it happen in?
Crossplane version: 2.3.3
Provider v0.15

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the API schema for the namespaced and cluster PostgreSQL Grant resources, then trace the reconciler path that currently reports this runtime error. Reproduce the case with both databaseSelector and memberOf set. Done means the schema rejects mutually exclusive memberOf and database fields, including their reference and selector variants, before reconciliation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.