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

Support TargetName binding of nested properties #71

Closed
BernieWhite opened this issue Jan 31, 2019 · 0 comments
Closed

Support TargetName binding of nested properties #71

BernieWhite opened this issue Jan 31, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@BernieWhite
Copy link
Member

BernieWhite commented Jan 31, 2019

When an object is passed from the pipeline, PSRule assigns the object a TargetName. TargetName is used in output results to identify one object from another.

Currently direct properties of the pipeline object can be bound, or a custom script block can be used to perform binding.

Using a custom script block is highly flexible but has performance impacts. For simple cases like nested properties, it would be better to provide this feature natively.

A similar feature was added in #60 for Exists, Within and Match keywords.

For example:

# Use the metadata.name property as TargetName
binding:
  targetName:
  - 'metadata.name'

An example Kubernetes namespace object:

---
# Namespace: dev
apiVersion: v1
kind: Namespace
metadata:
  name: dev

Using metadata.name to bind TargetName should return dev.

@BernieWhite BernieWhite added the enhancement New feature or request label Jan 31, 2019
@BernieWhite BernieWhite self-assigned this Jan 31, 2019
@BernieWhite BernieWhite added this to the v0.3.0 milestone Jan 31, 2019
BernieWhite added a commit that referenced this issue Feb 7, 2019
 #71 (#78)

- Import objects from YAML or JSON format #75
- Support TargetName binding of nested properties #71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant