aws-controllers-k8s / community

AWS Controllers for Kubernetes (ACK) is a project enabling you to manage AWS services from Kubernetes
https://aws-controllers-k8s.github.io/community/
Apache License 2.0
2.39k stars 253 forks source link

RDS Controller - implement admission controller #1918

Open gecube opened 11 months ago

gecube commented 11 months ago

Hello!

I tried to created a RDS Cluster with databaseName filed set to something like database-1-uat Then I got in kind: DBCluster in status the following:

    - message: "InvalidParameterValue: DatabaseName must begin with a letter and contain only alphanumeric characters.\n\tstatus code: 400, request id: b3a41460-d9bc-429d-b036-74e5d4416992"

It would be nice to disallow the apply of kind: DBCluster if it won't be accepted by Amazon API. I bet that the current CRD schema could not disallow databaseName with hyphens. So it'd be logical to implement admission controller that will check all fields to have correct values that could be fed to Amazon API. In such a way I will get faster the error message than to wait till the status field of DBCluster will be updated.

The same applies to very every other controllers in ACK project.

gecube commented 11 months ago

The same if you created DBCluster first and then you want to add DBInstance to the cluster:

otherwise you will get something like

    - message: "InvalidParameterCombination: The requested DB instance will be a member of a DB cluster. You don't need to set storage size.\n\tstatus code: 400, request id: 10afaf0d-51eb-4dd3-ae91-093c0d9855f2"
      status: 'True'
      type: ACK.Terminal

in status field.

ack-bot commented 5 months ago

Issues go stale after 180d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 60d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://github.com/aws-controllers-k8s/community. /lifecycle stale

gecube commented 5 months ago

/remove-lifecycle stale