Skip to content

fix(addon): prevent add-on names from colliding with application name - #785

Open
lmmendes wants to merge 1 commit into
kubero-dev:mainfrom
lmmendes:fix/addon-app-name-collision
Open

lmmendes wants to merge 1 commit into
kubero-dev:mainfrom
lmmendes:fix/addon-app-name-collision

Conversation

@lmmendes

Copy link
Copy Markdown

Description

An add-on could be created with exactly the same name as its application. The add-on form checked startsWith(appName), so an exact match was incorrectly treated as already prefixed. Although the application and add-on are different Kubernetes resource kinds, the Helm operator uses their names as release names within the same namespace. This caused reconciliation to fail with a duplicate release name error.

This change:

  • treats an add-on name as prefixed only when it starts with <app-name>-;
  • preserves the prefix correctly when editing an existing add-on;
  • validates Kubero-managed add-on release names on both application creation and update;
  • rejects names that collide with the application or another Kubero add-on;
  • adds unit tests for colliding, duplicate, and valid prefixed names;
  • validates app-name validation in both the UI and the backend so the name is a valid Kubernetes DNS-1123 label (lowercase letters/numbers/hyphens, no spaces, no underscores, and must start/end with a letter or number).

Type of change

  • Template (non-breaking change which adds a template)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Server production build passed;
  • Client type-check and production build passed;
  • Full server test suite passed: 57 suites and 541 tests;
  • A Kind test reproduced the original collision using KuberoApp/demo and KuberoAddonPostgres/demo;
  • The add-on was recreated with the normalized name demo-postgres. Both KuberoApp/demo and KuberoAddonPostgres/demo-postgres reached Deployed=True, with separate deployed Helm releases and no duplicate release name errors;
  • I've built the image and tested it on a kubernetes cluster - note: using kind

Test Configuration:

  • Operator Version: v0.2.2
  • Kubernetes Version: v1.35.0 (Kind with Podman, arm64)
  • Kubero CLI Version (if applicable):

Checklist:

  • I removed unnecessary debug logs
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I documented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@lmmendes lmmendes changed the title fix(addon): prevent add-on names from colliding with application helm… fix(addon): prevent add-on names from colliding with application name Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant