Skip to content

Commit

Permalink
remove PodSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
cofyc committed Aug 20, 2019
1 parent ecc8a6d commit fc1d770
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 61 deletions.
37 changes: 21 additions & 16 deletions pkg/apis/pingcap.com/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,27 @@ type TidbClusterStatus struct {
TiDB TiDBStatus `json:"tidb,omitempty"`
}

// PodSpec repreresents shared pod fields between PD/TiDB/TiKV
type PodSpec struct {
Replicas int32 `json:"replicas"`
Affinity *corev1.Affinity `json:"affinity,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
HostNetwork bool `json:"hostNetwork,omitempty"`
}

// PDSpec contains details of PD member
type PDSpec struct {
ContainerSpec
PodSpec
StorageClassName string `json:"storageClassName,omitempty"`
Replicas int32 `json:"replicas"`
Affinity *corev1.Affinity `json:"affinity,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
HostNetwork bool `json:"hostNetwork,omitempty"`
StorageClassName string `json:"storageClassName,omitempty"`
}

// TiDBSpec contains details of PD member
type TiDBSpec struct {
ContainerSpec
PodSpec
Replicas int32 `json:"replicas"`
Affinity *corev1.Affinity `json:"affinity,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
HostNetwork bool `json:"hostNetwork,omitempty"`
StorageClassName string `json:"storageClassName,omitempty"`
BinlogEnabled bool `json:"binlogEnabled,omitempty"`
MaxFailoverCount int32 `json:"maxFailoverCount,omitempty"`
Expand All @@ -139,9 +139,14 @@ type TiDBSlowLogTailerSpec struct {
// TiKVSpec contains details of PD member
type TiKVSpec struct {
ContainerSpec
PodSpec
Privileged bool `json:"privileged,omitempty"`
StorageClassName string `json:"storageClassName,omitempty"`
Replicas int32 `json:"replicas"`
Affinity *corev1.Affinity `json:"affinity,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
HostNetwork bool `json:"hostNetwork,omitempty"`
Privileged bool `json:"privileged,omitempty"`
StorageClassName string `json:"storageClassName,omitempty"`
}

// TiKVPromGatewaySpec runs as a sidecar with TiKVSpec
Expand Down
123 changes: 78 additions & 45 deletions pkg/apis/pingcap.com/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fc1d770

Please sign in to comment.