Files
Qing HaoandClaude Sonnet 4.5 391ae86bff split debug controller as standalone service with proper validation (#1461)
* feat(placement): split debug controller as standalone service with proper validation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Qing Hao <qhao@redhat.com>

* feat(placement): make placement service conditional on PlacementDebugServer feature gate

Make placement debug service deployment conditional based on
PlacementDebugServer feature gate to allow users to control
whether to expose the debug endpoint.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Qing Hao <qhao@redhat.com>

---------

Signed-off-by: Qing Hao <qhao@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-04-03 02:40:24 +00:00

44 lines
1.1 KiB
Go

package hub
import (
"context"
"github.com/spf13/cobra"
"k8s.io/utils/clock"
commonoptions "open-cluster-management.io/ocm/pkg/common/options"
controllers "open-cluster-management.io/ocm/pkg/placement/controllers"
"open-cluster-management.io/ocm/pkg/version"
)
func NewPlacementController() *cobra.Command {
opts := commonoptions.NewOptions()
cmdConfig := opts.
NewControllerCommandConfig("placement", version.Get(), controllers.RunControllerManager, clock.RealClock{})
cmd := cmdConfig.NewCommandWithContext(context.TODO())
cmd.Use = "controller"
cmd.Short = "Start the Placement Scheduling Controller"
flags := cmd.Flags()
opts.AddFlags(flags)
opts.ApplyTLSToCommand(cmd)
return cmd
}
func NewDebugServer() *cobra.Command {
opts := commonoptions.NewOptions()
cmdConfig := opts.
NewControllerCommandConfig("placement-debug", version.Get(), controllers.RunDebugServer, clock.RealClock{})
cmd := cmdConfig.NewCommandWithContext(context.TODO())
cmd.Use = "debug"
cmd.Short = "Start the Placement Debug Service (standalone)"
flags := cmd.Flags()
opts.AddFlags(flags)
opts.ApplyTLSToCommand(cmd)
return cmd
}