Skip to content

Commit

Permalink
added json coverage for scheduler (#2335)
Browse files Browse the repository at this point in the history
* added coverage for scheduler

* passed the variable to scheduler config

* changes implemeneted

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>

* added cluster_log_format

* minor fix

* minor fix remove $

* minor fix define cluster_log_format

* minor fix

* json coverage for scheduler

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>
  • Loading branch information
rahulii and serathius committed Jul 20, 2021
1 parent 754da24 commit 3be51cf
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions hack/ci/e2e-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ create_cluster() {
# Default Log level for all components in test clusters
KIND_CLUSTER_LOG_LEVEL=${KIND_CLUSTER_LOG_LEVEL:-4}

CLUSTER_LOG_FORMAT=${CLUSTER_LOG_FORMAT:-}
# potentially enable --logging-format
kubelet_extra_args=" \"v\": \"${KIND_CLUSTER_LOG_LEVEL}\""
if [ -n "${KUBELET_LOG_FORMAT:-}" ]; then
if [ -n "${KUBELET_LOG_FORMAT:-$CLUSTER_LOG_FORMAT}" ]; then
case "${KUBE_VERSION}" in
v1.1[0-8].*)
echo "KUBELET_LOG_FORMAT is only supported on versions >= v1.19, got ${KUBE_VERSION}"
Expand All @@ -86,6 +87,21 @@ create_cluster() {
esac
fi

scheduler_extra_args=" \"v\": \"${KIND_CLUSTER_LOG_LEVEL}\""
if [ -n "${SCHEDULER_LOG_FORMAT:-$CLUSTER_LOG_FORMAT}" ]; then
case "${KUBE_VERSION}" in
v1.1[0-8].*)
echo "SCHEDULER_LOG_FORMAT is only supported on versions >= v1.19, got ${KUBE_VERSION}"
exit 1
;;
*)
# NOTE: the indendation on the next line is meaningful!
scheduler_extra_args="${scheduler_extra_args}
\"logging-format\": \"${SCHEDULER_LOG_FORMAT}\""
;;
esac
fi

# JSON map injected into featureGates config
feature_gates="{}"
# --runtime-config argument value passed to the API server
Expand Down Expand Up @@ -147,7 +163,7 @@ kubeadmConfigPatches:
"v": "${KIND_CLUSTER_LOG_LEVEL}"
scheduler:
extraArgs:
"v": "${KIND_CLUSTER_LOG_LEVEL}"
${scheduler_extra_args}
---
kind: InitConfiguration
nodeRegistration:
Expand Down

0 comments on commit 3be51cf

Please sign in to comment.