diff --git a/apis/advertisement/v1alpha1/discovery_types.go b/apis/advertisement/v1alpha1/discovery_types.go index b9282e8..b299055 100644 --- a/apis/advertisement/v1alpha1/discovery_types.go +++ b/apis/advertisement/v1alpha1/discovery_types.go @@ -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 diff --git a/deployments/node/crds/advertisement.fluidos.eu_discoveries.yaml b/deployments/node/crds/advertisement.fluidos.eu_discoveries.yaml index 5c0bfba..4c40ef5 100644 --- a/deployments/node/crds/advertisement.fluidos.eu_discoveries.yaml +++ b/deployments/node/crds/advertisement.fluidos.eu_discoveries.yaml @@ -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 diff --git a/pkg/rear-controller/gateway/gateway.go b/pkg/rear-controller/gateway/gateway.go index 9c1d3f2..2789f9e 100644 --- a/pkg/rear-controller/gateway/gateway.go +++ b/pkg/rear-controller/gateway/gateway.go @@ -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) diff --git a/pkg/rear-controller/gateway/provider.go b/pkg/rear-controller/gateway/provider.go index 9306372..78b5bc4 100644 --- a/pkg/rear-controller/gateway/provider.go +++ b/pkg/rear-controller/gateway/provider.go @@ -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]) } } diff --git a/pkg/rear-controller/gateway/services.go b/pkg/rear-controller/gateway/services.go index 238b9fe..c4c9213 100644 --- a/pkg/rear-controller/gateway/services.go +++ b/pkg/rear-controller/gateway/services.go @@ -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 {