Skip to content

Commit

Permalink
Merge pull request #2467 from CatherineF-dev/patch-12
Browse files Browse the repository at this point in the history
fix: e2e test failure
  • Loading branch information
k8s-ci-robot authored Aug 5, 2024
2 parents 312b298 + b43702e commit b1c2e0c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ kind: Service
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:
clusterIP: None
Expand All @@ -17,4 +17,4 @@ spec:
port: 8081
targetPort: telemetry
selector:
app.kubernetes.io/name: kube-state-metrics-no-node-pods
app.kubernetes.io/name: kube-state-metrics-unscheduled-pods-fetching
2 changes: 1 addition & 1 deletion jsonnet/kube-state-metrics/kube-state-metrics.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
'--track-unscheduled-pods',
],
};
local shardksmname = ksm.name + '-no-node-pods';
local shardksmname = ksm.name + '-unscheduled-pods-fetching';
std.mergePatch(
ksm.service,
{
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ function kube_pod_up() {
function test_daemonset() {
sed -i "s|${KUBE_STATE_METRICS_CURRENT_IMAGE_NAME}:v.*|${KUBE_STATE_METRICS_IMAGE_NAME}:${KUBE_STATE_METRICS_IMAGE_TAG}|g" ./examples/daemonsetsharding/deployment.yaml
sed -i "s|${KUBE_STATE_METRICS_CURRENT_IMAGE_NAME}:v.*|${KUBE_STATE_METRICS_IMAGE_NAME}:${KUBE_STATE_METRICS_IMAGE_TAG}|g" ./examples/daemonsetsharding/daemonset.yaml
sed -i "s|${KUBE_STATE_METRICS_CURRENT_IMAGE_NAME}:v.*|${KUBE_STATE_METRICS_IMAGE_NAME}:${KUBE_STATE_METRICS_IMAGE_TAG}|g" ./examples/daemonsetsharding/deployment-no-node-pods.yaml
sed -i "s|${KUBE_STATE_METRICS_CURRENT_IMAGE_NAME}:v.*|${KUBE_STATE_METRICS_IMAGE_NAME}:${KUBE_STATE_METRICS_IMAGE_TAG}|g" ./examples/daemonsetsharding/deployment-unscheduled-pods-fetching.yaml

kubectl get deployment -n kube-system
kubectl create -f ./examples/daemonsetsharding
kube_state_metrics_up kube-state-metrics-no-node-pods
kube_state_metrics_up kube-state-metrics-unscheduled-pods-fetching
kube_state_metrics_up kube-state-metrics
kube_state_metrics_up kube-state-metrics-shard
kubectl apply -f ./tests/e2e/testdata/pods.yaml
Expand All @@ -147,11 +147,11 @@ function test_daemonset() {
exit 1
fi

kubectl logs deployment/kube-state-metrics-no-node-pods -n kube-system
kubectl logs deployment/kube-state-metrics-unscheduled-pods-fetching -n kube-system
sleep 2
kubectl get pods -A --field-selector spec.nodeName=""
sleep 2
pendingpod2="$(curl -s "http://localhost:8001/api/v1/namespaces/kube-system/services/kube-state-metrics-no-node-pods:http-metrics/proxy/metrics" | grep "pendingpod2" | grep -c "kube_pod_info" )"
pendingpod2="$(curl -s "http://localhost:8001/api/v1/namespaces/kube-system/services/kube-state-metrics-unscheduled-pods-fetching:http-metrics/proxy/metrics" | grep "pendingpod2" | grep -c "kube_pod_info" )"
if [ "${pendingpod2}" != "${expected_num_pod}" ]; then
echo "metric kube_pod_info for pendingpod2 doesn't show up only once, got ${runningpod1} times"
exit 1
Expand Down

0 comments on commit b1c2e0c

Please sign in to comment.