-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Container Service - Add OpenShift support #3712
Container Service - Add OpenShift support #3712
Conversation
Automation for azure-sdk-for-pythonA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
Can one of the admins verify this patch? |
Automation for azure-sdk-for-rubyNothing to generate for azure-sdk-for-ruby |
Automation for azure-sdk-for-goThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-nodeA PR has been created for you: |
Automation for azure-sdk-for-javaNothing to generate for azure-sdk-for-java |
Thanks @julienstroheker - please ping me when you've finished updating the spec (i.e. no longer WIP) so I can tag for ARM review. :) |
@AutorestCI rebuild azure-sdk-for-python |
Automation for azure-sdk-for-jsThe initial PR has been merged into your service PR: |
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.
Hi @julienstroheker - I just did a preliminary look over while we're waiting on ARM signoff.
}, | ||
"description": "Tags object for patch operations." | ||
}, | ||
"OpenShiftManagedClusterListResult": { |
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 definition is never used? Perhaps missing a "list" operation?
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.
Good catch. Not for now but for sure later. I'll remove it for now.
], | ||
"description": "OpenShift Managed cluster." | ||
}, | ||
"OpenShiftManagedClusterServiceAADIdentityProvider": { |
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 definition is never used?
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 used in OpenShiftManagedClusterIdentityProviders
in the provider field as object
we are planning to support more auth in the future
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.
But this generated model will not be used in response deserialization?
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 will be used by the sdk to create an authentication model? Makes sense ?
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.
Hi @julienstroheker ,
Yes and no - technically this will work, however the standard approach here is to use polymorphic models. I see for example, that OpenShiftManagedClusterServiceAADIdentityProvider
has a "kind" property. We generally consider this to be a discriminator (as I suspect this should be a constant value?). If all your intended "IdentityProvider" models will likely have a "kind" property - then I would recommend that you restructure this to use an "OpenShiftManagedClusterServiceIdentityProvider" base class.
Here is an example:
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/postgresql.json#L1355
You can see the base class "ServerPropertiesForCreate" defines the descriminator "createMode" (in your case this would be "kind") which is then set for each of the children using the "x-ms-discriminator-value" extension. In this example the base class has additional common properties - but that's not required depending on your case.
Here is an additional example:
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/graphrbac/data-plane/stable/1.6/graphrbac.json#L2327
In this case, like yours, the base class only has one available child class at present - which leaves them the option to add more later.
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.
Thanks @julienstroheker - But making the model polymorphic doesn't change the interface?
What is the expected value of "kind" for the AAD provider? It seems that at a minimum this should be a constant (i.e. an enum with a single option) so that a user doesn't have to set this value.
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 should works indeed ! Let me run some tests with it ! Thanks @annatisch
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.
@annatisch I just pushed the modification, can you check and tell me if it is ok?
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.
Thanks @julienstroheker - not quite - You can remove the x-ms-enum extension and it also needs to be marked as required.
Take a look at the docs here:
https://github.com/Azure/autorest/blob/bc0dcde0a05606a1b102c0e08c1798fa4da4dcc8/docs/extensions/readme.md#single-value-enum-as-a-constant
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.
What about now ? :)
"description": "Type of authentication profile to use." | ||
} | ||
}, | ||
"description": "OpenShiftManagedClusterAuthProfile defines all possible authentication profiles for the OpenShift cluster." |
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.
Try to avoid using the name of the model or property in the description (i.e. OpenShiftManagedClusterAuthProfile
) as this may not be the way it appears in a generated SDK depending on the naming conventions of the language.
In this instance I think you could simply removed it:
"description": "Defines all possible authentication profiles for the OpenShift cluster"
"description": "Configuration of the provider." | ||
} | ||
}, | ||
"description": "OpenShiftManagedClusterIdentityProvider is heavily cut down equivalent to IdentityProvider in the upstream." |
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 description would be a bit confusing to a developer using the SDK.
I think it would be better to give a simple description of its role, e.g. "Basic/Essential/etc details of an Identity Provider"
"count", | ||
"vmSize" | ||
], | ||
"description": "OpenShiftManagedClusterAgentPoolProfile represents configuration of OpenShift cluster VMs." |
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.
Try to avoid using the name of the model or property in the description (i.e. OpenShiftManagedClusterAgentPoolProfile
) as this may not be the way it appears in a generated SDK depending on the naming conventions of the language.
In this instance I think you could simply removed it:
"description": "Represents configuration of OpenShift cluster VMs."
...-manager/Microsoft.ContainerService/preview/2018-09-30-preview/openShiftManagedClusters.json
Show resolved
Hide resolved
} | ||
}, | ||
"definitions": { | ||
"OperationListResult": { |
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 spec does not include any "Operations" requests - so I don't think this and the next two models need to be here.
"maximum": 5, | ||
"minimum": 1, | ||
"description": "Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 5 (inclusive). The default value is 1. ", | ||
"default": 1 |
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.
I quick comment on the use of "defaults". I see you have a couple of them in the spec, so I wont leave a comment for every one.
It's important to note that how "defaults" are handled can vary from language to language.
Some languages will send the default values in the request body (regardless of whether it's set by the user) and other languages will leave these fields in the request as empty, and use the default purely to document the service behavior.
So please make sure that your service API will handle both scenarios the same way - i.e. it will treat a request with an empty field and a request with a default value exactly the same.
ping @ravbhatnagar |
@annatisch @ravbhatnagar any news on this ? Thanks |
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.
Few notes added. please take a look.
"description": "Parameters supplied to the Create or Update an OpenShift Managed Cluster operation." | ||
} | ||
], | ||
"responses": { |
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.
please model the default response to capture all the error states. Sample can be found in batch RP swagger.
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.
Schema has not been added for the default response. Please check Batch RP swagger for sample.
"description": "The name of the openshift managed cluster resource." | ||
} | ||
], | ||
"responses": { |
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.
model the 200 response. 204 will indicate that the resource to be deleted was not found. and 200 will indicate that the resource was found and deleted successfully.
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.
Hi @ravbhatnagar we don't have a 200 response here, only 202 or 204. is it ok ?
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.
so as per ARM Resource provider contract, 204 on a delete must be returned when the requested resourceId was not found. 200 is returned in case where resource was successfully deleted.
} | ||
} | ||
}, | ||
"paths": { |
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.
GET APIs to list all openShiftManagedClusters under a resource group and under a subscription missing. Please add.
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 is not implemented yet in our RP.
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.
ok, please note that having this is a requirement as clients like portal will have issues if these APIs were not supported.
Only one outstanding item- adding the schema for the default response. Conditionally Signing off from ARM side. |
# Conflicts: # specification/containerservices/resource-manager/readme.md
@ravbhatnagar @annatisch I added the schema for the default response. Please let me know if it is ok ? Thanks |
Thanks for the updates @julienstroheker - I'm just about to do a final review. |
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-version
in the path should match theapi-version
in the spec).Quality of Swagger