diff --git a/sdk/proto/events/event.proto b/sdk/proto/events/event.proto index ba925506e..61324fc70 100644 --- a/sdk/proto/events/event.proto +++ b/sdk/proto/events/event.proto @@ -69,7 +69,7 @@ message SecurityViolationEvent { // DEPRECATED reserved 39; reserved "NginxID"; - + string PolicyName = 1 [(gogoproto.jsontag) = "policy_name"]; string SupportID = 2 [(gogoproto.jsontag) = "support_id"]; diff --git a/src/core/nginx.go b/src/core/nginx.go index ffc6ee23d..d27322b39 100644 --- a/src/core/nginx.go +++ b/src/core/nginx.go @@ -269,6 +269,10 @@ func (n *NginxBinaryType) ValidateConfig(processId, bin, configLocation string, return fmt.Errorf("error running nginx -t -c %v:\n%s", configLocation, response) } + if strings.Contains(response.String(), "nginx: [warn]") { + return fmt.Errorf("error running nginx -t -c %v:\n%s", configLocation, response) + } + log.Infof("Config validated:\n%s", response) return nil diff --git a/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto b/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto index ba925506e..61324fc70 100644 --- a/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto +++ b/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto @@ -69,7 +69,7 @@ message SecurityViolationEvent { // DEPRECATED reserved 39; reserved "NginxID"; - + string PolicyName = 1 [(gogoproto.jsontag) = "policy_name"]; string SupportID = 2 [(gogoproto.jsontag) = "support_id"]; diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto index ba925506e..61324fc70 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto @@ -69,7 +69,7 @@ message SecurityViolationEvent { // DEPRECATED reserved 39; reserved "NginxID"; - + string PolicyName = 1 [(gogoproto.jsontag) = "policy_name"]; string SupportID = 2 [(gogoproto.jsontag) = "support_id"]; diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/nginx.go index ffc6ee23d..d27322b39 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/nginx.go @@ -269,6 +269,10 @@ func (n *NginxBinaryType) ValidateConfig(processId, bin, configLocation string, return fmt.Errorf("error running nginx -t -c %v:\n%s", configLocation, response) } + if strings.Contains(response.String(), "nginx: [warn]") { + return fmt.Errorf("error running nginx -t -c %v:\n%s", configLocation, response) + } + log.Infof("Config validated:\n%s", response) return nil diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto b/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto index ba925506e..61324fc70 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto @@ -69,7 +69,7 @@ message SecurityViolationEvent { // DEPRECATED reserved 39; reserved "NginxID"; - + string PolicyName = 1 [(gogoproto.jsontag) = "policy_name"]; string SupportID = 2 [(gogoproto.jsontag) = "support_id"];