|
1 | 1 | package variablesources
|
2 | 2 |
|
3 | 3 | import (
|
4 |
| - "context" |
5 | 4 | "fmt"
|
6 | 5 | "sort"
|
7 | 6 |
|
8 | 7 | "k8s.io/apimachinery/pkg/util/sets"
|
9 | 8 |
|
10 | 9 | "github.com/operator-framework/deppy/pkg/deppy"
|
11 |
| - "github.com/operator-framework/deppy/pkg/deppy/input" |
12 | 10 |
|
13 | 11 | "github.com/operator-framework/operator-controller/internal/catalogmetadata"
|
14 | 12 | catalogfilter "github.com/operator-framework/operator-controller/internal/catalogmetadata/filter"
|
@@ -92,53 +90,3 @@ func filterBundleDependencies(allBundles []*catalogmetadata.Bundle, bundle *cata
|
92 | 90 |
|
93 | 91 | return dependencies, nil
|
94 | 92 | }
|
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 |
| -} |
0 commit comments