Documentation ¶
Index ¶
- Constants
- Variables
- func FilterOutCondition(conditions []v1alpha1.ServerlessDBCondition, condType v1alpha1.ConditionType) []v1alpha1.ServerlessDBCondition
- func GetProxyResourceName(instanceName string) string
- func GetServerlessDBCondition(status v1alpha1.ServerlessDBStatus, condType v1alpha1.ConditionType) *v1alpha1.ServerlessDBCondition
- func IgnoreErrorf(format string, a ...interface{}) error
- func IsIgnoreError(err error) bool
- func IsRequeueError(err error) bool
- func IsServerlessDBRestart(db *v1alpha1.ServerlessDB) bool
- func IsServerlessDBSilence(db *v1alpha1.ServerlessDB) bool
- func LabelEq(key string, val string) *labels.Requirement
- func LabelsComponentForServerlessDB(name, component string) map[string]string
- func LabelsForServerlessDB(name string) map[string]string
- func NewServerlessDBCondition(condType v1alpha1.ConditionType, status v1.ConditionStatus, ...) *v1alpha1.ServerlessDBCondition
- func RequeueErrorf(format string, a ...interface{}) error
- func SetServerlessDBCondition(status *v1alpha1.ServerlessDBStatus, condition v1alpha1.ServerlessDBCondition)
- type IgnoreError
- type Label
- func (l Label) BcRdsInstance(name string) Label
- func (l Label) Component(name string) Label
- func (l Label) Copy() Label
- func (l Label) Instance(name string) Label
- func (l Label) LabelSelector() *metav1.LabelSelector
- func (l Label) Labels() map[string]string
- func (l Label) Selector() (labels.Selector, error)
- func (l Label) String() string
- type RequeueError
Constants ¶
const ( // AnnPingcapToolOptions describes optional command line args for a tool. AnnPingcapToolOptions = "tidb.pingcap.com/tool-options" DefaultRootUser = "root" DefaultRootPassword = "Nz_2@sMw6R" )
const ( // InstanceLabelKey is Kubernetes recommended label key, it represents a unique name identifying the instance of an application // It's set by helm when installing a release InstanceLabelKey string = "app.kubernetes.io/instance" InstanceAnnotationKey string = "bcrds.cmss.com/instance" BcRdsInstanceLabelKey = InstanceAnnotationKey RoleInstanceLabelKey string = "bcrds.cmss.com/role" // RestartAtAnnotationKey represents restart flag RestartAtAnnotationKey string = "bcrds.cmss.com/restartAt" // RestartAtAnnotationKey represents restart flag PingcapRestartAtAnnotationKey string = "tidb.pingcap.com/restartedAt" // SLDBOperator is ManagedByLabelKey label value SLDBOperator string = "sldb-operator" )
const ( // Ready Ready = "Ready" // TiDBInitialNotDone is added when ti is not done. TiDBInitialNotDone = "TiDBInitialNotDone" // TiDBRestartNotDone is added when ti is not done. TiDBRestartNotDone = "TiDBRestartNotDone" )
Variables ¶
var ( // controllerKind contains the schema.GroupVersionKind for ServerlessDB controller type. ServerlessDBControllerKind = v1alpha1.SchemeGroupVersion.WithKind("ServerlessDB") )
Functions ¶
func FilterOutCondition ¶
func FilterOutCondition(conditions []v1alpha1.ServerlessDBCondition, condType v1alpha1.ConditionType) []v1alpha1.ServerlessDBCondition
FilterOutCondition returns a new slice of ServerlessDB conditions without conditions with the provided type.
func GetProxyResourceName ¶
func GetServerlessDBCondition ¶
func GetServerlessDBCondition(status v1alpha1.ServerlessDBStatus, condType v1alpha1.ConditionType) *v1alpha1.ServerlessDBCondition
GetServerlessDBCondition returns the condition with the provided type.
func IgnoreErrorf ¶
IgnoreErrorf returns a IgnoreError
func IsIgnoreError ¶
IsIgnoreError returns whether err is a IgnoreError
func IsRequeueError ¶
IsRequeueError returns whether err is a RequeueError
func IsServerlessDBRestart ¶
func IsServerlessDBRestart(db *v1alpha1.ServerlessDB) bool
IsServerlessDBRestart, true means tidb is restarting.
func IsServerlessDBSilence ¶
func IsServerlessDBSilence(db *v1alpha1.ServerlessDB) bool
IsServerlessDBSilence, true means tidb server pods replica is zero.
func LabelsComponentForServerlessDB ¶
LabelsProxyForServerlessDB returns the labels for selecting the resources belonging to the given CR name.
func LabelsForServerlessDB ¶
LabelsForServerlessDB returns the labels for selecting the resources belonging to the given CR name.
func NewServerlessDBCondition ¶
func NewServerlessDBCondition(condType v1alpha1.ConditionType, status v1.ConditionStatus, reason, message string) *v1alpha1.ServerlessDBCondition
NewServerlessDBCondition creates a new ServerlessDB condition.
func RequeueErrorf ¶
RequeueErrorf returns a RequeueError
func SetServerlessDBCondition ¶
func SetServerlessDBCondition(status *v1alpha1.ServerlessDBStatus, condition v1alpha1.ServerlessDBCondition)
SetServerlessDBCondition updates the ServerlessDB to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.
Types ¶
type IgnoreError ¶
type IgnoreError struct {
// contains filtered or unexported fields
}
IgnoreError is used to ignore this item, this error type should't be considered as a real error, no need to requeue
func (*IgnoreError) Error ¶
func (re *IgnoreError) Error() string
type Label ¶
Label is the label field in metadata
func (Label) BcRdsInstance ¶
Instance adds instance kv pair to label
func (Label) LabelSelector ¶
func (l Label) LabelSelector() *metav1.LabelSelector
LabelSelector gets LabelSelector from label
type RequeueError ¶
type RequeueError struct {
// contains filtered or unexported fields
}
RequeueError is used to requeue the item, this error type should't be considered as a real error
func (*RequeueError) Error ¶
func (re *RequeueError) Error() string