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

[Help needed] Feature/documentdb 20240815 #4550

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

petrepopescu21
Copy link

@petrepopescu21 petrepopescu21 commented Jan 30, 2025

What this PR does

  • Adds support for DocumentDB apiVersion 2024-08-15
  • Adds MongodbUserDefinition
  • Adds MongodbRoleDefinition
  • Adds support for MongoDB 5.0, 6.0 and 7.0

The currently supported version 4.2 has been EOL for a while now.

How does this PR make you feel?

gif

Checklist

  • this PR contains documentation
  • this PR contains tests
  • this PR contains YAML Samples

@petrepopescu21
Copy link
Author

petrepopescu21 commented Feb 1, 2025

I'm having trouble with making the MongodbRoleDefinition work. While the status struct is generated correctly:

type MongodbRoleDefinition_STATUS struct {
	Conditions     []conditions.Condition `json:"conditions,omitempty"`
	DatabaseName   *string                `json:"databaseName,omitempty"`
	Id             *string                `json:"id,omitempty"`
	Name           *string                `json:"name,omitempty"`
	Privileges     []Privilege_STATUS     `json:"privileges,omitempty"`
	PropertiesType *string                `json:"properties_type,omitempty"`
	PropertyBag    genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	RoleName       *string                `json:"roleName,omitempty"`
	Roles          []Role_STATUS          `json:"roles,omitempty"`
	Type           *string                `json:"type,omitempty"`
}

when reading a resource using Azure CLI I get an integer instead of a string for the PropertiesType field:

az resource show --ids /subscriptions/3e8e8f8d-5388-41dd-8cb1-6dd1d418fe76/resourceGroups/asotest-rg-bmupee/providers/Microsoft.DocumentDB/databaseAccounts/asotestdbkgsgso/mongodbRoleDefinitions/asotest-mongo-hamilo.dboperator
{
  "extendedLocation": null,
  "id": "/subscriptions/3e8e8f8d-5388-41dd-8cb1-6dd1d418fe76/resourceGroups/asotest-rg-bmupee/providers/Microsoft.DocumentDB/databaseAccounts/asotestdbkgsgso/mongodbRoleDefinitions/asotest-mongo-hamilo.dboperator",
  "identity": null,
  "kind": null,
  "location": null,
  "managedBy": null,
  "name": "dboperator",
  "plan": null,
  "properties": {
    "databaseName": "asotest-mongo-hamilo",
    "privileges": [
      {
        "actions": [
          "dbStats"
        ],
        "resource": {
          "db": "asotest-mongo-hamilo"
        }
      }
    ],
    "roleName": "dboperator",
    "roles": [],
    "type": 1
  },
  "resourceGroup": "asotest-rg-bmupee",
  "sku": null,
  "tags": null,
  "type": "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions"
}

This causes an unmarshaling failure which is blocking my PR.
I was looking through the various modifiers in azure-arm.yaml but I was not able to find a similar situation.

Could anyone help out here?
Thanks!

@petrepopescu21 petrepopescu21 changed the title [WIP] Feature/documentdb 20240815 [Help needed] Feature/documentdb 20240815 Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant