pingcap / pingcap/tidb-operator

Add clusterName validate at validation phase.

Open
#3,454 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status/discussion-wanted status/help-wanted
Dominant language
Go
Stars
1.3k
Forks
540
Avg merge
3d 2h
Merged PRs (30d)
18

Description

Feature Request

**Is your feature request related to a problem?
We use clusterName to construct the name of sts, deployment, service and pod,the conditions of k8s for pod service name are as follows:

	// * must be no more than 63 characters long.
	// * must consist of lower case alphanumeric characters or '-'.
	// * must start and end with an alphanumeric character.

Therefore, we can use the k8s method validation.IsQualifiedName to verify the name of the service and pod to be generated.

https://github.com/mikechengwei/kubernetes/blob/23b66eaabd3a535dbee6474638c5bf51e78fbcfa/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L42

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.

Research direction

Start at the validation phase that handles clusterName and read Kubernetes validation.IsQualifiedName to confirm the required naming rules. Done means invalid clusterName values are rejected before the operator generates the related StatefulSet, Deployment, Service, and Pod names.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.