Skip to content

Commit 2b3598c

Browse files
fix(panic): empty AccessRequestConfig
1 parent e791ac1 commit 2b3598c

File tree

1 file changed

+7
-2
lines changed
  • cmd/openmcp-operator/app

1 file changed

+7
-2
lines changed

cmd/openmcp-operator/app/run.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
"github.com/openmcp-project/openmcp-operator/api/install"
2727
"github.com/openmcp-project/openmcp-operator/api/provider/v1alpha1"
28+
"github.com/openmcp-project/openmcp-operator/internal/config"
2829
"github.com/openmcp-project/openmcp-operator/internal/controllers/accessrequest"
2930
"github.com/openmcp-project/openmcp-operator/internal/controllers/provider"
3031
"github.com/openmcp-project/openmcp-operator/internal/controllers/scheduler"
@@ -67,7 +68,7 @@ func NewRunCommand(so *SharedOptions) *cobra.Command {
6768
func (o *RunOptions) AddFlags(cmd *cobra.Command) {
6869
// kubebuilder default flags
6970
cmd.Flags().StringVar(&o.MetricsAddr, "metrics-bind-address", "0", "The address the metrics endpoint binds to. Use :8443 for HTTPS or :8080 for HTTP, or leave as 0 to disable the metrics service.")
70-
cmd.Flags().StringVar(&o.ProbeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
71+
cmd.Flags().StringVar(&o.ProbeAddr, "health-probe-bind-address", ":8082", "The address the probe endpoint binds to.")
7172
cmd.Flags().StringVar(&o.PprofAddr, "pprof-bind-address", "", "The address the pprof endpoint binds to. Expected format is ':<port>'. Leave empty to disable pprof endpoint.")
7273
cmd.Flags().BoolVar(&o.EnableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
7374
cmd.Flags().BoolVar(&o.SecureMetrics, "metrics-secure", true, "If set, the metrics endpoint is served securely via HTTPS. Use --metrics-secure=false to use HTTP instead.")
@@ -303,7 +304,11 @@ func (o *RunOptions) Run(ctx context.Context) error {
303304

304305
// setup accessrequest controller
305306
if slices.Contains(o.Controllers, strings.ToLower(accessrequest.ControllerName)) {
306-
if err := accessrequest.NewAccessRequestReconciler(o.Clusters.Platform, o.Config.AccessRequest).SetupWithManager(mgr); err != nil {
307+
var arConfig *config.AccessRequestConfig
308+
if o.Config != nil {
309+
arConfig = o.Config.AccessRequest
310+
}
311+
if err := accessrequest.NewAccessRequestReconciler(o.Clusters.Platform, arConfig).SetupWithManager(mgr); err != nil {
307312
return fmt.Errorf("unable to setup accessrequest controller: %w", err)
308313
}
309314
}

0 commit comments

Comments
 (0)