-
Notifications
You must be signed in to change notification settings - Fork 17
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
Move funcmap and add template functions docs #41
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
On top of golangs normal templating we provide some functions to make writitng references easier. | ||
The (sprig functions)[http://masterminds.github.io/sprig/] are included along with some other functions that can be found in the (subpackages pkg.go.dev page)[https://pkg.go.dev/github.com/openshift/kube-compare/pkg/funcmap#pkg-functions] | ||
|
||
If you want to custom functions you can define them as a templates and include them a paths under `templateFunctionFiles` at the root of your reference `metadata.yml` |
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.
Maybe an example or two (sprig && custom) would be nice!
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.
Not sure what you mean here?
Do you mean you want me to list a few or show a template with them in?
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.
Yep that's it. Show a template with them...so like as a user I would like tips on how to incorporate spring/template funcs in my existing references! Also not sure what templateFunctionFiles
is...a custom dir name? (but including an example should clear it up)
btw metadata.yml should be metadata.yaml
? The file ext is somewhat hardcoded right?
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.
Ok yeah I think that makes sense :)
templateFunctionFiles
is an entry in the metadata file that can be used to load templates to be used as custom functions.
I'll check if there is documentation on that.
Good shout on the .yaml
we should make it less so I'll make an issue for that.
# Templating functions | ||
|
||
On top of golangs normal templating we provide some functions to make writitng references easier. | ||
The (sprig functions)[http://masterminds.github.io/sprig/] are included along with some other functions that can be found in the (subpackages pkg.go.dev page)[https://pkg.go.dev/github.com/openshift/kube-compare/pkg/funcmap#pkg-functions] |
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.
all some other functions
are the functions supported by helm,
until we introduce any custom functions (that can take time because we still have not plan that),
i think its better to change it too the function supported be helm (without include). and i then i would add comment that we do try stay aligned but there may be drifts, to see the exact functions supported view the package docs
2893ca7
to
df748b0
Compare
df748b0
to
107c72d
Compare
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@nocturnalastro: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
#20
Note the url https://pkg.go.dev/github.com/openshift/kube-compare/pkg/funcmap#pkg-functions wont be live until we merge it but https://pkg.go.dev/github.com/openshift/kube-compare/pkg/compare#pkg-functions to see how it would look - although currently the to/from helper functions are not visible as they are currently private