package resource

import validation "github.com/Thearas/ozzo-validation/v4"

// QosClaim defines the a QosClaim setting
type QosClaim struct {
	// PodGroup is the podGroup name, with the PodGroup we ensure a group of pods can be scheduled altogether.
	//
	// ref: https://github.com/PingCAP-QE/NaglfarCloud
	PodGroup string `json:"podGroup"`
	// Exclusive means whether the podGroup is mutually exclusive with other Pod or PodGroup.
	//
	// If it is set, this pod are mutually exclusive with other pods(means don't schedule on the same node)
	// which has different podGroup name or without a podGroup binding
	Exclusive *bool `json:"exclusive,omitempty"`
	// TODO(@mahjonp) any other qos related config?
}

func (q QosClaim) Validate() error {
	return validation.ValidateStruct(&q,
		validation.Field(&q.PodGroup, validation.Required))
}
