62 Commits
Author SHA1 Message Date
Klaus Post ed0b962588 Modernize + Go version bump + Pin linter (#5256)
* Upgrade go version in CI.
* Add toolchain to pin version.
* Add linter/fumpt as pinned version in tools.
* Run `go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...`
2025-11-05 04:20:36 -08:00
Shireesh Anjal 1e412f58a5 Remove logs feature from 'mc support callhome' (#5157)
Both the flags --logs and --diag are removed, and the command supports
only diagnostics callhome.
2025-03-06 08:30:58 -08:00
Aditya Manthramurthy d4b7b00d73 Bump up minio/pkg to v3 (#4940) 2024-05-23 00:59:47 -07:00
Shireesh Anjal 206d017878 Expose health diagnostics related functions (#4885)
So that dependent projects (e.g. console) can make use of them instead
of duplicating the logic.
2024-03-30 08:28:09 -07:00
Shireesh Anjal 9043bbf545 Expose getClusterRegInfo (#4881)
so that it can be used by other projects (e.g. console) instead of
duplicating the logic.
2024-03-20 14:07:29 -07:00
Harshavardhana 53f59667f6 support node being part of multiple pools pick the actual number (#4870) 2024-03-13 12:22:53 -07:00
Shireesh Anjal daf5b18e18 Add command for uploading file to SUBNET issue (#4854)
mc support upload --issue <issueNum> --comment <msg> <alias> </path/to/file>

Will upload the given file to the given SUBNET issue
2024-03-06 16:29:26 -08:00
Shireesh Anjal 66daa906eb mc support commands: allow --json in online mode (#4859)
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.
2024-03-02 11:55:14 -08:00
Shireesh Anjal 744dc910d8 Do not validate deployment id from license if nil uuid (#4856)
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.
2024-02-23 16:44:28 -08:00
Shireesh Anjal fb5dd2588c Accept --license flag in mc license register (#4795)
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)
2023-12-20 00:45:13 -08:00
Shireesh Anjal 28f44cb9a0 Read new key license_v2 from SUBNET response (#4788)
SUBNET now has a v2 license that is returned in the new key
`license_v2`. mc will start reading and storing the same.
2023-12-13 20:46:56 -08:00
Anis Eleuch 1facc1eef5 support: --debug flag will print http requests for easier debugging (#4776) 2023-12-13 15:31:01 -08:00
Shireesh Anjal bb65ba8874 Use subnet package in pkg for license validation (#4784)
Most of the code related to license validation is now available in
`minio/pkg`. So remove it from mc and use the function(s) from `pkg`.
2023-12-11 09:06:09 -08:00
Shireesh Anjal 937b34616f Do not fail if deployment id not found in license (#4767)
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.
2023-11-20 08:30:59 -08:00
Aditya Manthramurthy e2056fb057 Update to minio/pkg v2 (#4674) 2023-09-02 14:28:03 -07:00
Harshavardhana 1fbd97aa04 run gofumpt -extra on all source files (#4634) 2023-07-17 13:10:20 -07:00
Shireesh Anjal e8f049cbb1 Ensure --airgap is available on all support commands (#4633)
- remove deprecated and unused flags from `support diag`
- add missing registration check-in
  - call home status
  - proxy set|show|remove
2023-07-17 09:02:50 -07:00
Aditya Manthramurthy 5f39522e69 Add response details for policy attach/detach cmd (#4602)
For internal IDP.

Also updates madmin-go to v3 as part of this change

- Temporarily disable test_admin_users until minio side fix is merged
2023-06-19 12:31:19 -07:00
Shireesh Anjal 298dbc50ca fix proxy not being used to test connectivity (#4583) 2023-05-28 11:02:33 -07:00
Anis Eleuch aefb1db4db Load Subnet proxy and API key from the env if found (#4557) 2023-05-09 10:11:27 -07:00
Shireesh Anjal af0e241883 Support setting subnet url via env var in dev mode (#4564) 2023-05-07 23:34:22 -07:00
Shubhendu f3ff8b1556 Revert query parameter src while diag upload to SUBNET (#4516) 2023-03-23 12:36:06 -07:00
Harshavardhana 252421354c update functional tests for admin_users with 'policy commands' (#4508) 2023-03-19 20:49:16 -07:00
Shubhendu 045430905a Added query parameter src while diag upload to SUBNET (#4504)
Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
2023-03-18 16:36:36 -07:00
Shubhendu aaed62cdd8 Skip subnet config get while --airgap mode of license register (#4479)
Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
2023-03-08 00:26:24 -08:00
Anis Elleuch 1843bab500 subnet: Avoid general hard timeout for requests (#4478) 2023-02-21 09:32:38 -08:00
Anis Elleuch 40e51ee9af inspect: Avoid memory usage in subnet upload (#4477) 2023-02-21 19:57:51 +05:30
Harshavardhana 54e2edd1be support unix-pipes with bigger buffers for performance (#4472) 2023-02-16 11:20:11 -08:00
Shireesh Anjal 58f9fec703 Support --airgap in unregister command (#4441) 2023-01-18 10:03:24 +05:30
Shireesh Anjal 7c6499b8a8 Renew license online if license file not passed (#4429) 2023-01-09 01:19:23 -08:00
Klaus Post 52a931bfa7 Add staticcheck to CI (#4386) 2022-12-05 08:32:04 -08:00
Aditya Manthramurthy 854b4f123f Bump up madmin-go to v2 (#4382) 2022-12-01 10:41:14 -08:00
adfost fd7142e223 update license headers to 2022 (#4360) 2022-11-14 18:38:39 -08:00
Shireesh Anjal 3cc795610b Add command to unregister a cluster (#4314) 2022-10-20 11:36:25 -07:00
Shireesh Anjal e8afb9b135 Improve help text for support profile|perf (#4311) 2022-10-19 10:32:32 -07:00
Shireesh Anjal 81c04723f9 Print license info table with solid lines (#4301) 2022-10-17 09:44:34 -07:00
Shireesh Anjal e917b9513d error out from support commands if not registered (#4271) 2022-09-28 14:52:11 -07:00
Shireesh Anjal ba5f9ac373 Upload results of perf tests to SUBNET (#4254) 2022-09-27 02:56:43 -07:00
Shireesh Anjal cdb6b179d3 Upload profile zip to SUBNET (#4226)
When the `--airgap` flag is not passed, the generated profile zip will
be uploaded to SUBNET.
2022-09-15 22:18:14 -07:00
Shireesh Anjal 07fffc3bc8 Enhancements in registration and diagnostics (#4200)
- 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`
2022-08-22 22:45:20 -07:00
Aditya Manthramurthy 1529bb83bf Move config parsing logic to madmin (#4212) 2022-08-17 17:07:58 -07:00
Shireesh Anjal edd633ff2f Save api key passed as argument in config (#4157)
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.
2022-07-31 22:44:23 -07:00
Shireesh Anjal 9de421ffd4 New offline registration flow (#4156)
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
2022-07-26 23:21:06 -07:00
Shireesh Anjal 7b20dc2958 Move support register to license register (#4150)
Also, introduce a new command `license info` to print information 
from the license (when the license is available)
2022-07-13 18:25:30 -07:00
Shireesh Anjal 81c4a5ad6e Add --api-key flag to mc support register (#4144) 2022-07-06 07:54:36 -07:00
Shireesh Anjal 78f844a357 Save license at the time of registration (#4123)
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.
2022-06-26 11:35:31 -07:00
Shireesh Anjal 80ae287b02 Add commands to enable/disable callhome and logs (#4107)
- 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
2022-06-15 09:14:52 -07:00
Shireesh Anjal 7a6a43046c Improve success message in support register cmd (#4108)
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.
2022-06-10 15:12:40 -07:00
Shireesh Anjal e9d27aef5c fix: callhome get error when subnet hook not set (#4089)
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.
2022-06-03 10:24:25 -07:00
Shireesh Anjal 907555c849 Deprecate --name flag from support diag (#4092)
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.
2022-05-19 10:35:19 -07:00