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

Changing Discovery & PeeringCandidate CRDs behaviour #41

Merged
merged 1 commit into from
Apr 22, 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
6 changes: 3 additions & 3 deletions apis/advertisement/v1alpha1/discovery_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type DiscoverySpec struct {
// This pattern corresponds to what has been defined in the REAR Protocol to do a discovery with a selector
Selector *nodecorev1alpha1.FlavourSelector `json:"selector"`

// This flag indicates that needs to be enstablished a subscription to the provider in case a match is found.
// 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 Flavour
Subscribe bool `json:"subscribe"`
}
Expand All @@ -45,8 +45,8 @@ type DiscoveryStatus struct {
// This is the current phase of the discovery
Phase nodecorev1alpha1.PhaseStatus `json:"phase"`

// This is the reference to the PeeringCandidate CRD that is the result of the discovery if a match is found
PeeringCandidate nodecorev1alpha1.GenericRef `json:"peeringCandidate,omitempty"`
// This is a list of the PeeringCandidates that have been found as a result of the discovery matching the solver
PeeringCandidateList PeeringCandidateList `json:"peeringCandidateList,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
4 changes: 2 additions & 2 deletions apis/advertisement/v1alpha1/peeringcandidate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (

// PeeringCandidateSpec defines the desired state of PeeringCandidate
type PeeringCandidateSpec struct {
Reserved bool `json:"reserved"`

SolverID string `json:"solverID"`

Flavour nodecorev1alpha1.Flavour `json:"flavour"`

Available bool `json:"available"`
}

// PeeringCandidateStatus defines the observed state of PeeringCandidate
Expand Down
4 changes: 2 additions & 2 deletions apis/advertisement/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions apis/nodecore/v1alpha1/allocation_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,3 @@ func (allocation *Allocation) SetStatus(status Status, msg string) {
allocation.Status.LastUpdateTime = tools.GetTimeNow()
allocation.Status.Message = msg
}

/*
// SetPurchasePhase sets the ReserveAndBuy phase of the solver
func (allocation *Allocation) SetReserveAndBuyStatus(phase Phase) {
solver.Status.ReserveAndBuy = phase
solver.Status.SolverPhase.LastChangeTime = tools.GetTimeNow()
}

// SetFindCandidateStatus sets the FindCandidate phase of the solver
func (allocation *Allocation) SetFindCandidateStatus(phase Phase) {
solver.Status.FindCandidate = phase
solver.Status.SolverPhase.LastChangeTime = tools.GetTimeNow()
}

// SetDiscoveryStatus sets the discovery phase of the solver
func (allocation *Allocation) SetDiscoveryStatus(phase Phase) {
solver.Status.DiscoveryPhase = phase
solver.Status.SolverPhase.LastChangeTime = tools.GetTimeNow()
}

// SetReservationStatus sets the reservation phase of the solver
func (allocation *Allocation) SetReservationStatus(phase Phase) {
solver.Status.ReservationPhase = phase
solver.Status.SolverPhase.LastChangeTime = tools.GetTimeNow()
}
*/
8 changes: 0 additions & 8 deletions apis/nodecore/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,3 @@ type LiqoCredentials struct {
Token string `json:"token"`
Endpoint string `json:"endpoint"`
}

// toString() returns a string representation of the GenericRef.
/* func (r GenericRef) toString() string {
if r.Namespace != "" {
return r.Namespace + "/" + r.Name
}
return r.Name
} */
18 changes: 0 additions & 18 deletions apis/nodecore/v1alpha1/solver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@ type PhaseStatus struct {
EndTime string `json:"endTime,omitempty"`
}

// Selector represents the criteria for selecting Flavours.
/* type Selector struct {
FlavourType string `json:"type,omitempty"`
Architecture string `json:"architecture,omitempty"`
Cpu int `json:"cpu,omitempty"`
Memory int `json:"memory,omitempty"`
EphemeralStorage int `json:"ephemeral-storage,omitempty"`
MoreThanCpu int `json:"moreThanCpu,omitempty"`
MoreThanMemory int `json:"moreThanMemory,omitempty"`
MoreThanEph int `json:"moreThanEph,omitempty"`
LessThanCpu int `json:"lessThanCpu,omitempty"`
LessThanMemory int `json:"lessThanMemory,omitempty"`
LessThanEph int `json:"lessThanEph,omitempty"`
} */

type FlavourSelector struct {
FlavourType string `json:"type"`
Architecture string `json:"architecture"`
Expand Down Expand Up @@ -129,9 +114,6 @@ type SolverStatus struct {
// It is usefull to understand if the solver is still running or if it has finished or failed.
SolverPhase PhaseStatus `json:"solverPhase,omitempty"`

// PeeringCandidate contains the candidate that the solver has eventually found to solve the intent.
PeeringCandidate GenericRef `json:"peeringCandidate,omitempty"`

// Allocation contains the allocation that the solver has eventually created for the intent.
// It can correspond to a virtual node
// The Node Orchestrator will use this allocation to fullfill the intent.
Expand Down
1 change: 0 additions & 1 deletion apis/nodecore/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading