-
Notifications
You must be signed in to change notification settings - Fork 30
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
Support version pinning in a configuration document #543
Comments
Currently discovery in the engine and resource invocation (i.e. |
Arguably, it might be better to have a metadata:
Microsoft.DSC:
requireResources:
- type: MyOrg/Database
version: 1.2
sha: <sha>
- type: MyOrg.Web/*
version: "[2.0,3.0)"
signed_by: <trusted-persona>
resources:
# Using `require` field on instance
- type: MyOrg.Web/Server
name: Setup web server
require:
version: 2.4.2
properties: {}
# Using `require` field in metadata
- type: MyOrg.Web/Static
name: Define static site
metadata:
Microsoft.DSC: { require: { version: 2.3.0, sha: <sha> } }
properties: {}
dependsOn:
- "[resourceId('MyOrg.Web/Server', 'Setup web server')]" Note In this example I'm showing using both top-of-document and per-instance pins, but I wouldn't expect people to mix and match like this, or at least not to override document-level pins. If we didn't have to maintain ARM compatibility, I think I would prefer specifying resources:
- name: Setup web server
type: MyOrg.Web/[email protected]
properties {}
- name: Define static site
type:
name: MyOrg.Web/Static
version: 2.3.0
sha: <sha>
properties: {}
dependsOn:
- "[resourceId('MyOrg.Web/Server', 'Setup web server')]" If we implement the |
Summary of the new feature / enhancement
Proposed technical implementation details (optional)
A few options come to mind.
The easiest-for-users would be to allow them to append a version pin to the end of the resource type name for a resource, like
Microsoft.DSC/[email protected]
. This would require introduce complexity to the engine for handling and impact the way configuration functions work, which makes it a harder sell to me.The more explicit option is to support a
version
field on the resource instance declaration:Another option would be to define it under resource metadata:
Of the available options, I lean more towards the metadata implementation, even though it requires defining per-resource metadata. However, we've discussed other uses for this property bag, and defining a structure for this would pave the way for those use cases. It would also enable users to declare version pins in the top-level metadata with per-resource overrides (if we choose to support that).
I don't think this would require any further work for adapters, since they already report available resources and versions to DSC.
The text was updated successfully, but these errors were encountered: