-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: syntax errors in kube-state-metrics.libsonnet #2454
Conversation
|
Welcome @jeffmccune! |
/lgtm Thanks! |
/lgtm |
Looks like there are further changes needed. Can you regenerate it running make generate? |
/assign @mrueg |
selector{ | ||
matchLabels: {app.kubernetes.io/name': shardksmname} | ||
} | ||
selector: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the fix.
- move
local shardksmname = ksm.name + "-unscheduled-pods-fetching";
to
deploymentNoNodePods:
# <--------here
local c = ksm.deployment.spec.template.spec.containers[0] {
- generate manifests
make generate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CatherineF-dev Thanks, I made this change in a860c17 and ran make generate
, but the CI failure, make validate-manifests
is still failing locally for me. Could you help me understand why and what needs to be done to fix the CI job?
make validate-manifests
diff --git a/examples/daemonsetsharding/deployment-no-node-pods-service.yaml b/examples/daemonsetsharding/deployment-no-node-pods-service.yaml
index 5f287b7a..ddf08923 100644
--- a/examples/daemonsetsharding/deployment-no-node-pods-service.yaml
+++ b/examples/daemonsetsharding/deployment-no-node-pods-service.yaml
@@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics-no-node-pods
- app.kubernetes.io/version: 2.12.0
+ app.kubernetes.io/version: 2.13.0
name: kube-state-metrics-no-node-pods
namespace: kube-system
spec:
diff --git a/examples/daemonsetsharding/deployment-no-node-pods.yaml b/examples/daemonsetsharding/deployment-no-node-pods.yaml
index eac87a53..c3b6c00b 100644
--- a/examples/daemonsetsharding/deployment-no-node-pods.yaml
+++ b/examples/daemonsetsharding/deployment-no-node-pods.yaml
@@ -3,20 +3,20 @@ kind: Deployment
metadata:
labels:
app.kubernetes.io/component: exporter
- app.kubernetes.io/name: kube-state-metrics-no-node-pods
+ app.kubernetes.io/name: kube-state-metrics-unscheduled-pods-fetching
app.kubernetes.io/version: 2.13.0
- name: kube-state-metrics-no-node-pods
+ name: kube-state-metrics-unscheduled-pods-fetching
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
- app.kubernetes.io/name: kube-state-metrics-no-node-pods
+ app.kubernetes.io/name: kube-state-metrics-unscheduled-pods-fetching
template:
metadata:
labels:
app.kubernetes.io/component: exporter
- app.kubernetes.io/name: kube-state-metrics-no-node-pods
+ app.kubernetes.io/name: kube-state-metrics-unscheduled-pods-fetching
app.kubernetes.io/version: 2.13.0
spec:
automountServiceAccountToken: true
@@ -31,7 +31,7 @@ spec:
port: http-metrics
initialDelaySeconds: 5
timeoutSeconds: 5
- name: kube-state-metrics-no-node-pods
+ name: kube-state-metrics-unscheduled-pods-fetching
ports:
- containerPort: 8080
name: http-metrics
make: *** [validate-manifests] Error 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you run make generate -B
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake, I forgot to commit the generated examples. 3aebcf7 should be good, passes locally for me.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: examples/daemonsetsharding/deployment-no-node-pods-service.yaml
modified: examples/daemonsetsharding/deployment-no-node-pods.yaml
@jeffmccune friendly ping, do you have time to fix the CI and include @CatherineF-dev's comments? |
Any update here? https://github.com/prometheus-operator/kube-prometheus is currently not updating anymore due to this issue |
Yes I'll take a look at this today. |
Previously customizing kube-prometheus [1] failed with the following error. ❯ ./build.sh example.jsonnet + set -o pipefail + rm -rf manifests + mkdir -p manifests/setup + jsonnet -J vendor -m manifests example.jsonnet + xargs '-I{}' sh -c 'cat {} | gojsontoyaml > {}.yaml' -- '{}' RUNTIME ERROR: vendor/github.com/kubernetes/kube-state-metrics/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet:392:21-22 Expected token OPERATOR but got "{" vendor/kube-prometheus/components/kube-state-metrics.libsonnet:51:19-124 function <anonymous> vendor/kube-prometheus/main.libsonnet:136:21-64 object <anonymous> vendor/kube-prometheus/platforms/platforms.libsonnet:37:22-40 +: example.jsonnet:33:90-109 thunk from <$> <std>:1539:24-25 thunk from <function <anonymous>> <std>:1539:5-33 function <anonymous> example.jsonnet:33:73-110 $ example.jsonnet:33:1-112 example.jsonnet:33:1-112 During evaluation With this patch, the build succeeds: ❯ bash build.sh example.jsonnet ; echo $? + set -o pipefail + rm -rf manifests + mkdir -p manifests/setup + jsonnet -J vendor -m manifests example.jsonnet + xargs '-I{}' sh -c 'cat {} | gojsontoyaml > {}.yaml' -- '{}' + find manifests -type f '!' -name '*.yaml' -delete + rm -f kustomization 0 [1]: https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizing.md
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CatherineF-dev, jeffmccune, mrueg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I didn't know |
Me either, but I think we're good, it pulled in 3aebcf7 which should pass anyway. |
This looks like a race condition happened. I'll follow up. |
Previously customizing kube-prometheus 1 failed with the following
error.
With this patch, the build succeeds:
What this PR does / why we need it:
Quick follow up fix to syntax errors introduced in #2388 affecting kube-prometheus customization.
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
Does not change.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Unknown, see #2388