Skip to content

Commit

Permalink
add checks for the value of NODE_NODE_ENVVAR_NAME_IP
Browse files Browse the repository at this point in the history
  • Loading branch information
alaypatel07 committed Apr 6, 2020
1 parent 38602d9 commit f8e8a8c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bindata/etcd/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ spec:
: "${NODE_NODE_ENVVAR_NAME_ETCD_NAME?not set}"
: "${NODE_NODE_ENVVAR_NAME_IP?not set}"
if [ "${NODE_NODE_ENVVAR_NAME_IP}" != "${POD_IP}" ]; then
# echo the error message to stderr
>&2 echo "Expected node IP to be ${NODE_IP} got ${NODE_NODE_ENVVAR_NAME_IP}";
exit 1;
fi
if [ "${NODE_NODE_ENVVAR_NAME_ETCD_URL_HOST}" != "${NODE_NAME}" ]; then
# echo the error message to stderr
>&2 echo "Expected etcd url host to be ${NODE_NAME} got ${NODE_NODE_ENVVAR_NAME_ETCD_URL_HOST}";
exit 1;
fi
if [ "${NODE_NODE_ENVVAR_NAME_ETCD_NAME}" != "${NODE_NAME}" ]; then
# echo the error message to stderr
>&2 echo "Expected etcd node name to be ${NODE_NAME} got ${NODE_NODE_ENVVAR_NAME_ETCD_NAME}";
exit 1;
fi
resources:
requests:
memory: 60Mi
Expand All @@ -33,6 +51,14 @@ spec:
privileged: true
env:
${COMPUTED_ENV_VARS}
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: etcd-resources-copy
image: ${IMAGE}
imagePullPolicy: IfNotPresent
Expand Down
26 changes: 26 additions & 0 deletions pkg/operator/etcd_assets/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f8e8a8c

Please sign in to comment.