-
Story
-
Resolution: Done
-
Normal
-
None
-
False
-
None
-
False
-
-
-
-
GRC Sprint 2023-18
-
No
Value Statement
When dealing with templatizing kube resources, such as is done with PolicyGenerator there is often cause to generate dynamic resource names. when generating dynamic resource names you always have to be concerned about exceeding the 63 char limit for resource names. the way this problem is solved in the helm world is by using the `trunc` and `trimAll` functions such as:
{{}}
name: '{{ printf "%s-%s" myvar "my-post-fix" | trunc 63 | trimAll "" }}'
But we dont have access to the trunc and trimAll functions in ACM templates at the moment.
Using the list of funcitons currently avaialbe (https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/2.8/html-single/governance/index#open-source-community-functions) i can't even find a work around to achieve this same result, none of the string functions needed for dynamically cutting down a string are available.
This essentially means its impossible to safely have dynamic resource names when creating PolicyGenerator templates because you run the risk of exceeding the 63 char limit (as i found out the hard way at a client).
Definition of Done for Engineering Story Owner (Checklist)
- ...
Development Complete
- The code is complete.
- Functionality is working.
- Any required downstream Docker file changes are made.
Tests Automated
- [ ] Unit/function tests have been automated and incorporated into the
build. - [ ] 100% automated unit/function test coverage for new or changed APIs.
Secure Design
- [ ] Security has been assessed and incorporated into your threat model.
Multidisciplinary Teams Readiness
- [ ] Create an informative documentation issue using the [Customer
Portal_doc_issue template](
https://github.com/stolostron/backlog/issues/new?assignees=&labels=squad%3Adoc&template=doc_issue.md&title=),
and ensure doc acceptance criteria is met. Link the development issue to
the doc issue. - [ ] Provide input to the QE team, and ensure QE acceptance criteria
(established between story owner and QE focal) are met.
Support Readiness
- [ ] The must-gather script has been updated.
- is documented by
-
ACM-7781 Add additional functions to the exported sprig template functions list
- Closed