Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KEP-29: Install dependencies of operators. #1554

Merged
merged 12 commits into from Jun 11, 2020
Merged

KEP-29: Install dependencies of operators. #1554

merged 12 commits into from Jun 11, 2020

Conversation

nfnt
Copy link
Member

@nfnt nfnt commented Jun 8, 2020

What this PR does / why we need it:
When installing an operator package using the KUDO CLI, operator dependencies can be provided as KudoOperator tasks. For each of these tasks, the respective package is resolved and its Operator and OperatorVersion installed on the cluster. Because dependent package can also have dependencies on packages, dependencies are resolved recursively. Cyclic dependencies are detected by modeling the dependencies as a directed graph and checking this graph for cycles when new dependencies are added.

Fixes part of #1514

Co-authored-by: Aleksey Dukhovniy adukhovniy@mesosphere.io

When installing an operator package using the KUDO CLI, operator dependencies can be provided as 'KudoOperator' tasks. For each of these tasks, the respective package is resolved and its Operator and OperatorVersion installed on the cluster. Because dependent package can also have dependencies on packages, dependencies are resolved recursively. Cyclic dependencies are detected by modeling the dependencies as a directed graph and checking this graph for cycles when new dependencies are added.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt changed the title Install dependencies of operators. KEP-29: Install dependencies of operators. Jun 9, 2020
Packages returned by 'gatherDependencies' only includes dependencies.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt marked this pull request as ready for review June 9, 2020 07:34
@nfnt nfnt requested a review from zen-dog June 9, 2020 07:35
func Package(
client *kudo.Client,
instanceName string,
namespace string,
resources packages.Resources,
parameters map[string]string,
resolver resolver.Resolver,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would work to rename some package so we get resolver dependencies.Resolver or resolver packages.Resolver?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, third time resolver is the charm! :D

Jan Schlicht and others added 9 commits June 9, 2020 10:54
Also renames some variables to make code more readable.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
Signed-off-by: Jan Schlicht <jan@d2iq.com>
Signed-off-by: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
by introducing a `FullyQualifiedName` method for the `OperatorVersion`

Signed-off-by: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
Signed-off-by: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
Signed-off-by: Jan Schlicht <jan@d2iq.com>
the cycle error now mentions both parent and child package that cause the cycle

Signed-off-by: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
Signed-off-by: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
Signed-off-by: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
Copy link
Contributor

@zen-dog zen-dog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 🚢

@nfnt nfnt merged commit 2b4e0dd into master Jun 11, 2020
@nfnt nfnt deleted the nfnt/deps-cli branch June 11, 2020 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants