Find would replace placeholders before splitting input, meaning files with spaces would be executed as separate args.
Split before replacing args, and use shell-style parsing.
Technically, this requires quotes in input to be escaped, so to specify `--exec='echo {""}'` you must escape them like this: `--exec='echo {\"\"}'`. Quoted inputs aren't documented, but it is a change.
Errors would not be displayed, like `./mc find play/test123/ --exec='unknown {}'` would just exit. Instead it now prints `exec: "unknown": executable file not found in $PATH`.
Fixes#3906
mc diff/mirror command fails to compare source & target when doing
an S3 site-wide listing.
The reason is that client-s3.List(), when doing a site-wide listing,
lists buckets first and list objects inside each bucket with the order
returned by S3 ListBuckets API.
However this can produce a non properly sorted listing output,
e.g.:
```
$ mc ls -r myminio/
[2021-12-14 15:58:27 CET] 227KiB bucketname/object1
[2021-12-14 15:58:24 CET] 227KiB bucketname-0/object2
```
Though it should be
```
$ mc ls -r myminio/
[2021-12-14 15:58:24 CET] 227KiB bucketname-0/object2
[2021-12-14 15:58:27 CET] 227KiB bucketname/object1
```
because '/' has a higher ASCII value than '-'
This commit fixes the behavior by always sorting bucket names with
a fake trailing slash when doing a site-wide recursive listing.
it is potentially harmful when retrying
a lot of buckets where in this might
trigger a retry - continous Listing()
however this retry is not needed as the
callers restart as needed when --watch
or --active-active are used.
`mc du play` would count objects twice since it was doing a recursive listing AND travering into folders.
Compare total to `mc du play --depth=2` and `mc du play --recursive`.
mc admin heal was showing additional unnecessary entries
of nodes with empty disks listing when that node does not
belong to the current pool number. A node only belongs to
one pool, so remove the extra entries.
The earlier approach of using a license token for communicating with
SUBNET is being replaced with a simpler mechanism of API keys. Unlike
the license which is a JWT token, these API keys will be simple UUID
tokens, and don't have any embedded information in them. SUBNET would
generate the API key on cluster registration, and return in the API
response. mc then stores it in the `subnet api_key` config of minio,
to be used for subsequent communication with SUBNET.
In case the api_key is not available in the config, but the cluster's
license is available, it will be used as auth in the subnet API call,
and api_key will be set after the call succeeds. This will help in
smooth migration from older versions of MinIO.
Sometimes, with slow machines, speedtest will not able to accomplish
any PUT/GET operations though no errors is met. In that case, this
commit will show an adequate error message asking the user to increase
the --duration flag.
It contains a new field `TLSInfoAvailable` which will get added under
the `tls` node in health report, helping `health-analyzer` perform the
TLS related checks more reliably.
The writer needs to be closed before creating the request. Otherwise the
call to subnet api fails with error like:
HTTP/1.x transport connection broken: http: ContentLength=6235 with Body length 6303.
Windows users often click on the binary without
knowing `mc` is a command-line tool and should be
run from a terminal. Throw a message to guide them
on what to do.
- reach subnet, upon failure provide `--airgap` command line
to allow them to upload report manually.
- use a proper httpClient when reaching out to subnet
with a 10sec timeout, and also support custom proxies
with self signed certs.
- also fix some error messages and cleanup help with correct
wording and grammar.
When a dynamic config is reset, the minio api response has `true` as
value of the header `x-minio-config-applied`. In such cases, mc should
not show the message asking the user to restart `minio`.