Skip to content

Conversation

@bimakw
Copy link
Contributor

@bimakw bimakw commented Dec 14, 2025

Summary

  • Refactored duplicate getIntegrationKit implementations to use the existing kubernetes.GetIntegrationKit utility function
  • Removed unused ctrl import from pkg/trait/util.go and pkg/trait/jvm.go
  • Simplified pkg/cmd/promote.go to use the centralized utility

Files Changed

  • pkg/trait/util.go: Use kubernetes.GetIntegrationKit, remove unused ctrl import
  • pkg/trait/jvm.go: Use kubernetes.GetIntegrationKit, remove unused ctrl import
  • pkg/cmd/promote.go: Simplify to use kubernetes.GetIntegrationKit

Test Plan

  • go build ./pkg/trait/... ./pkg/cmd/... passes
  • CI tests pass

Fixes #6413

Refactored duplicate getIntegrationKit implementations to use the
existing kubernetes.GetIntegrationKit utility function. This reduces
code duplication and centralizes the IntegrationKit retrieval logic.

Changes:
- pkg/trait/util.go: Use kubernetes.GetIntegrationKit, remove unused ctrl import
- pkg/trait/jvm.go: Use kubernetes.GetIntegrationKit, remove unused ctrl import
- pkg/cmd/promote.go: Simplify to use kubernetes.GetIntegrationKit

Fixes: apache#6413
Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! If you can, just revert the check I commented in the review which I think it was clearer before.

pkg/trait/jvm.go Outdated

func (t *jvmTrait) getIntegrationKit(e *Environment) (*v1.IntegrationKit, error) {
kit := e.IntegrationKit
if e.IntegrationKit != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check is redundant. We can keep as it was.

@squakez
Copy link
Contributor

squakez commented Dec 14, 2025

Please run make lint to verify the validation failure and make lint-fix to automatically fix them or fix the problem manually. Thanks!

@squakez squakez merged commit 9b52a9a into apache:main Dec 15, 2025
10 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.

Duplicated getIntegrationKit code

3 participants