atkrad / wait4x Goto Github PK
View Code? Open in Web Editor NEWWait4X allows you to wait for a port or a service to enter the requested state.
Home Page: https://wait4x.dev
License: Apache License 2.0
Wait4X allows you to wait for a port or a service to enter the requested state.
Home Page: https://wait4x.dev
License: Apache License 2.0
What do you think about adding multiple addresses support? For example for HTTP it can be something like this:
wait4x http http://srv1:8080,http://srv2:8080
If both http://srv1:8080
and http://srv2:8080
return the expected result, wait4x exits successfully and otherwise it should be failed.
Maybe we can use comma separated string that is mentioned above or split strings like this:
wait4x http http://srv1:8080 http://srv1:8080
It can help us a lot to improve our deployment process.
Hello!
What do you think about supporting head method for http-requests? Now the only GET and POST methods are supported. Sometimes the only thing you want to know is upstream response status code. Upstream page may be hard to GET. With HEAD it will be simpler. Another case is when you only do --expect-header
-check is it enough to send HEAD-request.
For example:
# implicit GET http-request:
wait4x http https://ifconfig.co --expect-header "Authorization=Token 1234ABCD"
# explicit HEAD http-request:
wait4x http https://ifconfig.co --expect-header "Authorization=Token 1234ABCD" --http-method head
# explicit HEAD http-request:
wait4x http https://ifconfig.co --expect-status-code 200 --http-method head
All commands work the same, but explicit --http-method head
argument sends head-request in some cases.
I really like this tool, and use it in Kubernetes initContainers.
But the docker hub images (and release binaries) are only for amd64 architecture.
Would it be possible to provide images for arm architecture, too?
It would allow to use them on RaspberryPi-like devices, and also on Apple M1/M2 CPUs
It would be great if wait4x was able to test a connection to a Kafka cluster (based on a given bootstrap servers string)
A workaround is to test with tcp, but it's far less precise: the kafka cluster can be up and running even if one of the bootstrap servers is down (for example)
Logs of docker images are currently in UTC timezone.
In most docker images, it's possible to choose a different timezone by passing a "TZ" environment variable.
Could it be also supported in wait4x docker image?
From what I read, it might be as simple as adding the "tzdata" package in the Dockerfile (as your docker image is based on Alpine).
See https://jakeroid.com/blog/how-to-set-timezone-in-your-docker-image/
Hi,
It's nice to support proxy on HTTP requests.
Cheers,
Mort
➜ dockerProjects docker exec -it 265f808d5b08 sh
/ # apk add wait4x
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/1) Installing wait4x (0.4.0-r7)
Executing busybox-1.35.0-r15.trigger
OK: 33 MiB in 43 packages
/ # wait4x version
Version: v0.4.0
Go version: go1.18.4
Git commit: 9fcfdc13
Built: 2020-12-21T19:05:13Z
OS/Arch: linux/amd64
/ # wait4x http http://www.baidu.com http://www.qq.com -- echo "The api is up! Let's use it"
INFO[0000] Checking HTTP connection ...
/ # wait4x http http://www.baidu.com http://www.qq.com -- echo "The api is up! Let's use it"
INFO[0000] Checking HTTP connection ...
/ # wait4x http http://www.baidu.com http://www.qq.com -- echo "The api is up! Let's use it"
INFO[0000] Checking HTTP connection ...
/ # wait4x http http://www.baidu.com http://www.qq.com -- echo "The api is up! Let's use it"
INFO[0000] Checking HTTP connection ...
/ # exit
➜ dockerProjects
This is a request to add asdf
as a method for installing. Here's a bunch of other plugins that you can look at: https://github.com/asdf-community. Making a plugin is pretty simple.
well if its getting Kafka support then can we have the NATS too :)
If one wants to use Wait4X on Windows or with Windows Containers the current output of the github pipeline cannot be used directly and must be renamed to wait4x.exe
to become available in both Powershell and CMD.
Is it possible to change the pipeline output to reflect this requirement already?
PS. If needed I can adjust the stuff myself, just wanted to start a discussion about it first.
It would great if we can use context instead of pure timeout in checkers but it also needs support from raw connectors.
It would be nice to be able to specify the http request as a POST request with some body.
Something like --with-body '{"foo":"bar"}'
could change the verb to POST and behave like the curl -d
flag.
This is a feature request to include go install
instructions
The --timeout
command-line parameter allows to set a timeout (10s by default).
But I have some cases where I'd like to wait for ever.
Maybe a value of zero could be considered as "for ever"? (It's not the case currently).
Or any other suitable command-line parameter to do that?
The application does not log errors (e.g. incorrect sql password or unreachable host) correctly.
With -l debug
the errors are readable, however they should be logged using the error
level imo.
Example:
2022-11-14T15:15:39+01:00 INF [PostgreSQL] Checking the [...]:5432 ...
2022-11-14T15:15:39+01:00 DBG pq: Passwort-Authentifizierung für Benutzer postgres fehlgeschlagen
2022-11-14T15:15:40+01:00 INF [PostgreSQL] Checking the [...]:5432 ...
2022-11-14T15:15:40+01:00 DBG pq: Passwort-Authentifizierung für Benutzer postgres fehlgeschlagen
2022-11-14T15:15:41+01:00 INF [PostgreSQL] Checking the [...]:5432 ...
2022-11-14T15:15:41+01:00 DBG pq: Passwort-Authentifizierung für Benutzer postgres fehlgeschlagen
Hi, i am using wait4x in the pipeline using the HTTP provider in order to compare a specific body JSON key with a specific value. AFAIK, also looking at the gjson doc, this seems not possible.
For example a body with
{"version": 1234}
cannot be done afaik with --expect-body-json with something like:
wait4x http https://ifconfig.co/json --expect-body-json "version==1234" or something similar.
Is it possible to disable logging?
Would be nice to have a --quiet
or --slient
flag.
It's the case at least with MySQL and PostgreSQL
When wait4x fails to connect (for example because the DNS name does not yet exist under k8s), it outputs something like:
2023-05-05T23:17:16+02:00 ERR Expectation failed error="failed to establish a connection to the mysql server, caused by: dial tcp: lookup mymariadb on 10.43.0.10:53: no such host" dsn=username:password@tcp(mymariadb:3306)/mydatabase
or
2023-05-06T09:57:46+02:00 ERR Expectation failed error="failed to establish a connection to the postgresql server, caused by: dial tcp 10.43.75.241:5432: connect: connection refused" dsn=postgres://username:password@mypostgres:5432/mydatabase?sslmode=disable
which reveals the password
Ideally, the password would be replaced by stars, or any other means.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.