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-06-13 16:10:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/minio-client (Old) and /work/SRC/openSUSE:Factory/.minio-client.new.15902 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "minio-client" Tue Jun 13 16:10:47 2023 rev:34 rq:1092826 version:20230606T134856Z Changes: -------- --- /work/SRC/openSUSE:Factory/minio-client/minio-client.changes 2023-05-28 19:24:12.249448265 +0200 +++ /work/SRC/openSUSE:Factory/.minio-client.new.15902/minio-client.changes 2023-06-13 16:10:50.519356869 +0200 @@ -1,0 +2,16 @@ +Tue Jun 13 06:12:51 UTC 2023 - ka...@b1-systems.de + +- Update to version 20230606T134856Z: + * add ftp trace support (#4590) + * print in tabular form for callhome status (#4588) + +------------------------------------------------------------------- +Tue Jun 13 06:09:35 UTC 2023 - ka...@b1-systems.de + +- Update to version 20230530T224138Z: + * Implement '--expiry' flag for 'mc admin user svcacct add & + edit' (#4570) + * Make mc ping useful for startup checks (#4584) + * fix proxy not being used to test connectivity (#4583) + +------------------------------------------------------------------- Old: ---- mc-20230526T233154Z.obscpio New: ---- mc-20230606T134856Z.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ minio-client.spec ++++++ --- /var/tmp/diff_new_pack.EPsVy5/_old 2023-06-13 16:10:51.487362578 +0200 +++ /var/tmp/diff_new_pack.EPsVy5/_new 2023-06-13 16:10:51.491362603 +0200 @@ -22,7 +22,7 @@ %define binary_name minio-client Name: minio-client -Version: 20230526T233154Z +Version: 20230606T134856Z Release: 0 Summary: Client for MinIO License: AGPL-3.0-only ++++++ _service ++++++ --- /var/tmp/diff_new_pack.EPsVy5/_old 2023-06-13 16:10:51.531362839 +0200 +++ /var/tmp/diff_new_pack.EPsVy5/_new 2023-06-13 16:10:51.535362862 +0200 @@ -5,7 +5,7 @@ <param name="exclude">.git</param> <param name="changesgenerate">enable</param> <param name="versionformat">@PARENT_TAG@</param> - <param name="revision">RELEASE.2023-05-26T23-31-54Z</param> + <param name="revision">RELEASE.2023-06-06T13-48-56Z</param> <param name="match-tag">RELEASE.*</param> <param name="versionrewrite-pattern">RELEASE\.(.*)-(.*)-(.*)-(.*)-(.*)</param> <param name="versionrewrite-replacement">\1\2\3\4\5</param> @@ -19,7 +19,7 @@ <param name="compression">gz</param> </service> <service name="go_modules" mode="disabled"> - <param name="archive">mc-20230526T233154Z.obscpio</param> + <param name="archive">mc-20230606T134856Z.obscpio</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.EPsVy5/_old 2023-06-13 16:10:51.555362980 +0200 +++ /var/tmp/diff_new_pack.EPsVy5/_new 2023-06-13 16:10:51.559363003 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/minio/mc</param> - <param name="changesrevision">9cb069e7afaa45c64c45b7b59ba65c0441019efd</param></service></servicedata> + <param name="changesrevision">5e4ab1ec484fd398acbbda89cf17b381f8618184</param></service></servicedata> (No newline at EOF) ++++++ mc-20230526T233154Z.obscpio -> mc-20230606T134856Z.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20230526T233154Z/cmd/admin-trace.go new/mc-20230606T134856Z/cmd/admin-trace.go --- old/mc-20230526T233154Z/cmd/admin-trace.go 2023-05-27 01:31:54.000000000 +0200 +++ new/mc-20230606T134856Z/cmd/admin-trace.go 2023-06-06 15:48:56.000000000 +0200 @@ -105,6 +105,7 @@ "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" }, "ilm": func(o *madmin.ServiceTraceOpts) string { o.ILM = true; return "Trace ILM operations" }, + "ftp": func(o *madmin.ServiceTraceOpts) string { o.FTP = true; return "Trace FTP operations" }, "healing": func(o *madmin.ServiceTraceOpts) string { o.Healing = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20230526T233154Z/cmd/admin-user-svcacct-add.go new/mc-20230606T134856Z/cmd/admin-user-svcacct-add.go --- old/mc-20230526T233154Z/cmd/admin-user-svcacct-add.go 2023-05-27 01:31:54.000000000 +0200 +++ new/mc-20230606T134856Z/cmd/admin-user-svcacct-add.go 2023-06-06 15:48:56.000000000 +0200 @@ -62,6 +62,10 @@ Hidden: true, Usage: "description for the service account (DEPRECATED: use --description instead)", }, + cli.StringFlag{ + Name: "expiry", + Usage: "time of expiration for the service account", + }, } var adminUserSvcAcctAddCmd = cli.Command{ @@ -86,12 +90,18 @@ EXAMPLES: 1. Add a new service account for user 'foobar' to MinIO server with a name and description. {{.Prompt}} {{.HelpName}} myminio foobar --name uploaderKey --description "foobar uploader scripts" - 2. Add a new service account to MinIO server with specified access key and secret key for user'foobar'. + 2. Add a new service account to MinIO server with specified access key and secret key for user 'foobar'. {{.Prompt}} {{.HelpName}} myminio foobar --access-key "myaccesskey" --secret-key "mysecretkey" - 3. Add a new service account to MinIO server with specified access key and random secret key for user'foobar'. + 3. Add a new service account to MinIO server with specified access key and random secret key for user 'foobar'. {{.Prompt}} {{.HelpName}} myminio foobar --access-key "myaccesskey" - 4. Add a new service account to MinIO server with specified secret key and random access key for user'foobar'. + 4. Add a new service account to MinIO server with specified secret key and random access key for user 'foobar'. {{.Prompt}} {{.HelpName}} myminio foobar --secret-key "mysecretkey" + 5. Add a new service account to MinIO server with specified expiry date in the future for user 'foobar'. + {{.Prompt}} {{.HelpName}} myminio foobar --expiry 2023-06-24 + {{.Prompt}} {{.HelpName}} myminio foobar --expiry 2023-06-24T10:00 + {{.Prompt}} {{.HelpName}} myminio foobar --expiry 2023-06-24T10:00:00 + {{.Prompt}} {{.HelpName}} myminio foobar --expiry 2023-06-24T10:00:00Z + {{.Prompt}} {{.HelpName}} myminio foobar --expiry 2023-06-24T10:00:00-07:00 `, } @@ -154,6 +164,13 @@ secretKeyMaxLen = 40 ) +var supportedTimeFormats = []string{ + "2006-01-02", + "2006-01-02T15:04", + "2006-01-02T15:04:05", + time.RFC3339, +} + func (u acctMessage) String() string { switch u.op { case svcAccOpList: @@ -196,8 +213,12 @@ case svcAccOpEnable: return console.Colorize("AccMessage", "Enabled service account `"+u.AccessKey+"` successfully.") case svcAccOpAdd: + if u.Expiration != nil && !u.Expiration.IsZero() && !u.Expiration.Equal(timeSentinel) { + return console.Colorize("AccMessage", + fmt.Sprintf("Access Key: %s\nSecret Key: %s\nExpiration: %s", u.AccessKey, u.SecretKey, *u.Expiration)) + } return console.Colorize("AccMessage", - fmt.Sprintf("Access Key: %s\nSecret Key: %s", u.AccessKey, u.SecretKey)) + fmt.Sprintf("Access Key: %s\nSecret Key: %s\nExpiration: no-expiry", u.AccessKey, u.SecretKey)) case svcAccOpSet: return console.Colorize("AccMessage", "Edited service account `"+u.AccessKey+"` successfully.") } @@ -267,6 +288,7 @@ if description == "" { description = ctx.String("comment") } + expiry := ctx.String("expiry") // generate access key and secret key if len(accessKey) <= 0 || len(secretKey) <= 0 { @@ -299,6 +321,31 @@ } } + var expiryTime time.Time + var expiryPointer *time.Time + + if expiry != "" { + location, e := time.LoadLocation("Local") + if e != nil { + fatalIf(probe.NewError(e), "Unable to parse the expiry argument.") + } + + patternMatched := false + for _, format := range supportedTimeFormats { + t, e := time.ParseInLocation(format, expiry, location) + if e == nil { + patternMatched = true + expiryTime = t + expiryPointer = &expiryTime + break + } + } + + if !patternMatched { + fatalIf(probe.NewError(fmt.Errorf("expiry argument is not matching any of the supported patterns")), "unable to parse the expiry argument.") + } + } + opts := madmin.AddServiceAccountReq{ Policy: policyBytes, AccessKey: accessKey, @@ -306,15 +353,17 @@ Name: name, Description: description, TargetUser: user, + Expiration: expiryPointer, } creds, e := client.AddServiceAccount(globalContext, opts) - fatalIf(probe.NewError(e).Trace(args...), "Unable to add a new service account") + fatalIf(probe.NewError(e).Trace(args...), "Unable to add a new service account.") printMsg(acctMessage{ op: svcAccOpAdd, AccessKey: creds.AccessKey, SecretKey: creds.SecretKey, + Expiration: &creds.Expiration, AccountStatus: "enabled", }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20230526T233154Z/cmd/admin-user-svcacct-set.go new/mc-20230606T134856Z/cmd/admin-user-svcacct-set.go --- old/mc-20230526T233154Z/cmd/admin-user-svcacct-set.go 2023-05-27 01:31:54.000000000 +0200 +++ new/mc-20230606T134856Z/cmd/admin-user-svcacct-set.go 2023-06-06 15:48:56.000000000 +0200 @@ -18,7 +18,9 @@ package cmd import ( + "fmt" "os" + "time" "github.com/minio/cli" "github.com/minio/madmin-go/v2" @@ -42,6 +44,10 @@ Name: "description", Usage: "description for the service account", }, + cli.StringFlag{ + Name: "expiry", + Usage: "time of expiration for the service account", + }, } var adminUserSvcAcctSetCmd = cli.Command{ @@ -64,6 +70,12 @@ EXAMPLES: 1. Change the secret key of the service account 'J123C4ZXEQN8RK6ND35I' in MinIO server. {{.Prompt}} {{.HelpName}} myminio/ 'J123C4ZXEQN8RK6ND35I' --secret-key 'xxxxxxx' + 2. Change the expiry of the service account 'J123C4ZXEQN8RK6ND35I' in MinIO server. + {{.Prompt}} {{.HelpName}} myminio/ 'J123C4ZXEQN8RK6ND35I' --expiry 2023-06-24 + {{.Prompt}} {{.HelpName}} myminio/ 'J123C4ZXEQN8RK6ND35I' --expiry 2023-06-24T10:00 + {{.Prompt}} {{.HelpName}} myminio/ 'J123C4ZXEQN8RK6ND35I' --expiry 2023-06-24T10:00:00 + {{.Prompt}} {{.HelpName}} myminio/ 'J123C4ZXEQN8RK6ND35I' --expiry 2023-06-24T10:00:00Z + {{.Prompt}} {{.HelpName}} myminio/ 'J123C4ZXEQN8RK6ND35I' --expiry 2023-06-24T10:00:00-07:00 `, } @@ -87,6 +99,7 @@ policyPath := ctx.String("policy") name := ctx.String("name") description := ctx.String("description") + expiry := ctx.String("expiry") // Create a new MinIO Admin Client client, err := newAdminClient(aliasedURL) @@ -99,11 +112,37 @@ fatalIf(probe.NewError(e), "Unable to open the policy document.") } + var expiryTime time.Time + var expiryPointer *time.Time + + if expiry != "" { + location, e := time.LoadLocation("Local") + if e != nil { + fatalIf(probe.NewError(e), "Unable to parse the expiry argument.") + } + + patternMatched := false + for _, format := range supportedTimeFormats { + t, e := time.ParseInLocation(format, expiry, location) + if e == nil { + patternMatched = true + expiryTime = t + expiryPointer = &expiryTime + break + } + } + + if !patternMatched { + fatalIf(probe.NewError(fmt.Errorf("expiry argument is not matching any of the supported patterns")), "unable to parse the expiry argument.") + } + } + opts := madmin.UpdateServiceAccountReq{ NewPolicy: buf, NewSecretKey: secretKey, NewName: name, NewDescription: description, + NewExpiration: expiryPointer, } e := client.UpdateServiceAccount(globalContext, svcAccount, opts) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20230526T233154Z/cmd/ping.go new/mc-20230606T134856Z/cmd/ping.go --- old/mc-20230526T233154Z/cmd/ping.go 2023-05-27 01:31:54.000000000 +0200 +++ new/mc-20230606T134856Z/cmd/ping.go 2023-06-06 15:48:56.000000000 +0200 @@ -45,6 +45,10 @@ Name: "error-count, e", Usage: "exit after N consecutive ping errors", }, + cli.BoolFlag{ + Name: "exit, x", + Usage: "exit when server(s) responds and reports being online", + }, cli.IntFlag{ Name: "interval, i", Usage: "wait interval between each request in seconds", @@ -203,10 +207,12 @@ if cliCtx.Bool("distributed") { servers = admInfo.Servers } + allOK := true for result := range anonClient.Alive(ctx, madmin.AliveOpts{}, servers...) { stat := pingStats(cliCtx, result, endPointMap) + allOK = allOK && result.Online endPointStat := EndPointStats{ Endpoint: result.Endpoint, Min: trimToTwoDecimal(time.Duration(stat.min)), @@ -221,13 +227,16 @@ endPointMap[result.Endpoint.Host] = stat } + stop = stop || cliCtx.Bool("exit") && allOK + printMsg(PingResult{ Status: "success", Counter: pad(strconv.Itoa(index), " ", 3-len(strconv.Itoa(index)), true), EndPointsStats: endPointStats, }) - - time.Sleep(time.Duration(cliCtx.Int("interval")) * time.Second) + if !stop { + time.Sleep(time.Duration(cliCtx.Int("interval")) * time.Second) + } } func trimToTwoDecimal(d time.Duration) string { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20230526T233154Z/cmd/subnet-utils.go new/mc-20230606T134856Z/cmd/subnet-utils.go --- old/mc-20230526T233154Z/cmd/subnet-utils.go 2023-05-27 01:31:54.000000000 +0200 +++ new/mc-20230606T134856Z/cmd/subnet-utils.go 2023-06-06 15:48:56.000000000 +0200 @@ -129,19 +129,10 @@ } func checkURLReachable(url string) *probe.Error { - clnt := httpClient(10 * time.Second) - req, e := http.NewRequest(http.MethodHead, url, nil) + _, e := subnetHeadReq(url, nil) if e != nil { return probe.NewError(e).Trace(url) } - resp, e := clnt.Do(req) - if e != nil { - return probe.NewError(e).Trace(url) - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return probe.NewError(errors.New(resp.Status)).Trace(url) - } return nil } @@ -219,6 +210,14 @@ return respStr, fmt.Errorf("Request failed with code %d with error: %s", resp.StatusCode, respStr) } +func subnetHeadReq(reqURL string, headers map[string]string) (string, error) { + r, e := http.NewRequest(http.MethodHead, reqURL, nil) + if e != nil { + return "", e + } + return subnetReqDo(r, headers) +} + func subnetGetReq(reqURL string, headers map[string]string) (string, error) { r, e := http.NewRequest(http.MethodGet, reqURL, nil) if e != nil { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20230526T233154Z/cmd/support-callhome.go new/mc-20230606T134856Z/cmd/support-callhome.go --- old/mc-20230526T233154Z/cmd/support-callhome.go 2023-05-27 01:31:54.000000000 +0200 +++ new/mc-20230606T134856Z/cmd/support-callhome.go 2023-06-06 15:48:56.000000000 +0200 @@ -19,8 +19,9 @@ import ( "fmt" - "strings" + "github.com/charmbracelet/bubbles/table" + "github.com/charmbracelet/lipgloss" "github.com/minio/cli" json "github.com/minio/colorjson" "github.com/minio/madmin-go/v2" @@ -91,20 +92,43 @@ // String colorized callhome command output message. func (s supportCallhomeMessage) String() string { - var msg string if s.Action == "status" { - msgs := []string{} + columns := []table.Column{ + {Title: "Features", Width: 20}, + {Title: "", Width: 15}, + } + + rows := []table.Row{} + if len(s.Diag) > 0 { - msgs = append(msgs, "Diagnostics is "+s.Diag) + rows = append(rows, table.Row{licInfoField("Diagnostics"), licInfoVal(s.Diag)}) } if len(s.Logs) > 0 { - msgs = append(msgs, "Logs is "+s.Logs) + rows = append(rows, table.Row{licInfoField("Logs"), licInfoVal(s.Logs)}) } - msg = strings.Join(msgs, "\n") - } else { - msg = s.Feature + " is now " + s.Action + + t := table.New( + table.WithColumns(columns), + table.WithRows(rows), + table.WithFocused(true), + table.WithHeight(len(rows)), + ) + + s := table.DefaultStyles() + s.Header = s.Header. + BorderStyle(lipgloss.NormalBorder()). + BorderForeground(lipgloss.Color("240")). + BorderBottom(true). + Bold(false) + s.Selected = s.Selected.Bold(false) + t.SetStyles(s) + + return lipgloss.NewStyle(). + BorderStyle(lipgloss.NormalBorder()). + BorderForeground(lipgloss.Color("240")).Render(t.View()) } - return console.Colorize(supportSuccessMsgTag, msg) + + return console.Colorize(supportSuccessMsgTag, s.Feature+" is now "+s.Action) } // JSON jsonified callhome command output message. @@ -121,6 +145,8 @@ } func mainCallhome(ctx *cli.Context) error { + initLicInfoColors() + setSuccessMessageColor() alias, arg := checkToggleCmdSyntax(ctx) ++++++ mc.obsinfo ++++++ --- /var/tmp/diff_new_pack.EPsVy5/_old 2023-06-13 16:10:51.819364538 +0200 +++ /var/tmp/diff_new_pack.EPsVy5/_new 2023-06-13 16:10:51.823364561 +0200 @@ -1,5 +1,5 @@ name: mc -version: 20230526T233154Z -mtime: 1685143914 -commit: 9cb069e7afaa45c64c45b7b59ba65c0441019efd +version: 20230606T134856Z +mtime: 1686059336 +commit: 5e4ab1ec484fd398acbbda89cf17b381f8618184 ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/minio-client/vendor.tar.gz /work/SRC/openSUSE:Factory/.minio-client.new.15902/vendor.tar.gz differ: char 5, line 1