Skip to content

Conversation

@gujingit
Copy link
Collaborator

feat: svcName changed to new format "s-rbg.Name-role.Name"

Ⅰ. Motivation

bugfix: add max len check for workloadName & serviceName

Ⅱ. Modifications

bugfix: add max len check for workloadName & serviceName
feat: change serviceName in new format "s-rbg.Name-role.Name"

Ⅲ. Does this pull request fix one issue?

NONE

Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅴ. Describe how to verify it

make test

VI. Special notes for reviews

Checklist

  • Format your code make fmt.
  • Add unit tests or integration tests.
  • Update the documentation related to the change.

@gujingit gujingit requested a review from Copilot October 16, 2025 09:37
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds DNS-compatible naming constraints and introduces a new service name format with backward compatibility.

  • Add length checks to workload and service names (max 63 chars)
  • Switch Service naming to s-<rbg.Name>-<role.Name> with compatibility for existing services
  • Plumb a Kubernetes client into discovery ConfigBuilder and update reconciler to use the compatibility helper

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pkg/utils/service_utils.go Adds GetCompatibleHeadlessServiceName to resolve old vs new Service names by checking for an existing Service.
pkg/reconciler/sts_reconciler.go Uses the new compatibility helper; updates constructServiceApplyConfiguration signature to return an error; minor formatting.
pkg/discovery/injector.go Passes the controller-runtime client into ConfigBuilder so it can resolve Service names.
pkg/discovery/config_builder.go Updates to fetch Service name via compatibility helper; methods now return errors where appropriate.
pkg/discovery/config_builder_test.go Updates tests to cover both new and old naming; injects fake client; adjusts expected addresses.
api/workloads/v1alpha1/helper.go Adds 63-char truncation to workload/service names; unconditionally prefixes service name with "s-"; updates comments.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

feat: svcName changed to new format "s-rbg.Name-role.Name"
@gujingit gujingit force-pushed the bugfix/add-limit-check branch from 42fd2a1 to 33a65de Compare October 16, 2025 10:13
Copy link
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@cheyang cheyang merged commit 3ce572a into sgl-project:main Oct 16, 2025
3 checks passed
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.

3 participants