Summary
The --modules-path-suffix flag (default /modules) is documented as controlling where modules are located in the source registry, but changing it has no effect on either d8 mirror pull or d8 mirror push. The module repository segment is effectively hardcoded to modules.
Details
Pull. The only code that reads params.ModulesPathSuffix is Puller.validateModulesAccess in internal/mirror/cmd/pull/pull.go, and that method is never invoked in production — the only caller is internal/mirror/cmd/pull/pull_test.go. The modules service builds every reference from a hardcoded segment:
internal/mirror/modules/modules.go — filepath.Join(svc.rootURL, "modules", moduleName) and svc.rootURL + "/modules/" + ...
pkg/registry/service/service.go — moduleSegment = "modules", NewModulesService(base.WithSegment(moduleSegment), ...)
Push. ModulesPathSuffix is stored into params (internal/mirror/cmd/push/push.go) but never read. The push segment is derived from the layout directory / the fixed internal.ModulesSegment (internal/mirror/push.go, pushSingleLayout).
Impact
A user who points --modules-path-suffix at a non-default value is silently ignored; mirroring always targets the default modules segment. The default value happens to work only because it equals the hardcoded segment.
Expected
Either make the flag actually change the module path, or remove it and document that the module segment is fixed.
As of main (62132d6).
Summary
The
--modules-path-suffixflag (default/modules) is documented as controlling where modules are located in the source registry, but changing it has no effect on eitherd8 mirror pullord8 mirror push. The module repository segment is effectively hardcoded tomodules.Details
Pull. The only code that reads
params.ModulesPathSuffixisPuller.validateModulesAccessininternal/mirror/cmd/pull/pull.go, and that method is never invoked in production — the only caller isinternal/mirror/cmd/pull/pull_test.go. The modules service builds every reference from a hardcoded segment:internal/mirror/modules/modules.go—filepath.Join(svc.rootURL, "modules", moduleName)andsvc.rootURL + "/modules/" + ...pkg/registry/service/service.go—moduleSegment = "modules",NewModulesService(base.WithSegment(moduleSegment), ...)Push.
ModulesPathSuffixis stored into params (internal/mirror/cmd/push/push.go) but never read. The push segment is derived from the layout directory / the fixedinternal.ModulesSegment(internal/mirror/push.go,pushSingleLayout).Impact
A user who points
--modules-path-suffixat a non-default value is silently ignored; mirroring always targets the defaultmodulessegment. The default value happens to work only because it equals the hardcoded segment.Expected
Either make the flag actually change the module path, or remove it and document that the module segment is fixed.
As of
main(62132d6).