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

Fixed Solver without selector (#3) #113

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apis/advertisement/v1alpha1/discovery_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type DiscoverySpec struct {

// This is the FlavourSelector that describes the characteristics of the intent that the solver is looking to satisfy
// This pattern corresponds to what has been defined in the REAR Protocol to do a discovery with a selector
Selector *nodecorev1alpha1.Selector `json:"selector"`
Selector *nodecorev1alpha1.Selector `json:"selector,omitempty"`

// This flag indicates that needs to be established a subscription to the provider in case a match is found.
// In order to have periodic updates of the status of the matching Flavor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ spec:
In order to have periodic updates of the status of the matching Flavor
type: boolean
required:
- selector
- solverID
- subscribe
type: object
Expand Down
2 changes: 1 addition & 1 deletion pkg/rear-controller/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (g *Gateway) CacheRefresher(interval time.Duration) func(ctx context.Contex
//
//nolint:revive // we need to pass ctx as parameter to be compliant with the Poller interface
func (g *Gateway) refreshCache(ctx context.Context) (bool, error) {
klog.Infof("Refreshing cache")
klog.InfoDepth(1, "Refreshing cache...")
for transactionID, transaction := range g.Transactions {
if tools.CheckExpiration(transaction.ExpirationTime) {
klog.Infof("Transaction %s expired, removing it from cache...", transactionID)
Expand Down
2 changes: 1 addition & 1 deletion pkg/rear-controller/gateway/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (g *Gateway) getFlavors(w http.ResponseWriter, _ *http.Request) {

// Filtering only the available flavors
for i := range flavors {
if !flavors[i].Spec.Availability {
if flavors[i].Spec.Availability {
availableFlavors = append(availableFlavors, flavors[i])
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/rear-controller/gateway/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func searchFlavorWithSelector(ctx context.Context, selector models.Selector, add
func searchFlavor(ctx context.Context, addr string) ([]*nodecorev1alpha1.Flavor, error) {
var flavors []models.Flavor

url := fmt.Sprintf("http://%s%s", addr, ListFlavorsPath)
url := fmt.Sprintf("http://%s%s", addr, Routes.Flavors)

resp, err := makeRequest(ctx, "GET", url, nil)
if err != nil {
Expand Down
Loading