percona / percona/percona-server-mongodb-operator

Error if replset name has upper-case letters in it

Open
#1,982 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
457
Forks
198
Avg merge
5d 19h
Merged PRs (30d)
10

Description

Report

We're trying to migrate from an existing cluster to using the operator. The repl set name starts with RS-, using upper-case letters. When we try to create the database using this operator we get an error because it uses the replsetname as part of the created service name, but service names cannot have upper-case letters in them in kubernetes.

More about the problem
Error: reconcile services: reconcile replset services: create or update
    service for replset RS-stagingdb-0: Service "stagingdb-RS-stagingdb-0" is
    invalid: metadata.name: Invalid value: "stagingdb-RS-stagingdb-0": a
    DNS-1035 label must consist of lower case alphanumeric characters or '-',
    start with an alphabetic character, and end with an alphanumeric character
    (e.g. 'my-name',  or 'abc-123', regex used for validation is
    '[a-z]([-a-z0-9]*[a-z0-9])?')
Steps to reproduce
Versions
  1. Kubernetes 1.30
  2. Operator 1.20.1
  3. Database mongodb
Anything else?

It seems like the operator assumes that the replset names will also be valid kubernetes identifier prefixes, but in our case that is not true.

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

No file or test is named. Start by tracing service reconciliation and how the replica set name becomes a Kubernetes Service metadata.name; reproduce the uppercase RS- case on Kubernetes 1.30 and identify the existing naming path. Done means the operator can create valid services for uppercase replica set names, with regression coverage for this input.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.