From d1fca7e98786d385264b2e880d41703cc2caf94b Mon Sep 17 00:00:00 2001 From: yusing Date: Sat, 31 Jan 2026 18:56:16 +0800 Subject: [PATCH] feat(route): add YAML anchor exclusion reason Add ExcludedReasonYAMLAnchor to explicitly identify routes with "x-" prefix used for YAML anchors and references. These routes are removed before validation. --- internal/route/route.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/route/route.go b/internal/route/route.go index 3059483e..3a472eae 100644 --- a/internal/route/route.go +++ b/internal/route/route.go @@ -749,6 +749,7 @@ const ( ExcludedReasonNoPortSpecified ExcludedReasonBlacklisted ExcludedReasonBuildx + ExcludedReasonYAMLAnchor ExcludedReasonOld ) @@ -768,6 +769,8 @@ func (re ExcludedReason) String() string { return "Blacklisted (backend service or database)" case ExcludedReasonBuildx: return "Buildx" + case ExcludedReasonYAMLAnchor: + return "YAML anchor or reference" case ExcludedReasonOld: return "Container renaming intermediate state" default: @@ -802,6 +805,12 @@ func (r *Route) findExcludedReason() ExcludedReason { } else if r.IsZeroPort() && r.Scheme != route.SchemeFileServer { return ExcludedReasonNoPortSpecified } + // this should happen on validation API only, + // those routes are removed before validation. + // see removeXPrefix in provider/file.go + if strings.HasPrefix(r.Alias, "x-") { // for YAML anchors and references + return ExcludedReasonYAMLAnchor + } if strings.HasSuffix(r.Alias, "-old") { return ExcludedReasonOld }