Skip to content

Reduce number of variable sources involved in resolution process #437

Closed
@m1kola

Description

@m1kola

Today we have variable sources which create other variable sources which create variables. While this gives us very short and simple units - it makes harder to follow and creates a lot of boilerplate (e.g. need for support of nested variable soruces).

For example OperatorVariableSource creates RequiredPackageVariableSource which creates RequiredPackageVariable:

rps, err := NewRequiredPackageVariableSource(
o.catalogClient,
operator.Spec.PackageName,
InVersionRange(operator.Spec.Version),
InChannel(operator.Spec.Channel),
)

return []deppy.Variable{
olmvariables.NewRequiredPackageVariable(r.packageName, resultSet),
}, nil

BundleDeploymentVariableSource creates InstalledPackageVariableSource which creates InstalledPackageVariable:

ips, err := NewInstalledPackageVariableSource(o.catalogClient, bundleDeployment.Spec.Template.Spec.Source.Image.Ref)

return []deppy.Variable{
variables.NewInstalledPackageVariable(installedBundle.Package, upgradeEdges),
}, nil

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions