Move CRD-to-apiMapping extraction into importyaml.nix and helm.nix where
raw objects are available before module evaluation, breaking the infinite
recursion cycle that occurred when kubernetes.nix read CRD data from
config.kubernetes.objects (which triggered submodule evaluation that
depended on apiMappings).
Drop the apiVersions default in helm.nix that referenced apiMappings,
since it created a dependency from helm objects back to apiMappings.
Users can still pass a hardcoded list if a chart needs it.
Use same style as importyaml.
Only override namespace on namespaced resources
We need to handle the namespace case specifically since it's part of
the attribute path for resources and can't rely on the "overrides"
functionality for this since it relies on the module system to to the
merging and we don't have the resources as part of the module system
when deciding the attrkey
This converts lists where all elements have the name attributes into
attrsets where the name is inherited from the element. Except for a
special case (initContainers) where execution order is determined by
list order.
All other lists are converted into attrsets with an index as name so
that they're also easily overrideable. This is an optional setting that
takes the bad parts out of using imported manifests.
Users are still going to use nixpkgs default for fetching. That's fine
unless we want to change the module API to include all parameters for
chart fetching, which would gain nothing.