Giter VIP home page Giter VIP logo

wait4x's Issues

Multiple Address Support Request

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.

HEAD http method support

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.

Please provide arm images, too

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

Kafka support

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)

Alpine Linux version don't support Command Execution

➜  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

NATS Support

well if its getting Kafka support then can we have the NATS too :)

Adjust pipeline to output .exe for Windows instead of file without extension

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.

Support Context in Checkers

It would great if we can use context instead of pure timeout in checkers but it also needs support from raw connectors.

Support POSTing data in http

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.

Wait indefinitely

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?

Incorrect log level for errors when checking resources

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

--expect-body-json comparison with value

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.

Disable logging

Is it possible to disable logging?

Would be nice to have a --quiet or --slient flag.

Do not reveal passwords in logs

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.