Skip to content

Commit

Permalink
fix: add label overwrite for tiproxy component val compatibility (#5194)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhebox authored Aug 2, 2023
1 parent 0154af3 commit eea66fb
Show file tree
Hide file tree
Showing 14 changed files with 224 additions and 9 deletions.
16 changes: 16 additions & 0 deletions docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25536,6 +25536,22 @@ LabelSelector is generated by component type
See pkg/apis/pingcap/v1alpha1/tidbcluster_component.go#TopologySpreadConstraints()</p>
</td>
</tr>
<tr>
<td>
<code>matchLabels</code></br>
<em>
github.com/pingcap/tidb-operator/pkg/apis/label.Label
</em>
</td>
<td>
<em>(Optional)</em>
<p>MatchLabels is used to overwrite generated corev1.TopologySpreadConstraints.LabelSelector
corev1.TopologySpreadConstraint generated in component_spec.go will set a
LabelSelector 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>
</table>
<h3 id="txnlocallatches">TxnLocalLatches</h3>
Expand Down
2 changes: 1 addition & 1 deletion hack/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function hack::ensure_aws_k8s_tester() {

function hack::ensure_gen_crd_api_references_docs() {
echo "Installing gen_crd_api_references_docs..."
GOBIN=$OUTPUT_BIN go install github.com/xhebox/gen-crd-api-reference-docs@e46d84594a6d158ec7123ff05acd57acf62e140f
GOBIN=$OUTPUT_BIN go install github.com/xhebox/gen-crd-api-reference-docs@a8a3b01e858f0de8bc8f9419d210da4334929e2d
}

function hack::ensure_misspell() {
Expand Down
3 changes: 2 additions & 1 deletion hack/localtest/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
name: basic
annotations:
spec:
version: v6.3.0
timezone: UTC
Expand Down Expand Up @@ -33,7 +34,7 @@ spec:
maxFailoverCount: 0
config: {}
tiproxy:
baseImage: xhebox/tiproxy
baseImage: pingcap/tiproxy
version: latest
imagePullPolicy: Always
replicas: 1
Expand Down
24 changes: 24 additions & 0 deletions hack/localtest/monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: pingcap.com/v1alpha1
kind: TidbMonitor
metadata:
name: basic
spec:
replicas: 1
clusters:
- name: basic
prometheus:
baseImage: prom/prometheus
version: v2.27.1
grafana:
baseImage: grafana/grafana
version: 7.5.11
initializer:
baseImage: pingcap/tidb-monitor-initializer
version: v6.5.0
reloader:
baseImage: pingcap/tidb-monitor-reloader
version: v1.0.1
prometheusReloader:
baseImage: quay.io/prometheus-operator/prometheus-config-reloader
version: v0.49.0
imagePullPolicy: IfNotPresent
4 changes: 2 additions & 2 deletions hack/localtest/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if [ -n "$BUILD" ]; then
make DOCKER_REPO=xx operator-docker
fi

kubectl replace -f $BASE/../../manifests/crd.yaml
kubectl replace -f $BASE/../../manifests/advanced-statefulset-crd.v1.yaml
kubectl replace --force -f $BASE/../../manifests/crd.yaml
kubectl replace --force -f $BASE/../../manifests/advanced-statefulset-crd.v1.yaml

kubectl delete --force namespace $namespace || true

Expand Down
64 changes: 64 additions & 0 deletions manifests/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7471,6 +7471,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -10010,6 +10014,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -10142,6 +10150,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -12610,6 +12622,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -18449,6 +18465,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -21024,6 +21044,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -23558,6 +23582,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -26069,6 +26097,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -28762,6 +28794,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -31311,6 +31347,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -33849,6 +33889,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -36331,6 +36375,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -36369,6 +36417,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -40319,6 +40371,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -47672,6 +47728,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -47810,6 +47870,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down
16 changes: 16 additions & 0 deletions manifests/crd/v1/pingcap.com_dmclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2866,6 +2866,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -5405,6 +5409,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -5537,6 +5545,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down Expand Up @@ -8005,6 +8017,10 @@ spec:
topologySpreadConstraints:
items:
properties:
matchLabels:
additionalProperties:
type: string
type: object
topologyKey:
type: string
required:
Expand Down
Loading

0 comments on commit eea66fb

Please sign in to comment.