Skip to content
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

Feature: Goal-seeking creation of Azure API Managament #3433

Open
ross-p-smith opened this issue Oct 16, 2023 · 4 comments
Open

Feature: Goal-seeking creation of Azure API Managament #3433

ross-p-smith opened this issue Oct 16, 2023 · 4 comments
Labels
microsoft.apimanagement Issues related to APIManagement resources new-feature

Comments

@ross-p-smith
Copy link
Contributor

Azure APIM supports soft deletion by default. We need to support goal seeking behaviour so that the Operator can createOrRestore if required. The Resource Provider will currently error if you supply Restore: true if an apim has not previously been created. We would like the Operator to succeed in this scenario.

@ross-p-smith
Copy link
Contributor Author

Deleted APIM services are unrecoverable within 48 hours. If you try and recover an apim after this, you will get the following error.

[controller:test-integration-envtest]     crd_apimanagement_20220801_test.go:60: 
[controller:test-integration-envtest]         No future change is possible.  Bailing out early after 10.009s.
[controller:test-integration-envtest]         Expected
[controller:test-integration-envtest]             <conditions.Condition>: {
[controller:test-integration-envtest]                 Type: "Ready",
[controller:test-integration-envtest]                 Status: "False",
[controller:test-integration-envtest]                 Severity: "Error",
[controller:test-integration-envtest]                 LastTransitionTime: {
[controller:test-integration-envtest]                     Time: 2023-10-25T22:19:54+01:00,
[controller:test-integration-envtest]                 },
[controller:test-integration-envtest]                 ObservedGeneration: 1,
[controller:test-integration-envtest]                 Reason: "InvalidOperation",
[controller:test-integration-envtest]                 Message: "Unable to undelete service 'asotest-apim-sczlzm'.: PUT https://management.azure.com/subscriptions/d5a106d2-ebae-4327-b2e8-c21962d4aaf5/resourceGroups/asotest-rg-pwokuh/providers/Microsoft.ApiManagement/service/asotest-apim-sczlzm\n--------------------------------------------------------------------------------\nRESPONSE 400: 400 Bad Request\nERROR CODE: InvalidOperation\n--------------------------------------------------------------------------------\n{\n  \"error\": {\n    \"code\": \"InvalidOperation\",\n    \"message\": \"Unable to undelete service 'asotest-apim-sczlzm'.\",\n    \"details\": null,\n    \"innerError\": null\n  }\n}\n--------------------------------------------------------------------------------\n",

@matthchr matthchr added the microsoft.apimanagement Issues related to APIManagement resources label Nov 9, 2023
@theunrepentantgeek theunrepentantgeek modified the milestones: v2.6.0, v2.7.0 Dec 11, 2023
@ross-p-smith
Copy link
Contributor Author

Whilst adding the new v2 APIM SKU in, the error message you get if you re-run any of the envtest a second time, is as follows

[controller:test-integration-envtest]     logr.go:284: I2023-12-22T02:57:16Z] NamedValueController "msg"="Owner exists but is not ready. Current condition" name="asotest1ktulmn" namespace="aso-test-samples-creationanddeletion-test-apimanagement-v-6d24f" ready="Condition [Ready], Status = \"False\", ObservedGeneration = 1, Severity = \"Warning\", Reason = \"ServiceAlreadyExistsInSoftDeletedState\", Message = \"Api service asotest1gnmjdw was soft-deleted. In order to create the new service with the same name, you have to either undelete the service or purge it. See https://aka.ms/apimsoftdelete.: PUT https://management.azure.com/subscriptions/xxxx/resourceGroups/asotest1-rg-pxwcxb/providers/Microsoft.ApiManagement/service/asotest1gnmjdw\\n--------------------------------------------------------------------------------\\nRESPONSE 409: 409 Conflict\\nERROR CODE: ServiceAlreadyExistsInSoftDeletedState\\n--------------------------------------------------------------------------------\\n{\\n  \\\"error\\\": {\\n    \\\"code\\\": \\\"ServiceAlreadyExistsInSoftDeletedState\\\",\\n    \\\"message\\\": \\\"Api service asotest1gnmjdw was soft-deleted. In order to create the new service with the same name, you have to either undelete the service or purge it. See https://aka.ms/apimsoftdelete.\\\",\\n    \\\"details\\\": null,\\n    \\\"innerError\\\": null\\n  }\\n}\\n--------------------------------------------------------------------------------\\n\", LastTransitionTime = \"2023-12-22 02:57:03 +0000 GMT\""

Just leaving this here to help later!

@matthchr matthchr removed this from the v2.7.0 milestone Feb 22, 2024
@matthchr
Copy link
Member

matthchr commented Jul 8, 2024

This is something we should look into still.

@matthchr
Copy link
Member

No change from above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
microsoft.apimanagement Issues related to APIManagement resources new-feature
Projects
Development

No branches or pull requests

3 participants