mirror of
https://github.com/hanzoai/volume.git
synced 2026-10-01 00:48:00 +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.
38 lines
953 B
Go
38 lines
953 B
Go
package dns
|
|
|
|
//go:generate go run duplicate_generate.go
|
|
|
|
// IsDuplicate checks of r1 and r2 are duplicates of each other, excluding the TTL.
|
|
// So this means the header data is equal *and* the RDATA is the same. Returns true
|
|
// if so, otherwise false. It's a protocol violation to have identical RRs in a message.
|
|
func IsDuplicate(r1, r2 RR) bool {
|
|
// Check whether the record header is identical.
|
|
if !r1.Header().isDuplicate(r2.Header()) {
|
|
return false
|
|
}
|
|
|
|
// Check whether the RDATA is identical.
|
|
return r1.isDuplicate(r2)
|
|
}
|
|
|
|
func (r1 *RR_Header) isDuplicate(_r2 RR) bool {
|
|
r2, ok := _r2.(*RR_Header)
|
|
if !ok {
|
|
return false
|
|
}
|
|
if r1.Class != r2.Class {
|
|
return false
|
|
}
|
|
if r1.Rrtype != r2.Rrtype {
|
|
return false
|
|
}
|
|
if !isDuplicateName(r1.Name, r2.Name) {
|
|
return false
|
|
}
|
|
// ignore TTL
|
|
return true
|
|
}
|
|
|
|
// isDuplicateName checks if the domain names s1 and s2 are equal.
|
|
func isDuplicateName(s1, s2 string) bool { return equal(s1, s2) }
|