Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Fix offloading nodes (#132)
Browse files Browse the repository at this point in the history
* Use a connected node for offloading

Signed-off-by: Matthieu Calteau <[email protected]>

* bump version

Signed-off-by: Matthieu Calteau <[email protected]>

* sort nodes to get first connected node in statefulset

Co-authored-by: Matthieu Calteau <[email protected]>
Co-authored-by: Sebastien Dupont <[email protected]>
  • Loading branch information
3 people authored Jun 21, 2021
1 parent 3b9d96d commit 5823d57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v2
name: nifi
version: 0.7.6
version: 0.7.7
appVersion: 1.12.1
description: Apache NiFi is a software project from the Apache Software Foundation designed to automate the flow of data between software systems.
keywords:
Expand Down
9 changes: 9 additions & 0 deletions templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,15 @@ spec:
echo "disconnecting node ${nnid}"
${NIFI_TOOLKIT_HOME}/bin/cli.sh nifi disconnect-node -nnid $nnid -u ${baseUrl} ${secureArgs}
echo ""
echo "get a connected node"
connectedNode=$(jq -r 'first(.cluster.nodes|=sort_by(.address)| .cluster.nodes[] | select(.status=="CONNECTED")) | .address' nodes.json)
{{- if .Values.properties.clusterSecure }}
baseUrl=https://${connectedNode}:{{ .Values.properties.httpsPort }}
{{- else }}
baseUrl=http://${connectedNode}:{{ .Values.properties.httpPort }}
{{- end }}
echo baseUrl ${baseUrl}
echo ""
echo "wait until node has state 'DISCONNECTED'"
while [[ "${node_state}" != "DISCONNECTED" ]]; do
sleep 1
Expand Down

0 comments on commit 5823d57

Please sign in to comment.