Value Statement
I need the pick function for something like this:
---
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: clone-sc-rbd-to-thin
spec:
remediationAction: inform
severity: medium
object-templates-raw: |
{{- $src := (lookup "storage.k8s.io/v1" "StorageClass" "" "ocs-storagecluster-ceph-rbd") -}}
{{- if $src }}
- complianceType: musthave
objectDefinition:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: thin
# Use 'pick' directly on the $src object
{{- pick $src "provisioner" "parameters" "reclaimPolicy" "allowVolumeExpansion" "volumeBindingMode" | toYaml | nindent 8 }}
{{- end }}
But the function is not available in ACM ([it is available in sprig|https://masterminds.github.io/sprig/dicts.html:]
template: tmpl:12: function "pick" not defined
Definition of Done for Engineering Story Owner (Checklist)
- pick function to be defined in the Policy templates
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 template that you can access from [The Playbook](
and ensure doc acceptance criteria is met.
- Call out this sentence as it's own action:
- [ ] Link the development issue to the doc issue.
Support Readiness
- [ ] The must-gather script has been updated.