Skip to content

Commit 0b2a515

Browse files
author
Mikalai Radchuk
committed
Clean up the variable source code
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
1 parent 69a1999 commit 0b2a515

12 files changed

+0
-1496
lines changed

internal/resolution/variablesources/bundle.go

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package variablesources
22

33
import (
4-
"context"
54
"fmt"
65
"sort"
76

87
"k8s.io/apimachinery/pkg/util/sets"
98

109
"github.com/operator-framework/deppy/pkg/deppy"
11-
"github.com/operator-framework/deppy/pkg/deppy/input"
1210

1311
"github.com/operator-framework/operator-controller/internal/catalogmetadata"
1412
catalogfilter "github.com/operator-framework/operator-controller/internal/catalogmetadata/filter"
@@ -92,53 +90,3 @@ func filterBundleDependencies(allBundles []*catalogmetadata.Bundle, bundle *cata
9290

9391
return dependencies, nil
9492
}
95-
96-
type BundlesAndDepsVariableSource struct {
97-
catalogClient BundleProvider
98-
variableSources []input.VariableSource
99-
}
100-
101-
func NewBundlesAndDepsVariableSource(catalogClient BundleProvider, inputVariableSources ...input.VariableSource) *BundlesAndDepsVariableSource {
102-
return &BundlesAndDepsVariableSource{
103-
catalogClient: catalogClient,
104-
variableSources: inputVariableSources,
105-
}
106-
}
107-
108-
func (b *BundlesAndDepsVariableSource) GetVariables(ctx context.Context) ([]deppy.Variable, error) {
109-
variables := []deppy.Variable{}
110-
111-
for _, variableSource := range b.variableSources {
112-
inputVariables, err := variableSource.GetVariables(ctx)
113-
if err != nil {
114-
return nil, err
115-
}
116-
variables = append(variables, inputVariables...)
117-
}
118-
119-
allBundles, err := b.catalogClient.Bundles(ctx)
120-
if err != nil {
121-
return nil, err
122-
}
123-
124-
requiredPackages := []*olmvariables.RequiredPackageVariable{}
125-
installedPackages := []*olmvariables.InstalledPackageVariable{}
126-
for _, variable := range variables {
127-
switch v := variable.(type) {
128-
case *olmvariables.RequiredPackageVariable:
129-
requiredPackages = append(requiredPackages, v)
130-
case *olmvariables.InstalledPackageVariable:
131-
installedPackages = append(installedPackages, v)
132-
}
133-
}
134-
135-
bundles, err := MakeBundleVariables(allBundles, requiredPackages, installedPackages)
136-
if err != nil {
137-
return nil, err
138-
}
139-
140-
for _, v := range bundles {
141-
variables = append(variables, v)
142-
}
143-
return variables, nil
144-
}

internal/resolution/variablesources/bundle_deployment.go

Lines changed: 0 additions & 58 deletions
This file was deleted.

internal/resolution/variablesources/bundle_deployment_test.go

Lines changed: 0 additions & 146 deletions
This file was deleted.

internal/resolution/variablesources/bundle_provider.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)