From 67b56711cf0fd8b44d14e9b132179e2a066a63a9 Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Thu, 25 Apr 2024 15:09:12 +0200 Subject: [PATCH] fix: logger nil pointer in instrumented_project_command_builder (#4461) Signed-off-by: kvanzuijlen <8818390+kvanzuijlen@users.noreply.github.com> --- server/events/project_command_builder.go | 5 ++++- server/server.go | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/events/project_command_builder.go b/server/events/project_command_builder.go index 41945ca170..d40ae25893 100644 --- a/server/events/project_command_builder.go +++ b/server/events/project_command_builder.go @@ -11,6 +11,7 @@ import ( "github.com/runatlantis/atlantis/server/core/config/valid" "github.com/runatlantis/atlantis/server/core/terraform" + "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/metrics" "github.com/pkg/errors" @@ -35,6 +36,7 @@ const ( ) func NewInstrumentedProjectCommandBuilder( + logger logging.SimpleLogging, policyChecksSupported bool, parserValidator *config.ParserValidator, projectFinder ProjectFinder, @@ -89,7 +91,8 @@ func NewInstrumentedProjectCommandBuilder( scope, terraformClient, ), - scope: scope, + Logger: logger, + scope: scope, } } diff --git a/server/server.go b/server/server.go index 0183b99f89..6573078fce 100644 --- a/server/server.go +++ b/server/server.go @@ -600,6 +600,7 @@ func NewServer(userConfig UserConfig, config Config) (*Server, error) { Router: router, } projectCommandBuilder := events.NewInstrumentedProjectCommandBuilder( + logger, policyChecksEnabled, validator, &events.DefaultProjectFinder{},