-
Notifications
You must be signed in to change notification settings - Fork 206
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
Add CosmosDB Mongo database and collection resources #1870
Add CosmosDB Mongo database and collection resources #1870
Conversation
Adds the charmingly named DatabaseAccountsMongodbDatabasesCollection. Marked the MongoDBCollectionResource.Id field as not being a resource reference - as far as I can tell it's the name of the collection within the mongo database.
These should be in a similar form to commit messages to match how they're used in the output.
For some reason Mongo database tags aren't coming back in the status of the resource - I haven't worked out yet whether they're on the ARM resource.
bc42213
to
22fa618
Compare
tc.CreateResourceAndWait(&db) | ||
defer tc.DeleteResourceAndWait(&db) | ||
|
||
// TODO: for reasons I don't understand tags set on the database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there's no way to specify tags on databases from az
, but the SDK supports it (presumably going off the same sources we are).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably the thing that @matthchr noticed, where the ResourceBase has Tags but not everything supports Tags so they are ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I had a feeling it might be something like that. I'll remove that section then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's it exactly @Porges. There's a bug here #1730. I think the Azure resource manager schema folks agreed this was a bug, but it's likely that the best fix is just to move to use Swagger (which when I looked at the resources I had found with this problem correctly did not have tags
defined on the resource).
It’s a good game |
Codecov Report
@@ Coverage Diff @@
## master #1870 +/- ##
==========================================
- Coverage 62.67% 62.44% -0.24%
==========================================
Files 323 329 +6
Lines 68780 70462 +1682
==========================================
+ Hits 43108 44000 +892
- Misses 22245 22931 +686
- Partials 3427 3531 +104
Continue to review full report at Codecov.
|
@@ -7,7 +7,7 @@ spec: | |||
location: westcentralus | |||
owner: | |||
name: aso-sample-rg | |||
kind: GlobalDocumentDB | |||
kind: MongoDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old one was also valid, right? Or was it the "Default" and so specifying it is sorta pointless and enables nothing extra?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it wouldn't let me create mongo databases/collections unless I set the kind to MongoDB.
What this PR does / why we need it:
This adds the resources
DatabaseAccountsMongodbDatabase
andDatabaseAccountsMongodbDatabasesCollection
which enable managing Mongo databases and collections respectively.Special notes for your reviewer:
Seems like a lot but because of the joys of code-gen and recorded requests it's really just 10 lines of config change and 161 lines of tests.
(Also I did some driveby fixes to pipeline stage descriptions.)
How does this PR make you feel:
![gif](https://camo.githubusercontent.com/0dc99cd7664c998c18e42be0d3ccdafaddcff674b8b04a6ef6c8a1fd663a9c6f/68747470733a2f2f632e74656e6f722e636f6d2f76356c787a54716537394141414141642f6f757465722d77696c64732e676966)
If applicable: