mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 00:03:29 +03:00
c46b16ec62
The transitional references land in one commit, because they are only correct together: the repository is pgsty/silo, its default branch is main, and nothing in the tree should point a user at the old names. Changed: - Workflow branch filters. go.yml and vulncheck.yml gated on `branches: master` for both push and pull_request, so renaming the default branch would have taken automatic CI offline with no error and no signal - the workflows would simply never trigger again. They now name main. - Release target. goreleaser's `release.github.name` becomes silo, which is what actually decides where a tagged build publishes. sign-release-rpms.sh's GH_REPO default follows. - The OCI `image.source` label, the Helm chart `sources` entry, the security advisory link in the issue-template config, and the go.mod comment citing the LDAP TLS fix. - 115 occurrences across README, README_ZH, SECURITY, CONTRIBUTING and 30 docs pages, including 72 links that also carried the master branch in their path. Those matter most: GitHub redirects clone, fetch, push and web URLs after a rename, but raw.githubusercontent.com does not, and neither follows a branch rename - every one of those links would 404 twice over. - Three error strings in cmd/erasure-sets.go, cmd/storage-errors.go and internal/config/errors.go that print an issue URL to operators. These are Go string literals inside rebrand-guard's brand allowlist, so the baseline is regenerated. The regeneration removes exactly those three entries and adds none; all twelve other protected sets, including the 9014 exported symbols, are byte-identical. - The transitional-naming disclaimers in README, README_ZH, SECURITY and CONTRIBUTING are dropped, since they no longer describe anything. Deliberately unchanged, all three because they exist to reject or freeze the old name rather than to point at it: - buildscripts/minio-upgrade.sh pins pgsty/minio@sha256:b6bfe72... - the frozen pre-rebrand image is the control group for the MinIO-to-Silo upgrade test. - helm-migration-guard rejects any rendered container still pulling pgsty/minio. - verify-rebrand.sh rejects the same in the delivery surfaces. Also unchanged: docs/config/README.md links to pgsty/mc/blob/master, and that repository's default branch really is still master. It moves when mc does. verify-rebrand.sh gains three assertions so this cannot silently regress: no source reference may name pgsty/minio outside the three allowlisted guards, no link may target pgsty/silo's master branch, and go.yml and vulncheck.yml must filter on main. Both new rejections were negative-tested - reintroducing a master branch filter and adding a pgsty/minio URL each fail the gate with the specific message. This commit assumes the rename actually happens. Until the GitHub branch and repository renames are executed, the links it introduces do not resolve. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
188 lines
6.4 KiB
Go
188 lines
6.4 KiB
Go
// Copyright (c) 2015-2023 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 (
|
|
"context"
|
|
"errors"
|
|
)
|
|
|
|
// errMaxVersionsExceeded return error beyond 10000 (default) versions per object
|
|
var errMaxVersionsExceeded = StorageErr("maximum versions exceeded, please delete few versions to proceed")
|
|
|
|
// errUnexpected - unexpected error, requires manual intervention.
|
|
var errUnexpected = StorageErr("unexpected error, please report this issue at https://github.com/pgsty/silo/issues")
|
|
|
|
// errCorruptedFormat - corrupted format.
|
|
var errCorruptedFormat = StorageErr("corrupted format")
|
|
|
|
// errCorruptedBackend - corrupted backend.
|
|
var errCorruptedBackend = StorageErr("corrupted backend")
|
|
|
|
// errUnformattedDisk - unformatted disk found.
|
|
var errUnformattedDisk = StorageErr("unformatted drive found")
|
|
|
|
// errInconsistentDisk - inconsistent disk found.
|
|
var errInconsistentDisk = StorageErr("inconsistent drive found")
|
|
|
|
// errUnsupporteDisk - when disk does not support O_DIRECT flag.
|
|
var errUnsupportedDisk = StorageErr("drive does not support O_DIRECT")
|
|
|
|
// errDiskFull - cannot create volume or files when disk is full.
|
|
var errDiskFull = StorageErr("drive path full")
|
|
|
|
// errDiskNotDir - cannot use storage disk if its not a directory
|
|
var errDiskNotDir = StorageErr("drive is not directory or mountpoint")
|
|
|
|
// errDiskNotFound - cannot find the underlying configured disk anymore.
|
|
var errDiskNotFound = StorageErr("drive not found")
|
|
|
|
// errDiskOngoingReq - indicates if the disk has an on-going request in progress.
|
|
var errDiskOngoingReq = StorageErr("drive still did not complete the request")
|
|
|
|
// errDriveIsRoot - cannot use the disk since its a root disk.
|
|
var errDriveIsRoot = StorageErr("drive is part of root drive, will not be used")
|
|
|
|
// errFaultyRemoteDisk - remote disk is faulty.
|
|
var errFaultyRemoteDisk = StorageErr("remote drive is faulty")
|
|
|
|
// errFaultyDisk - disk is faulty.
|
|
var errFaultyDisk = StorageErr("drive is faulty")
|
|
|
|
// errDiskAccessDenied - we don't have write permissions on disk.
|
|
var errDiskAccessDenied = StorageErr("drive access denied")
|
|
|
|
// errFileNotFound - cannot find the file.
|
|
var errFileNotFound = StorageErr("file not found")
|
|
|
|
// errFileNotFound - cannot find requested file version.
|
|
var errFileVersionNotFound = StorageErr("file version not found")
|
|
|
|
// errTooManyOpenFiles - too many open files.
|
|
var errTooManyOpenFiles = StorageErr("too many open files, please increase 'ulimit -n'")
|
|
|
|
// errFileNameTooLong - given file name is too long than supported length.
|
|
var errFileNameTooLong = StorageErr("file name too long")
|
|
|
|
// errVolumeExists - cannot create same volume again.
|
|
var errVolumeExists = StorageErr("volume already exists")
|
|
|
|
// errIsNotRegular - not of regular file type.
|
|
var errIsNotRegular = StorageErr("not of regular file type")
|
|
|
|
// errPathNotFound - cannot find the path.
|
|
var errPathNotFound = StorageErr("path not found")
|
|
|
|
// errVolumeNotFound - cannot find the volume.
|
|
var errVolumeNotFound = StorageErr("volume not found")
|
|
|
|
// errVolumeNotEmpty - volume not empty.
|
|
var errVolumeNotEmpty = StorageErr("volume is not empty")
|
|
|
|
// errVolumeAccessDenied - cannot access volume, insufficient permissions.
|
|
var errVolumeAccessDenied = StorageErr("volume access denied")
|
|
|
|
// errFileAccessDenied - cannot access file, insufficient permissions.
|
|
var errFileAccessDenied = StorageErr("file access denied")
|
|
|
|
// errFileCorrupt - file has an unexpected size, or is not readable
|
|
var errFileCorrupt = StorageErr("file is corrupted")
|
|
|
|
// errBitrotHashAlgoInvalid - the algo for bit-rot hash
|
|
// verification is empty or invalid.
|
|
var errBitrotHashAlgoInvalid = StorageErr("bit-rot hash algorithm is invalid")
|
|
|
|
// errCrossDeviceLink - rename across devices not allowed.
|
|
var errCrossDeviceLink = StorageErr("Rename across devices not allowed, please fix your backend configuration")
|
|
|
|
// errLessData - returned when less data available than what was requested.
|
|
var errLessData = StorageErr("less data available than what was requested")
|
|
|
|
// errMoreData = returned when more data was sent by the caller than what it was supposed to.
|
|
var errMoreData = StorageErr("more data was sent than what was advertised")
|
|
|
|
// indicates readDirFn to return without further applying the fn()
|
|
var errDoneForNow = errors.New("done for now")
|
|
|
|
// errSkipFile returned by the fn() for readDirFn() when it needs
|
|
// to proceed to next entry.
|
|
var errSkipFile = errors.New("skip this file")
|
|
|
|
var errIgnoreFileContrib = errors.New("ignore this file's contribution toward data-usage")
|
|
|
|
// errXLBackend XL drive mode requires fresh deployment.
|
|
var errXLBackend = errors.New("XL backend requires fresh drive")
|
|
|
|
// StorageErr represents error generated by xlStorage call.
|
|
type StorageErr string
|
|
|
|
func (h StorageErr) Error() string {
|
|
return string(h)
|
|
}
|
|
|
|
// Collection of basic errors.
|
|
var baseErrs = []error{
|
|
errDiskNotFound,
|
|
errFaultyDisk,
|
|
errFaultyRemoteDisk,
|
|
}
|
|
|
|
var baseIgnoredErrs = baseErrs
|
|
|
|
// Is a one place function which converts all os.PathError
|
|
// into a more FS object layer friendly form, converts
|
|
// known errors into their typed form for top level
|
|
// interpretation.
|
|
func osErrToFileErr(err error) error {
|
|
if err == nil {
|
|
return nil
|
|
}
|
|
if osIsNotExist(err) {
|
|
return errFileNotFound
|
|
}
|
|
if osIsPermission(err) {
|
|
return errFileAccessDenied
|
|
}
|
|
if isSysErrNotDir(err) || isSysErrIsDir(err) {
|
|
return errFileNotFound
|
|
}
|
|
if isSysErrPathNotFound(err) {
|
|
return errFileNotFound
|
|
}
|
|
if isSysErrTooManyFiles(err) {
|
|
return errTooManyOpenFiles
|
|
}
|
|
if isSysErrHandleInvalid(err) {
|
|
return errFileNotFound
|
|
}
|
|
if isSysErrIO(err) {
|
|
return errFaultyDisk
|
|
}
|
|
if isSysErrInvalidArg(err) {
|
|
storageLogIf(context.Background(), err)
|
|
// For some odd calls with O_DIRECT reads
|
|
// filesystems can return EINVAL, handle
|
|
// these as FileNotFound instead.
|
|
return errFileNotFound
|
|
}
|
|
if isSysErrNoSpace(err) {
|
|
return errDiskFull
|
|
}
|
|
return err
|
|
}
|