Repository: vllm-project/aibrix
File: api/orchestration/v1alpha1/podset_types.go (Go)

Code before:
type PodSetPhase string

const (
	// PodSetPhasePending indicates the PodSet is being created
	PodSetPhasePending PodSetPhase = "Pending"

	// PodSetPhaseRunning indicates at least one pod is running
	PodSetPhaseRunning PodSetPhase = "Running"

	// PodSetPhaseReady indicates all pods in the set are ready
	PodSetPhaseReady PodSetPhase = "Ready"

	// PodSetPhaseFailed indicates the PodSet has failed
	PodSetPhaseFailed PodSetPhase = "Failed"
)

// PodRecreateStrategy defines how a PodSet handles pod recreation when pods are lost or fail.
// +enum
type PodRecreateStrategy string

const (
	// MissingOnlyPodRecreateStrategy means only missing pods (by index) will be recreated.
	MissingOnlyPodRecreateStrategy PodRecreateStrategy = "MissingOnly"

	// FullRecreatePodRecreateStrategy means if any pod is missing, all pods in the set will be deleted, and then all pods will be recreated.
	FullRecreatePodRecreateStrategy PodRecreateStrategy = "FullRecreate"
)

// PodSet conditions
const (
	// PodSetReady indicates whether all pods in the set are ready
	PodSetReady ConditionType = "Ready"

	// PodSetProgressing indicates the PodSet is in the process of updating
	PodSetProgressing ConditionType = "Progressing"
)

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// PodSet is the Schema for the podsets API
// PodSet represents an atomic group of pods that work together
// This is an internal API used by RoleSet controller when podGroupSize > 1
type PodSet struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PodSetSpec   `json:"spec,omitempty"`
	Status PodSetStatus `json:"status,omitempty"`
}


Review comment (suggestion):
Since we define at podset level, I think `Recreate` is enough, it represents `Recreate` the podset object. No need to append `Full` as suffix. 





Code after:
type PodSetPhase string

const (
	// PodSetPhasePending indicates the PodSet is being created
	PodSetPhasePending PodSetPhase = "Pending"

	// PodSetPhaseRunning indicates at least one pod is running
	PodSetPhaseRunning PodSetPhase = "Running"

	// PodSetPhaseReady indicates all pods in the set are ready
	PodSetPhaseReady PodSetPhase = "Ready"

	// PodSetPhaseFailed indicates the PodSet has failed
	PodSetPhaseFailed PodSetPhase = "Failed"
)

// PodRecoveryPolicy defines how a PodSet handles pod recreation when pods are lost or fail.
// +enum
type PodRecoveryPolicy string

const (
	// ReplaceUnhealthy means only missing pods (by index) will be recreated.
	ReplaceUnhealthy PodRecoveryPolicy = "ReplaceUnhealthy"

	// RecreatePodRecreateStrategy means if any pod is missing, all pods in the set will be deleted, and then all pods will be recreated.
	RecreatePodRecreateStrategy PodRecoveryPolicy = "Recreate"
)

// PodSet conditions
const (
	// PodSetReady indicates whether all pods in the set are ready
	PodSetReady ConditionType = "Ready"

	// PodSetProgressing indicates the PodSet is in the process of updating
	PodSetProgressing ConditionType = "Progressing"
)

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// PodSet is the Schema for the podsets API
// PodSet represents an atomic group of pods that work together
// This is an internal API used by RoleSet controller when podGroupSize > 1
type PodSet struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PodSetSpec   `json:"spec,omitempty"`
	Status PodSetStatus `json:"status,omitempty"`
}