-
Notifications
You must be signed in to change notification settings - Fork 53
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
Configuration for YAML/ JSON based rules #1016
Comments
@BernieWhite I can probably help with this one. Was thinking |
@ArmaanMcleod Thanks. Agreed. |
@BernieWhite If we had a configuration defined like below: configuration:
allowedBusinessUnits:
- 'IT Operations'
- 'Finance'
- 'HR' And a YAML rule ---
# Synopsis: A YAML rule for testing.
apiVersion: github.com/microsoft/PSRule/v1
kind: Rule
metadata:
name: RuleYamlTagConfig
spec:
condition:
allOf:
- field: 'tags.businessUnit'
exists: true
- field: 'tags.businessUnit'
in:
configuration: 'allowedBusinessUnits' How would this work with the existing schema? Since Or would we need to convert this to an array of values: - field: 'tags.businessUnit'
in:
- configuration: 'allowedBusinessUnits' Probably need to find a consistent way to doing this for all the expressions. |
@ArmaanMcleod I was thinking something like this: - field: 'tags.businessUnit'
in:
$:
configuration: 'allowedBusinessUnits' It should be easy to update the schema to support all the advanced use cases for complex function support through a |
This should be addressed by initial function support. |
Currently PowerShell-based rules can use configuration values from options.
This is currently not supported for YAML/ JSON rules, we should add this feature.
Related to discussion Azure/PSRule.Rules.Azure#1314
May be able to work into: #1033
The text was updated successfully, but these errors were encountered: