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

Export should allow resource to supply name to generated instance #598

Open
SteveL-MSFT opened this issue Nov 17, 2024 · 2 comments
Open
Labels
Issue-Enhancement The issue is a feature or idea Needs Triage
Milestone

Comments

@SteveL-MSFT
Copy link
Member

Summary of the new feature / enhancement

Currently, when dsc calls export, for each returned instance, it generates the name property as an incrementing value prefixed by the resource type. This means the end user needs to manually modify each instance if they want it a bit more descriptive.

Proposed technical implementation details (optional)

Resources should be able to return a _name type metadata as part of export that would be used instead.

@SteveL-MSFT SteveL-MSFT added Issue-Enhancement The issue is a feature or idea Needs Triage labels Nov 17, 2024
@SteveL-MSFT SteveL-MSFT added this to the 3.1-Consider milestone Nov 17, 2024
@michaeltlombardi
Copy link
Collaborator

michaeltlombardi commented Nov 20, 2024

Should the resources return the _metadata object with the name annotation instead, to keep all metadata processing limited to that field?

e.g. instead of returning an instance like:

scope: machine
updateAutomatically: false
_exist: true
_name: TSToy Machine Configuration

The instance would return:

scope: machine
updateAutomatically: false
_exist: true
_metadata:
  Microsoft.Dsc:
    export:
      _name: TSToy Machine Configuration

And DSC / other integrators would be able to handle it appropriately.

I've been thinking about the contract for metadata and I think having a single _metadata object is probably a good idea, especially if we scope the DSC-engine-specific metadata to a top-level property - then people can comfortably add whatever other metadata to that object, as long as whatever they return in metadata."Microsoft.DSC" matches our schemas.

@SteveL-MSFT
Copy link
Member Author

Yeah, when I said "metadata", I literally meant metadata :)

I think we only want that as a means for resources to return this type of info back to DSC rather than as a property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea Needs Triage
Projects
None yet
Development

No branches or pull requests

2 participants