You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is problematic when you run etcdctl with cron and you want to receive a mail from the cronjob only when an error occured.
I agree with you on the stderr aspect. If you're interested in some workaround to make the admin live easier, etcdutl snapshot status <file of previously taken snapshot> adheres to that better.
#17510 solves the redirection issue for this specific command. However, after reviewing that PR, IMO solving this on a per-command basis doesn't sound clever. Do we want to redirect <= info level logs to stdout and > info level logs to stderr for all of etcdctl commands?
Now, #17510 is aiming to address the issue for all of the etcdctl commands. I suggest reaching a conclusion on what we want to do here before we move forward with the PR.
Bug report criteria
What happened?
I run
etcdctl --endpoints=https://[127.0.0.1]:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key snapshot save /var/lib/etcd/backups/etcd-$(date +"%Y-%m-%d").db >/dev/null
I get this:
What did you expect to happen?
I was expecting no output
How can we reproduce it (as minimally and precisely as possible)?
run
etcdctl --endpoints=https://[127.0.0.1]:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key snapshot save /var/lib/etcd/backups/etcd-$(date +"%Y-%m-%d").db >/dev/null
Anything else we need to know?
This is problematic because in order to have a quiet run I need to run:
etcdctl --endpoints=https://[127.0.0.1]:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key snapshot save /var/lib/etcd/backups/etcd-$(date +"%Y-%m-%d").db >/dev/null 2>&1
which will suppress error messages too.
I believe programs should adhere to the following:
Now, etcdctl does the following:
This is problematic when you run etcdctl with cron and you want to receive a mail from the cronjob only when an error occured.
Etcd version (please run commands below)
Etcd configuration (command line flags or environment variables)
paste your configuration here
Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
Relevant log output
No response
The text was updated successfully, but these errors were encountered: