namedunits: validate names with controlname, not release
release.ValidApp and release.ValidAccount only wrap controlname's. Using controlname directly drops internal/namedunits from the release-importers count (66 back to 65).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+2
−3
internal/namedunits/namedunits.go+2 −3
diff --git a/internal/namedunits/namedunits.go b/internal/namedunits/namedunits.go| index 6c4b2990c..6a31e399f 100644 |
| --- a/internal/namedunits/namedunits.go |
| +++ b/internal/namedunits/namedunits.go |
| @@ -15,7 +15,6 @@ import ( |
| "github.com/carlosframework/platform/internal/controlname" |
| "github.com/carlosframework/platform/internal/provision" |
| "github.com/carlosframework/platform/internal/registry" |
| - "github.com/carlosframework/platform/internal/release" |
| ) |
| // MaxBytes is the largest declaration file ValidateStrict accepts. |
| @@ -53,10 +52,10 @@ func Decode(raw []byte) ([]Entry, error) { |
| if !controlname.ValidHostShape(u.Host) { |
| return nil, fmt.Errorf("named units: host %q is not a valid host name", u.Host) |
| } |
| - if !release.ValidApp(u.App) { |
| + if !controlname.ValidApp(u.App) { |
| return nil, fmt.Errorf("named units: host %s: app %q is not valid", u.Host, u.App) |
| } |
| - if u.Account != "" && !release.ValidAccount(u.Account) { |
| + if u.Account != "" && !controlname.ValidAccount(u.Account) { |
| return nil, fmt.Errorf("named units: host %s: account %q is not valid", u.Host, u.Account) |
| } |
| } |