mirror of
https://github.com/hanzoai/volume.git
synced 2026-10-30 14:55:30 +00:00
A fork of Rancher's local-path-provisioner at v0.0.36. The behaviour is unchanged and deliberately so — a directory on the node a pod lands on is the right thing for a disk. What changes is identity. The provisioner answers to hanzo.ai/volume rather than rancher.io/local-path. That is not branding: two provisioners sharing one name race for the same claims, and a stock k3s carries the upstream one, so a cluster running both would settle our storage by chance. Data lives at /var/lib/hanzo/volume, so reading a Hanzo cluster does not mean learning another vendor's directory. Apache-2.0 as published, unaltered, with Rancher's attribution in NOTICE. The README says what this is not: durability. A volume here dies with its node. That is hanzoai/replicate's question, one layer up, and keeping the two apart is what lets the disk stay this simple.
39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package jsonpatch
|
|
|
|
import "fmt"
|
|
|
|
// AccumulatedCopySizeError is an error type returned when the accumulated size
|
|
// increase caused by copy operations in a patch operation has exceeded the
|
|
// limit.
|
|
type AccumulatedCopySizeError struct {
|
|
limit int64
|
|
accumulated int64
|
|
}
|
|
|
|
// NewAccumulatedCopySizeError returns an AccumulatedCopySizeError.
|
|
func NewAccumulatedCopySizeError(l, a int64) *AccumulatedCopySizeError {
|
|
return &AccumulatedCopySizeError{limit: l, accumulated: a}
|
|
}
|
|
|
|
// Error implements the error interface.
|
|
func (a *AccumulatedCopySizeError) Error() string {
|
|
return fmt.Sprintf("Unable to complete the copy, the accumulated size increase of copy is %d, exceeding the limit %d", a.accumulated, a.limit)
|
|
}
|
|
|
|
// ArraySizeError is an error type returned when the array size has exceeded
|
|
// the limit.
|
|
type ArraySizeError struct {
|
|
limit int
|
|
size int
|
|
}
|
|
|
|
// NewArraySizeError returns an ArraySizeError.
|
|
func NewArraySizeError(l, s int) *ArraySizeError {
|
|
return &ArraySizeError{limit: l, size: s}
|
|
}
|
|
|
|
// Error implements the error interface.
|
|
func (a *ArraySizeError) Error() string {
|
|
return fmt.Sprintf("Unable to create array of size %d, limit is %d", a.size, a.limit)
|
|
}
|