Browse Source

Merge pull request #8656 from jim-minter/broken_sync

allow node config sync controller to handle multiple node labels
Jim Minter 6 years ago
parent
commit
f94bd842b0
1 changed files with 2 additions and 3 deletions
  1. 2 3
      roles/openshift_node_group/files/sync.yaml

+ 2 - 3
roles/openshift_node_group/files/sync.yaml

@@ -117,9 +117,8 @@ spec:
               # TODO: kubelet doesn't relabel nodes, best effort for now
               # https://github.com/kubernetes/kubernetes/issues/59314
               if args="$(openshift start node --write-flags --config /etc/origin/node/node-config.yaml)"; then
-                labels=' --node-labels=([^ ]+) '
-                if [[ ${args} =~ ${labels} ]]; then
-                  labels="${BASH_REMATCH[1]//,/ }"
+                labels=$(tr ' ' '\n' <<<$args | sed -ne '/^--node-labels=/ { s/^--node-labels=//; p; }' | tr ',\n' ' ')
+                if [[ -n "${labels}" ]]; then
                   echo "info: Applying node labels $labels" 2>&1
                   if ! oc label --config=/etc/origin/node/node.kubeconfig "node/${NODE_NAME}" ${labels} --overwrite; then
                     echo "error: Unable to apply labels, will retry in 10" 2>&1