You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raise an error when a component uses another component's name as library prefix
Until now, Commodore's component library name validation only checked
that each library is prefixed with the component's name. This isn't
sufficient in some cases: for example if we have components `foo` and
`foo-operator`, component foo was allowed to deploy a library
`foo-operator.libsonnet` which could cause non-deterministic symlinking
if component `foo-operator` also deployed the library
`foo-operator.libsonnet`.
This commit introduces an additional check in the component library name
validation which raises an error if a component deploys a library which
is prefixed with another component's name.
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/reference/concepts.adoc
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,9 @@ inventory to install the software.
57
57
Components can optionally provide Jsonnet libraries which can be used by other components.
58
58
To allow Commodore to make component libraries available to other components, they must be placed in directory `lib/`.
59
59
Components must ensure that all Jsonnet libraries which they provide are prefixed with the component name.
60
+
Additionally, components must ensure that their Jsonnet library names don't collide with other component names that are prefixed by the component's name.
60
61
For example, component `foo-bar` can only contain libraries whose file name starts with `foo-bar`, such as `foo-bar.libsonnet`, or `foo-bar-baz.libsonnet`.
62
+
However, note that the library name `foo-bar-baz.libsonnet` would be prohibited if component `foo-bar-baz` also exists.
61
63
Commodore allows components to advertise aliases for their component libraries.
62
64
Component library aliases are described in more detail in the xref:commodore:ROOT:reference/architecture.adoc#_component_template_libraries[architecture documentation].
0 commit comments