-
Notifications
You must be signed in to change notification settings - Fork 204
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
Bug: Creating a SQL server with an invalid name should error out #214
Labels
bug 🪲
Something isn't working
Comments
I'd suggest not trying to code so much server specific logic into the operator. Let's call the api and if it rejects the request due to names that are invalid, take the message and save it in the sqlserver entity status. We need to catch this error:
|
Why? Isn’t it better to catch the error instead of making a call to Azure and letting it fail & then catch the error?
It seems a waste of round trip to Azure for something that you can check and prevent.
…________________________________
From: Erin Corson <notifications@github.com>
Sent: Thursday, September 12, 2019 4:52 PM
To: Azure/azure-service-operator
Cc: Janani Vasudevan; Author
Subject: Re: [Azure/azure-service-operator] Bug: Creating a SQL server with an invalid name should error out (#214)
I'd suggest not trying to code so much server specific logic into the operator. Let's call the api and if it rejects the request due to names that are invalid, take the message and save it in the sqlserver entity status.
We need to catch this error:
2019-09-12T22:49:13.203Z ERROR controller-runtime.controller Reconciler error {"controller": "sqlserver", "request": "default/sqlserver1.2", "error": "error reconciling sql server in azure: sql.ServersClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code=\"InvalidServerName\" Message=\"Server name 'sqlserver1.2' cannot be empty or null. It can only be made up of lowercase letters 'a'-'z', the numbers 0-9 and the hyphen. The hyphen may not lead or trail in the name.\""}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgh.neting.cc%2FAzure%2Fazure-service-operator%2Fissues%2F214%3Femail_source%3Dnotifications%26email_token%3DAL2HWUNSER2KZ4CDCFWLBKDQJLBZFA5CNFSM4IVZOMV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6TPTCQ%23issuecomment-531036554&data=02%7C01%7Cjananiv%40microsoft.com%7Ccd5592528317454109e808d737d3d3d3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637039255245345723&sdata=xDg%2FECGK5cI0FbdcanMI4PQTI5XL%2FHLY9BM4iEgpEQI%3D&reserved=0>, or mute the thread<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgh.neting.cc%2Fnotifications%2Funsubscribe-auth%2FAL2HWUKCL2IXIWYWIMMYY4TQJLBZFANCNFSM4IVZOMVQ&data=02%7C01%7Cjananiv%40microsoft.com%7Ccd5592528317454109e808d737d3d3d3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637039255245355720&sdata=mIoxvYXU1OdUakacJJXxhjKp5HtlzyGmf2aMZ53GcnA%3D&reserved=0>.
|
2 tasks
Porges
pushed a commit
that referenced
this issue
May 11, 2021
- It is built during CI now (and by make all for local testing).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Currently when you use the invalid name sqlserver1.2 for the sqlserver, the reconcile loop keeps requeuing and trying again. We should check for the validity of the name before calling create. Ideally all SDK helpers should expose the "Validatename" function that the SDK provides
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Controller should error out and not create the kube instance
The text was updated successfully, but these errors were encountered: