There was a validation that said `--json` is supported only when
`--airgap` is also passed for SUBNET related `mc support` commands.
Remove this validation to allow `--json` to be passed even in online
mode. In this scenario, print a status JSON after upload to SUBNET.
In some very rare cases the license can contain a nil uuid
(00000000-0000-0000-0000-000000000000). Do not validate it against the
cluster's deployment id during registration.
If passed,
- validate and save it immediately in the subnet config
- extract API key from it and use it for online registration with SUBNET
(if `--airgap` is not passed)
- in case online registration with SUBNET fails for any reason, fallback
to airgap mode (show URL to be visited on SUBNET)
SUBNET is being enhanced to generate account-level licenses instead of
deployment-level. So newer licenses may not contain the deployment id.
So validate the deployment id against the cluster only if present in the
license.
- When the cluster is registered but either license or api-key
are available in the config, and when `--airgap` is not passed
to the command, try to automatically fetch and store the other
both.
- Add `--api-key` flag to `mc support diag`
- Use header-based auth with subnet
- Introduce a common function to initialize/check connectivity with subnet
- Make the health report upload function generic so that it can be used
by other commands like profile in future
- Add a global variable for airgapped mode
- Add more examples to `mc license register`
When the account api key is passed to `mc license register` via the
`--api-key` flag and after the registration is successful, save it to
minio config, so that it can be used automatically in subsequent calls.
Also stop extracting and storing api key from the response of SUBNET
register api.
Instead of asking the user to
- open the subnet register page
- paste the registered token
- copy the generated license token
- paste it back on mc
Now we will simply ask the user to visit a subnet URL (which contains
the registration token as a query parameter). On visiting this page,
subnet will automatically register the cluster and generate a license
for it.
User can then optionally update the license on mc using
the `mc license update` command
Currently we only extract the `api_key` from SUBNET's registration api
response and store it in the minio subnet config. The response contains
license also, and it can be useful in getting information about the
subscription. So this PR enhances the register command to extract and
store the license also.
- Remove the get/set options under `callhome`
- Move logs settings to a separate command (`mc support logs`)
- Provide toggle options (`enable, disable, status`) for both the
commands
In case of logs (`mc support logs enable|disable|status`),
`enable` configures minio to push logs to SUBNET in real-time by
configuring the webhook `logger_webhook:subnet`
`disable` disables the webhook
`status` displays whether it is enabled or disabled
In the case of call home (`mc support callhome enable|disable|status`),
`enable` configures minio to automatically push callhome info to SUBNET
every 24hrs by setting the config `callhome enable=on`
`disable` disables callhome by setting `enable=off`
`status` displays whether it is enabled or disabled
Change the success message on cluster registration to `{alias}
registered successfully`.
When the `mc support register` command is run for an already registered
cluster, show the message `{alias} updated successfully` to indicate
that updated information about the cluster was sent to SUBNET.
When there is no SUBNET webhook configured in the cluster (which is the
default state), the `mc support callhome get` command fails as it tries
to fetch the `logger_webhook:subnet` setting which doesn't exist.
Fixed by ignoring the specific error that says the sub-system target
doesn't exist, and printing `logs=off` in such cases.
Earlier the `support diag` command used to work even when the cluster
was not registered with SUBNET. In such cases, it used to pass the value
of `--name` flag as the cluster name to be set on SUBNET.
Now it errors out if the cluster is not registered. i.e. It expects the
cluster to be already registered with SUBNET, which means it already has
a name. Hence the `--name` flag is meaningless.
Removing the code that used this flag, and marking it as hidden and
deprecated.
* Add `mc support callhome get` command
Will print all the callhome settings (currently just `logs=on|off`)
* Rename retrieveCallhomeSetting to printCallhomeSetting
As it doesn't need to return anything, and only prints the setting.
minio now supports storing the proxy to be used for connecting to subnet
in the `subnet proxy` config. So mc can use it if available when
communicating with subnet during cluster registration or diagnostics
upload.