99 "github.com/hashicorp/go-version"
1010 "github.com/openshift/assisted-service/internal/common"
1111 "github.com/openshift/assisted-service/internal/featuresupport"
12+ "github.com/openshift/assisted-service/internal/operators"
1213 "github.com/openshift/assisted-service/models"
1314 logutil "github.com/openshift/assisted-service/pkg/log"
1415 restoperators "github.com/openshift/assisted-service/restapi/operations/operators"
@@ -123,8 +124,22 @@ func (h *Handler) V2ListBundles(_ context.Context, params restoperators.V2ListBu
123124 featureIDs = append (featureIDs , models .FeatureSupportLevelID (featureID ))
124125 }
125126
126- // Get filtered bundles using featuresupport API
127- filteredBundles := h .operatorsAPI .ListBundles (filters , featureIDs )
127+ // Create GPU filter from nvidia/amd parameters
128+ var gpuFilter * operators.GPUFilter
129+ if params .NvidiaEnabled != nil || params .AmdEnabled != nil {
130+ gpuFilter = & operators.GPUFilter {
131+ NvidiaEnabled : params .NvidiaEnabled ,
132+ AmdEnabled : params .AmdEnabled ,
133+ }
134+ }
135+
136+ // Get filtered bundles using GPU filter
137+ var filteredBundles []* models.Bundle
138+ if gpuFilter != nil {
139+ filteredBundles = h .operatorsAPI .ListBundlesWithGPUFilter (filters , featureIDs , gpuFilter )
140+ } else {
141+ filteredBundles = h .operatorsAPI .ListBundles (filters , featureIDs )
142+ }
128143
129144 return restoperators .NewV2ListBundlesOK ().WithPayload (filteredBundles )
130145}
@@ -139,7 +154,23 @@ func (h *Handler) V2GetBundle(ctx context.Context, params restoperators.V2GetBun
139154 featureIDs = append (featureIDs , models .FeatureSupportLevelID (featureID ))
140155 }
141156
142- bundle , err := h .operatorsAPI .GetBundle (params .ID , featureIDs )
157+ // Create GPU filter from nvidia/amd parameters (same as V2ListBundles)
158+ var gpuFilter * operators.GPUFilter
159+ if params .NvidiaEnabled != nil || params .AmdEnabled != nil {
160+ gpuFilter = & operators.GPUFilter {
161+ NvidiaEnabled : params .NvidiaEnabled ,
162+ AmdEnabled : params .AmdEnabled ,
163+ }
164+ }
165+
166+ // Get bundle using GPU filter
167+ var bundle * models.Bundle
168+ var err error
169+ if gpuFilter != nil {
170+ bundle , err = h .operatorsAPI .GetBundleWithGPUFilter (params .ID , featureIDs , gpuFilter )
171+ } else {
172+ bundle , err = h .operatorsAPI .GetBundle (params .ID , featureIDs )
173+ }
143174 if err != nil {
144175 log .Errorf ("Failed to get operators for bundle %s: %v" , params .ID , err )
145176 return common .GenerateErrorResponder (err )
0 commit comments