func toInt (input interface{}) (output int)
func toInt (input interface{}) (output int)
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: demo-template-function
namespace: test
spec:
namespaceSelector:
exclude:
- kube-*
include:
- default
object-templates:
- complianceType: musthave
objectDefinition:
...
spec:
vlanid: |
{{ (fromConfigMap "site-config" "site1" "vlan") | toInt }}
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: demo-template-function
namespace: test
spec:
namespaceSelector:
exclude:
- kube-*
include:
- default
object-templates:
- complianceType: musthave
objectDefinition:
...
spec:
vlanid: |
{{ (fromConfigMap "site-config" "site1" "vlan") | toInt }}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow