package resource

const (
	KafkaClusterReady      KafkaClusterPhase = "Ready"
	KafkaClusterNotReady   KafkaClusterPhase = "NotReady"
	KafkaClusterZKNotReady KafkaClusterPhase = "ZKNotReady"
)

type KafkaCluster struct {
	ResourceHandle `json:",inline"`

	Spec   KafkaClusterSpec   `json:"spec"`
	Status KafkaClusterStatus `json:"status"`
}

type ZooKeeperComp struct {
	Replicas  int32                `json:"replicas,omitempty"`
	Image     string               `json:"image,omitempty"`
	Resources ResourceRequirements `json:"resources"`
}

type KafkaComp struct {
	Replicas        int32           `json:"replicas,omitempty"`
	Image           string          `json:"image,omitempty"`
	ImagePullPolicy ImagePullPolicy `json:"imagePullPolicy" default:"IfNotPresent"`

	Resources    ResourceRequirements `json:"resources"`
	Env          map[string]string    `json:"env,omitempty"`
	Command      []string             `json:"command,omitempty"`
	Args         []string             `json:"args,omitempty"`
	NodeSelector map[string]string    `json:"nodeSelector,omitempty"`
}

type KafkaClusterSpec struct {
	ZkSpec    ZooKeeperComp `json:"zkspec"`
	KafkaSpec KafkaComp     `json:"kafkaspec"`
}

type KafkaClusterPhase string

type KafkaClusterStatus struct {
	Phase KafkaClusterPhase `json:"phase"`
}
