-
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
Add parameters support #291
Conversation
use serde_json::Value; | ||
use std::collections::HashMap; | ||
|
||
pub struct Context { |
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.
If params can potentially be used in direct resource invocations (in addition to configurations) then this file probably should be moved to a more shared place.
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.
There's no intent to have params supported for direct resource invocation, it's a feature of config only at this time
@@ -4,6 +4,6 @@ version = "0.1.0" | |||
edition = "2021" | |||
|
|||
[dependencies] | |||
sysinfo = "*" | |||
sysinfo = "0.30" |
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.
- Are this changes in "process" related to this PR/parameters?
- why the "sysinfo" package version change?
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.
Yes, because the *
, CI picked up a different older version than what I was building on my local system so some of the syntax changed between versions. Having explicit version keeps it consistent so it builds both locally and in CI.
dsc_lib/src/configure/contraints.rs
Outdated
/// # Errors | ||
/// | ||
/// * `DscError::Validation` if the value does not match the constraints. | ||
pub fn check_number(name: &str, value: &Value, constraint: &Parameter) -> Result<(), DscError> { |
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 would rename this to be more specific like something like "check_number_limits" or "check_max_min" .
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.
agree on naming, will make this change.
This change adds documentation to the CLI and schema reference for the parameters support implementation in PowerShell#291 and PowerShell#294. It also updates the changelog with the relevant information.
PR Summary
Added:
dsc
CLI can accept parameters JSON/YAML as string or fileThe osinfo example YAMLs currently do not work due to schema validation happening before expression execution
PR Context
Fix #49