Skip to content

fix: Rename clientID to be client_name to match env var - #95

Merged
Alan-Cha merged 1 commit into
rossoctl:mainfrom
Alan-Cha:client_id_rename
Feb 16, 2026
Merged

Alan-Cha merged 1 commit into
rossoctl:mainfrom
Alan-Cha:client_id_rename

Conversation

@Alan-Cha

@Alan-Cha Alan-Cha commented Feb 3, 2026

Copy link
Copy Markdown
Member

Description

Fixes rossoctl/rossoctl#83

Type of Change

  • 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)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test addition or update
  • CI/CD update

How Has This Been Tested?

I need some guidance for testing

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented 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
  • Any dependent changes have been merged and published in downstream modules


// Check and inject client-registration sidecar (with SPIRE option)
if !containerExists(podSpec.Containers, ClientRegistrationContainerName) {
clientID := fmt.Sprintf("%s/%s", namespace, crName)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It seems redundant to pass clientID here it not needed anywhere else and we also compose clientID in BuildClientRegistrationContainerWithSpireOption()

Comment on lines -94 to +97
func BuildClientRegistrationContainerWithSpireOption(clientID, name, namespace string, spireEnabled bool) corev1.Container {
func BuildClientRegistrationContainerWithSpireOption(name, namespace string, spireEnabled bool) corev1.Container {
builderLog.Info("building ClientRegistration Container", "spireEnabled", spireEnabled)

if clientID == "" {
clientID = namespace + "/" + name
}
clientName := namespace + "/" + name

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Instead of passing clientID (which isn't being used anywhere else) and checking if it exists, we can just compose it here

@Alan-Cha
Alan-Cha requested review from cwiklik and mrsabath February 3, 2026 22:20
@Alan-Cha

Alan-Cha commented Feb 3, 2026

Copy link
Copy Markdown
Member Author

@cwiklik Could clarify how I should go about testing this? I recall previous, I used your scripts and I also had to build images. I'm not sure what I would need for this

@mrsabath

mrsabath commented Feb 3, 2026

Copy link
Copy Markdown
Member

If you follow the instructions on demo-webhook.md you should be able to get it working

Signed-off-by: Alan Cha <Alan.cha1@ibm.com>
@Alan-Cha Alan-Cha changed the title Rename clientID to be client_name to match env var fix: Rename clientID to be client_name to match env var Feb 4, 2026
@Alan-Cha

Copy link
Copy Markdown
Member Author

I've verified this PR and it seems to be working

@Alan-Cha Alan-Cha added enhancement New feature or request Ready for Review! labels Feb 16, 2026
@Alan-Cha

Copy link
Copy Markdown
Member Author

@cwiklik @mrsabath Can I get another review?

@cwiklik cwiklik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm;

@Alan-Cha
Alan-Cha merged commit 36d850a into rossoctl:main Feb 16, 2026
4 of 5 checks passed
cwiklik added a commit to cwiklik/kagenti-extensions that referenced this pull request Feb 16, 2026
…onfig

Phase 4 of 5: PodMutator Wiring & Main

Changes to pod_mutator.go:
- Add Builder, GetPlatformConfig, GetFeatureGates fields
- Update NewPodMutator to accept getter functions (not direct pointers)
- Rewrite InjectAuthBridge to use PrecedenceEvaluator for injection decisions
- Use ContainerBuilder with fresh config for each mutation
- Remove duplicate constants (now in constants.go from Phase 2)
- Update BuildClientRegistrationContainerWithSpireOption calls to remove clientID parameter (per upstream PR rossoctl#95)

Changes to main.go:
- Add --config-path and --feature-gates-path CLI flags
- Create ConfigLoader and FeatureGateLoader with hot-reload via Watch()
- Pass getter functions to NewPodMutator for dynamic config access
- Move ctrl.SetupSignalHandler() before loaders (shared context)
- Add OnChange callbacks for logging config updates

Changes to authbridge_webhook.go:
- Expand isAlreadyInjected to check EnvoyProxyContainerName

Changes to webhook_suite_test.go:
- Update NewPodMutator calls to pass lambda getters

Part of epic rossoctl#109

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: cwiklik <cwiklikj@gmail.com>
cwiklik added a commit to cwiklik/kagenti-extensions that referenced this pull request Feb 17, 2026
…onfig

Phase 4 of 5: PodMutator Wiring & Main

Changes to pod_mutator.go:
- Add Builder, GetPlatformConfig, GetFeatureGates fields
- Update NewPodMutator to accept getter functions (not direct pointers)
- Rewrite InjectAuthBridge to use PrecedenceEvaluator for injection decisions
- Use ContainerBuilder with fresh config for each mutation
- Remove redundant spireEnabled check on spiffe-helper injection
  (evaluateSpiffeHelper() already guarantees Inject=true only when SPIRE label is set)
- Remove duplicate constants (now in constants.go from Phase 2)
- Update BuildClientRegistrationContainerWithSpireOption calls to remove
  clientID parameter (per upstream PR rossoctl#95)

Changes to main.go:
- Add --config-path and --feature-gates-path CLI flags
- Create ConfigLoader and FeatureGateLoader with hot-reload via Watch()
- Pass getter functions to NewPodMutator for dynamic config access
- Move ctrl.SetupSignalHandler() before loaders (shared context)
- Add OnChange callbacks for logging config updates

Changes to authbridge_webhook.go:
- Expand isAlreadyInjected to check EnvoyProxyContainerName

Changes to webhook_suite_test.go:
- Update NewPodMutator calls to pass lambda getters

Part of epic rossoctl#109

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: cwiklik <cwiklikj@gmail.com>
cwiklik added a commit to cwiklik/kagenti-extensions that referenced this pull request Feb 17, 2026
…onfig

Phase 4 of 5: PodMutator Wiring & Main

Changes to pod_mutator.go:
- Add Builder, GetPlatformConfig, GetFeatureGates fields
- Update NewPodMutator to accept getter functions (not direct pointers)
- Rewrite InjectAuthBridge to use PrecedenceEvaluator for injection decisions
- Use ContainerBuilder with fresh config for each mutation
- Remove redundant spireEnabled check on spiffe-helper injection
  (evaluateSpiffeHelper() already guarantees Inject=true only when SPIRE label is set)
- Remove duplicate constants (now in constants.go from Phase 2)
- Update BuildClientRegistrationContainerWithSpireOption calls to remove
  clientID parameter (per upstream PR rossoctl#95)

Changes to main.go:
- Add --config-path and --feature-gates-path CLI flags
- Create ConfigLoader and FeatureGateLoader with hot-reload via Watch()
- Pass getter functions to NewPodMutator for dynamic config access
- Move ctrl.SetupSignalHandler() before loaders (shared context)
- Add OnChange callbacks for logging config updates

Changes to authbridge_webhook.go:
- Expand isAlreadyInjected to check EnvoyProxyContainerName

Changes to webhook_suite_test.go:
- Update NewPodMutator calls to pass lambda getters

Part of epic rossoctl#109

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: cwiklik <cwiklikj@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Ready for Review!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename CLIENT_NAME to CLIENT_ID

3 participants