mirror of
https://github.com/stakater/Reloader.git
synced 2026-08-27 14:37:17 +00:00
feat: Use strategic merge to patch workloads and add metrics for load testing
This commit is contained in:
+12
-10
@@ -106,6 +106,18 @@ func run(cmd *cobra.Command, args []string) error {
|
||||
|
||||
collectors := metrics.SetupPrometheusEndpoint()
|
||||
|
||||
if config.ShouldAutoDetectOpenShift() {
|
||||
restConfig := controllerruntime.GetConfigOrDie()
|
||||
discoveryClient, err := discovery.NewDiscoveryClientForConfig(restConfig)
|
||||
if err != nil {
|
||||
log.V(1).Info("Failed to create discovery client for DeploymentConfig detection", "error", err)
|
||||
} else if openshift.HasDeploymentConfigSupport(discoveryClient, log) {
|
||||
cfg.DeploymentConfigEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
controller.AddOptionalSchemes(cfg.ArgoRolloutsEnabled, cfg.DeploymentConfigEnabled)
|
||||
|
||||
mgr, err := controller.NewManager(
|
||||
controller.ManagerOptions{
|
||||
Config: cfg,
|
||||
@@ -117,16 +129,6 @@ func run(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("creating manager: %w", err)
|
||||
}
|
||||
|
||||
if config.ShouldAutoDetectOpenShift() {
|
||||
restConfig := controllerruntime.GetConfigOrDie()
|
||||
discoveryClient, err := discovery.NewDiscoveryClientForConfig(restConfig)
|
||||
if err != nil {
|
||||
log.V(1).Info("Failed to create discovery client for DeploymentConfig detection", "error", err)
|
||||
} else if openshift.HasDeploymentConfigSupport(discoveryClient, log) {
|
||||
cfg.DeploymentConfigEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
if err := controller.SetupReconcilers(mgr, cfg, log, &collectors); err != nil {
|
||||
return fmt.Errorf("setting up reconcilers: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user