Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

EVEREST-271 fix name starts with a digit #154

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

oksana-grishchenko
Copy link
Contributor

@oksana-grishchenko oksana-grishchenko commented Sep 14, 2023

EVEREST-271 Powered by Pull Request Badge

Fix CR names validation

Problem:
EVEREST-271 Database clusters with a name that starts with a digit, never go up

oxanagrishchenko@Oxanas-MacBook-Pro percona-everest-backend % kubectl get dbc -n percona-everest 
NAME                     SIZE   READY   STATUS         HOSTNAME                                                    AGE
1mysql                   2              initializing   1mysql-haproxy.percona-everest                              11m
1test-pg-cluster                        initializing   1test-pg-cluster-pgbouncer.percona-everest.svc              3m42s
1test-psmdb-cluster      1      1       initializing   1test-psmdb-cluster-rs0.percona-everest.svc.cluster.local   6m3s
2test-pg-cluster                        initializing   2test-pg-cluster-pgbouncer.percona-everest.svc              112s
3mysql-321123456789      2              initializing   3mysql-321123456789-haproxy.percona-everest                 4h31m
3mysql-3211234567890     2              initializing   3mysql-3211234567890-haproxy.percona-everest                4h34m
3mysql-32112345678909    2              initializing   3mysql-32112345678909-haproxy.percona-everest               4h35m
3mysql-321123456789093   2              initializing   3mysql-321123456789093-haproxy.percona-everest              4h46m
mysql-3211234567890123   2      2       ready          mysql-3211234567890123-haproxy.percona-everest              4h30m
test-pg-cluster          2      2       ready          test-pg-cluster-pgbouncer.percona-everest.svc               3m35s
test-psmdb-cluster       1      1       ready          test-psmdb-cluster-rs0.percona-everest.svc.cluster.local    5m35s
test-pxc-cluster2        2      2       ready          test-pxc-cluster2-haproxy.percona-everest                   4h38m

Cause:
from the pxc logs:

 ERROR   Reconciler error        {"controller": "perconaxtradbcluster-controller", "object": {"name":"1minimal-cluster",
"namespace":"percona-everest"}, "namespace": "percona-everest", "name": "1minimal-cluster", "reconcileID": 
"d0244667-3a9a-4d4c-99eb-71df0fca6fa2", "error": "PXC service upgrade error: Service \"1minimal-cluster-pxc\" is 
invalid: metadata.name: Invalid value: \"1minimal-cluster-pxc\": 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])?')"

Solution:
Do not allow first symbol of the CR name to be a digit

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?

Tests

  • Is an Integration test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

@oksana-grishchenko oksana-grishchenko marked this pull request as ready for review September 14, 2023 08:30
@oksana-grishchenko oksana-grishchenko requested a review from a user September 14, 2023 08:30
@oksana-grishchenko oksana-grishchenko merged commit de3e2b0 into main Sep 14, 2023
4 checks passed
@oksana-grishchenko oksana-grishchenko deleted the EVEREST-271-names-validation branch September 14, 2023 08:41
@recharte recharte mentioned this pull request Sep 14, 2023
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants