package common

import cloudv1 "github.com/tidbcloud/infra-api/api/v1"

const (
	MigrateNodeGroupAnnotation  = "tidbcloud.com/migrate-managed-nodegroup-when-upgrading"
	ScaleOutExtraTiDBAnnotation = "tidbcloud.com/scale-out-extra-tidb"
	// ParallelCDCUpgradeAnnotation controls whether TiCDC CRs are upgraded in parallel.
	// Set to "true" to upgrade all TiCDC CRs simultaneously. Default is serial.
	ParallelCDCUpgradeAnnotation = "tidbcloud.com/parallel-cdc-upgrade"
	TargetCDCUpgradeAnnotation   = "tidbcloud.com/target-cdc-upgrade"

	RestartTiDBAnnotation = "tidb.pingcap.com/restartedAt"

	NormalEvent  = "Normal"
	WarningEvent = "Warning"

	// UO status Reasons
	ReasonRestartingTiDBCluster = "Restarting the TiDB Cluster"
	ReasonRestartingTiProxy     = "Restarting TiProxy"
	ReasonRestartingStorage     = "Restarting storage components (PD/TiKV/TiFlash)"
	ReasonRestartingTiDB        = "Restarting TiDB"
	ReasonPending               = "Wait for the scheduled time"

	PauseReason = "paused by UpgradeOperation controller"
)

var (
	ComponentSet = map[string]struct{}{
		string(cloudv1.ComponentPD):      {},
		string(cloudv1.ComponentTiKV):    {},
		string(cloudv1.ComponentTiProxy): {},
		string(cloudv1.ComponentTiFlash): {},
		string(cloudv1.ComponentTiDB):    {},
	}
)
