You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened?
After applying the add-on for managed clusters, I find that the objects, null'ed by the add-on are present in the data-structures and are written to the output.
The result is similar to the following block, beside that it references paths on my local machine
RUNTIME ERROR: Value non indexable: *jsonnet.valueNull
labels/addRuleLabels.libsonnet:12:12-18 function <anonymous>
labels/addRuleLabels.libsonnet:14:10-26 object <anonymous>
Field "kubernetes-serviceMonitorKubeControllerManager"
During manifestation
Workaround: @paulfantom worked with me to find a temporary workaround for the issue and this is the version that worked out for me. As said, this is my local version, adopted from the runbook code mentioned above.
local k8sMixinUtils = import 'github.com/kubernetes-monitoring/kubernetes-mixin/lib/utils.libsonnet';
local addLabels(rule) = rule {
[if 'alert' in rule && ('labels' in rule) then 'labels']+: {
namespace: 'monitoring',
env: std.extVar('target_env'),
},
};
{
addLabels(o): {
local filterRule(o) = o {
[if (o.kind == 'PrometheusRule') then 'spec']+: k8sMixinUtils.mapRuleGroups(addLabels),
},
[k]: filterRule(o[k])
for k in std.objectFields(o) if std.isObject(o[k])
},
}
The text was updated successfully, but these errors were encountered:
What happened?
After applying the add-on for managed clusters, I find that the objects, null'ed by the add-on are present in the data-structures and are written to the output.
I've hat a conversation with @paulfantom about a different topic on Slack (https://kubernetes.slack.com/archives/CFFDS2Z7F/p1616409344029800) and the solution drove me into finding the issue.
Did you expect to see some different?
I would expect the add-on not to break unrelated code or force the user to introduce workarounds / null checks.
How to reproduce it (as minimally and precisely as possible):
Steps to reproduce:
The result is similar to the following block, beside that it references paths on my local machine
Environment
Prometheus Operator version:
4d200f29f594c90c4850848c2611f062a90ed046
Anything else we need to know?:
In a Slack conversation with @paulfantom, he discovered that this issue is related to google/jsonnet#312
Workaround:
@paulfantom worked with me to find a temporary workaround for the issue and this is the version that worked out for me. As said, this is my local version, adopted from the runbook code mentioned above.
The text was updated successfully, but these errors were encountered: