this will couple future versions of the definition language to v1.SecretRefs
no clear structural differentiation between the user-accessible definition language and the resolved definition structs
pkg/definition/v1 contains structs describing the definitions possible end states, as well as some of the initial (pre-resolution) states, but not all of the initial states, as well as no way to determine what is initial state vs end state
pkg/definition/v1 contains the Reference type, but a Reference can't exist after resolution
pkg/definition/v1 only contains a SecretRef type, but a user cannot create a SecretRef, only a $secret
in addition to it just being confusing, it also eliminates some of the utility in e.g. automatically generating docs
should pkg/definition/resolver and pkg/definition/component be merged?
resolution info was hastily put together
I do think the general idea of ResolveReference returning a *ResolutionResult is a good idea, however it should probably be re-examined and probably expanded
*ResolutionResult could probably be expanded to contain more information about how exactly different values were derived (e.g. the value of components[0].exec.env['foo'] came from parameter bar).
similarly, a lot more information could be returned about parsing errors, etc
pkg/definition
currently has a number of design shortcomings, among them:v1.Reference
toresolver.ComponentResolver
v1.Reference
sv1.SecretRef
to$secret
$secret
, we transform it into a *pkg/definition/v1.SecretRef: https://github.com/mlab-lattice/lattice/blob/662e7d9b76c48886fc6d9a361ae229f04da42ee0/pkg/definition/template/template.go#L113-L141v1.SecretRef
spkg/definition/v1
contains structs describing the definitions possible end states, as well as some of the initial (pre-resolution) states, but not all of the initial states, as well as no way to determine what is initial state vs end statepkg/definition/v1
contains theReference
type, but aReference
can't exist after resolutionpkg/definition/v1
only contains aSecretRef
type, but a user cannot create aSecretRef
, only a$secret
pkg/definition/resolver
andpkg/definition/component
be merged?*ResolutionResult
is a good idea, however it should probably be re-examined and probably expandedResolutionNodeInfo
has json annotations: https://github.com/mlab-lattice/lattice/blob/662e7d9b76c48886fc6d9a361ae229f04da42ee0/pkg/definition/resolver/component_resolver.go#L41-L44 solely because we know that we serialize it later in a k8s custom resource. this is pretty leaky*ResolutionResult
could probably be expanded to contain more information about how exactly different values were derived (e.g. the value ofcomponents[0].exec.env['foo']
came from parameterbar
).