Local zones were only editable as mounted files, so operators could not manage DNS entries from the console. Add a Local zones editor backed by a shared Kubernetes ConfigMap, validate master files before saving, scope the pod service account to that ConfigMap, and reload changed zones on every replica while flushing stale cache entries.
This commit is contained in:
1 parent
2a7ac824f7
commit
32f940b763
18 files changed
+727
-36
No files matched your search
@@ -577,13 +577,20 @@ func ParseFiles(paths []string, originFor func(string) string) (*Zone, error) {
|
||||
return z, nil
|
||||
}
|
||||
|
||||
// OriginFromPath derives a zone origin from a file path: "rpz/ads.zone" and
|
||||
// "ads.zone" both become "ads.zone.".
|
||||
// OriginFromPath derives a zone origin from a file path. Legacy names such as
|
||||
// "rpz/ads.zone" and "ads.zone" become "ads."; UI-managed names use the
|
||||
// "zone--" marker so "zone--example.com.zone" becomes "example.com.".
|
||||
func OriginFromPath(p string) string {
|
||||
base := p
|
||||
if i := strings.LastIndexByte(base, '/'); i >= 0 {
|
||||
base = base[i+1:]
|
||||
}
|
||||
// The UI stores fully-qualified zone names with a marker so they do not
|
||||
// collide with the legacy filename convention where "local.example.zone"
|
||||
// means the "local." zone.
|
||||
if strings.HasPrefix(base, "zone--") && strings.HasSuffix(base, ".zone") {
|
||||
return ensureDot(strings.TrimSuffix(strings.TrimPrefix(base, "zone--"), ".zone"))
|
||||
}
|
||||
if i := strings.IndexByte(base, '.'); i > 0 {
|
||||
base = base[:i]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user