kudobuilder / kudo

Kubernetes Universal Declarative Operator (KUDO)
https://kudo.dev
Apache License 2.0
1.18k stars 103 forks source link

Package resolvers now only returns resolved resources #1724

Closed zen-dog closed 4 years ago

zen-dog commented 4 years ago

Summary: Package resolver interface used to return package.Package containing the underlying package files and the converted resources:

type Package struct {
    // transformed server view
    Resources *Resources
    // working with local package files
    Files *Files
}

The original assumption was that the files are always present. However, in some cases e.g. InClusterResolver all the resources are already installed in the cluster and there are no files that lead to some hacky workaround. Turns out, that files are not needed as most callers needed the resolved resources anyway. This refactoring removes this entanglement and allows for better integration of already installed operators e.g. one could list parameters of the installed zookeeper operator with: kudo package list parameters zookeeper --in-cluster (not yet implemented).

Signed-off-by: Aleksey Dukhovniy alex.dukhovniy@googlemail.com