Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package minio-client for openSUSE:Factory checked in at 2023-01-14 00:02:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/minio-client (Old) and /work/SRC/openSUSE:Factory/.minio-client.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "minio-client" Sat Jan 14 00:02:46 2023 rev:25 rq:1058119 version:20230111T031416Z Changes: -------- --- /work/SRC/openSUSE:Factory/minio-client/minio-client.changes 2023-01-04 20:18:21.661546307 +0100 +++ /work/SRC/openSUSE:Factory/.minio-client.new.32243/minio-client.changes 2023-01-14 00:03:26.553789472 +0100 @@ -1,0 +2,13 @@ +Fri Jan 13 06:10:14 UTC 2023 - ka...@b1-systems.de + +- Update to version 20230111T031416Z: + * Add confirm flag to `mc admin update --yes` (#4439) + * Renew license online if license file not passed (#4429) + * Rename admin replicate subcommands (#4383) + * support concurrent uploads for 'mc pipe' (#4435) + * rb: avoid throwing error for force delete of prefix (#4436) + * Upload inspect data to SUBNET (#4420) + * trace: Add bootstrap tracing type (#4416) + * Allow mirror to continue syncing after an object fails to sync (#4427) + +------------------------------------------------------------------- Old: ---- mc-20221224T152138Z.tar.gz New: ---- mc-20230111T031416Z.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ minio-client.spec ++++++ --- /var/tmp/diff_new_pack.A7AMNC/_old 2023-01-14 00:03:28.053798210 +0100 +++ /var/tmp/diff_new_pack.A7AMNC/_new 2023-01-14 00:03:28.061798256 +0100 @@ -22,7 +22,7 @@ %define binary_name minio-client Name: minio-client -Version: 20221224T152138Z +Version: 20230111T031416Z Release: 0 Summary: Client for MinIO License: AGPL-3.0-only ++++++ _service ++++++ --- /var/tmp/diff_new_pack.A7AMNC/_old 2023-01-14 00:03:28.101798489 +0100 +++ /var/tmp/diff_new_pack.A7AMNC/_new 2023-01-14 00:03:28.101798489 +0100 @@ -5,7 +5,7 @@ <param name="exclude">.git</param> <param name="changesgenerate">enable</param> <param name="versionformat">@PARENT_TAG@</param> - <param name="revision">RELEASE.2022-12-24T15-21-38Z</param> + <param name="revision">RELEASE.2023-01-11T03-14-16Z</param> <param name="match-tag">RELEASE.*</param> <param name="versionrewrite-pattern">RELEASE\.(.*)-(.*)-(.*)-(.*)-(.*)</param> <param name="versionrewrite-replacement">\1\2\3\4\5</param> @@ -21,7 +21,7 @@ <param name="compression">gz</param> </service> <service name="go_modules" mode="disabled"> - <param name="archive">mc-20221224T152138Z.tar.gz</param> + <param name="archive">mc-20230111T031416Z.tar.gz</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.A7AMNC/_old 2023-01-14 00:03:28.125798629 +0100 +++ /var/tmp/diff_new_pack.A7AMNC/_new 2023-01-14 00:03:28.129798652 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/minio/mc</param> - <param name="changesrevision">176072dee43de613569aaa56061eba9d6d550290</param></service></servicedata> + <param name="changesrevision">14c2e506fa78b53fb6db88bcf87d8f6d3fb6989e</param></service></servicedata> (No newline at EOF) ++++++ mc-20221224T152138Z.tar.gz -> mc-20230111T031416Z.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/.gitignore new/mc-20230111T031416Z/.gitignore --- old/mc-20221224T152138Z/.gitignore 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/.gitignore 2023-01-11 04:14:16.000000000 +0100 @@ -11,4 +11,5 @@ mc .run* .idea/ -mc.RELEASE* \ No newline at end of file +mc.RELEASE* +mc.gz \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/admin-replicate-edit.go new/mc-20230111T031416Z/cmd/admin-replicate-edit.go --- old/mc-20221224T152138Z/cmd/admin-replicate-edit.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/admin-replicate-edit.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,128 +0,0 @@ -// Copyright (c) 2015-2022 MinIO, Inc. -// -// This file is part of MinIO Object Storage stack -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cmd - -import ( - "net/url" - "strings" - - "github.com/fatih/color" - "github.com/minio/cli" - json "github.com/minio/colorjson" - "github.com/minio/madmin-go/v2" - "github.com/minio/mc/pkg/probe" - "github.com/minio/pkg/console" -) - -var adminReplicateEditFlags = []cli.Flag{ - cli.StringFlag{ - Name: "deployment-id", - Usage: "deployment id of the site, should be a unique value", - }, - cli.StringFlag{ - Name: "endpoint", - Usage: "endpoint for the site", - }, -} - -var adminReplicateEditCmd = cli.Command{ - Name: "edit", - Usage: "edit endpoint of site participating in cluster replication", - Action: mainAdminReplicateEdit, - OnUsageError: onUsageError, - Before: setGlobalsFromContext, - Flags: append(globalFlags, adminReplicateEditFlags...), - CustomHelpTemplate: `NAME: - {{.HelpName}} - {{.Usage}} - -USAGE: - {{.HelpName}} ALIAS --deployment-id [DEPLOYMENT-ID] --endpoint [NEW-ENDPOINT] - -FLAGS: - {{range .VisibleFlags}}{{.}} - {{end}} - -EXAMPLES: - 1. Edit a site endpoint participating in cluster-level replication: - {{.Prompt}} {{.HelpName}} myminio --deployment-id c1758167-4426-454f-9aae-5c3dfdf6df64 --endpoint https://minio2:9000 -`, -} - -type editSuccessMessage madmin.ReplicateEditStatus - -func (m editSuccessMessage) JSON() string { - bs, e := json.MarshalIndent(madmin.ReplicateEditStatus(m), "", " ") - fatalIf(probe.NewError(e), "Unable to marshal into JSON.") - return string(bs) -} - -func (m editSuccessMessage) String() string { - v := madmin.ReplicateEditStatus(m) - messages := []string{v.Status} - - if v.ErrDetail != "" { - messages = append(messages, v.ErrDetail) - } - return console.Colorize("UserMessage", strings.Join(messages, "\n")) -} - -func checkAdminReplicateEditSyntax(ctx *cli.Context) { - // Check argument count - argsNr := len(ctx.Args()) - if argsNr < 1 { - showCommandHelpAndExit(ctx, 1) // last argument is exit code - } - if argsNr != 1 { - fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...), - "Invalid arguments specified for edit command.") - } -} - -func mainAdminReplicateEdit(ctx *cli.Context) error { - checkAdminReplicateEditSyntax(ctx) - console.SetColor("UserMessage", color.New(color.FgGreen)) - - // Get the alias parameter from cli - args := ctx.Args() - aliasedURL := args.Get(0) - - // Create a new MinIO Admin Client - client, err := newAdminClient(aliasedURL) - fatalIf(err, "Unable to initialize admin connection.") - - if !ctx.IsSet("deployment-id") { - fatalIf(errInvalidArgument(), "--deployment-id is a required flag") - } - if !ctx.IsSet("endpoint") { - fatalIf(errInvalidArgument(), "--endpoint is a required flag") - } - parsedURL := ctx.String("endpoint") - u, e := url.Parse(parsedURL) - if e != nil { - fatalIf(errInvalidArgument().Trace(parsedURL), "Unsupported URL format %v", e) - } - res, e := client.SiteReplicationEdit(globalContext, madmin.PeerInfo{ - DeploymentID: ctx.String("deployment-id"), - Endpoint: u.String(), - }) - fatalIf(probe.NewError(e).Trace(args...), "Unable to edit cluster replication site endpoint") - - printMsg(editSuccessMessage(res)) - - return nil -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/admin-replicate-remove.go new/mc-20230111T031416Z/cmd/admin-replicate-remove.go --- old/mc-20221224T152138Z/cmd/admin-replicate-remove.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/admin-replicate-remove.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,134 +0,0 @@ -// Copyright (c) 2015-2022 MinIO, Inc. -// -// This file is part of MinIO Object Storage stack -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cmd - -import ( - "fmt" - - "github.com/fatih/color" - "github.com/minio/cli" - json "github.com/minio/colorjson" - "github.com/minio/madmin-go/v2" - "github.com/minio/mc/pkg/probe" - "github.com/minio/pkg/console" -) - -var adminReplicateRemoveFlags = []cli.Flag{ - cli.BoolFlag{ - Name: "all", - Usage: "remove site replication from all participating sites", - }, - cli.BoolFlag{ - Name: "force", - Usage: "force removal of site(s) from site replication configuration", - }, -} - -var adminReplicateRemoveCmd = cli.Command{ - Name: "remove", - Usage: "remove one or more sites from site replication", - Action: mainAdminReplicationRemoveStatus, - OnUsageError: onUsageError, - Before: setGlobalsFromContext, - Flags: append(globalFlags, adminReplicateRemoveFlags...), - CustomHelpTemplate: `NAME: - {{.HelpName}} - {{.Usage}} - -USAGE: - {{.HelpName}} TARGET - -FLAGS: - {{range .VisibleFlags}}{{.}} - {{end}} - -EXAMPLES: - 1. Remove site replication for all sites: - {{.Prompt}} {{.HelpName}} minio2 --all --force - - 2. Remove site replication for site with site names alpha, baker from active cluster minio2: - {{.Prompt}} {{.HelpName}} minio2 alpha baker --force -`, -} - -type srRemoveStatus struct { - madmin.ReplicateRemoveStatus - sites []string - RemoveAll bool -} - -func (i srRemoveStatus) JSON() string { - ds, e := json.MarshalIndent(i.ReplicateRemoveStatus, "", " ") - fatalIf(probe.NewError(e), "Unable to marshal into JSON.") - return string(ds) -} - -func (i srRemoveStatus) String() string { - if i.RemoveAll { - return console.Colorize("UserMessage", "All site(s) were removed successfully") - } - if i.ReplicateRemoveStatus.Status == madmin.ReplicateRemoveStatusSuccess { - return console.Colorize("UserMessage", fmt.Sprintf("Following site(s) %s were removed successfully", i.sites)) - } - if len(i.sites) == 1 { - return console.Colorize("UserMessage", fmt.Sprintf("Following site %s was removed partially, some operations failed:\nERROR: '%s'", i.sites, i.ReplicateRemoveStatus.ErrDetail)) - } - return console.Colorize("UserMessage", fmt.Sprintf("Following site(s) %s were removed partially, some operations failed: \nERROR: '%s'", i.sites, i.ReplicateRemoveStatus.ErrDetail)) -} - -func checkAdminReplicateRemoveSyntax(ctx *cli.Context) { - // Check argument count - argsNr := len(ctx.Args()) - if ctx.IsSet("all") && argsNr > 1 { - fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...), - "") - } - if argsNr < 2 && !ctx.IsSet("all") { - fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...), - "Need at least two arguments to remove command.") - } - if !ctx.IsSet("force") { - fatalIf(errDummy().Trace(), - "Site removal requires --force flag. This operation is *IRREVERSIBLE*. Please review carefully before performing this *DANGEROUS* operation.") - } -} - -func mainAdminReplicationRemoveStatus(ctx *cli.Context) error { - checkAdminReplicateRemoveSyntax(ctx) - console.SetColor("UserMessage", color.New(color.FgGreen)) - - // Get the alias parameter from cli - args := ctx.Args() - aliasedURL := args.Get(0) - var rreq madmin.SRRemoveReq - rreq.SiteNames = append(rreq.SiteNames, args.Tail()...) - rreq.RemoveAll = ctx.Bool("all") - // Create a new MinIO Admin Client - client, err := newAdminClient(aliasedURL) - fatalIf(err, "Unable to initialize admin connection.") - - st, e := client.SiteReplicationRemove(globalContext, rreq) - fatalIf(probe.NewError(e).Trace(args...), "Unable to remove cluster replication") - - printMsg(srRemoveStatus{ - ReplicateRemoveStatus: st, - sites: args.Tail(), - RemoveAll: rreq.RemoveAll, - }) - - return nil -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/admin-replicate-rm.go new/mc-20230111T031416Z/cmd/admin-replicate-rm.go --- old/mc-20221224T152138Z/cmd/admin-replicate-rm.go 1970-01-01 01:00:00.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/admin-replicate-rm.go 2023-01-11 04:14:16.000000000 +0100 @@ -0,0 +1,136 @@ +// Copyright (c) 2015-2022 MinIO, Inc. +// +// This file is part of MinIO Object Storage stack +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +package cmd + +import ( + "fmt" + + "github.com/fatih/color" + "github.com/minio/cli" + json "github.com/minio/colorjson" + "github.com/minio/madmin-go/v2" + "github.com/minio/mc/pkg/probe" + "github.com/minio/pkg/console" +) + +var adminReplicateRemoveFlags = []cli.Flag{ + cli.BoolFlag{ + Name: "all", + Usage: "remove site replication from all participating sites", + }, + cli.BoolFlag{ + Name: "force", + Usage: "force removal of site(s) from site replication configuration", + }, +} + +var adminReplicateRemoveCmd = cli.Command{ + Name: "rm", + Aliases: []string{"remove"}, + Usage: "remove one or more sites from site replication", + Action: mainAdminReplicationRemoveStatus, + OnUsageError: onUsageError, + HiddenAliases: true, + Before: setGlobalsFromContext, + Flags: append(globalFlags, adminReplicateRemoveFlags...), + CustomHelpTemplate: `NAME: + {{.HelpName}} - {{.Usage}} + +USAGE: + {{.HelpName}} TARGET + +FLAGS: + {{range .VisibleFlags}}{{.}} + {{end}} + +EXAMPLES: + 1. Remove site replication for all sites: + {{.Prompt}} {{.HelpName}} minio2 --all --force + + 2. Remove site replication for site with site names alpha, baker from active cluster minio2: + {{.Prompt}} {{.HelpName}} minio2 alpha baker --force +`, +} + +type srRemoveStatus struct { + madmin.ReplicateRemoveStatus + sites []string + RemoveAll bool +} + +func (i srRemoveStatus) JSON() string { + ds, e := json.MarshalIndent(i.ReplicateRemoveStatus, "", " ") + fatalIf(probe.NewError(e), "Unable to marshal into JSON.") + return string(ds) +} + +func (i srRemoveStatus) String() string { + if i.RemoveAll { + return console.Colorize("UserMessage", "All site(s) were removed successfully") + } + if i.ReplicateRemoveStatus.Status == madmin.ReplicateRemoveStatusSuccess { + return console.Colorize("UserMessage", fmt.Sprintf("Following site(s) %s were removed successfully", i.sites)) + } + if len(i.sites) == 1 { + return console.Colorize("UserMessage", fmt.Sprintf("Following site %s was removed partially, some operations failed:\nERROR: '%s'", i.sites, i.ReplicateRemoveStatus.ErrDetail)) + } + return console.Colorize("UserMessage", fmt.Sprintf("Following site(s) %s were removed partially, some operations failed: \nERROR: '%s'", i.sites, i.ReplicateRemoveStatus.ErrDetail)) +} + +func checkAdminReplicateRemoveSyntax(ctx *cli.Context) { + // Check argument count + argsNr := len(ctx.Args()) + if ctx.IsSet("all") && argsNr > 1 { + fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...), + "") + } + if argsNr < 2 && !ctx.IsSet("all") { + fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...), + "Need at least two arguments to remove command.") + } + if !ctx.IsSet("force") { + fatalIf(errDummy().Trace(), + "Site removal requires --force flag. This operation is *IRREVERSIBLE*. Please review carefully before performing this *DANGEROUS* operation.") + } +} + +func mainAdminReplicationRemoveStatus(ctx *cli.Context) error { + checkAdminReplicateRemoveSyntax(ctx) + console.SetColor("UserMessage", color.New(color.FgGreen)) + + // Get the alias parameter from cli + args := ctx.Args() + aliasedURL := args.Get(0) + var rreq madmin.SRRemoveReq + rreq.SiteNames = append(rreq.SiteNames, args.Tail()...) + rreq.RemoveAll = ctx.Bool("all") + // Create a new MinIO Admin Client + client, err := newAdminClient(aliasedURL) + fatalIf(err, "Unable to initialize admin connection.") + + st, e := client.SiteReplicationRemove(globalContext, rreq) + fatalIf(probe.NewError(e).Trace(args...), "Unable to remove cluster replication") + + printMsg(srRemoveStatus{ + ReplicateRemoveStatus: st, + sites: args.Tail(), + RemoveAll: rreq.RemoveAll, + }) + + return nil +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/admin-replicate-update.go new/mc-20230111T031416Z/cmd/admin-replicate-update.go --- old/mc-20221224T152138Z/cmd/admin-replicate-update.go 1970-01-01 01:00:00.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/admin-replicate-update.go 2023-01-11 04:14:16.000000000 +0100 @@ -0,0 +1,130 @@ +// Copyright (c) 2015-2022 MinIO, Inc. +// +// This file is part of MinIO Object Storage stack +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +package cmd + +import ( + "net/url" + "strings" + + "github.com/fatih/color" + "github.com/minio/cli" + json "github.com/minio/colorjson" + "github.com/minio/madmin-go/v2" + "github.com/minio/mc/pkg/probe" + "github.com/minio/pkg/console" +) + +var adminReplicateUpdateFlags = []cli.Flag{ + cli.StringFlag{ + Name: "deployment-id", + Usage: "deployment id of the site, should be a unique value", + }, + cli.StringFlag{ + Name: "endpoint", + Usage: "endpoint for the site", + }, +} + +var adminReplicateUpdateCmd = cli.Command{ + Name: "update", + Aliases: []string{"edit"}, + HiddenAliases: true, + Usage: "modify endpoint of site participating in site replication", + Action: mainAdminReplicateUpdate, + OnUsageError: onUsageError, + Before: setGlobalsFromContext, + Flags: append(globalFlags, adminReplicateUpdateFlags...), + CustomHelpTemplate: `NAME: + {{.HelpName}} - {{.Usage}} + +USAGE: + {{.HelpName}} ALIAS --deployment-id [DEPLOYMENT-ID] --endpoint [NEW-ENDPOINT] + +FLAGS: + {{range .VisibleFlags}}{{.}} + {{end}} + +EXAMPLES: + 1. Edit a site endpoint participating in cluster-level replication: + {{.Prompt}} {{.HelpName}} myminio --deployment-id c1758167-4426-454f-9aae-5c3dfdf6df64 --endpoint https://minio2:9000 +`, +} + +type updateSuccessMessage madmin.ReplicateEditStatus + +func (m updateSuccessMessage) JSON() string { + bs, e := json.MarshalIndent(madmin.ReplicateEditStatus(m), "", " ") + fatalIf(probe.NewError(e), "Unable to marshal into JSON.") + return string(bs) +} + +func (m updateSuccessMessage) String() string { + v := madmin.ReplicateEditStatus(m) + messages := []string{v.Status} + + if v.ErrDetail != "" { + messages = append(messages, v.ErrDetail) + } + return console.Colorize("UserMessage", strings.Join(messages, "\n")) +} + +func checkAdminReplicateUpdateSyntax(ctx *cli.Context) { + // Check argument count + argsNr := len(ctx.Args()) + if argsNr < 1 { + showCommandHelpAndExit(ctx, 1) // last argument is exit code + } + if argsNr != 1 { + fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...), + "Invalid arguments specified for edit command.") + } +} + +func mainAdminReplicateUpdate(ctx *cli.Context) error { + checkAdminReplicateUpdateSyntax(ctx) + console.SetColor("UserMessage", color.New(color.FgGreen)) + + // Get the alias parameter from cli + args := ctx.Args() + aliasedURL := args.Get(0) + + // Create a new MinIO Admin Client + client, err := newAdminClient(aliasedURL) + fatalIf(err, "Unable to initialize admin connection.") + + if !ctx.IsSet("deployment-id") { + fatalIf(errInvalidArgument(), "--deployment-id is a required flag") + } + if !ctx.IsSet("endpoint") { + fatalIf(errInvalidArgument(), "--endpoint is a required flag") + } + parsedURL := ctx.String("endpoint") + u, e := url.Parse(parsedURL) + if e != nil { + fatalIf(errInvalidArgument().Trace(parsedURL), "Unsupported URL format %v", e) + } + res, e := client.SiteReplicationEdit(globalContext, madmin.PeerInfo{ + DeploymentID: ctx.String("deployment-id"), + Endpoint: u.String(), + }) + fatalIf(probe.NewError(e).Trace(args...), "Unable to edit cluster replication site endpoint") + + printMsg(updateSuccessMessage(res)) + + return nil +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/admin-replicate.go new/mc-20230111T031416Z/cmd/admin-replicate.go --- old/mc-20221224T152138Z/cmd/admin-replicate.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/admin-replicate.go 2023-01-11 04:14:16.000000000 +0100 @@ -21,7 +21,7 @@ var adminReplicateSubcommands = []cli.Command{ adminReplicateAddCmd, - adminReplicateEditCmd, + adminReplicateUpdateCmd, adminReplicateRemoveCmd, adminReplicateInfoCmd, adminReplicateStatusCmd, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/admin-trace.go new/mc-20230111T031416Z/cmd/admin-trace.go --- old/mc-20221224T152138Z/cmd/admin-trace.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/admin-trace.go 2023-01-11 04:14:16.000000000 +0100 @@ -98,11 +98,12 @@ // traceCallTypes contains all call types and flags to apply when selected. var traceCallTypes = map[string]func(o *madmin.ServiceTraceOpts) (help string){ - "storage": func(o *madmin.ServiceTraceOpts) string { o.Storage = true; return "Trace Storage calls" }, - "internal": func(o *madmin.ServiceTraceOpts) string { o.Internal = true; return "Trace Internal RPC calls" }, - "s3": func(o *madmin.ServiceTraceOpts) string { o.S3 = true; return "Trace S3 API calls" }, - "os": func(o *madmin.ServiceTraceOpts) string { o.OS = true; return "Trace Operating System calls" }, - "scanner": func(o *madmin.ServiceTraceOpts) string { o.Scanner = true; return "Trace Scanner calls" }, + "storage": func(o *madmin.ServiceTraceOpts) string { o.Storage = true; return "Trace Storage calls" }, + "internal": func(o *madmin.ServiceTraceOpts) string { o.Internal = true; return "Trace Internal RPC calls" }, + "s3": func(o *madmin.ServiceTraceOpts) string { o.S3 = true; return "Trace S3 API calls" }, + "os": func(o *madmin.ServiceTraceOpts) string { o.OS = true; return "Trace Operating System calls" }, + "scanner": func(o *madmin.ServiceTraceOpts) string { o.Scanner = true; return "Trace Scanner calls" }, + "bootstrap": func(o *madmin.ServiceTraceOpts) string { o.Bootstrap = true; return "Trace Bootstrap operations" }, "healing": func(o *madmin.ServiceTraceOpts) string { o.Healing = true return "Trace Healing operations (alias: heal)" @@ -585,6 +586,12 @@ switch s.trcType { case madmin.TraceS3, madmin.TraceInternal: + case madmin.TraceBootstrap: + fmt.Fprintf(b, "[%s] %s %s %s", console.Colorize("RespStatus", strings.ToUpper(s.trcType.String())), console.Colorize("FuncName", s.FuncName), + hostStr, + s.StatusMsg, + ) + return b.String() default: if s.Error != "" { fmt.Fprintf(b, "[%s] %s %s %s err='%s' %2s", console.Colorize("RespStatus", strings.ToUpper(s.trcType.String())), console.Colorize("FuncName", s.FuncName), @@ -714,6 +721,9 @@ if trc.HTTP == nil { return "" } + case madmin.TraceBootstrap: + fmt.Fprintf(b, "%s %s [%s] %s", nodeNameStr, console.Colorize("Request", fmt.Sprintf("[%s %s]", strings.ToUpper(trc.TraceType.String()), trc.FuncName)), trc.Time.Local().Format(traceTimeFormat), trc.Message) + return b.String() default: if trc.Error != "" { fmt.Fprintf(b, "%s %s [%s] %s err='%s' %s", nodeNameStr, console.Colorize("Request", fmt.Sprintf("[%s %s]", strings.ToUpper(trc.TraceType.String()), trc.FuncName)), trc.Time.Local().Format(traceTimeFormat), trc.Path, console.Colorize("ErrStatus", trc.Error), trc.Duration) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/admin-update.go new/mc-20230111T031416Z/cmd/admin-update.go --- old/mc-20221224T152138Z/cmd/admin-update.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/admin-update.go 2023-01-11 04:14:16.000000000 +0100 @@ -30,13 +30,20 @@ "github.com/minio/pkg/console" ) +var adminUpdateFlags = []cli.Flag{ + cli.BoolFlag{ + Name: "yes, y", + Usage: "Confirms the server update", + }, +} + var adminServerUpdateCmd = cli.Command{ Name: "update", Usage: "update all MinIO servers", Action: mainAdminServerUpdate, OnUsageError: onUsageError, Before: setGlobalsFromContext, - Flags: globalFlags, + Flags: append(adminUpdateFlags, globalFlags...), CustomHelpTemplate: `NAME: {{.HelpName}} - {{.Usage}} @@ -106,7 +113,9 @@ updateURL := args.Get(1) - if isTerminal() { + autoConfirm := ctx.Bool("yes") + + if isTerminal() && !autoConfirm { fmt.Printf("You are about to upgrade *MinIO Server*, please confirm [y/N]: ") answer, e := bufio.NewReader(os.Stdin).ReadString('\n') fatalIf(probe.NewError(e), "Unable to parse user input.") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/auto-complete.go new/mc-20230111T031416Z/cmd/auto-complete.go --- old/mc-20221224T152138Z/cmd/auto-complete.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/auto-complete.go 2023-01-11 04:14:16.000000000 +0100 @@ -447,9 +447,11 @@ "/ilm/tier/rm": nil, "/admin/replicate/add": aliasCompleter, + "/admin/replicate/update": aliasCompleter, "/admin/replicate/edit": aliasCompleter, "/admin/replicate/info": aliasCompleter, "/admin/replicate/status": aliasCompleter, + "/admin/replicate/rm": aliasCompleter, "/admin/replicate/remove": aliasCompleter, "/admin/replicate/resync/start": aliasCompleter, "/admin/replicate/resync/cancel": aliasCompleter, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/client-s3.go new/mc-20230111T031416Z/cmd/client-s3.go --- old/mc-20221224T152138Z/cmd/client-s3.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/client-s3.go 2023-01-11 04:14:16.000000000 +0100 @@ -1042,20 +1042,21 @@ } opts := minio.PutObjectOptions{ - UserMetadata: metadata, - UserTags: tagsMap, - Progress: progress, - ContentType: contentType, - CacheControl: cacheControl, - ContentDisposition: contentDisposition, - ContentEncoding: contentEncoding, - ContentLanguage: contentLanguage, - StorageClass: strings.ToUpper(putOpts.storageClass), - ServerSideEncryption: putOpts.sse, - SendContentMd5: putOpts.md5, - DisableMultipart: putOpts.disableMultipart, - PartSize: putOpts.multipartSize, - NumThreads: putOpts.multipartThreads, + UserMetadata: metadata, + UserTags: tagsMap, + Progress: progress, + ContentType: contentType, + CacheControl: cacheControl, + ContentDisposition: contentDisposition, + ContentEncoding: contentEncoding, + ContentLanguage: contentLanguage, + StorageClass: strings.ToUpper(putOpts.storageClass), + ServerSideEncryption: putOpts.sse, + SendContentMd5: putOpts.md5, + DisableMultipart: putOpts.disableMultipart, + PartSize: putOpts.multipartSize, + NumThreads: putOpts.multipartThreads, + ConcurrentStreamParts: putOpts.concurrentStream, // if enabled honors NumThreads for piped() uploads } if !retainUntilDate.IsZero() && !retainUntilDate.Equal(timeSentinel) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/client.go new/mc-20230111T031416Z/cmd/client.go --- old/mc-20221224T152138Z/cmd/client.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/client.go 2023-01-11 04:14:16.000000000 +0100 @@ -60,6 +60,7 @@ storageClass string multipartSize uint64 multipartThreads uint + concurrentStream bool } // StatOptions holds options of the HEAD operation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/license-update.go new/mc-20230111T031416Z/cmd/license-update.go --- old/mc-20221224T152138Z/cmd/license-update.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/license-update.go 2023-01-11 04:14:16.000000000 +0100 @@ -20,7 +20,6 @@ import ( "fmt" "os" - "time" "github.com/fatih/color" "github.com/minio/cli" @@ -35,7 +34,7 @@ OnUsageError: onUsageError, Action: mainLicenseUpdate, Before: setGlobalsFromContext, - Flags: append(supportGlobalFlags, subnetCommonFlags...), + Flags: supportGlobalFlags, CustomHelpTemplate: `NAME: {{.HelpName}} - {{.Usage}} @@ -49,6 +48,8 @@ EXAMPLES: 1. Update license for cluster with alias 'play' from the file license.key {{.Prompt}} {{.HelpName}} play license.key + 2. Update (renew) license for already registered cluster with alias 'play' + {{.Prompt}} {{.HelpName}} play `, } @@ -73,21 +74,51 @@ } func mainLicenseUpdate(ctx *cli.Context) error { - if len(ctx.Args()) != 2 { + args := ctx.Args() + argsLen := len(args) + if argsLen > 2 || argsLen < 1 { showCommandHelpAndExit(ctx, 1) // last argument is exit code } console.SetColor(licUpdateMsgTag, color.New(color.FgGreen, color.Bold)) - aliasedURL := ctx.Args().Get(0) - alias, _ := initSubnetConnectivity(ctx, aliasedURL, false) + aliasedURL := args.Get(0) + alias, _ := url2Alias(aliasedURL) - licFile := ctx.Args().Get(1) + if argsLen == 2 { + licFile := args.Get(1) + printMsg(performLicenseUpdate(licFile, alias)) + return nil + } - printMsg(performLicenseUpdate(licFile, alias)) + // renew the license + printMsg(performLicenseRenew(alias)) return nil } +func performLicenseRenew(alias string) licUpdateMessage { + apiKey, _, e := getSubnetCreds(alias) + fatalIf(probe.NewError(e), "Error getting subnet creds") + + if len(apiKey) == 0 { + errMsg := fmt.Sprintf("Please register the cluster first by running 'mc license register %s'", alias) + fatal(errDummy().Trace(), errMsg) + } + + renewURL := subnetLicenseRenewURL() + headers := subnetAPIKeyAuthHeaders(apiKey) + headers.addDeploymentIDHeader(alias) + resp, e := subnetPostReq(renewURL, nil, headers) + fatalIf(probe.NewError(e), "Error renewing license for %s", alias) + + extractAndSaveSubnetCreds(alias, resp) + + return licUpdateMessage{ + Alias: alias, + Status: "success", + } +} + func performLicenseUpdate(licFile string, alias string) licUpdateMessage { lum := licUpdateMessage{ Alias: alias, @@ -98,21 +129,7 @@ fatalIf(probe.NewError(e), fmt.Sprintf("Unable to read license file %s", licFile)) lic := string(licBytes) - li, e := parseLicense(lic) - fatalIf(probe.NewError(e), fmt.Sprintf("Error parsing license from %s", licFile)) - - if li.ExpiresAt.Before(time.Now()) { - fatalIf(errDummy().Trace(), fmt.Sprintf("License has expired on %s", li.ExpiresAt)) - } - - if li.DeploymentID != getAdminInfo(alias).DeploymentID { - fatalIf(errDummy().Trace(), fmt.Sprintf("License is invalid for the deployment %s", alias)) - } - - setSubnetLicense(alias, lic) - if len(li.APIKey) > 0 { - setSubnetAPIKey(alias, li.APIKey) - } + validateAndSaveLic(lic, alias, true) return lum } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/mirror-main.go new/mc-20230111T031416Z/cmd/mirror-main.go --- old/mc-20221224T152138Z/cmd/mirror-main.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/mirror-main.go 2023-01-11 04:14:16.000000000 +0100 @@ -511,6 +511,9 @@ errorIf(sURLs.Error.Trace(sURLs.TargetContent.URL.String()), fmt.Sprintf("Failed to remove `%s`.", sURLs.TargetContent.URL.String())) default: + if strings.Contains(sURLs.Error.ToGoError().Error(), "Overwrite not allowed") { + ignoreErr = true + } if sURLs.ErrorCond == differInUnknown { errorIf(sURLs.Error.Trace(), "Failed to perform mirroring") } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/pipe-main.go new/mc-20230111T031416Z/cmd/pipe-main.go --- old/mc-20221224T152138Z/cmd/pipe-main.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/pipe-main.go 2023-01-11 04:14:16.000000000 +0100 @@ -18,13 +18,22 @@ package cmd import ( + "io" "os" + "runtime/debug" "syscall" + "github.com/dustin/go-humanize" "github.com/minio/cli" "github.com/minio/mc/pkg/probe" + "github.com/minio/minio-go/v7" ) +func defaultPartSize() string { + _, partSize, _, _ := minio.OptimalPartInfo(-1, 0) + return humanize.IBytes(uint64(partSize)) +} + var pipeFlags = []cli.Flag{ cli.StringFlag{ Name: "encrypt", @@ -42,6 +51,16 @@ Name: "tags", Usage: "apply one or more tags to the uploaded objects", }, + cli.IntFlag{ + Name: "concurrent", + Value: 1, + Usage: "allow N concurrent uploads [WARNING: will use more memory use it with caution]", + }, + cli.StringFlag{ + Name: "part-size", + Value: defaultPartSize(), + Usage: "customize chunk size for each concurrent upload", + }, } // Display contents of a file. @@ -89,23 +108,46 @@ `, } -func pipe(targetURL string, encKeyDB map[string][]prefixSSEPair, storageClass string, meta map[string]string) *probe.Error { +func pipe(ctx *cli.Context, targetURL string, encKeyDB map[string][]prefixSSEPair, meta map[string]string) *probe.Error { if targetURL == "" { // When no target is specified, pipe cat's stdin to stdout. return catOut(os.Stdin, -1).Trace() } + + storageClass := ctx.String("storage-class") alias, _ := url2Alias(targetURL) sseKey := getSSE(targetURL, encKeyDB[alias]) + multipartThreads := ctx.Int("concurrent") + if multipartThreads > 1 { + // We will be allocating large buffers, reduce default GC overhead + debug.SetGCPercent(20) + } + + var multipartSize uint64 + var e error + if partSizeStr := ctx.String("part-size"); partSizeStr != "" { + multipartSize, e = humanize.ParseBytes(partSizeStr) + if e != nil { + return probe.NewError(e) + } + } + // Stream from stdin to multiple objects until EOF. // Ignore size, since os.Stat() would not return proper size all the time // for local filesystem for example /proc files. opts := PutOptions{ - sse: sseKey, - storageClass: storageClass, - metadata: meta, + sse: sseKey, + storageClass: storageClass, + metadata: meta, + multipartSize: multipartSize, + multipartThreads: uint(multipartThreads), + concurrentStream: ctx.IsSet("concurrent"), } - _, err := putTargetStreamWithURL(targetURL, os.Stdin, -1, opts) + + pg := newProgressBar(0) + + _, err := putTargetStreamWithURL(targetURL, io.TeeReader(os.Stdin, pg), -1, opts) // TODO: See if this check is necessary. switch e := err.ToGoError().(type) { case *os.PathError: @@ -142,12 +184,12 @@ meta["X-Amz-Tagging"] = tags } if len(ctx.Args()) == 0 { - err = pipe("", nil, ctx.String("storage-class"), meta) + err = pipe(ctx, "", nil, meta) fatalIf(err.Trace("stdout"), "Unable to write to one or more targets.") } else { // extract URLs. URLs := ctx.Args() - err = pipe(URLs[0], encKeyDB, ctx.String("storage-class"), meta) + err = pipe(ctx, URLs[0], encKeyDB, meta) fatalIf(err.Trace(URLs[0]), "Unable to write to one or more targets.") } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/rb-main.go new/mc-20230111T031416Z/cmd/rb-main.go --- old/mc-20221224T152138Z/cmd/rb-main.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/rb-main.go 2023-01-11 04:14:16.000000000 +0100 @@ -199,6 +199,15 @@ return result.Err.Trace(url) } } + // Return early if prefix delete + switch c := clnt.(type) { + case *S3Client: + _, object := c.url2BucketAndObject() + if object != "" && isForce { + return nil + } + default: + } // Remove a bucket without force flag first because force // won't work if a bucket has some locking rules, that's diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/subnet-utils.go new/mc-20230111T031416Z/cmd/subnet-utils.go --- old/mc-20221224T152138Z/cmd/subnet-utils.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/subnet-utils.go 2023-01-11 04:14:16.000000000 +0100 @@ -43,9 +43,10 @@ ) const ( - subnetRespBodyLimit = 1 << 20 // 1 MiB - minioSubscriptionURL = "https://min.io/subscription" - subnetPublicKeyPath = "/downloads/license-pubkey.pem" + subnetRespBodyLimit = 1 << 20 // 1 MiB + minioSubscriptionURL = "https://min.io/subscription" + subnetPublicKeyPath = "/downloads/license-pubkey.pem" + minioDeploymentIDHeader = "x-minio-deployment-id" ) var ( @@ -102,6 +103,10 @@ return subnetBaseURL() + "/api/cluster/unregister?deploymentId=" + depID } +func subnetLicenseRenewURL() string { + return subnetBaseURL() + "/api/cluster/renew-license" +} + func subnetOfflineRegisterURL(regToken string) string { return subnetBaseURL() + "/cluster/register?token=" + regToken } @@ -151,6 +156,12 @@ return reqURL, subnetAPIKeyAuthHeaders(apiKey), nil } +type subnetHeaders map[string]string + +func (h subnetHeaders) addDeploymentIDHeader(alias string) { + h[minioDeploymentIDHeader] = getAdminInfo(alias).DeploymentID +} + func subnetTokenAuthHeaders(authToken string) map[string]string { return map[string]string{"Authorization": "Bearer " + authToken} } @@ -159,7 +170,7 @@ return map[string]string{"x-subnet-license": lic} } -func subnetAPIKeyAuthHeaders(apiKey string) map[string]string { +func subnetAPIKeyAuthHeaders(apiKey string) subnetHeaders { return map[string]string{"x-subnet-api-key": apiKey} } @@ -580,24 +591,52 @@ return nil } +// validateAndSaveLic - validates the given license in minio config +// If the license contains api key and the saveApiKey arg is true, +// api key is also saved in the minio config +func validateAndSaveLic(lic string, alias string, saveAPIKey bool) string { + li, e := parseLicense(lic) + fatalIf(probe.NewError(e), "Error parsing license") + + if li.ExpiresAt.Before(time.Now()) { + fatalIf(errDummy().Trace(), fmt.Sprintf("License has expired on %s", li.ExpiresAt)) + } + + if li.DeploymentID != getAdminInfo(alias).DeploymentID { + fatalIf(errDummy().Trace(), fmt.Sprintf("License is invalid for the deployment %s", alias)) + } + + setSubnetLicense(alias, lic) + if len(li.APIKey) > 0 && saveAPIKey { + setSubnetAPIKey(alias, li.APIKey) + } + + return li.APIKey +} + // extractAndSaveSubnetCreds - extract license from response and set it in minio config func extractAndSaveSubnetCreds(alias string, resp string) (string, string, error) { parsedResp := gjson.Parse(resp) - apiKey, e := extractSubnetCred("api_key", parsedResp) + + lic, e := extractSubnetCred("license", parsedResp) if e != nil { return "", "", e } - if len(apiKey) > 0 { - setSubnetAPIKey(alias, apiKey) + if len(lic) > 0 { + apiKey := validateAndSaveLic(lic, alias, true) + if len(apiKey) > 0 { + return apiKey, lic, nil + } } - lic, e := extractSubnetCred("license", parsedResp) + apiKey, e := extractSubnetCred("api_key", parsedResp) if e != nil { return "", "", e } - if len(lic) > 0 { - setSubnetLicense(alias, lic) + if len(apiKey) > 0 { + setSubnetAPIKey(alias, apiKey) } + return apiKey, lic, nil } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/cmd/support-inspect.go new/mc-20230111T031416Z/cmd/support-inspect.go --- old/mc-20221224T152138Z/cmd/support-inspect.go 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/cmd/support-inspect.go 2023-01-11 04:14:16.000000000 +0100 @@ -39,14 +39,17 @@ "github.com/minio/pkg/console" ) -const defaultPublicKey = "MIIBCgKCAQEAs/128UFS9A8YSJY1XqYKt06dLVQQCGDee69T+0Tip/1jGAB4z0/3QMpH0MiS8Wjs4BRWV51qvkfAHzwwdU7y6jxU05ctb/H/WzRj3FYdhhHKdzear9TLJftlTs+xwj2XaADjbLXCV1jGLS889A7f7z5DgABlVZMQd9BjVAR8ED3xRJ2/ZCNuQVJ+A8r7TYPGMY3wWvhhPgPk3Lx4WDZxDiDNlFs4GQSaESSsiVTb9vyGe/94CsCTM6Cw9QG6ifHKCa/rFszPYdKCabAfHcS3eTr0GM+TThSsxO7KfuscbmLJkfQev1srfL2Ii2RbnysqIJVWKEwdW05ID8ryPkuTuwIDAQAB" +const ( + defaultPublicKey = "MIIBCgKCAQEAs/128UFS9A8YSJY1XqYKt06dLVQQCGDee69T+0Tip/1jGAB4z0/3QMpH0MiS8Wjs4BRWV51qvkfAHzwwdU7y6jxU05ctb/H/WzRj3FYdhhHKdzear9TLJftlTs+xwj2XaADjbLXCV1jGLS889A7f7z5DgABlVZMQd9BjVAR8ED3xRJ2/ZCNuQVJ+A8r7TYPGMY3wWvhhPgPk3Lx4WDZxDiDNlFs4GQSaESSsiVTb9vyGe/94CsCTM6Cw9QG6ifHKCa/rFszPYdKCabAfHcS3eTr0GM+TThSsxO7KfuscbmLJkfQev1srfL2Ii2RbnysqIJVWKEwdW05ID8ryPkuTuwIDAQAB" + inspectOutputFilename = "inspect-data.enc" +) -var supportInspectFlags = []cli.Flag{ +var supportInspectFlags = append(subnetCommonFlags, cli.BoolFlag{ Name: "legacy", Usage: "use the older inspect format", }, -} +) var supportInspectCmd = cli.Command{ Name: "inspect", @@ -66,11 +69,14 @@ {{range .VisibleFlags}}{{.}} {{end}} EXAMPLES: - 1. Download 'xl.meta' for a specific object from all the drives in a zip file. + 1. Upload 'xl.meta' of a specific object from all the drives {{.Prompt}} {{.HelpName}} myminio/bucket/test*/xl.meta - 2. Download recursively all objects at a prefix. NOTE: This can be an expensive operation use it with caution. + 2. Upload recursively all objects at a prefix. NOTE: This can be an expensive operation use it with caution. {{.Prompt}} {{.HelpName}} myminio/bucket/test/** + + 3. Download 'xl.meta' of a specific object from all the drives locally, and upload to SUBNET manually + {{.Prompt}} {{.HelpName}} myminio/bucket/test*/xl.meta --airgap `, } @@ -116,8 +122,11 @@ args := ctx.Args() aliasedURL := args.Get(0) - alias, _ := url2Alias(aliasedURL) - validateClusterRegistered(alias, false) + alias, apiKey := initSubnetConnectivity(ctx, aliasedURL, true) + if len(apiKey) == 0 { + // api key not passed as flag. Check that the cluster is registered. + apiKey = validateClusterRegistered(alias, true) + } console.SetColor("File", color.New(color.FgWhite, color.Bold)) console.SetColor("Key", color.New(color.FgHiRed, color.Bold)) @@ -173,10 +182,31 @@ r.Close() tmpFile.Close() + if globalAirgapped { + saveInspectDataFile(key, tmpFile) + return nil + } + + uploadURL := subnetUploadURL("inspect", inspectOutputFilename) + reqURL, headers := prepareSubnetUploadURL(uploadURL, alias, inspectOutputFilename, apiKey) + + _, e = uploadFileToSubnet(alias, tmpFile.Name(), reqURL, headers) + if e != nil { + console.Errorln("Unable to upload inspect data to SUBNET portal: " + e.Error()) + saveInspectDataFile(key, tmpFile) + return nil + } + + clr := color.New(color.FgGreen, color.Bold) + clr.Println("uploaded successfully to SUBNET.") + return nil +} + +func saveInspectDataFile(key []byte, tmpFile *os.File) { var keyHex string + downloadPath := inspectOutputFilename // Choose a name and move the inspect data to its final destination - downloadPath := "inspect-data.enc" if key != nil { // Create an id that is also crc. var id [4]byte @@ -202,5 +232,4 @@ File: downloadPath, Key: keyHex, }) - return nil } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/go.mod new/mc-20230111T031416Z/go.mod --- old/mc-20221224T152138Z/go.mod 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/go.mod 2023-01-11 04:14:16.000000000 +0100 @@ -1,6 +1,6 @@ module github.com/minio/mc -go 1.18 +go 1.19 require ( github.com/charmbracelet/bubbletea v0.22.1 @@ -19,9 +19,9 @@ github.com/minio/cli v1.24.2 github.com/minio/colorjson v1.0.4 github.com/minio/filepath v1.0.0 - github.com/minio/madmin-go/v2 v2.0.1 + github.com/minio/madmin-go/v2 v2.0.2-0.20221221104141-93e7e5aefaf2 github.com/minio/md5-simd v1.1.2 // indirect - github.com/minio/minio-go/v7 v7.0.44 + github.com/minio/minio-go/v7 v7.0.46 github.com/minio/pkg v1.5.6 github.com/minio/selfupdate v0.5.0 github.com/minio/sha256-simd v1.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20221224T152138Z/go.sum new/mc-20230111T031416Z/go.sum --- old/mc-20221224T152138Z/go.sum 2022-12-24 16:21:38.000000000 +0100 +++ new/mc-20230111T031416Z/go.sum 2023-01-11 04:14:16.000000000 +0100 @@ -506,13 +506,13 @@ github.com/minio/filepath v1.0.0 h1:fvkJu1+6X+ECRA6G3+JJETj4QeAYO9sV43I79H8ubDY= github.com/minio/filepath v1.0.0/go.mod h1:/nRZA2ldl5z6jT9/KQuvZcQlxZIMQoFFQPvEXx9T/Bw= github.com/minio/madmin-go v1.6.6/go.mod h1:ATvkBOLiP3av4D++2v1UEHC/QzsGtgXD5kYvvRYzdKs= -github.com/minio/madmin-go/v2 v2.0.1 h1:WFfe12P18k9WSEFUZzUaBOQ78vjMBafM1YjgtXkkJoM= -github.com/minio/madmin-go/v2 v2.0.1/go.mod h1:5aFi/VLWBHC2DEFfGIlUmAeJhaF4ZAjuYpEWZFU14Zw= +github.com/minio/madmin-go/v2 v2.0.2-0.20221221104141-93e7e5aefaf2 h1:MPWI0f+mXCX9/0t8XBHXHzR8L0yT40NI4fdbvKyy0aU= +github.com/minio/madmin-go/v2 v2.0.2-0.20221221104141-93e7e5aefaf2/go.mod h1:5aFi/VLWBHC2DEFfGIlUmAeJhaF4ZAjuYpEWZFU14Zw= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/minio-go/v7 v7.0.41/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw= -github.com/minio/minio-go/v7 v7.0.44 h1:9zUJ7iU7ax2P1jOvTp6nVrgzlZq3AZlFm0XfRFDKstM= -github.com/minio/minio-go/v7 v7.0.44/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw= +github.com/minio/minio-go/v7 v7.0.46 h1:Vo3tNmNXuj7ME5qrvN4iadO7b4mzu/RSFdUkUhaPldk= +github.com/minio/minio-go/v7 v7.0.46/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw= github.com/minio/pkg v1.5.4/go.mod h1:2MOaRFdmFKULD+uOLc3qHLGTQTuxCNPKNPfLBTxC8CA= github.com/minio/pkg v1.5.6 h1:4OUvRU1gDWilu/dohkJMVapylXN8q94kU5MgkOJ/x0I= github.com/minio/pkg v1.5.6/go.mod h1:EiGlHS2xaooa2VMxhJsxxAZHDObHVUB3HwtuoEXOCVE= ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/minio-client/vendor.tar.gz /work/SRC/openSUSE:Factory/.minio-client.new.32243/vendor.tar.gz differ: char 5, line 1