konpyutaika / nifikop

The NiFiKop NiFi Kubernetes operator makes it easy to run Apache NiFi on Kubernetes. Apache NiFI is a free, open-source solution that support powerful and scalable directed graphs of data routing, transformation, and system mediation logic.
https://konpyutaika.github.io/nifikop/
Apache License 2.0
131 stars 45 forks source link

update pod command curl to strip ellipsis if it exists #378

Closed mh013370 closed 8 months ago

mh013370 commented 8 months ago
Q A
Bug fix? yes
New feature? no
API breaks? no
Deprecations? no
License Apache 2.0

What's in this PR?

After upgrading to nifikop v1.7.0, the following was observed during pod startup for a headless NifiCluster:

Waiting for host to be reachable
failed to reach nifi-1-node.nifi-headless.nifi.svc.cluster.local:8443
Found: 1.2.3.4..., expecting: 1.2.3.4

I am running a custom NiFi image, so i believe this could be due to the curl version in the OS. I found that it was v7.29.0.

I ran the following tests to ensure this will handle both of the following cases:

user $ echo "Trying 1.2.3.4..." | awk '{gsub(/\.\.\./, ""); print $2}'
1.2.3.4
user $ echo "Trying 1.2.3.4" | awk '{gsub(/\.\.\./, ""); print $2}'
1.2.3.4

Checklist

mh013370 commented 8 months ago

It looks like curl always outputs the ellipsis now (and has for a while): https://github.com/curl/curl/blob/cb343182b7181c6df57e7bb711e418ae447fd443/lib/cf-socket.c#L1003

So this change would handle most, if not all, versions of curl used in the NiFi image used.