kudobuilder / kudo

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

Tarball packages can now contain local dependencies #1728

Closed zen-dog closed 3 years ago

zen-dog commented 3 years ago

Summary: Currently, KUDO allows local dependencies like package: ../child or ../child.tgz however, only if the parent operator is also in a local directory. This PR adds the possibility for a packaged operator (a tarball) to contain all the dependencies it needs. While, the preferred way is to keep the individual operators in the repo, sometimes a self-contained operator package (like an uber-jar) is more desirable e.g.:

To keep the packages backward-compatible, we continue to expect the parent operator at the top-level of the tarball, so that all the dependencies must share the same base path and be at least one level deeper e.g.:

.
└── child
│   └── operator.yaml
└── operator.yaml

A dependency operator (child above) is always relative to the parent operator.yaml which declares it. In this case, it should be referenced like:

  - name: child
    kind: KudoOperator
    spec:
      package: "./child"

See this commit for more information.

Fixes #1701

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

ANeumann82 commented 3 years ago

First iteration of review. Looks great so far, my concerns are mostly around naming, because "resolve" is getting super overloaded. Will do another iteration to verify that combinations of tarball, directory and URL dependencies work as expected. I think they do, just need to double-check.

Thanks :) This was handed over from zen-dog, and I'm not sure it's already ready for review, he said that it needs polishing. Thanks for the comments, i'll make a pass now

zen-dog commented 3 years ago

@nfnt would you have time to look at this PR again? I believe most of your concerns were addressed.

zen-dog commented 3 years ago

Don't forget to put yourself as co-author @ANeumann82 😉