Skip to content

Surface _kind, _securityContext, and _name from resource during export #884

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tgauth
Copy link
Collaborator

@tgauth tgauth commented Jun 12, 2025

PR Summary

  • update export to surface specific properties from resource at top-level, while also removing those properties from the lower-level object
  • add corresponding pester test

PR Context

@tgauth tgauth requested a review from SteveL-MSFT June 12, 2025 20:02
@tgauth tgauth changed the title Surface props export Surface _kind, _securityContext, and _name from resource during export Jun 12, 2025
pub properties: Option<Map<String, Value>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<Map<String, Value>>,
#[serde(rename = "securityContext", skip_serializing_if = "Option::is_none")]
pub security_context: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

securityContext is part of metadata already

Copy link
Collaborator Author

@tgauth tgauth Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the goal to surface securityContext in the resource metadata or the resource's Microsoft.DSC metadata (or somewhere else entirely)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be within the Microsoft.DSC metadata where we have securityContext already

@ThomasNieto
Copy link

What is _kind and are there any restrictions on the values?

@SteveL-MSFT
Copy link
Member

What is _kind and are there any restrictions on the values?

The intent is to align with ARM where we have scenarios where this info is needed https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/syntax#resources. So short answer, is it's currently just a string with no validation. It isn't information that will be used by DSC itself, but higher level tools so scenario specific. I expect most DSC resources to not use this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export should allow resource to supply name to generated instance
3 participants