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-04-17 23:50:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/minio-client (Old) and /work/SRC/openSUSE:Factory/.minio-client.new.1941 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "minio-client" Sun Apr 17 23:50:15 2022 rev:3 rq:970423 version:20220407T214327Z Changes: -------- --- /work/SRC/openSUSE:Factory/minio-client/minio-client.changes 2022-04-02 18:21:11.865832470 +0200 +++ /work/SRC/openSUSE:Factory/.minio-client.new.1941/minio-client.changes 2022-04-17 23:51:52.914474931 +0200 @@ -1,0 +2,11 @@ +Sat Apr 16 09:07:02 UTC 2022 - [email protected] + +- Update to version 20220407T214327Z: + * Do not rely on contentCh to print removal messages (#4041) + * Get speedtest results as part of `support diag` (#4034) + * Simplify `mc ilm ls` (#4042) + * Compute bucket/object correctly for some endpoints (#4040) + * mirror: Do not exit upon errors when --watch is passed (#4032) + * rm: Fix sending an object/version to removal with --no-current flag (#4038) + +------------------------------------------------------------------- Old: ---- mc-20220401T234448Z.tar.gz New: ---- mc-20220407T214327Z.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ minio-client.spec ++++++ --- /var/tmp/diff_new_pack.qxzD5s/_old 2022-04-17 23:51:53.626475907 +0200 +++ /var/tmp/diff_new_pack.qxzD5s/_new 2022-04-17 23:51:53.630475913 +0200 @@ -22,7 +22,7 @@ %define binary_name minio-client Name: minio-client -Version: 20220401T234448Z +Version: 20220407T214327Z Release: 0 Summary: Client for MinIO License: AGPL-3.0-only ++++++ _service ++++++ --- /var/tmp/diff_new_pack.qxzD5s/_old 2022-04-17 23:51:53.658475951 +0200 +++ /var/tmp/diff_new_pack.qxzD5s/_new 2022-04-17 23:51:53.662475957 +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-01T23-44-48Z</param> + <param name="revision">RELEASE.2022-04-07T21-43-27Z</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-20220401T234448Z.tar.gz</param> + <param name="archive">mc-20220407T214327Z.tar.gz</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.qxzD5s/_old 2022-04-17 23:51:53.682475984 +0200 +++ /var/tmp/diff_new_pack.qxzD5s/_new 2022-04-17 23:51:53.682475984 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/minio/mc</param> - <param name="changesrevision">5a3ad93ab94b8517528470269a4e0bb4f628f154</param></service></servicedata> + <param name="changesrevision">3f0953f9f47326f9554c5067b39cd39ab82f30a3</param></service></servicedata> (No newline at EOF) ++++++ mc-20220401T234448Z.tar.gz -> mc-20220407T214327Z.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220401T234448Z/cmd/client-fs.go new/mc-20220407T214327Z/cmd/client-fs.go --- old/mc-20220401T234448Z/cmd/client-fs.go 2022-04-02 01:39:16.000000000 +0200 +++ new/mc-20220407T214327Z/cmd/client-fs.go 2022-04-07 20:52:55.000000000 +0200 @@ -514,7 +514,7 @@ } e := deleteFile(f.PathURL.Path, name) if e == nil { - _, objectName := url2BucketAndObject(&content.URL, false) + _, objectName := url2BucketAndObject(&content.URL) res := RemoveResult{} res.ObjectName = objectName resultCh <- res diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220401T234448Z/cmd/client-s3.go new/mc-20220407T214327Z/cmd/client-s3.go --- old/mc-20220401T234448Z/cmd/client-s3.go 2022-04-02 01:39:16.000000000 +0200 +++ new/mc-20220407T214327Z/cmd/client-s3.go 2022-04-07 20:52:55.000000000 +0200 @@ -1650,37 +1650,14 @@ return isAmazon(host) && !isAmazonChina(host) || isGoogle(host) || isAmazonAccelerated(host) } -func url2BucketAndObject(u *ClientURL, virtualStyle bool) (bucketName, objectName string) { - path := u.Path - // Convert any virtual host styled requests. - // - // For the time being this check is introduced for S3, - // If you have custom virtual styled hosts please. - // List them below. - if virtualStyle { - var bucket string - hostIndex := strings.Index(u.Host, "s3") - if hostIndex != -1 && !matchS3InHost(u.Host) { - hostIndex = -1 - } - if hostIndex == -1 { - hostIndex = strings.Index(u.Host, "s3-accelerate") - } - if hostIndex == -1 { - hostIndex = strings.Index(u.Host, "storage.googleapis") - } - if hostIndex > 0 { - bucket = u.Host[:hostIndex-1] - path = string(u.Separator) + bucket + u.Path - } - } - tokens := splitStr(path, string(u.Separator), 3) +func url2BucketAndObject(u *ClientURL) (bucketName, objectName string) { + tokens := splitStr(u.Path, string(u.Separator), 3) return tokens[1], tokens[2] } // url2BucketAndObject gives bucketName and objectName from URL path. func (c *S3Client) url2BucketAndObject() (bucketName, objectName string) { - return url2BucketAndObject(c.targetURL, c.virtualStyle) + return url2BucketAndObject(c.targetURL) } // splitPath split path into bucket and object. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220401T234448Z/cmd/ilm/tabular_info.go new/mc-20220407T214327Z/cmd/ilm/tabular_info.go --- old/mc-20220401T234448Z/cmd/ilm/tabular_info.go 2022-04-02 01:39:16.000000000 +0200 +++ new/mc-20220407T214327Z/cmd/ilm/tabular_info.go 2022-04-07 20:52:55.000000000 +0200 @@ -30,16 +30,14 @@ prefixColumnWidth int = 16 // StatusColumnWidth column width in table output statusColumnWidth int = 12 - // ExpiryColumnWidth column width in table output - expiryColumnWidth int = 8 - // ExpiryDatesColumnWidth column width in table output - expiryDatesColumnWidth int = 14 + // IlmDatesColumnWidth column width in table output + ilmDatesColumnWidth int = 14 // TagsColumnWidth column width in table output tagsColumnWidth int = 24 - // TransitionColumnWidth column width in table output - transitionColumnWidth int = 14 - // TransitionDateColumnWidth column width in table output - transitionDateColumnWidth int = 18 + // TypeColumnWidth column width in table output + typeColumnWidth int = 12 + // VersionColumnWidth column width in table output + versionColumnWidth int = 14 // StorageClassColumnWidth column width in table output storageClassColumnWidth int = 18 ) @@ -56,19 +54,20 @@ prefixLabel string = "Prefix" statusLabel string = "Enabled " expiryLabel string = "Expiry" - expiryDatesLabel string = "Date/Days " + lifecycleDatesLabel string = "Date/Days " tagLabel string = "Tags" transitionLabel string = "Transition" - transitionDateLabel string = "Date/Days " - storageClassLabel string = "Storage-Class " + storageClassLabel string = "Tier " + typeLabel string = "Type" + versionLabel string = "Version " + unknownLabel string = "Unknown " ) // Keys to be used in map structure which stores the columns to be displayed. const ( - statusLabelKey string = "Enabled" - storageClassLabelKey string = "Storage-Class" - expiryDatesLabelKey string = "Expiry-Dates" - transitionDatesLabelKey string = "Transition-Date" + statusLabelKey string = "Enabled" + storageClassLabelKey string = "Storage-Class" + ilmDatesLabelKey string = "ILM-Dates" ) // Some cell values @@ -143,10 +142,9 @@ colWidth[idLabel] = idColumnWidth colWidth[prefixLabel] = prefixColumnWidth colWidth[statusLabelKey] = statusColumnWidth - colWidth[expiryLabel] = expiryColumnWidth - colWidth[expiryDatesLabelKey] = expiryDatesColumnWidth - colWidth[transitionLabel] = transitionColumnWidth - colWidth[transitionDatesLabelKey] = transitionDateColumnWidth + colWidth[typeLabel] = typeColumnWidth + colWidth[versionLabel] = versionColumnWidth + colWidth[lifecycleDatesLabel] = ilmDatesColumnWidth colWidth[storageClassLabelKey] = storageClassColumnWidth colWidth[tagLabel] = tagsColumnWidth @@ -198,15 +196,6 @@ } } -// The right kind of tick is returned. Cross-tick if expiry is not set. -func getExpiryTick(rule lifecycle.Rule) string { - expiryTick := crossTickCell - if !rule.Expiration.IsNull() { - expiryTick = tickCell - } - return expiryTick -} - // The right kind of tick is returned. Cross-tick if status is 'Disabled' & tick if status is 'Enabled'. func getStatusTick(rule lifecycle.Rule) string { statusTick := crossTickCell @@ -217,43 +206,76 @@ } // Expiry date. 'YYYY-MM-DD'. Set for 00:00:00 GMT as per the standard. -func getExpiryDateVal(rule lifecycle.Rule) string { - expiryDate := blankCell +func getLifeCycleDateVal(rule lifecycle.Rule) string { + columnDate := blankCell + // For Expiration Type Rules if !rule.Expiration.IsDateNull() { - expiryDate = strconv.Itoa(rule.Expiration.Date.Day()) + " " + + columnDate = strconv.Itoa(rule.Expiration.Date.Day()) + " " + rule.Expiration.Date.Month().String()[0:3] + " " + strconv.Itoa(rule.Expiration.Date.Year()) } else if !rule.Expiration.IsDaysNull() { - expiryDate = strconv.Itoa(int(rule.Expiration.Days)) + " day(s)" + columnDate = strconv.Itoa(int(rule.Expiration.Days)) + " day(s)" } - return expiryDate -} -// Cross-tick if Transition is not set. -func getTransitionTick(rule lifecycle.Rule) string { - transitionSet := !rule.Transition.IsNull() - transitionDateSet := transitionSet && !rule.Transition.IsDateNull() - transitionDaysSet := transitionSet && !rule.Transition.IsDaysNull() - if !transitionSet && !transitionDateSet && !transitionDaysSet { - return crossTickCell + if !rule.Expiration.IsDateNull() { + columnDate = strconv.Itoa(rule.Expiration.Date.Day()) + " " + + rule.Expiration.Date.Month().String()[0:3] + " " + + strconv.Itoa(rule.Expiration.Date.Year()) + } else if !rule.Expiration.IsDaysNull() { + columnDate = strconv.Itoa(int(rule.Expiration.Days)) + " day(s)" } - return tickCell -} -// Transition date. 'YYYY-MM-DD'. Set for 00:00:00 GMT as per the standard. -func getTransitionDate(rule lifecycle.Rule) string { - transitionDate := blankCell - transitionSet := !rule.Transition.IsNull() - transitionDateSet := transitionSet && !rule.Transition.IsDateNull() - transitionDaySet := transitionSet && !rule.Transition.IsDaysNull() - if transitionDateSet { - transitionDate = strconv.Itoa(rule.Transition.Date.Day()) + " " + + if !rule.NoncurrentVersionExpiration.IsDaysNull() { + columnDate = strconv.Itoa(int(rule.NoncurrentVersionExpiration.NoncurrentDays)) + " day(s)" + } + + if !rule.Transition.IsDateNull() { + columnDate = strconv.Itoa(rule.Transition.Date.Day()) + " " + rule.Transition.Date.Month().String()[0:3] + " " + strconv.Itoa(rule.Transition.Date.Year()) - } else if transitionDaySet { - transitionDate = strconv.Itoa(int(rule.Transition.Days)) + " day(s)" + } else if !rule.Transition.IsDaysNull() { + columnDate = strconv.Itoa(int(rule.Transition.Days)) + " day(s)" + } + + if !rule.NoncurrentVersionTransition.IsDaysNull() { + columnDate = strconv.Itoa(int(rule.NoncurrentVersionTransition.NoncurrentDays)) + " day(s)" + } + + return columnDate +} + +// Returns whether the rule is Transition or Expiration +func getIlmRuleType(rule lifecycle.Rule) string { + if !rule.Transition.IsNull() { + return transitionLabel + } + if !rule.NoncurrentVersionTransition.IsDaysNull() { + return transitionLabel + } + if !rule.Expiration.IsNull() { + return expiryLabel + } + if !rule.NoncurrentVersionExpiration.IsDaysNull() { + return expiryLabel + } + return unknownLabel +} + +// Returns whether the rule is for current or non-current +func getTargetVersion(rule lifecycle.Rule) string { + if !rule.NoncurrentVersionTransition.IsDaysNull() { + return "Non-Current" } - return transitionDate + if !rule.Transition.IsNull() { + return "Current" + } + if !rule.NoncurrentVersionExpiration.IsDaysNull() { + return "Non-Current" + } + if !rule.Expiration.IsNull() { + return "Current" + } + return unknownLabel } // Storage class name for transition. @@ -330,19 +352,18 @@ checkAddTableCell(&((*cellInfo)[count]), rowCheck, tableCellInfo{label: rule.ID, labelKey: idLabel, columnWidth: idColumnWidth, align: leftAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getPrefixVal(rule), labelKey: prefixLabel, columnWidth: prefixColumnWidth, align: centerAlign}) + tableCellInfo{label: getIlmRuleType(rule), labelKey: typeLabel, columnWidth: typeColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getStatusTick(rule), labelKey: statusLabelKey, columnWidth: statusColumnWidth, align: centerAlign}) - checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getExpiryTick(rule), labelKey: expiryLabel, columnWidth: expiryColumnWidth, align: centerAlign}) + tableCellInfo{label: getTargetVersion(rule), labelKey: versionLabel, columnWidth: versionColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getExpiryDateVal(rule), labelKey: expiryDatesLabelKey, columnWidth: expiryDatesColumnWidth, align: centerAlign}) + tableCellInfo{label: getStorageClassName(rule), labelKey: storageClassLabelKey, columnWidth: storageClassColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getTransitionTick(rule), labelKey: transitionLabel, columnWidth: transitionColumnWidth, align: centerAlign}) + tableCellInfo{label: getLifeCycleDateVal(rule), labelKey: ilmDatesLabelKey, columnWidth: ilmDatesColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getTransitionDate(rule), labelKey: transitionDatesLabelKey, columnWidth: transitionDateColumnWidth, align: centerAlign}) + tableCellInfo{label: getPrefixVal(rule), labelKey: prefixLabel, columnWidth: prefixColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getStorageClassName(rule), labelKey: storageClassLabelKey, columnWidth: storageClassColumnWidth, align: centerAlign}) + tableCellInfo{label: getStatusTick(rule), labelKey: statusLabelKey, columnWidth: statusColumnWidth, align: centerAlign}) + checkAddTableCell(&((*cellInfo)[count]), rowCheck, tableCellInfo{label: blankCell, labelKey: tagLabel, columnWidth: tagsColumnWidth, align: centerAlign}) count++ @@ -372,19 +393,18 @@ checkAddTableCell(&((*cellInfo)[count]), rowCheck, tableCellInfo{label: rule.ID, labelKey: idLabel, columnWidth: idColumnWidth, align: leftAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getPrefixVal(rule), labelKey: prefixLabel, columnWidth: prefixColumnWidth, align: centerAlign}) + tableCellInfo{label: getIlmRuleType(rule), labelKey: typeLabel, columnWidth: versionColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getStatusTick(rule), labelKey: statusLabelKey, columnWidth: statusColumnWidth, align: centerAlign}) + tableCellInfo{label: getTargetVersion(rule), labelKey: versionLabel, columnWidth: typeColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getExpiryTick(rule), labelKey: expiryLabel, columnWidth: expiryColumnWidth, align: centerAlign}) - checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getExpiryDateVal(rule), labelKey: expiryDatesLabelKey, columnWidth: expiryDatesColumnWidth, align: centerAlign}) + tableCellInfo{label: getStorageClassName(rule), labelKey: storageClassLabelKey, columnWidth: storageClassColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getTransitionTick(rule), labelKey: transitionLabel, columnWidth: transitionColumnWidth, align: centerAlign}) + tableCellInfo{label: getLifeCycleDateVal(rule), labelKey: ilmDatesLabelKey, columnWidth: ilmDatesColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getTransitionDate(rule), labelKey: transitionDatesLabelKey, columnWidth: transitionDateColumnWidth, align: centerAlign}) + tableCellInfo{label: getPrefixVal(rule), labelKey: prefixLabel, columnWidth: prefixColumnWidth, align: centerAlign}) checkAddTableCell(&((*cellInfo)[count]), rowCheck, - tableCellInfo{label: getStorageClassName(rule), labelKey: storageClassLabelKey, columnWidth: storageClassColumnWidth, align: centerAlign}) + tableCellInfo{label: getStatusTick(rule), labelKey: statusLabelKey, columnWidth: statusColumnWidth, align: centerAlign}) + checkAddTableCellRows(&((*cellInfo)[count]), rowCheck, showOpts, tableCellInfo{multLabels: getTagArr(rule), label: "", labelKey: tagLabel, columnWidth: tagsColumnWidth, align: leftAlign}, rule.ID, newRows) @@ -405,7 +425,7 @@ return prefixVal } -func showExpiryDetails(rule lifecycle.Rule, showOpts showDetails) bool { +func showLifeCycleDetails(rule lifecycle.Rule, showOpts showDetails) bool { if showOpts.allAvailable { return true } @@ -414,23 +434,6 @@ return (expirySet && (showOpts.allAvailable || showOpts.expiry)) } -func showExpTick(showOpts showDetails) bool { - return showOpts.allAvailable -} - -func showTransitionTick(showOpts showDetails) bool { - return showOpts.allAvailable -} - -func showTransitionDetails(rule lifecycle.Rule, showOpts showDetails) bool { - if showOpts.allAvailable { - return true - } - transitionSet := !rule.Transition.IsNull() - transitionDetailsShow := (showOpts.allAvailable || showOpts.transition) - return transitionSet && transitionDetailsShow -} - func showTags(rule lifecycle.Rule, showOpts showDetails) bool { tagSet := showOpts.allAvailable || !rule.RuleFilter.And.IsEmpty() return tagSet @@ -457,6 +460,26 @@ rowCheck[idLabel] = colIdx (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(idLabel, centerAlign, colWidthTbl[idLabel])) } + _, ok = rowCheck[typeLabel] + if !ok { + rowCheck[typeLabel] = incColIdx() + (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(typeLabel, centerAlign, colWidthTbl[typeLabel])) + } + _, ok = rowCheck[versionLabel] + if !ok { + rowCheck[versionLabel] = incColIdx() + (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(versionLabel, centerAlign, colWidthTbl[versionLabel])) + } + _, ok = rowCheck[storageClassLabelKey] + if !ok { + rowCheck[storageClassLabelKey] = incColIdx() + (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(storageClassLabel, centerAlign, colWidthTbl[storageClassLabelKey])) + } + _, ok = rowCheck[ilmDatesLabelKey] + if !ok && showLifeCycleDetails(rule, showOpts) { + rowCheck[ilmDatesLabelKey] = incColIdx() + (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(lifecycleDatesLabel, centerAlign, colWidthTbl[ilmDatesLabelKey])) + } _, ok = rowCheck[prefixLabel] if !ok { // ID & Prefix are shown always. rowCheck[prefixLabel] = incColIdx() @@ -467,31 +490,6 @@ rowCheck[statusLabelKey] = incColIdx() (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(statusLabel, centerAlign, colWidthTbl[statusLabelKey])) } - _, ok = rowCheck[expiryLabel] - if !ok && showExpTick(showOpts) { - rowCheck[expiryLabel] = incColIdx() - (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(expiryLabel, centerAlign, colWidthTbl[expiryLabel])) - } - _, ok = rowCheck[expiryDatesLabelKey] - if !ok && showExpiryDetails(rule, showOpts) { - rowCheck[expiryDatesLabelKey] = incColIdx() - (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(expiryDatesLabel, centerAlign, colWidthTbl[expiryDatesLabelKey])) - } - _, ok = rowCheck[transitionLabel] - if !ok && showTransitionTick(showOpts) { - rowCheck[transitionLabel] = incColIdx() - (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(transitionLabel, centerAlign, colWidthTbl[transitionLabel])) - } - _, ok = rowCheck[transitionDatesLabelKey] - if !ok && showTransitionDetails(rule, showOpts) { - rowCheck[transitionDatesLabelKey] = incColIdx() - (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(transitionDateLabel, centerAlign, colWidthTbl[transitionDatesLabelKey])) - } - _, ok = rowCheck[storageClassLabelKey] - if !ok && showTransitionDetails(rule, showOpts) { - rowCheck[storageClassLabelKey] = incColIdx() - (*alignedHdrLabels) = append((*alignedHdrLabels), getAlignedText(storageClassLabel, centerAlign, colWidthTbl[storageClassLabelKey])) - } _, ok = rowCheck[tagLabel] if !ok && showTags(rule, showOpts) { rowCheck[tagLabel] = incColIdx() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220401T234448Z/cmd/mirror-main.go new/mc-20220407T214327Z/cmd/mirror-main.go --- old/mc-20220401T234448Z/cmd/mirror-main.go 2022-04-02 01:39:16.000000000 +0200 +++ new/mc-20220407T214327Z/cmd/mirror-main.go 2022-04-07 20:52:55.000000000 +0200 @@ -510,11 +510,13 @@ errDuringMirror = true } - if mj.opts.activeActive { + // Do not quit mirroring if we are in --watch or --active-active mode + if !mj.opts.activeActive && !mj.opts.isWatch { cancel() cancelInProgress = true - continue } + + continue } if sURLs.SourceContent != nil { @@ -522,8 +524,7 @@ } else if sURLs.TargetContent != nil { // Construct user facing message and path. targetPath := filepath.ToSlash(filepath.Join(sURLs.TargetAlias, sURLs.TargetContent.URL.Path)) - size := sURLs.TargetContent.Size - mj.status.PrintMsg(rmMessage{Key: targetPath, Size: size}) + mj.status.PrintMsg(rmMessage{Key: targetPath}) } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220401T234448Z/cmd/rm-main.go new/mc-20220407T214327Z/cmd/rm-main.go --- old/mc-20220401T234448Z/cmd/rm-main.go 2022-04-02 01:39:16.000000000 +0200 +++ new/mc-20220407T214327Z/cmd/rm-main.go 2022-04-07 20:52:55.000000000 +0200 @@ -167,12 +167,10 @@ // Structured message depending on the type of console. type rmMessage struct { - Status string `json:"status"` - Key string `json:"key"` - DeleteMarker bool `json:"deleteMarker"` - VersionID string `json:"versionID"` - ModTime time.Time `json:"modTime"` - Size int64 `json:"size"` + Status string `json:"status"` + Key string `json:"key"` + DeleteMarker bool `json:"deleteMarker"` + VersionID string `json:"versionID"` } // Colorized message for console printing. @@ -182,11 +180,7 @@ msg = console.Colorize("Remove", fmt.Sprintf("Creating delete marker `%s`", r.Key)) } if r.VersionID != "" { - if !r.ModTime.IsZero() { - msg += fmt.Sprintf(" (versionId=%s, modTime=%s)", r.VersionID, r.ModTime) - } else { - msg += fmt.Sprintf(" (versionId=%s)", r.VersionID) - } + msg += fmt.Sprintf(" (versionId=%s)", r.VersionID) } msg += "." return msg @@ -274,7 +268,6 @@ ignoreStatError bool isDir bool - size int64 modTime time.Time ) @@ -289,7 +282,6 @@ } } else { isDir = content.Type.IsDir() - size = content.Size modTime = content.Time } @@ -337,15 +329,15 @@ } return exitStatus(globalErrorExitStatus) } - if versionID == "" { - versionID = result.DeleteMarkerVersionID + msg := rmMessage{ + Key: path.Join(targetAlias, result.BucketName, result.ObjectName), + VersionID: result.ObjectVersionID, + } + if result.DeleteMarker { + msg.DeleteMarker = true + msg.VersionID = result.DeleteMarkerVersionID } - printMsg(rmMessage{ - Key: targetAlias + contentURL.Path, - Size: size, - VersionID: versionID, - DeleteMarker: result.DeleteMarker, - }) + printMsg(msg) } } return nil @@ -459,27 +451,34 @@ continue } - select { - case contentCh <- content: - case result := <-resultCh: - if result.Err != nil { - errorIf(result.Err.Trace(content.URL.Path), - "Failed to remove `"+content.URL.Path+"`.") - switch result.Err.ToGoError().(type) { - case PathInsufficientPermission: - // Ignore Permission error. - continue + sent := false + for !sent { + select { + case contentCh <- content: + sent = true + case result := <-resultCh: + path := path.Join(targetAlias, result.BucketName, result.ObjectName) + if result.Err != nil { + errorIf(result.Err.Trace(path), + "Failed to remove `"+path+"`.") + switch result.Err.ToGoError().(type) { + case PathInsufficientPermission: + // Ignore Permission error. + continue + } + close(contentCh) + return exitStatus(globalErrorExitStatus) + } + msg := rmMessage{ + Key: path, + VersionID: result.ObjectVersionID, } - close(contentCh) - return exitStatus(globalErrorExitStatus) + if result.DeleteMarker { + msg.DeleteMarker = true + msg.VersionID = result.DeleteMarkerVersionID + } + printMsg(msg) } - printMsg(rmMessage{ - Key: path.Join(targetAlias, content.BucketName, result.ObjectName), - Size: content.Size, - VersionID: content.VersionID, - DeleteMarker: result.DeleteMarker, - ModTime: content.Time, - }) } } perObjectVersions = []*ClientContent{} @@ -516,9 +515,10 @@ case contentCh <- content: sent = true case result := <-resultCh: + path := path.Join(targetAlias, result.BucketName, result.ObjectName) if result.Err != nil { - errorIf(result.Err.Trace(content.URL.Path), - "Failed to remove `"+content.URL.Path+"`.") + errorIf(result.Err.Trace(path), + "Failed to remove `"+path+"`.") switch result.Err.ToGoError().(type) { case PathInsufficientPermission: // Ignore Permission error. @@ -527,17 +527,15 @@ close(contentCh) return exitStatus(globalErrorExitStatus) } - versionID := content.VersionID - if content.VersionID == "" { - versionID = result.DeleteMarkerVersionID + msg := rmMessage{ + Key: path, + VersionID: result.ObjectVersionID, + } + if result.DeleteMarker { + msg.DeleteMarker = true + msg.VersionID = result.DeleteMarkerVersionID } - printMsg(rmMessage{ - Key: path.Join(targetAlias, content.BucketName, result.ObjectName), - Size: content.Size, - VersionID: versionID, - DeleteMarker: result.DeleteMarker, - ModTime: content.Time, - }) + printMsg(msg) } } } else { @@ -570,27 +568,34 @@ continue } - select { - case contentCh <- content: - case result := <-resultCh: - if result.Err != nil { - errorIf(result.Err.Trace(content.URL.Path), - "Failed to remove `"+content.URL.Path+"`.") - switch result.Err.ToGoError().(type) { - case PathInsufficientPermission: - // Ignore Permission error. - continue + sent := false + for !sent { + select { + case contentCh <- content: + sent = true + case result := <-resultCh: + path := path.Join(targetAlias, result.BucketName, result.ObjectName) + if result.Err != nil { + errorIf(result.Err.Trace(path), + "Failed to remove `"+path+"`.") + switch result.Err.ToGoError().(type) { + case PathInsufficientPermission: + // Ignore Permission error. + continue + } + close(contentCh) + return exitStatus(globalErrorExitStatus) + } + msg := rmMessage{ + Key: path, + VersionID: result.ObjectVersionID, } - close(contentCh) - return exitStatus(globalErrorExitStatus) + if result.DeleteMarker { + msg.DeleteMarker = true + msg.VersionID = result.DeleteMarkerVersionID + } + printMsg(msg) } - printMsg(rmMessage{ - Key: path.Join(targetAlias, result.BucketName, result.ObjectName), - Size: content.Size, - VersionID: content.VersionID, - DeleteMarker: result.DeleteMarker, - ModTime: content.Time, - }) } } } @@ -600,8 +605,9 @@ return nil } for result := range resultCh { + path := path.Join(targetAlias, result.BucketName, result.ObjectName) if result.Err != nil { - errorIf(result.Err.Trace(url), "Failed to remove `"+url+"` recursively.") + errorIf(result.Err.Trace(path), "Failed to remove `"+path+"` recursively.") switch result.Err.ToGoError().(type) { case PathInsufficientPermission: // Ignore Permission error. @@ -609,15 +615,15 @@ } return exitStatus(globalErrorExitStatus) } - versionID := result.ObjectVersionID - if versionID == "" { - versionID = result.DeleteMarkerVersionID - } - printMsg(rmMessage{ - Key: path.Join(targetAlias, result.BucketName, result.ObjectName), - VersionID: versionID, - DeleteMarker: result.DeleteMarker, - }) + msg := rmMessage{ + Key: path, + VersionID: result.ObjectVersionID, + } + if result.DeleteMarker { + msg.DeleteMarker = true + msg.VersionID = result.DeleteMarkerVersionID + } + printMsg(msg) } if !atLeastOneObjectFound { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220401T234448Z/cmd/support-diag.go new/mc-20220407T214327Z/cmd/support-diag.go --- old/mc-20220401T234448Z/cmd/support-diag.go 2022-04-02 01:39:16.000000000 +0200 +++ new/mc-20220407T214327Z/cmd/support-diag.go 2022-04-07 20:52:55.000000000 +0200 @@ -47,7 +47,7 @@ var supportDiagFlags = append([]cli.Flag{ HealthDataTypeFlag{ Name: "test", - Usage: "choose specific diagnostics to run [" + fullOptions.String() + "]", + Usage: "choose specific diagnostics to run [" + options.String() + "]", Value: nil, Hidden: true, }, @@ -62,11 +62,6 @@ Usage: "SUBNET license key", Hidden: true, // deprecated dec 2021 }, - cli.BoolFlag{ - Name: "full", - Usage: "include long running diagnostics (takes longer to generate the report)", - Hidden: false, - }, }, subnetCommonFlags...) var supportDiagCmd = cli.Command{ @@ -344,12 +339,7 @@ func fetchServerDiagInfo(ctx *cli.Context, client *madmin.AdminClient) (interface{}, string, error) { opts := GetHealthDataTypeSlice(ctx, "test") if len(*opts) == 0 { - full := ctx.Bool("full") - if full { - opts = &fullOptions - } else { - opts = &liteOptions - } + opts = &options } optsMap := make(map[madmin.HealthDataType]struct{}) @@ -439,21 +429,32 @@ config := spinner("Server Config", madmin.HealthDataTypeMinioConfig) drive := spinner("Drive Test", madmin.HealthDataTypePerfDrive) net := spinner("Network Test", madmin.HealthDataTypePerfNet) + obj := spinner("Objects Test", madmin.HealthDataTypePerfObj) syserr := spinner("System Errors", madmin.HealthDataTypeSysErrors) syssrv := spinner("System Services", madmin.HealthDataTypeSysServices) sysconfig := spinner("System Config", madmin.HealthDataTypeSysConfig) progressV0 := func(info madmin.HealthInfoV0) { - noOfServers := len(info.Sys.CPUInfo) _ = admin(len(info.Minio.Info.Servers) > 0) && cpu(len(info.Sys.CPUInfo) > 0) && diskHw(len(info.Sys.DiskHwInfo) > 0) && osInfo(len(info.Sys.OsInfo) > 0) && mem(len(info.Sys.MemInfo) > 0) && process(len(info.Sys.ProcInfo) > 0) && - config(info.Minio.Config != nil) && - drive(len(info.Perf.DriveInfo) > 0) && - net(noOfServers == 1 || (len(info.Perf.Net) > 1 && len(info.Perf.NetParallel.Addr) > 0)) + config(info.Minio.Config != nil) + } + + progressV2 := func(info madmin.HealthInfoV2) { + _ = cpu(len(info.Sys.CPUInfo) > 0) && + diskHw(len(info.Sys.Partitions) > 0) && + osInfo(len(info.Sys.OSInfo) > 0) && + mem(len(info.Sys.MemInfo) > 0) && + process(len(info.Sys.ProcInfo) > 0) && + config(info.Minio.Config.Config != nil) && + syserr(len(info.Sys.SysErrs) > 0) && + syssrv(len(info.Sys.SysServices) > 0) && + sysconfig(len(info.Sys.SysConfig) > 0) && + admin(len(info.Minio.Info.Servers) > 0) } progress := func(info madmin.HealthInfo) { @@ -464,8 +465,9 @@ mem(len(info.Sys.MemInfo) > 0) && process(len(info.Sys.ProcInfo) > 0) && config(info.Minio.Config.Config != nil) && - drive(len(info.Perf.Drives) > 0) && - net(noOfServers == 1 || (len(info.Perf.Net) > 1 && len(info.Perf.NetParallel.Addr) > 0)) && + drive(len(info.Perf.DrivePerf) > 0) && + obj(len(info.Perf.ObjPerf) > 0) && + net(noOfServers == 1 || len(info.Perf.NetPerf) > 0) && syserr(len(info.Sys.SysErrs) > 0) && syssrv(len(info.Sys.SysServices) > 0) && sysconfig(len(info.Sys.SysConfig) > 0) && @@ -509,7 +511,20 @@ healthInfo = MapHealthInfoToV1(info, nil) version = madmin.HealthInfoVersion1 + case madmin.HealthInfoVersion2: + info := madmin.HealthInfoV2{} + for { + if err = decoder.Decode(&info); err != nil { + if errors.Is(err, io.EOF) { + err = nil + } + + break + } + progressV2(info) + } + healthInfo = info case madmin.HealthInfoVersion: info := madmin.HealthInfo{} for { @@ -540,7 +555,7 @@ if obdData, ok := madmin.HealthDataTypesMap[strings.Trim(v, " ")]; ok { *d = append(*d, obdData) } else { - return fmt.Errorf("valid options include %s", fullOptions.String()) + return fmt.Errorf("valid options include %s", options.String()) } } return nil @@ -642,7 +657,4 @@ return nil } -var ( - liteOptions = HealthDataTypeSlice(madmin.HealthDataTypesLite) - fullOptions = HealthDataTypeSlice(madmin.HealthDataTypesList) -) +var options = HealthDataTypeSlice(madmin.HealthDataTypesList) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220401T234448Z/cmd/utils.go new/mc-20220407T214327Z/cmd/utils.go --- old/mc-20220401T234448Z/cmd/utils.go 2022-04-02 01:39:16.000000000 +0200 +++ new/mc-20220407T214327Z/cmd/utils.go 2022-04-07 20:52:55.000000000 +0200 @@ -24,7 +24,6 @@ "fmt" "math" "math/rand" - "net" "net/http" "os" "path/filepath" @@ -407,23 +406,6 @@ return attribute, nil } -// Returns true if "s3" is entirely in sub-domain and false otherwise. -// true for s3.amazonaws.com, false for ams3.digitaloceanspaces.com, 192.168.1.12 -func matchS3InHost(urlHost string) bool { - if strings.Contains(urlHost, ":") { - if host, _, err := net.SplitHostPort(urlHost); err == nil { - urlHost = host - } - } - fqdnParts := strings.Split(urlHost, ".") - for _, fqdn := range fqdnParts { - if fqdn == "s3" { - return true - } - } - return false -} - const ansi = "[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))" var reAnsi = regexp.MustCompile(ansi) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220401T234448Z/go.mod new/mc-20220407T214327Z/go.mod --- old/mc-20220401T234448Z/go.mod 2022-04-02 01:39:16.000000000 +0200 +++ new/mc-20220407T214327Z/go.mod 2022-04-07 20:52:55.000000000 +0200 @@ -20,7 +20,7 @@ github.com/minio/cli v1.22.0 github.com/minio/colorjson v1.0.1 github.com/minio/filepath v1.0.0 - github.com/minio/madmin-go v1.3.5 + github.com/minio/madmin-go v1.3.8 github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/minio-go/v7 v7.0.23 github.com/minio/pkg v1.1.14 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mc-20220401T234448Z/go.sum new/mc-20220407T214327Z/go.sum --- old/mc-20220401T234448Z/go.sum 2022-04-02 01:39:16.000000000 +0200 +++ new/mc-20220407T214327Z/go.sum 2022-04-07 20:52:55.000000000 +0200 @@ -294,8 +294,8 @@ github.com/minio/colorjson v1.0.1/go.mod h1:oPM3zQQY8Gz9NGtgvuBEjQ+gPZLKAGc7T+kjMlwtOgs= 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.3.5 h1:YbDc4Q1oAjeGCss1u4j29kVgwJDLzoohgIGebAaLBXc= -github.com/minio/madmin-go v1.3.5/go.mod h1:vGKGboQgGIWx4DuDUaXixjlIEZOCIp6ivJkQoiVaACc= +github.com/minio/madmin-go v1.3.8 h1:sL0vTRKoGi0bjAKa2f4+RsM4eFdH+uKQCe7k4E2tyjk= +github.com/minio/madmin-go v1.3.8/go.mod h1:vGKGboQgGIWx4DuDUaXixjlIEZOCIp6ivJkQoiVaACc= github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= 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= ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/minio-client/vendor.tar.gz /work/SRC/openSUSE:Factory/.minio-client.new.1941/vendor.tar.gz differ: char 5, line 1
