Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
Signed-off-by: xhe <xw897002528@gmail.com>
  • Loading branch information
xhebox committed Jul 21, 2023
1 parent 6d164a5 commit a436155
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25497,6 +25497,11 @@ github.com/pingcap/tidb-operator/pkg/apis/label.Label
</em>
</td>
<td>
<p>MatchLabels is used to overwrite generated corev1.TopologySpreadConstraints.NodeSelector.</p>
<p>corev1.TopologySpreadConstraint generated in component_spec.go will set a
NodeSelector automatically with some KV.
Historically, it is l[&ldquo;comp&rdquo;] = &ldquo;&rdquo; for component tiproxy. And we will use
MatchLabels to keep l[&ldquo;comp&rdquo;] = &ldquo;&rdquo; for old clusters with tiproxy/</p>
</td>
</tr>
</tbody>
Expand Down
8 changes: 7 additions & 1 deletion pkg/apis/pingcap/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3002,7 +3002,13 @@ type TopologySpreadConstraint struct {
// WhenUnsatisfiable is default set to DoNotSchedule
// LabelSelector is generated by component type
// See pkg/apis/pingcap/v1alpha1/tidbcluster_component.go#TopologySpreadConstraints()
TopologyKey string `json:"topologyKey"`
TopologyKey string `json:"topologyKey"`
// MatchLabels is used to overwrite generated corev1.TopologySpreadConstraints.NodeSelector.
//
// corev1.TopologySpreadConstraint generated in component_spec.go will set a
// NodeSelector automatically with some KV.
// Historically, it is l["comp"] = "" for component tiproxy. And we will use
// MatchLabels to keep l["comp"] = "" for old clusters with tiproxy/
MatchLabels label.Label `json:"matchLabels"`
}

Expand Down

0 comments on commit a436155

Please sign in to comment.