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 2022-05-06 18:59:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/minio-client (Old) and /work/SRC/openSUSE:Factory/.minio-client.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "minio-client" Fri May 6 18:59:40 2022 rev:6 rq:975322 version:20220504T060755Z Changes: -------- --- /work/SRC/openSUSE:Factory/minio-client/minio-client.changes 2022-04-27 21:42:20.629086448 +0200 +++ /work/SRC/openSUSE:Factory/.minio-client.new.1538/minio-client.changes 2022-05-06 18:59:56.965396573 +0200 @@ -1,0 +2,10 @@ +Fri May 06 06:19:04 UTC 2022 - [email protected] + +- Update to version 20220504T060755Z: + * update golang.org/x/crypto (#4068) + * fix: support autocompletion for command aliases (#4070) + * Document setting multiple policies (#4065) + * Fix client-s3 Stat() for prefix with parallel lower prefixes (#4069) + * fix: README.md rename config to alias (#4062) + +------------------------------------------------------------------- Old: ---- mc-20220426T180022Z.tar.gz New: ---- mc-20220504T060755Z.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ minio-client.spec ++++++ --- /var/tmp/diff_new_pack.2KPqYu/_old 2022-05-06 18:59:57.857397547 +0200 +++ /var/tmp/diff_new_pack.2KPqYu/_new 2022-05-06 18:59:57.861397551 +0200 @@ -22,7 +22,7 @@ %define binary_name minio-client Name: minio-client -Version: 20220426T180022Z +Version: 20220504T060755Z Release: 0 Summary: Client for MinIO License: AGPL-3.0-only ++++++ _service ++++++ --- /var/tmp/diff_new_pack.2KPqYu/_old 2022-05-06 18:59:57.885397577 +0200 +++ /var/tmp/diff_new_pack.2KPqYu/_new 2022-05-06 18:59:57.889397582 +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.2022-04-26T18-00-22Z</param> + <param name="revision">RELEASE.2022-05-04T06-07-55Z</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-20220426T180022Z.tar.gz</param> + <param name="archive">mc-20220504T060755Z.tar.gz</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.2KPqYu/_old 2022-05-06 18:59:57.905397599 +0200 +++ /var/tmp/diff_new_pack.2KPqYu/_new 2022-05-06 18:59:57.905397599 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/minio/mc</param> - <param name="changesrevision">276e1db70d7bb495025b414f509b63f88c74c634</param></service></servicedata> + <param name="changesrevision">5619a78ead66ba651bcbc36df61ef892e470b8ea</param></service></servicedata> (No newline at EOF) ++++++ mc-20220426T180022Z.tar.gz -> mc-20220504T060755Z.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220426T180022Z/README.md new/mc-20220504T060755Z/README.md --- old/mc-20220426T180022Z/README.md 2022-04-26 13:30:21.000000000 +0200 +++ new/mc-20220504T060755Z/README.md 2022-04-29 16:42:08.000000000 +0200 @@ -56,7 +56,7 @@ docker run -it --entrypoint=/bin/sh minio/mc ``` -then use the [`mc config` command](#add-a-cloud-storage-service). +then use the [`mc alias` command](#add-a-cloud-storage-service). ### GitLab CI When using the Docker container in GitLab CI, you must [set the entrypoint to an empty string](https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#overriding-the-entrypoint-of-an-image). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220426T180022Z/cmd/admin-policy-set.go new/mc-20220504T060755Z/cmd/admin-policy-set.go --- old/mc-20220426T180022Z/cmd/admin-policy-set.go 2022-04-26 13:30:21.000000000 +0200 +++ new/mc-20220504T060755Z/cmd/admin-policy-set.go 2022-04-29 16:42:08.000000000 +0200 @@ -41,7 +41,7 @@ {{.HelpName}} TARGET POLICYNAME [ user=username1 | group=groupname1 ] POLICYNAME: - Name of the policy on the MinIO server. + Name of the policy on the MinIO server. To set multiple policies, separate names with a comma (,). FLAGS: {{range .VisibleFlags}}{{.}} @@ -52,6 +52,9 @@ 2. Set the "readonly" policy for group "auditors". {{.Prompt}} {{.HelpName}} myminio readonly group=auditors + + 3. Set the "readonly" and the "diagnostics" policies for user "alice" + {{.Prompt}} {{.HelpName}} myminio readonly,diagnostics user=alice `, } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220426T180022Z/cmd/auto-complete.go new/mc-20220504T060755Z/cmd/auto-complete.go --- old/mc-20220426T180022Z/cmd/auto-complete.go 2022-04-26 13:30:21.000000000 +0200 +++ new/mc-20220504T060755Z/cmd/auto-complete.go 2022-04-29 16:42:08.000000000 +0200 @@ -444,6 +444,9 @@ continue } complCmd.Sub[subCmd.Name] = cmdToCompleteCmd(subCmd, parentPath+"/"+cmd.Name) + for _, alias := range subCmd.Aliases { + complCmd.Sub[alias] = cmdToCompleteCmd(subCmd, parentPath+"/"+cmd.Name) + } } complCmd.Flags = flagsToCompleteFlags(cmd.Flags) @@ -461,6 +464,9 @@ continue } complCmds[cmd.Name] = cmdToCompleteCmd(cmd, "") + for _, alias := range cmd.Aliases { + complCmds[alias] = cmdToCompleteCmd(cmd, "") + } } complFlags := flagsToCompleteFlags(globalFlags) mcComplete := complete.Command{ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220426T180022Z/cmd/client-s3.go new/mc-20220504T060755Z/cmd/client-s3.go --- old/mc-20220426T180022Z/cmd/client-s3.go 2022-04-26 13:30:21.000000000 +0200 +++ new/mc-20220504T060755Z/cmd/client-s3.go 2022-04-29 16:42:08.000000000 +0200 @@ -1511,7 +1511,7 @@ func (c *S3Client) Stat(ctx context.Context, opts StatOptions) (*ClientContent, *probe.Error) { c.Lock() defer c.Unlock() - bucket, object := c.url2BucketAndObject() + bucket, path := c.url2BucketAndObject() // Bucket name cannot be empty, stat on URL has no meaning. if bucket == "" { @@ -1525,7 +1525,7 @@ }, nil } - if object == "" { + if path == "" { content, err := c.bucketStat(ctx, bucket) if err != nil { return nil, err.Trace(bucket) @@ -1535,7 +1535,7 @@ // If the request is for incomplete upload stat, handle it here. if opts.incomplete { - return c.statIncompleteUpload(ctx, bucket, object) + return c.statIncompleteUpload(ctx, bucket, path) } // The following code tries to calculate if a given prefix/object does really exist @@ -1550,14 +1550,14 @@ // because the list could be very large. At the same time, the HEAD call is avoided if the // object already contains a trailing prefix or we passed rewind flag to know the object version // created just before the rewind parameter. - if !strings.HasSuffix(object, string(c.targetURL.Separator)) && opts.timeRef.IsZero() { + if !strings.HasSuffix(path, string(c.targetURL.Separator)) && opts.timeRef.IsZero() { // Issue HEAD request first but ignore no such key error // so we can check if there is such prefix which exists o := minio.StatObjectOptions{ServerSideEncryption: opts.sse, VersionID: opts.versionID} if opts.isZip { o.Set("x-minio-extract", "true") } - ctnt, err := c.getObjectStat(ctx, bucket, object, o) + ctnt, err := c.getObjectStat(ctx, bucket, path, o) if err == nil { return ctnt, nil } @@ -1568,19 +1568,26 @@ } } - nonRecursive := false - // Prefix to pass to minio-go listing in order to fetch if a prefix exists - prefix := strings.TrimRight(object, string(c.targetURL.Separator)) + // No object found, start looking for a prefix with the same name + // or a directory marker. Add a trailing slash if it is not in the path + if !strings.HasSuffix(path, string(c.targetURL.Separator)) { + path += string(c.targetURL.Separator) + } - for objectStat := range c.listObjectWrapper(ctx, bucket, prefix, nonRecursive, opts.timeRef, false, false, false, 1, opts.isZip) { + nonRecursive := false + maxKeys := 1 + for objectStat := range c.listObjectWrapper(ctx, bucket, path, nonRecursive, opts.timeRef, false, false, false, maxKeys, opts.isZip) { if objectStat.Err != nil { return nil, probe.NewError(objectStat.Err) } - - if object == objectStat.Key || object == strings.TrimSuffix(objectStat.Key, string(c.targetURL.Separator)) { + // In case of a directory marker + if path == objectStat.Key { return c.objectInfo2ClientContent(bucket, objectStat), nil } - break + if strings.HasPrefix(objectStat.Key, path) { + // An object inside the prefix is found, then the prefix exists. + return c.prefixInfo2ClientContent(bucket, path), nil + } } return nil, probe.NewError(ObjectMissing{opts.timeRef}) @@ -2002,6 +2009,22 @@ return content } +// Convert objectInfo to ClientContent +func (c *S3Client) prefixInfo2ClientContent(bucket string, prefix string) *ClientContent { + // Join bucket and incoming object key. + if bucket == "" { + panic("should never happen, bucket cannot be empty") + } + content := &ClientContent{} + url := c.targetURL.Clone() + url.Path = c.joinPath(bucket, prefix) + content.URL = url + content.BucketName = bucket + content.Type = os.ModeDir + content.Time = time.Now() + return content +} + // Convert objectInfo to ClientContent func (c *S3Client) objectInfo2ClientContent(bucket string, entry minio.ObjectInfo) *ClientContent { content := &ClientContent{} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220426T180022Z/functional-tests.sh new/mc-20220504T060755Z/functional-tests.sh --- old/mc-20220426T180022Z/functional-tests.sh 2022-04-26 13:30:21.000000000 +0200 +++ new/mc-20220504T060755Z/functional-tests.sh 2022-04-29 16:42:08.000000000 +0200 @@ -297,6 +297,25 @@ assert_success "$start_time" "${FUNCNAME[0]}" mc_cmd rb --force "${SERVER_ALIAS}/${BUCKET_NAME}" } +# Test mc ls on a S3 prefix where a lower similar prefix exists as well e.g. dir-foo/ and dir/ +function test_list_dir() +{ + show "${FUNCNAME[0]}" + + start_time=$(get_time) + assert_success "$start_time" "${FUNCNAME[0]}" mc_cmd cp "${FILE_1_MB}" "${SERVER_ALIAS}/${BUCKET_NAME}/dir-foo/object1" + assert_success "$start_time" "${FUNCNAME[0]}" mc_cmd cp "${FILE_1_MB}" "${SERVER_ALIAS}/${BUCKET_NAME}/dir/object2" + diff -bB <(echo "object2") <("${MC_CMD[@]}" --json ls "${SERVER_ALIAS}/${BUCKET_NAME}/dir" | jq -r '.key') >/dev/null 2>&1 + assert_success "$start_time" "${FUNCNAME[0]}" show_on_failure $? "unexpected listing dir" + + # Cleanup + assert_success "$start_time" "${FUNCNAME[0]}" mc_cmd cp "${FILE_1_MB}" "${SERVER_ALIAS}/${BUCKET_NAME}/dir-foo/${object_name}" + assert_success "$start_time" "${FUNCNAME[0]}" mc_cmd cp "${FILE_1_MB}" "${SERVER_ALIAS}/${BUCKET_NAME}/dir/${object_name}" + + log_success "$start_time" "${FUNCNAME[0]}" +} + + function test_put_object() { show "${FUNCNAME[0]}" @@ -1024,6 +1043,7 @@ test_rb setup + test_list_dir test_put_object test_put_object_error test_put_object_0byte diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220426T180022Z/go.mod new/mc-20220504T060755Z/go.mod --- old/mc-20220426T180022Z/go.mod 2022-04-26 13:30:21.000000000 +0200 +++ new/mc-20220504T060755Z/go.mod 2022-04-29 16:42:08.000000000 +0200 @@ -34,7 +34,7 @@ github.com/secure-io/sio-go v0.3.1 github.com/shirou/gopsutil/v3 v3.21.12 github.com/tidwall/gjson v1.12.1 - golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed + golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd golang.org/x/text v0.3.7 gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220426T180022Z/go.sum new/mc-20220504T060755Z/go.sum --- old/mc-20220426T180022Z/go.sum 2022-04-26 13:30:21.000000000 +0200 +++ new/mc-20220504T060755Z/go.sum 2022-04-29 16:42:08.000000000 +0200 @@ -546,8 +546,8 @@ golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed h1:YoWVYYAfvQ4ddHv3OKmIvX7NCAhFGTj62VP2l2kfBbA= -golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f h1:OeJjE6G4dgCY4PIXvIRQbE8+RX+uXZyGhUy/ksMGJoc= +golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/minio-client/vendor.tar.gz /work/SRC/openSUSE:Factory/.minio-client.new.1538/vendor.tar.gz differ: char 5, line 1
