There is no suitable mechanism to estimate the ETA of healing when it is
retrying, although in most cases, it is just a listing that should be
quick enough. Hide the ETA anyway for now.
In a new MinIO version, Healing can be set to false while HealInfo is
not nil. This indicates that the drive was healed and the healing is
finished. This commit adapts the code with the new concept. This will
not break with older MinIO versions since those versions will already
remove .healing.bin, in that case Healing will be false, HealInfo will
be nil.
allow users to avoid list() call when an object does not
exist when following flags are used with `mc stat`
```
--no-list (HEAD the latest version)
--version-id <vid>
```
Also avoid superflous url2Stat() calls while processing
the args, there is no real reason to do that.
add global `--resolve HOST[:PORT]:IP` flag
This commit adds support for custom DNS overwrites via one or multiple
`--resolve` flags. It allows `mc` users to define custom DNS mappings
from a HOST (and optional port) to an IP address.
For example:
```
mc --resolve foo.com:9000=10.1.2.3 ls myminio/mybucket
```
The `--resolve` syntax is taken from cURL. Ref. `curl --help dns`
Use cases:
1. DNS overwrites. If there are no DNS resolvers available, e.g.
due to a temp. outage, this allows `mc` to connect to a defined
alias as long as the IP of the one or multiple cluster nodes are
known. It also allows `mc` to overwrite the current DNS responses.
This is useful for various tests in dev and staging environments.
2. TLS certificate verification. Often TLS certificates are issued
for some DNS names (via SAN) but not for IP addresses. IP addresses
are usually not static and might change anytime. Accessing a MinIO
cluster that serves a certificate containing only DNS SANs via an
IP address results in a TLS certificate verification error - even
if the certificate is issued by a trusted CA. The current workaround
is the `--insecure` flag which disables TLS certification completely.
Example for TLS verification:
```
$ mc alias set 'myminio' 'https://192.168.188.118:9000' 'minioadmin' 'minioadmin'
mc: <ERROR> Unable to initialize new alias from the provided credentials.
Get "https://192.168.188.118:9000": tls: failed to verify certificate:
x509: cannot validate certificate for 192.168.188.118 because it doesn't contain any IP SANs.
```
```
mc alias set --resolve foo.com:9000=192.168.188.118 'myminio' 'https://foo.com:9000' 'minioadmin' 'minioadmin'
Added `myminio` successfully.
```
Signed-off-by: Andreas Auernhammer <github@aead.dev>
When upload of the inspect file to SUBNET fails, following wrong message
was getting printed:
`Object inspection data for '' uploaded to SUBNET successfully`
Fixed the if condition to ensure that following correct message is
printed:
`File data successfully downloaded as <filename>`
Make `mc admin trace -stats` more compact, and hopefully more readable.
* Truncates durations more reasonably
* Use `-` for 0 TTFB.
* Use `↑151B ↓12K` instead of `↑ 151 B ↓ 12 KiB/m`
* Reduce FPS from 7 to 3 for less flickering.
Many listings would stop after the first version had been processed on Windows, since
For example, `mytls/testbucket/trace.json` != `mytls\testbucket\trace.json` would cause `mc undo` to only see one version since this would fail.
Use `getStandardizedURL` for both sides of these compares.
Add a flag --api-version with possible values of v2 and v3, with default
being v2.
So when this flag is not passed, the command will work exactly as it did
before.
When using v3, there is a different set of metric types supported. It
also supports a new flag:
bucket: the bucket for which the metrics are to be fetched. it is
applicable only for the metric types that are available at bucket level,
which currently are 'api' and 'replication'
Add a flag --api-version with possible values of v2 and v3, with the default
being v2. So when this flag is not passed, the command will work exactly
as before.
When using v3, a different set of metric types is supported. It
also supports two additional flags:
Bucket: the bucket for which the metrics are to be fetched. it is
applicable only for the metric types that are available at the bucket level,
which currently are 'api' and 'replication'
```
mc admin service restart local -w
Service status: ▰▱▱ [DONE]
Summary:
┌───────────────────────┬─────────────────────────────┐
│ Servers: │ 4 online, 0 offline, 0 hung │
│ Restart Time: │ 3.949842ms │
│ Background Init Time: │ 1.503707801s │
└───────────────────────┴─────────────────────────────┘
```
Existing UI didn't scale well for 100+ nodes, this
UI change is also made to provide clear guidance on
how soon the service is available v/s background
initialization time.
Combine into direct and indirect sections. See https://github.com/golang/go/issues/67948 for why this is a mess.
Enables running `go mod tidy` without blowing up things.