Add elastic pool reference support to MSSQLDatabase#1198
Conversation
08a4d05 to
f3c4d3f
Compare
|
Thank you @nicolamacoir for opening the PR! EDIT: |
|
I haven't noticed that there's no updates to CRDs. Please update |
Hi @jonasz-lasut |
|
/test-examples="examples/sql/namespaced/v1beta1/mssqldatabase.yaml" |
|
The E2E test has failed because the server name was not globally unique create failed: async create failed: failed to create the resource: [{0 creating Server (Subscription: "2895a7df-ae9f-41b8-9e78-3ce4926df838"
Resource Group Name: "example"
Server Name: "example"): polling after CreateOrUpdate: polling failed: the Azure API returned the following error:
Status: "NameAlreadyExists"
Code: ""
Message: "The name 'example.database.windows.net' already exists. Choose a different name."
Activity Id: ""
---
API Response:
----[start]----
{"name":"7ec5defe-8d91-4bb1-8146-9526b7172fe3","status":"Failed","startTime":"2026-04-16T12:57:28.287Z","error":{"code":"NameAlreadyExists","message":"The name 'example.database.windows.net' already exists. Choose a different name."}}
-----[end]-----
[]}]Could you change the server's (MSSQLServer) name in the examples to |
|
/test-examples="examples/sql/namespaced/v1beta1/mssqldatabase.yaml" |
|
Hi @jonasz-lasut I think the latest error is related to timeouts. The test ran for 1211 seconds and was killed (signal: killed). The resource status was empty. This really does look like it just timed out waiting for the Azure resources to provision. The signal: killed confirms the process was terminated externally. The elastic pool example uses uptest.upbound.io/timeout: "3600" its MSSQLServer, I guess for exactly this reason? I've added it to the mssqldatabase resource as well. |
|
This time it was a misconfiguration on a Database resource, MSSQL was not heavily tested and we did not have any new features for a long time so the examples may be a little stałe Here's the screenshot as I can't easily copy-paste YAML on my phone 😓 You can always find the dump of a full controlplane in the E2E job artifacts. There's a file called all-crossplane.yaml which contains the managed resources, CRDs and everything else related to the test |
|
/test-examples="examples/sql/namespaced/v1beta1/mssqldatabase.yaml |
|
ResourceGroup is failing because it's calling example and we already have a resource group with this name in another region. I'd propose to change the RG name similarly as with MSSQLServer - mssqldatabasev1beta2 and mssqldatabasev1beta1ns respectively for cluster example and namespaced example |
|
/test-examples="examples/sql/namespaced/v1beta1/mssqldatabase.yaml" |
|
Hi @jonasz-lasut, I found another bad reference (the ResourceGroup name collision). Hopefully all is good now. I've also took the opportunity to add an elastic pool to the example so that the new |
|
Hi @jonasz-lasut. Could you give the test another hit pls? Would be great to have this feature merged and released. Thanks! |
|
Hi @nicolamacoir |
I’ve identified the root cause. (I just discovered how to check the artifacts as you suggested before; apologies for my ignorance.) I’m puzzled by the existence of that database. I couldn’t find any other matching resources in the repository. Perhaps I lack sufficient understanding or context about the setup of the E2E test suite. I would assume that all resources are deleted after each run. |
|
They should be, we may have caught a bug :) For now you can change the name in examples so we can run the e2e suite and I'll open a thread on maintainer slack that the resources are not cleaned up mssqldatabase... --> sqldatabase... in examples should be fine EDIT: found a bug in namespaced resources cleanup, I'll run cluster tests for now |
|
/test-examples="examples/sql/cluster/v1beta2/mssqldatabase.yaml" |
|
Good that we've tested with the cluster version. You'll need to manually copy the diff in I'd also appreciate if you could squash your commits before we can proceed with merging the code later |
4b73890 to
74e711a
Compare
|
Appreciate the quick fix, I've added a small comment as you've backported the new fields into Observation in v1beta1 as well and they're not supposed to be there. You'll have to remove them from the commented file and run |
Add elasticPoolIdRef/elasticPoolIdSelector fields to MSSQLDatabase, allowing users to declaratively reference an MSSQLElasticPool resource instead of hard-coding the Azure resource ID. Changes: - Add elastic_pool_id reference config for both cluster and namespaced providers pointing to azurerm_mssql_elasticpool - Backport reference fields to v1beta1 (InitParameters and Parameters only, not Observation) - Regenerate CRDs, types, resolvers, and deepcopy methods - Rewrite examples following the proven elastic pool pattern with unique resource names and labels to avoid E2E test conflicts - Add MSSQLElasticPool to examples to test the new reference Fixes crossplane-contrib#1197 Signed-off-by: Nicola <nicola.macoir@rightcrowd.com>
74e711a to
606cd78
Compare
|
/test-examples="examples/sql/cluster/v1beta2/mssqldatabase.yaml" |
jonasz-lasut
left a comment
There was a problem hiding this comment.
LGTM @nicolamacoir
Really appreciate all the effort you've put into this PR!
|
Thanks for all your help and quick guidance! |

Summary
elasticPoolIdRefandelasticPoolIdSelectorsupport toMSSQLDatabase, allowing declarative references toMSSQLElasticPoolresources instead of requiring hard-coded Azure resource IDsserverIdRef/serverIdSelectorFixes #1197
Test plan
elasticPoolIdRefandelasticPoolIdSelectorfields in the CRD typesMSSQLElasticPoolby name resolves correctly