HPA `withScaleTargetRef` custom function returns error
pharaujo opened this issue · comments
Minimal project that shows the problem follows:
Running tk init
in an empty dir, then adding the test code to environments/default/main.jsonnet
:
local k = import 'k.libsonnet';
{
deployment: k.apps.v1.deployment.new('sample', containers=[]),
hpa:
k.autoscaling.v2beta2.horizontalPodAutoscaler.new('sample') +
k.autoscaling.v2beta2.horizontalPodAutoscaler.spec.withScaleTargetRef($.deployment),
}
Running tk show environments/default/
returns the following error:
Error: evaluating jsonnet: RUNTIME ERROR: couldn't manifest function as JSON
Field "withApiVersion"
Field "scaleTargetRef"
Field "spec"
Field "hpa"
During manifestation
I believe this is caused by the merge of withApiVersion
here:
I left a comment in the PR that added this customization asking what was the original purpose, but I believe taking it out should solve the issue.