Support custom version strings on images with operator.

Open
#5,213 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go, kubernetes

Research direction

Start by reading the version handling in pkg/manager/member/utils.go, then inspect the cited paths in tidb_member_manager.go and ticdc_scaler.go. Determine where the cluster specification can carry an override separate from the image tag, and trace the related tests or CRD definitions. Done means custom image versions no longer fail parsing while version-gated behavior still uses the intended TiDB version.

Written by the indexing model from the issue text.

Description

Feature Request

Is your feature request related to a problem? Please describe:
We adapt the official pingcap images thru our internal docker image pipeline to produce images with custom version tags that don't follow the tidb version string format of v6.5.3 etc. e.g. our version strings look like tidb_2023-06-27_00.43.39Z_master_123abcde_123456789

Operator makes various assumptions to gate functionality based on wether a component is new enough past some version or not. For this it tries to parse the .spec.version field from the tidb cluster definition and errors out in our case like:

E0729 00:22:23.727017       1 utils.go:464] Parse version tidb_2023-06-27_00.43.39Z_master_123abcde_123456789 failure, error: Invalid Semantic Version
W0729 00:22:23.927754       1 tidb_member_manager.go:1102] parse tidb verson 'tidb_2023-06-27_00.43.39Z_master_123abcde_123456789' failed, skip setting store labels for TiKV of TiDB cluster tidb/devdev. err: Invalid Semantic Version

This makes a lot of error logs & prevents us from using various functionality and potentially incorrect usage at various operator code paths:
https://github.com/pingcap/tidb-operator/blob/34c19d4b977df6afe5f3a60db17905f71a2fc1cf/pkg/manager/member/tidb_member_manager.go#L1144
https://github.com/pingcap/tidb-operator/blob/34c19d4b977df6afe5f3a60db17905f71a2fc1cf/pkg/manager/member/utils.go#L463
https://github.com/pingcap/tidb-operator/blob/34c19d4b977df6afe5f3a60db17905f71a2fc1cf/pkg/manager/member/ticdc_scaler.go#L236

Describe the feature you'd like:
We would like to be able to specify an override version string for informing operator what tidb versions we are using which is separate from the actual image tag used for container images.

Describe alternatives you've considered:
N/A

Teachability, Documentation, Adoption, Migration Strategy:
Explained above.

cc: @coderplay @gegao-db

Dominant language
Go
Stars
1.3k
Forks
540
Avg merge
3d 2h
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pingcap/tidb-operator

All issues in pingcap/tidb-operator

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.