From 7f3136ef2bfde8a90e1fb5999b702032cfcfbd3b Mon Sep 17 00:00:00 2001 From: "o.omahony" Date: Fri, 9 Sep 2022 09:17:37 +0100 Subject: [PATCH 01/15] wip --- src/core/config/config.go | 1 + src/core/config/defaults.go | 2 ++ src/core/config/types.go | 1 + src/core/metrics/collectors/nginx.go | 2 ++ src/core/metrics/sources/nginx_plus.go | 4 ++-- src/core/nginx.go | 17 +++++++++++------ 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/core/config/config.go b/src/core/config/config.go index 83d92071f..912f3d709 100644 --- a/src/core/config/config.go +++ b/src/core/config/config.go @@ -304,6 +304,7 @@ func getNginx() Nginx { ExcludeLogs: Viper.GetString(NginxExcludeLogs), Debug: Viper.GetBool(NginxDebug), NginxCountingSocket: Viper.GetString(NginxCountingSocket), + ClientVersion: Viper.GetInt(NginxClientVersion), } } diff --git a/src/core/config/defaults.go b/src/core/config/defaults.go index d1a10b2b8..58346f64f 100644 --- a/src/core/config/defaults.go +++ b/src/core/config/defaults.go @@ -47,6 +47,7 @@ var ( Nginx: Nginx{ Debug: false, NginxCountingSocket: "unix:/var/run/nginx-agent/nginx.sock", + NginxClientVersion: 8, }, ConfigDirs: "/etc/nginx:/usr/local/etc/nginx:/usr/share/nginx/modules:/etc/nms", AllowedDirectoriesMap: map[string]struct{}{}, @@ -140,6 +141,7 @@ const ( NginxExcludeLogs = NginxKey + KeyDelimiter + "exclude_logs" NginxDebug = NginxKey + KeyDelimiter + "debug" NginxCountingSocket = NginxKey + KeyDelimiter + "socket" + NginxClientVersion = NginxKey + KeyDelimiter + "client_version" // viper keys used in config DataplaneKey = "dataplane" diff --git a/src/core/config/types.go b/src/core/config/types.go index 1ceddff13..66ab795b6 100644 --- a/src/core/config/types.go +++ b/src/core/config/types.go @@ -58,6 +58,7 @@ type Nginx struct { ExcludeLogs string `mapstructure:"exclude_logs" yaml:"-"` Debug bool `mapstructure:"debug" yaml:"-"` NginxCountingSocket string `mapstructure:"socket" yaml:"-"` + NginxClientVersion int `mapstructure:"client_version" yaml:"-"` } type Dataplane struct { diff --git a/src/core/metrics/collectors/nginx.go b/src/core/metrics/collectors/nginx.go index 6efcd378f..005a3ef0c 100644 --- a/src/core/metrics/collectors/nginx.go +++ b/src/core/metrics/collectors/nginx.go @@ -23,6 +23,7 @@ type NginxCollector struct { collectorConf *metrics.NginxCollectorConfig env core.Environment binary core.NginxBinary + conf config.Config } func NewNginxCollector(conf *config.Config, env core.Environment, collectorConf *metrics.NginxCollectorConfig, binary core.NginxBinary) *NginxCollector { @@ -38,6 +39,7 @@ func NewNginxCollector(conf *config.Config, env core.Environment, collectorConf collectorConf: collectorConf, env: env, binary: binary, + conf: conf, } } diff --git a/src/core/metrics/sources/nginx_plus.go b/src/core/metrics/sources/nginx_plus.go index 058a2b0b5..54626fa5f 100644 --- a/src/core/metrics/sources/nginx_plus.go +++ b/src/core/metrics/sources/nginx_plus.go @@ -44,7 +44,7 @@ func NewNginxPlus(baseDimensions *metrics.CommonDim, nginxNamespace, plusNamespa func (c *NginxPlus) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity) { defer wg.Done() c.init.Do(func() { - cl, err := plusclient.NewNginxClient(&http.Client{}, c.plusAPI) + cl, err := plusclient.NewNginxClientWithVersion(&http.Client{}, c.plusAPI, ) if err != nil { log.Errorf("Failed to create plus metrics client: %v", err) SendNginxDownStatus(ctx, c.baseDimensions.ToDimensions(), m) @@ -59,7 +59,7 @@ func (c *NginxPlus) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *p } }) - cl, err := plusclient.NewNginxClient(&http.Client{}, c.plusAPI) + cl, err := plusclient.NewNginxClientWithVersion(&http.Client{}, c.plusAPI) if err != nil { log.Errorf("Failed to create plus metrics client: %v", err) SendNginxDownStatus(ctx, c.baseDimensions.ToDimensions(), m) diff --git a/src/core/nginx.go b/src/core/nginx.go index f57da3142..af0826f13 100644 --- a/src/core/nginx.go +++ b/src/core/nginx.go @@ -64,6 +64,7 @@ type NginxBinaryType struct { errorLogs map[string]string accessLogsUpdated bool errorLogsUpdated bool + wg sync.WaitGroup } type nginxInfo struct { @@ -243,12 +244,16 @@ func (n *NginxBinaryType) Reload(processId, bin string) error { // ValidateConfig tests the config with nginx -t -c configLocation. func (n *NginxBinaryType) ValidateConfig(processId, bin, configLocation string, config *proto.NginxConfig, configApply *sdk.ConfigApply) error { log.Debugf("Validating config, %s for nginx process, %s", configLocation, processId) - response, err := runCmd(bin, "-t", "-c", configLocation) - if err != nil { - confFiles, auxFiles, err := sdk.GetNginxConfigFiles(config) - n.writeBackup(config, confFiles, auxFiles) - return fmt.Errorf("error running nginx -t -c %v:\n%s%v", configLocation, response, err) - } + + go func() { + n.wg.Wait() + response, err := runCmd(bin, "-t", "-c", configLocation) + if err != nil { + confFiles, auxFiles, err := sdk.GetNginxConfigFiles(config) + n.writeBackup(config, confFiles, auxFiles) + return fmt.Errorf("error running nginx -t -c %v:\n%s%v", configLocation, response, err) + } + }() log.Infof("Config validated:\n%s", response) From cd8c4fc1b3cd2e963ca815bd6b9dbf321fd32746 Mon Sep 17 00:00:00 2001 From: "o.omahony" Date: Thu, 15 Sep 2022 13:58:14 -0700 Subject: [PATCH 02/15] added timeout and channels --- src/core/config/config.go | 2 +- src/core/metrics/collectors/nginx.go | 5 ++-- src/core/metrics/metrics_util.go | 1 + src/core/metrics/sources/nginx_plus.go | 7 +++--- src/core/metrics/sources/nginx_plus_test.go | 4 ++-- src/core/nginx.go | 19 +++++++++------ .../nginx/agent/v2/src/core/config/config.go | 1 + .../agent/v2/src/core/config/defaults.go | 2 ++ .../nginx/agent/v2/src/core/config/types.go | 1 + .../v2/src/core/metrics/collectors/nginx.go | 3 ++- .../agent/v2/src/core/metrics/metrics_util.go | 1 + .../v2/src/core/metrics/sources/nginx_plus.go | 7 +++--- .../nginx/agent/v2/src/core/nginx.go | 24 +++++++++++++------ 13 files changed, 50 insertions(+), 27 deletions(-) diff --git a/src/core/config/config.go b/src/core/config/config.go index 6830e9035..ba58dca86 100644 --- a/src/core/config/config.go +++ b/src/core/config/config.go @@ -304,7 +304,7 @@ func getNginx() Nginx { ExcludeLogs: Viper.GetString(NginxExcludeLogs), Debug: Viper.GetBool(NginxDebug), NginxCountingSocket: Viper.GetString(NginxCountingSocket), - ClientVersion: Viper.GetInt(NginxClientVersion), + NginxClientVersion: Viper.GetInt(NginxClientVersion), } } diff --git a/src/core/metrics/collectors/nginx.go b/src/core/metrics/collectors/nginx.go index 005a3ef0c..07cf4e650 100644 --- a/src/core/metrics/collectors/nginx.go +++ b/src/core/metrics/collectors/nginx.go @@ -23,7 +23,7 @@ type NginxCollector struct { collectorConf *metrics.NginxCollectorConfig env core.Environment binary core.NginxBinary - conf config.Config + conf *config.Config } func NewNginxCollector(conf *config.Config, env core.Environment, collectorConf *metrics.NginxCollectorConfig, binary core.NginxBinary) *NginxCollector { @@ -39,7 +39,6 @@ func NewNginxCollector(conf *config.Config, env core.Environment, collectorConf collectorConf: collectorConf, env: env, binary: binary, - conf: conf, } } @@ -54,7 +53,7 @@ func buildSources(dimensions *metrics.CommonDim, binary core.NginxBinary, collec nginxSources = append(nginxSources, sources.NewNginxAccessLog(dimensions, sources.OSSNamespace, binary, sources.OSSNginxType, collectorConf.CollectionInterval)) nginxSources = append(nginxSources, sources.NewNginxErrorLog(dimensions, sources.OSSNamespace, binary, sources.OSSNginxType, collectorConf.CollectionInterval)) } else if collectorConf.PlusAPI != "" { - nginxSources = append(nginxSources, sources.NewNginxPlus(dimensions, sources.OSSNamespace, sources.PlusNamespace, collectorConf.PlusAPI)) + nginxSources = append(nginxSources, sources.NewNginxPlus(dimensions, sources.OSSNamespace, sources.PlusNamespace, collectorConf.PlusAPI, collectorConf.ClientVersion)) nginxSources = append(nginxSources, sources.NewNginxAccessLog(dimensions, sources.OSSNamespace, binary, sources.PlusNginxType, collectorConf.CollectionInterval)) nginxSources = append(nginxSources, sources.NewNginxErrorLog(dimensions, sources.OSSNamespace, binary, sources.PlusNginxType, collectorConf.CollectionInterval)) } else { diff --git a/src/core/metrics/metrics_util.go b/src/core/metrics/metrics_util.go index 0a96c87df..366534451 100644 --- a/src/core/metrics/metrics_util.go +++ b/src/core/metrics/metrics_util.go @@ -35,6 +35,7 @@ type NginxCollectorConfig struct { CollectionInterval time.Duration AccessLogs []string ErrorLogs []string + ClientVersion string } func NewStatsEntity(dims []*proto.Dimension, samples []*proto.SimpleMetric) *proto.StatsEntity { diff --git a/src/core/metrics/sources/nginx_plus.go b/src/core/metrics/sources/nginx_plus.go index 54626fa5f..c9a6ae3c3 100644 --- a/src/core/metrics/sources/nginx_plus.go +++ b/src/core/metrics/sources/nginx_plus.go @@ -35,16 +35,17 @@ type NginxPlus struct { // This is for keeping the previous stats. Need to report the delta. prevStats *plusclient.Stats init sync.Once + clientVersion int } -func NewNginxPlus(baseDimensions *metrics.CommonDim, nginxNamespace, plusNamespace, plusAPI string) *NginxPlus { +func NewNginxPlus(baseDimensions *metrics.CommonDim, nginxNamespace, plusNamespace, plusAPI, c string) *NginxPlus { return &NginxPlus{baseDimensions: baseDimensions, nginxNamespace: nginxNamespace, plusNamespace: plusNamespace, plusAPI: plusAPI} } func (c *NginxPlus) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity) { defer wg.Done() c.init.Do(func() { - cl, err := plusclient.NewNginxClientWithVersion(&http.Client{}, c.plusAPI, ) + cl, err := plusclient.NewNginxClientWithVersion(&http.Client{}, c.plusAPI, c.clientVersion) if err != nil { log.Errorf("Failed to create plus metrics client: %v", err) SendNginxDownStatus(ctx, c.baseDimensions.ToDimensions(), m) @@ -59,7 +60,7 @@ func (c *NginxPlus) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *p } }) - cl, err := plusclient.NewNginxClientWithVersion(&http.Client{}, c.plusAPI) + cl, err := plusclient.NewNginxClientWithVersion(&http.Client{}, c.plusAPI, c.clientVersion) if err != nil { log.Errorf("Failed to create plus metrics client: %v", err) SendNginxDownStatus(ctx, c.baseDimensions.ToDimensions(), m) diff --git a/src/core/metrics/sources/nginx_plus_test.go b/src/core/metrics/sources/nginx_plus_test.go index f9179cd70..723975f64 100644 --- a/src/core/metrics/sources/nginx_plus_test.go +++ b/src/core/metrics/sources/nginx_plus_test.go @@ -404,7 +404,7 @@ func (f *FakeNginxPlus) Collect(ctx context.Context, wg *sync.WaitGroup, m chan< } func TestNginxPlusUpdate(t *testing.T) { - nginxPlus := NewNginxPlus(&metrics.CommonDim{}, "test", PlusNamespace, "http://localhost:8080/api") + nginxPlus := NewNginxPlus(&metrics.CommonDim{}, "test", PlusNamespace, "http://localhost:8080/api", "8") assert.Equal(t, "", nginxPlus.baseDimensions.InstanceTags) assert.Equal(t, "http://localhost:8080/api", nginxPlus.plusAPI) @@ -643,7 +643,7 @@ func TestNginxPlus_Collect(t *testing.T) { for _, test := range tests { ctx := context.TODO() - f := &FakeNginxPlus{NewNginxPlus(test.baseDimensions, "nginx", "plus", "")} + f := &FakeNginxPlus{NewNginxPlus(test.baseDimensions, "nginx", "plus", "", "8")} wg := &sync.WaitGroup{} wg.Add(1) go f.Collect(ctx, wg, test.m) diff --git a/src/core/nginx.go b/src/core/nginx.go index af0826f13..e3f3612d3 100644 --- a/src/core/nginx.go +++ b/src/core/nginx.go @@ -245,17 +245,22 @@ func (n *NginxBinaryType) Reload(processId, bin string) error { func (n *NginxBinaryType) ValidateConfig(processId, bin, configLocation string, config *proto.NginxConfig, configApply *sdk.ConfigApply) error { log.Debugf("Validating config, %s for nginx process, %s", configLocation, processId) - go func() { + errChan := make(chan error, 1) + responseChan := make(chan string) + + go func(responseChan chan string, errChan chan error) { n.wg.Wait() - response, err := runCmd(bin, "-t", "-c", configLocation) - if err != nil { - confFiles, auxFiles, err := sdk.GetNginxConfigFiles(config) + res, errResponse := runCmd(bin, "-t", "-c", configLocation) + if errResponse != nil { + confFiles, auxFiles, errResponse := sdk.GetNginxConfigFiles(config) n.writeBackup(config, confFiles, auxFiles) - return fmt.Errorf("error running nginx -t -c %v:\n%s%v", configLocation, response, err) + errChan <- fmt.Errorf("error running nginx -t -c %s:\n %s %v", configLocation, res, errResponse) } - }() + responseChan <- res.String() + defer n.wg.Done() + }(responseChan, errChan) - log.Infof("Config validated:\n%s", response) + log.Infof("Config validated:\n%s", <-responseChan) return nil } diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go index cdc988afc..ba58dca86 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go @@ -304,6 +304,7 @@ func getNginx() Nginx { ExcludeLogs: Viper.GetString(NginxExcludeLogs), Debug: Viper.GetBool(NginxDebug), NginxCountingSocket: Viper.GetString(NginxCountingSocket), + NginxClientVersion: Viper.GetInt(NginxClientVersion), } } diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go index 9c9487b7b..f71592033 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go @@ -47,6 +47,7 @@ var ( Nginx: Nginx{ Debug: false, NginxCountingSocket: "unix:/var/run/nginx-agent/nginx.sock", + NginxClientVersion: 8, }, ConfigDirs: "/etc/nginx:/usr/local/etc/nginx:/usr/share/nginx/modules:/etc/nms", AllowedDirectoriesMap: map[string]struct{}{}, @@ -140,6 +141,7 @@ const ( NginxExcludeLogs = NginxKey + KeyDelimiter + "exclude_logs" NginxDebug = NginxKey + KeyDelimiter + "debug" NginxCountingSocket = NginxKey + KeyDelimiter + "socket" + NginxClientVersion = NginxKey + KeyDelimiter + "client_version" // viper keys used in config DataplaneKey = "dataplane" diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/types.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/types.go index 1ceddff13..66ab795b6 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/types.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/types.go @@ -58,6 +58,7 @@ type Nginx struct { ExcludeLogs string `mapstructure:"exclude_logs" yaml:"-"` Debug bool `mapstructure:"debug" yaml:"-"` NginxCountingSocket string `mapstructure:"socket" yaml:"-"` + NginxClientVersion int `mapstructure:"client_version" yaml:"-"` } type Dataplane struct { diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/collectors/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/collectors/nginx.go index 6efcd378f..07cf4e650 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/collectors/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/collectors/nginx.go @@ -23,6 +23,7 @@ type NginxCollector struct { collectorConf *metrics.NginxCollectorConfig env core.Environment binary core.NginxBinary + conf *config.Config } func NewNginxCollector(conf *config.Config, env core.Environment, collectorConf *metrics.NginxCollectorConfig, binary core.NginxBinary) *NginxCollector { @@ -52,7 +53,7 @@ func buildSources(dimensions *metrics.CommonDim, binary core.NginxBinary, collec nginxSources = append(nginxSources, sources.NewNginxAccessLog(dimensions, sources.OSSNamespace, binary, sources.OSSNginxType, collectorConf.CollectionInterval)) nginxSources = append(nginxSources, sources.NewNginxErrorLog(dimensions, sources.OSSNamespace, binary, sources.OSSNginxType, collectorConf.CollectionInterval)) } else if collectorConf.PlusAPI != "" { - nginxSources = append(nginxSources, sources.NewNginxPlus(dimensions, sources.OSSNamespace, sources.PlusNamespace, collectorConf.PlusAPI)) + nginxSources = append(nginxSources, sources.NewNginxPlus(dimensions, sources.OSSNamespace, sources.PlusNamespace, collectorConf.PlusAPI, collectorConf.ClientVersion)) nginxSources = append(nginxSources, sources.NewNginxAccessLog(dimensions, sources.OSSNamespace, binary, sources.PlusNginxType, collectorConf.CollectionInterval)) nginxSources = append(nginxSources, sources.NewNginxErrorLog(dimensions, sources.OSSNamespace, binary, sources.PlusNginxType, collectorConf.CollectionInterval)) } else { diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/metrics_util.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/metrics_util.go index 0a96c87df..366534451 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/metrics_util.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/metrics_util.go @@ -35,6 +35,7 @@ type NginxCollectorConfig struct { CollectionInterval time.Duration AccessLogs []string ErrorLogs []string + ClientVersion string } func NewStatsEntity(dims []*proto.Dimension, samples []*proto.SimpleMetric) *proto.StatsEntity { diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/sources/nginx_plus.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/sources/nginx_plus.go index 058a2b0b5..c9a6ae3c3 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/sources/nginx_plus.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/sources/nginx_plus.go @@ -35,16 +35,17 @@ type NginxPlus struct { // This is for keeping the previous stats. Need to report the delta. prevStats *plusclient.Stats init sync.Once + clientVersion int } -func NewNginxPlus(baseDimensions *metrics.CommonDim, nginxNamespace, plusNamespace, plusAPI string) *NginxPlus { +func NewNginxPlus(baseDimensions *metrics.CommonDim, nginxNamespace, plusNamespace, plusAPI, c string) *NginxPlus { return &NginxPlus{baseDimensions: baseDimensions, nginxNamespace: nginxNamespace, plusNamespace: plusNamespace, plusAPI: plusAPI} } func (c *NginxPlus) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *proto.StatsEntity) { defer wg.Done() c.init.Do(func() { - cl, err := plusclient.NewNginxClient(&http.Client{}, c.plusAPI) + cl, err := plusclient.NewNginxClientWithVersion(&http.Client{}, c.plusAPI, c.clientVersion) if err != nil { log.Errorf("Failed to create plus metrics client: %v", err) SendNginxDownStatus(ctx, c.baseDimensions.ToDimensions(), m) @@ -59,7 +60,7 @@ func (c *NginxPlus) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<- *p } }) - cl, err := plusclient.NewNginxClient(&http.Client{}, c.plusAPI) + cl, err := plusclient.NewNginxClientWithVersion(&http.Client{}, c.plusAPI, c.clientVersion) if err != nil { log.Errorf("Failed to create plus metrics client: %v", err) SendNginxDownStatus(ctx, c.baseDimensions.ToDimensions(), m) 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 f57da3142..e3f3612d3 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 @@ -64,6 +64,7 @@ type NginxBinaryType struct { errorLogs map[string]string accessLogsUpdated bool errorLogsUpdated bool + wg sync.WaitGroup } type nginxInfo struct { @@ -243,14 +244,23 @@ func (n *NginxBinaryType) Reload(processId, bin string) error { // ValidateConfig tests the config with nginx -t -c configLocation. func (n *NginxBinaryType) ValidateConfig(processId, bin, configLocation string, config *proto.NginxConfig, configApply *sdk.ConfigApply) error { log.Debugf("Validating config, %s for nginx process, %s", configLocation, processId) - response, err := runCmd(bin, "-t", "-c", configLocation) - if err != nil { - confFiles, auxFiles, err := sdk.GetNginxConfigFiles(config) - n.writeBackup(config, confFiles, auxFiles) - return fmt.Errorf("error running nginx -t -c %v:\n%s%v", configLocation, response, err) - } - log.Infof("Config validated:\n%s", response) + errChan := make(chan error, 1) + responseChan := make(chan string) + + go func(responseChan chan string, errChan chan error) { + n.wg.Wait() + res, errResponse := runCmd(bin, "-t", "-c", configLocation) + if errResponse != nil { + confFiles, auxFiles, errResponse := sdk.GetNginxConfigFiles(config) + n.writeBackup(config, confFiles, auxFiles) + errChan <- fmt.Errorf("error running nginx -t -c %s:\n %s %v", configLocation, res, errResponse) + } + responseChan <- res.String() + defer n.wg.Done() + }(responseChan, errChan) + + log.Infof("Config validated:\n%s", <-responseChan) return nil } From 64dd34e773555d04fbb3a3e39505807012082a39 Mon Sep 17 00:00:00 2001 From: dhurley Date: Mon, 3 Oct 2022 16:31:31 +0100 Subject: [PATCH 03/15] Updated apply config logic to validate the nginx config in a separate go routine and return the result of the config reply in the Dataplane status. --- sdk/proto/command.pb.go | 785 ++++++++++++++++-- sdk/proto/command.proto | 19 + src/core/config/defaults.go | 4 +- src/core/metrics/sources/nginx_plus.go | 4 +- src/core/nginx.go | 23 +- src/core/topics.go | 5 + src/plugins/dataplane_status.go | 79 +- src/plugins/dataplane_status_test.go | 170 +++- src/plugins/nginx.go | 179 +++- src/plugins/nginx_test.go | 197 ++++- .../nginx/agent/sdk/v2/proto/command.pb.go | 785 ++++++++++++++++-- .../nginx/agent/sdk/v2/proto/command.proto | 19 + .../agent/v2/src/core/config/defaults.go | 4 +- .../v2/src/core/metrics/sources/nginx_plus.go | 4 +- .../nginx/agent/v2/src/core/nginx.go | 23 +- .../nginx/agent/v2/src/core/topics.go | 5 + .../agent/v2/src/plugins/dataplane_status.go | 79 +- .../nginx/agent/v2/src/plugins/nginx.go | 179 +++- .../nginx/agent/sdk/v2/proto/command.pb.go | 785 ++++++++++++++++-- .../nginx/agent/sdk/v2/proto/command.proto | 19 + 20 files changed, 2912 insertions(+), 455 deletions(-) diff --git a/sdk/proto/command.pb.go b/sdk/proto/command.pb.go index d4b8a3870..2c617b1f5 100644 --- a/sdk/proto/command.pb.go +++ b/sdk/proto/command.pb.go @@ -105,6 +105,34 @@ func (CommandStatusResponse_CommandErrorCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor_213c0bb044472049, []int{1, 1} } +type NginxConfigStatus_Status int32 + +const ( + NginxConfigStatus_PENDING NginxConfigStatus_Status = 0 + NginxConfigStatus_OK NginxConfigStatus_Status = 1 + NginxConfigStatus_ERROR NginxConfigStatus_Status = 2 +) + +var NginxConfigStatus_Status_name = map[int32]string{ + 0: "PENDING", + 1: "OK", + 2: "ERROR", +} + +var NginxConfigStatus_Status_value = map[string]int32{ + "PENDING": 0, + "OK": 1, + "ERROR": 2, +} + +func (x NginxConfigStatus_Status) String() string { + return proto.EnumName(NginxConfigStatus_Status_name, int32(x)) +} + +func (NginxConfigStatus_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_213c0bb044472049, []int{4, 0} +} + type UploadStatus_TransferStatus int32 const ( @@ -130,7 +158,7 @@ func (x UploadStatus_TransferStatus) String() string { } func (UploadStatus_TransferStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{5, 0} + return fileDescriptor_213c0bb044472049, []int{7, 0} } // Command is the envelope sent between the management plane and the data plane, requesting some action or reporting a response @@ -422,6 +450,7 @@ type DataplaneStatus struct { Host *HostInfo `protobuf:"bytes,3,opt,name=host,proto3" json:"host"` Healths []*NginxHealth `protobuf:"bytes,5,rep,name=healths,proto3" json:"healths"` DataplaneSoftwareDetails []*DataplaneSoftwareDetails `protobuf:"bytes,6,rep,name=dataplane_software_details,json=dataplaneSoftwareDetails,proto3" json:"dataplane_software_details"` + AgentActivityStatus []*AgentActivityStatus `protobuf:"bytes,7,rep,name=agent_activity_status,json=agentActivityStatus,proto3" json:"agent_activity_status"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -495,6 +524,151 @@ func (m *DataplaneStatus) GetDataplaneSoftwareDetails() []*DataplaneSoftwareDeta return nil } +func (m *DataplaneStatus) GetAgentActivityStatus() []*AgentActivityStatus { + if m != nil { + return m.AgentActivityStatus + } + return nil +} + +type AgentActivityStatus struct { + // Types that are valid to be assigned to Status: + // *AgentActivityStatus_NginxConfigStatus + Status isAgentActivityStatus_Status `protobuf_oneof:"Status"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AgentActivityStatus) Reset() { *m = AgentActivityStatus{} } +func (m *AgentActivityStatus) String() string { return proto.CompactTextString(m) } +func (*AgentActivityStatus) ProtoMessage() {} +func (*AgentActivityStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_213c0bb044472049, []int{3} +} +func (m *AgentActivityStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AgentActivityStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AgentActivityStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AgentActivityStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_AgentActivityStatus.Merge(m, src) +} +func (m *AgentActivityStatus) XXX_Size() int { + return m.Size() +} +func (m *AgentActivityStatus) XXX_DiscardUnknown() { + xxx_messageInfo_AgentActivityStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_AgentActivityStatus proto.InternalMessageInfo + +type isAgentActivityStatus_Status interface { + isAgentActivityStatus_Status() + MarshalTo([]byte) (int, error) + Size() int +} + +type AgentActivityStatus_NginxConfigStatus struct { + NginxConfigStatus *NginxConfigStatus `protobuf:"bytes,1,opt,name=nginx_config_status,json=nginxConfigStatus,proto3,oneof" json:"nginx_config_status"` +} + +func (*AgentActivityStatus_NginxConfigStatus) isAgentActivityStatus_Status() {} + +func (m *AgentActivityStatus) GetStatus() isAgentActivityStatus_Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *AgentActivityStatus) GetNginxConfigStatus() *NginxConfigStatus { + if x, ok := m.GetStatus().(*AgentActivityStatus_NginxConfigStatus); ok { + return x.NginxConfigStatus + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*AgentActivityStatus) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*AgentActivityStatus_NginxConfigStatus)(nil), + } +} + +type NginxConfigStatus struct { + CorrelationId string `protobuf:"bytes,1,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id"` + Status NginxConfigStatus_Status `protobuf:"varint,2,opt,name=status,proto3,enum=f5.nginx.agent.sdk.NginxConfigStatus_Status" json:"status"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NginxConfigStatus) Reset() { *m = NginxConfigStatus{} } +func (m *NginxConfigStatus) String() string { return proto.CompactTextString(m) } +func (*NginxConfigStatus) ProtoMessage() {} +func (*NginxConfigStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_213c0bb044472049, []int{4} +} +func (m *NginxConfigStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NginxConfigStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NginxConfigStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NginxConfigStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_NginxConfigStatus.Merge(m, src) +} +func (m *NginxConfigStatus) XXX_Size() int { + return m.Size() +} +func (m *NginxConfigStatus) XXX_DiscardUnknown() { + xxx_messageInfo_NginxConfigStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_NginxConfigStatus proto.InternalMessageInfo + +func (m *NginxConfigStatus) GetCorrelationId() string { + if m != nil { + return m.CorrelationId + } + return "" +} + +func (m *NginxConfigStatus) GetStatus() NginxConfigStatus_Status { + if m != nil { + return m.Status + } + return NginxConfigStatus_PENDING +} + +func (m *NginxConfigStatus) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + type DownloadRequest struct { Meta *Metadata `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -506,7 +680,7 @@ func (m *DownloadRequest) Reset() { *m = DownloadRequest{} } func (m *DownloadRequest) String() string { return proto.CompactTextString(m) } func (*DownloadRequest) ProtoMessage() {} func (*DownloadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{3} + return fileDescriptor_213c0bb044472049, []int{5} } func (m *DownloadRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -555,7 +729,7 @@ func (m *NginxConfigResponse) Reset() { *m = NginxConfigResponse{} } func (m *NginxConfigResponse) String() string { return proto.CompactTextString(m) } func (*NginxConfigResponse) ProtoMessage() {} func (*NginxConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{4} + return fileDescriptor_213c0bb044472049, []int{6} } func (m *NginxConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -618,7 +792,7 @@ func (m *UploadStatus) Reset() { *m = UploadStatus{} } func (m *UploadStatus) String() string { return proto.CompactTextString(m) } func (*UploadStatus) ProtoMessage() {} func (*UploadStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{5} + return fileDescriptor_213c0bb044472049, []int{7} } func (m *UploadStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -682,7 +856,7 @@ func (m *DataChunk) Reset() { *m = DataChunk{} } func (m *DataChunk) String() string { return proto.CompactTextString(m) } func (*DataChunk) ProtoMessage() {} func (*DataChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{6} + return fileDescriptor_213c0bb044472049, []int{8} } func (m *DataChunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -771,7 +945,7 @@ func (m *ChunkedResourceHeader) Reset() { *m = ChunkedResourceHeader{} } func (m *ChunkedResourceHeader) String() string { return proto.CompactTextString(m) } func (*ChunkedResourceHeader) ProtoMessage() {} func (*ChunkedResourceHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{7} + return fileDescriptor_213c0bb044472049, []int{9} } func (m *ChunkedResourceHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -841,7 +1015,7 @@ func (m *ChunkedResourceChunk) Reset() { *m = ChunkedResourceChunk{} } func (m *ChunkedResourceChunk) String() string { return proto.CompactTextString(m) } func (*ChunkedResourceChunk) ProtoMessage() {} func (*ChunkedResourceChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{8} + return fileDescriptor_213c0bb044472049, []int{10} } func (m *ChunkedResourceChunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -895,10 +1069,13 @@ func init() { proto.RegisterEnum("f5.nginx.agent.sdk.Command_CommandType", Command_CommandType_name, Command_CommandType_value) proto.RegisterEnum("f5.nginx.agent.sdk.CommandStatusResponse_CommandStatus", CommandStatusResponse_CommandStatus_name, CommandStatusResponse_CommandStatus_value) proto.RegisterEnum("f5.nginx.agent.sdk.CommandStatusResponse_CommandErrorCode", CommandStatusResponse_CommandErrorCode_name, CommandStatusResponse_CommandErrorCode_value) + proto.RegisterEnum("f5.nginx.agent.sdk.NginxConfigStatus_Status", NginxConfigStatus_Status_name, NginxConfigStatus_Status_value) proto.RegisterEnum("f5.nginx.agent.sdk.UploadStatus_TransferStatus", UploadStatus_TransferStatus_name, UploadStatus_TransferStatus_value) proto.RegisterType((*Command)(nil), "f5.nginx.agent.sdk.Command") proto.RegisterType((*CommandStatusResponse)(nil), "f5.nginx.agent.sdk.CommandStatusResponse") proto.RegisterType((*DataplaneStatus)(nil), "f5.nginx.agent.sdk.DataplaneStatus") + proto.RegisterType((*AgentActivityStatus)(nil), "f5.nginx.agent.sdk.AgentActivityStatus") + proto.RegisterType((*NginxConfigStatus)(nil), "f5.nginx.agent.sdk.NginxConfigStatus") proto.RegisterType((*DownloadRequest)(nil), "f5.nginx.agent.sdk.DownloadRequest") proto.RegisterType((*NginxConfigResponse)(nil), "f5.nginx.agent.sdk.NginxConfigResponse") proto.RegisterType((*UploadStatus)(nil), "f5.nginx.agent.sdk.UploadStatus") @@ -910,85 +1087,94 @@ func init() { func init() { proto.RegisterFile("command.proto", fileDescriptor_213c0bb044472049) } var fileDescriptor_213c0bb044472049 = []byte{ - // 1245 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x26, 0x65, 0x8b, 0xb2, 0x46, 0x72, 0x2c, 0x6c, 0x9c, 0x82, 0x31, 0x02, 0xd3, 0x60, 0x9b, - 0xc6, 0x2d, 0x1a, 0x09, 0x75, 0x10, 0x14, 0x48, 0x2e, 0x35, 0x25, 0xa5, 0x34, 0x62, 0x4b, 0xc5, - 0x3a, 0x4e, 0x80, 0x14, 0x85, 0xc0, 0x90, 0xab, 0x1f, 0xd8, 0x22, 0x55, 0x2e, 0x95, 0xc4, 0x41, - 0xef, 0x05, 0x8a, 0xde, 0x8a, 0xa2, 0xe8, 0x53, 0xf4, 0x35, 0x7a, 0xcc, 0x13, 0x10, 0x85, 0x8f, - 0x7c, 0x80, 0x9e, 0x8b, 0xfd, 0xa1, 0x2c, 0xd9, 0x94, 0xdc, 0xc0, 0xbd, 0x68, 0x67, 0x67, 0xbf, - 0xf9, 0xe6, 0x67, 0x77, 0x67, 0x29, 0x58, 0x75, 0x83, 0xe1, 0xd0, 0xf1, 0xbd, 0xea, 0x28, 0x0c, - 0xa2, 0x00, 0xa1, 0xee, 0xc3, 0xaa, 0xdf, 0x1b, 0xf8, 0x6f, 0xab, 0x4e, 0x8f, 0xf8, 0x51, 0x95, - 0x7a, 0xc7, 0x1b, 0xd0, 0x0b, 0x7a, 0x81, 0x58, 0xdf, 0x28, 0x33, 0x78, 0xe0, 0xcb, 0x59, 0x49, - 0x80, 0xc4, 0x04, 0xfa, 0x01, 0x4d, 0xe5, 0x92, 0xe0, 0x98, 0xd8, 0xf8, 0xdd, 0x41, 0x4f, 0xce, - 0x10, 0x79, 0x4d, 0xfc, 0x88, 0xd6, 0xf8, 0x20, 0x75, 0xb7, 0xbd, 0x51, 0x87, 0x06, 0xdd, 0xe8, - 0x8d, 0x13, 0x92, 0x8e, 0x47, 0x22, 0x67, 0x70, 0x42, 0xc5, 0x92, 0xf9, 0x2b, 0x40, 0xa1, 0x2e, - 0x42, 0x44, 0x8f, 0x60, 0x79, 0x48, 0x22, 0x47, 0x57, 0xb7, 0xd4, 0xed, 0xd2, 0xce, 0x9d, 0xea, - 0xe5, 0x58, 0xab, 0x07, 0x24, 0x72, 0x3c, 0x27, 0x72, 0xac, 0x95, 0x24, 0x36, 0x38, 0x1a, 0xf3, - 0x5f, 0xd4, 0x84, 0xe5, 0xe8, 0x74, 0x44, 0xf4, 0xdc, 0x96, 0xba, 0x7d, 0x63, 0xe7, 0x5e, 0x96, - 0xad, 0x74, 0x93, 0x8e, 0xcf, 0x4e, 0x47, 0x44, 0xd0, 0x30, 0x43, 0xcc, 0x7f, 0xd1, 0x4b, 0x00, - 0x77, 0xe8, 0x75, 0x68, 0xe4, 0x44, 0x63, 0xaa, 0x2f, 0xf1, 0x40, 0x3e, 0x5b, 0x40, 0x76, 0xc8, - 0x81, 0x98, 0xd0, 0x51, 0xe0, 0x53, 0x62, 0xdd, 0x48, 0x62, 0x63, 0x8a, 0xc0, 0x56, 0x70, 0xd1, - 0x1d, 0x4a, 0x10, 0x7a, 0x0e, 0x65, 0xce, 0xd2, 0x11, 0xf5, 0xd2, 0x97, 0x39, 0xbb, 0x91, 0xc5, - 0xde, 0x62, 0xf3, 0x3a, 0x87, 0x59, 0x95, 0x24, 0x36, 0x66, 0x0c, 0x6d, 0x05, 0x8b, 0xfa, 0x0b, - 0x00, 0x7a, 0x0b, 0xb7, 0xa6, 0x97, 0x3b, 0xa1, 0x8c, 0x46, 0xcf, 0x73, 0x07, 0xf7, 0xae, 0x70, - 0x30, 0x09, 0xfe, 0x76, 0x12, 0x1b, 0xd9, 0x4c, 0xb6, 0x82, 0x6f, 0xfa, 0x97, 0x2d, 0x98, 0x67, - 0x4e, 0xc9, 0xf0, 0x3e, 0x71, 0xa3, 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c, 0x47, 0xf4, 0x1c, 0x4a, 0xf2, 0x15, 0x61, 0x09, - 0xc9, 0x83, 0xf1, 0x49, 0x76, 0x78, 0x0c, 0xd6, 0x20, 0xd4, 0x0d, 0x07, 0xa3, 0x28, 0x08, 0xad, - 0xb5, 0x24, 0x36, 0xa6, 0x8d, 0x31, 0x88, 0x09, 0xdb, 0x26, 0xf3, 0x1f, 0x15, 0xca, 0x47, 0x23, - 0x56, 0x57, 0x79, 0xde, 0xaf, 0xf3, 0x95, 0x76, 0x38, 0x29, 0x9f, 0xc8, 0xb7, 0x96, 0x65, 0x3d, - 0xed, 0xad, 0xfa, 0x2c, 0x74, 0x7c, 0xda, 0x25, 0xe1, 0x82, 0xae, 0x65, 0x82, 0x16, 0x12, 0x87, - 0x06, 0xbe, 0xec, 0x24, 0x1c, 0x23, 0x34, 0x58, 0x8e, 0xe6, 0x97, 0x70, 0x63, 0x96, 0x09, 0x95, - 0xa0, 0x70, 0xde, 0x23, 0x34, 0xc8, 0xf1, 0xfe, 0x00, 0xa0, 0x3d, 0xd9, 0xdd, 0xdb, 0x6f, 0x36, - 0x2a, 0x39, 0xf3, 0x4f, 0x15, 0x8a, 0xac, 0x02, 0xf5, 0xfe, 0xd8, 0x3f, 0x46, 0x6d, 0xd0, 0xfa, - 0xc4, 0xf1, 0x48, 0xb8, 0x70, 0xe3, 0x19, 0x94, 0x78, 0x98, 0xd0, 0x60, 0x1c, 0xba, 0xc4, 0xe6, - 0x06, 0x22, 0x1e, 0x61, 0x6c, 0x2b, 0x58, 0x4a, 0xc8, 0x16, 0xad, 0x9e, 0x17, 0x62, 0xce, 0xf7, - 0xca, 0x05, 0x3a, 0x3e, 0x15, 0x25, 0x65, 0x96, 0xb6, 0x82, 0xf9, 0x68, 0x15, 0x20, 0xef, 0xb2, - 0x25, 0xf3, 0xbd, 0x0a, 0xb7, 0x32, 0x43, 0xb8, 0xd6, 0x9e, 0x99, 0xa0, 0x71, 0x7a, 0xb1, 0x67, - 0x79, 0x91, 0x8e, 0xd0, 0x60, 0x39, 0xa2, 0x6d, 0x58, 0x71, 0xfb, 0xc4, 0x3d, 0xa6, 0xe3, 0xa1, - 0xdc, 0x84, 0x72, 0x12, 0x1b, 0x13, 0x1d, 0x9e, 0x48, 0xe8, 0x3e, 0x00, 0xb7, 0xe9, 0xd0, 0xc1, - 0x3b, 0xc2, 0xbb, 0x7a, 0x5e, 0x7e, 0x35, 0x4f, 0xb4, 0xb8, 0xc8, 0xe5, 0xc3, 0xc1, 0x3b, 0x62, - 0xfe, 0xa1, 0xc2, 0x7a, 0x56, 0x19, 0xae, 0x95, 0xd1, 0x3d, 0x16, 0x2d, 0xf3, 0x36, 0xf0, 0x64, - 0x4e, 0x32, 0x5a, 0xa1, 0xc3, 0x05, 0x2e, 0xed, 0x79, 0xe8, 0x8e, 0xdc, 0x23, 0x96, 0x52, 0xf9, - 0xbc, 0xf2, 0xb2, 0xee, 0xad, 0xbf, 0xce, 0x36, 0xd5, 0xf7, 0x67, 0x9b, 0xea, 0xdf, 0x67, 0x9b, - 0xea, 0xcb, 0xaf, 0x7b, 0x83, 0xe8, 0xc4, 0x79, 0x55, 0x75, 0x83, 0xe1, 0xa3, 0xee, 0xc3, 0x1a, - 0x0f, 0xa6, 0xc6, 0x83, 0xa9, 0x8d, 0xc2, 0xc0, 0x1b, 0xbb, 0x91, 0xd0, 0xdd, 0x17, 0x3a, 0xea, - 0x1d, 0xd7, 0x5e, 0xef, 0xd4, 0xf8, 0x9f, 0xa0, 0xc7, 0xfc, 0xf7, 0x95, 0xc6, 0x87, 0x07, 0xff, - 0x06, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x05, 0x57, 0x2c, 0xb3, 0x0d, 0x00, 0x00, + // 1382 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4b, 0x6f, 0xdb, 0x46, + 0x10, 0x26, 0x15, 0x4b, 0xb2, 0x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77, 0xc4, 0x5c, 0x2a, 0x9d, 0x46, 0x5e, 0xc6, 0xbd, 0xfd, 0xd7, 0xfb, + 0x0d, 0xf5, 0xdd, 0xfb, 0x0d, 0xf5, 0xef, 0xf7, 0x1b, 0xea, 0xcb, 0x6f, 0xfa, 0x4e, 0x70, 0x68, + 0xbe, 0xaa, 0x5a, 0x74, 0x70, 0xb7, 0x77, 0xa7, 0xc6, 0x8d, 0xa9, 0x71, 0x63, 0x6a, 0x43, 0x8f, + 0xda, 0x47, 0x56, 0x20, 0xf6, 0x6e, 0x89, 0x3d, 0xdf, 0x3e, 0xa8, 0x1d, 0x6f, 0xd7, 0xf8, 0x9f, + 0xe0, 0x7b, 0xfc, 0xf7, 0x55, 0x8e, 0x0f, 0xb7, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xbe, 0xbd, + 0x82, 0x5f, 0xb3, 0x0f, 0x00, 0x00, } func (m *Command) Marshal() (dAtA []byte, err error) { @@ -1329,6 +1515,20 @@ func (m *DataplaneStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.AgentActivityStatus) > 0 { + for iNdEx := len(m.AgentActivityStatus) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AgentActivityStatus[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommand(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } if len(m.DataplaneSoftwareDetails) > 0 { for iNdEx := len(m.DataplaneSoftwareDetails) - 1; iNdEx >= 0; iNdEx-- { { @@ -1393,6 +1593,109 @@ func (m *DataplaneStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AgentActivityStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AgentActivityStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentActivityStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Status != nil { + { + size := m.Status.Size() + i -= size + if _, err := m.Status.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *AgentActivityStatus_NginxConfigStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentActivityStatus_NginxConfigStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.NginxConfigStatus != nil { + { + size, err := m.NginxConfigStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommand(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *NginxConfigStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NginxConfigStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NginxConfigStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintCommand(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + } + if m.Status != 0 { + i = encodeVarintCommand(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if len(m.CorrelationId) > 0 { + i -= len(m.CorrelationId) + copy(dAtA[i:], m.CorrelationId) + i = encodeVarintCommand(dAtA, i, uint64(len(m.CorrelationId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *DownloadRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1935,6 +2238,62 @@ func (m *DataplaneStatus) Size() (n int) { n += 1 + l + sovCommand(uint64(l)) } } + if len(m.AgentActivityStatus) > 0 { + for _, e := range m.AgentActivityStatus { + l = e.Size() + n += 1 + l + sovCommand(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AgentActivityStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + n += m.Status.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AgentActivityStatus_NginxConfigStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NginxConfigStatus != nil { + l = m.NginxConfigStatus.Size() + n += 1 + l + sovCommand(uint64(l)) + } + return n +} +func (m *NginxConfigStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CorrelationId) + if l > 0 { + n += 1 + l + sovCommand(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovCommand(uint64(m.Status)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovCommand(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2905,6 +3264,260 @@ func (m *DataplaneStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentActivityStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AgentActivityStatus = append(m.AgentActivityStatus, &AgentActivityStatus{}) + if err := m.AgentActivityStatus[len(m.AgentActivityStatus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommand(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommand + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AgentActivityStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentActivityStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentActivityStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NginxConfigStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &NginxConfigStatus{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Status = &AgentActivityStatus_NginxConfigStatus{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommand(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommand + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NginxConfigStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NginxConfigStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NginxConfigStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorrelationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CorrelationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= NginxConfigStatus_Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCommand(dAtA[iNdEx:]) diff --git a/sdk/proto/command.proto b/sdk/proto/command.proto index efe97a327..84e24f03f 100644 --- a/sdk/proto/command.proto +++ b/sdk/proto/command.proto @@ -86,6 +86,25 @@ message DataplaneStatus { HostInfo host = 3 [(gogoproto.jsontag) = "host" ]; repeated NginxHealth healths = 5 [(gogoproto.jsontag) = "healths" ]; repeated DataplaneSoftwareDetails dataplane_software_details = 6 [(gogoproto.jsontag) = "dataplane_software_details"]; + repeated AgentActivityStatus agent_activity_status = 7 [(gogoproto.jsontag) = "agent_activity_status" ]; +} + +message AgentActivityStatus { + oneof Status { + NginxConfigStatus nginx_config_status = 1 [(gogoproto.jsontag) = "nginx_config_status" ]; + } +} + +message NginxConfigStatus { + string correlation_id = 1 [(gogoproto.jsontag) = "correlation_id" ]; + Status status = 2 [(gogoproto.jsontag) = "status" ]; + string message = 3 [(gogoproto.jsontag) = "message" ]; + + enum Status { + PENDING = 0; + OK = 1; + ERROR = 2; + } } message DownloadRequest { diff --git a/src/core/config/defaults.go b/src/core/config/defaults.go index f71592033..5492d746b 100644 --- a/src/core/config/defaults.go +++ b/src/core/config/defaults.go @@ -250,8 +250,8 @@ var ( Usage: "A comma-separated list of tags to add to the current instance or machine, to be used for inventory purposes.", }, &StringSliceFlag{ - Name: FeaturesKey, - Usage: "A comma-separated list of features enabled for the agent.", + Name: FeaturesKey, + Usage: "A comma-separated list of features enabled for the agent.", DefaultValue: Defaults.Features, }, // NGINX Config diff --git a/src/core/metrics/sources/nginx_plus.go b/src/core/metrics/sources/nginx_plus.go index c9a6ae3c3..29d2f7e25 100644 --- a/src/core/metrics/sources/nginx_plus.go +++ b/src/core/metrics/sources/nginx_plus.go @@ -33,8 +33,8 @@ type NginxPlus struct { plusNamespace, plusAPI string // This is for keeping the previous stats. Need to report the delta. - prevStats *plusclient.Stats - init sync.Once + prevStats *plusclient.Stats + init sync.Once clientVersion int } diff --git a/src/core/nginx.go b/src/core/nginx.go index e3f3612d3..92efcb008 100644 --- a/src/core/nginx.go +++ b/src/core/nginx.go @@ -244,23 +244,14 @@ func (n *NginxBinaryType) Reload(processId, bin string) error { // ValidateConfig tests the config with nginx -t -c configLocation. func (n *NginxBinaryType) ValidateConfig(processId, bin, configLocation string, config *proto.NginxConfig, configApply *sdk.ConfigApply) error { log.Debugf("Validating config, %s for nginx process, %s", configLocation, processId) + response, err := runCmd(bin, "-t", "-c", configLocation) + if err != nil { + confFiles, auxFiles, err := sdk.GetNginxConfigFiles(config) + n.writeBackup(config, confFiles, auxFiles) + return fmt.Errorf("error running nginx -t -c %v:\n%s%v", configLocation, response, err) + } - errChan := make(chan error, 1) - responseChan := make(chan string) - - go func(responseChan chan string, errChan chan error) { - n.wg.Wait() - res, errResponse := runCmd(bin, "-t", "-c", configLocation) - if errResponse != nil { - confFiles, auxFiles, errResponse := sdk.GetNginxConfigFiles(config) - n.writeBackup(config, confFiles, auxFiles) - errChan <- fmt.Errorf("error running nginx -t -c %s:\n %s %v", configLocation, res, errResponse) - } - responseChan <- res.String() - defer n.wg.Done() - }(responseChan, errChan) - - log.Infof("Config validated:\n%s", <-responseChan) + log.Infof("Config validated:\n%s", response) return nil } diff --git a/src/core/topics.go b/src/core/topics.go index 6ae1c1eb0..9c251993c 100644 --- a/src/core/topics.go +++ b/src/core/topics.go @@ -19,6 +19,11 @@ const ( NginxWorkerProcCreated = "nginx.worker.created" NginxWorkerProcKilled = "nginx.worker.killed" NginxDetailProcUpdate = "nginx.proc.update" + NginxConfigValidationPending = "nginx.config.validation.pending" + NginxConfigValidationFailed = "nginx.config.validation.failed" + NginxConfigValidationSucceeded = "nginx.config.validation.succeeded" + NginxConfigApplyFailed = "nginx.config.apply.failed" + NginxConfigApplySucceeded = "nginx.config.apply.succeeded" CommPrefix = "comms." CommStatus = CommPrefix + "status" CommMetrics = CommPrefix + "metrics" diff --git a/src/plugins/dataplane_status.go b/src/plugins/dataplane_status.go index bd5dd3ba4..bb52017f4 100644 --- a/src/plugins/dataplane_status.go +++ b/src/plugins/dataplane_status.go @@ -15,22 +15,23 @@ import ( ) type DataPlaneStatus struct { - messagePipeline core.MessagePipeInterface - ctx context.Context - sendStatus chan bool - healthTicker *time.Ticker - interval time.Duration - meta *proto.Metadata - binary core.NginxBinary - env core.Environment - version string - tags *[]string - configDirs string - lastSendDetails time.Time - envHostInfo *proto.HostInfo - statusUrls map[string]string - reportInterval time.Duration - napDetails *proto.DataplaneSoftwareDetails_AppProtectWafDetails + messagePipeline core.MessagePipeInterface + ctx context.Context + sendStatus chan bool + healthTicker *time.Ticker + interval time.Duration + meta *proto.Metadata + binary core.NginxBinary + env core.Environment + version string + tags *[]string + configDirs string + lastSendDetails time.Time + envHostInfo *proto.HostInfo + statusUrls map[string]string + reportInterval time.Duration + napDetails *proto.DataplaneSoftwareDetails_AppProtectWafDetails + agentActivityStatuses []*proto.AgentActivityStatus } const ( @@ -87,11 +88,54 @@ func (dps *DataPlaneStatus) Process(msg *core.Message) { case msg.Exact(core.NginxAppProtectDetailsGenerated): // If a NAP report was generated sync it dps.syncNAPDetails(msg) + + case msg.Exact(core.NginxConfigValidationPending): + log.Tracef("DataplaneStatus: %T message from topic %s received", msg.Data(), msg.Topic()) + switch data := msg.Data().(type) { + case *proto.AgentActivityStatus: + dps.updateAgentActivityStatuses(data) + default: + log.Errorf("Expected the type %T but got %T", &proto.AgentActivityStatus{}, data) + } + case msg.Exact(core.NginxConfigApplyFailed) || msg.Exact(core.NginxConfigApplySucceeded): + log.Tracef("DataplaneStatus: %T message from topic %s received", msg.Data(), msg.Topic()) + switch data := msg.Data().(type) { + case *proto.AgentActivityStatus: + dps.updateAgentActivityStatuses(data) + dps.sendDataplaneStatus(dps.messagePipeline, false) + default: + log.Errorf("Expected the type %T but got %T", &proto.AgentActivityStatus{}, data) + } } } func (dps *DataPlaneStatus) Subscriptions() []string { - return []string{core.AgentConfigChanged, core.NginxAppProtectDetailsGenerated} + return []string{ + core.AgentConfigChanged, + core.NginxAppProtectDetailsGenerated, + core.NginxConfigValidationPending, + core.NginxConfigApplyFailed, + core.NginxConfigApplySucceeded, + } +} + +func (dps *DataPlaneStatus) updateAgentActivityStatuses(newAgentActivityStatus *proto.AgentActivityStatus) { + log.Tracef("DataplaneStatus: Adding %v to agentActivityStatuses", newAgentActivityStatus) + if _, ok := newAgentActivityStatus.GetStatus().(*proto.AgentActivityStatus_NginxConfigStatus); ok { + foundExistingNginxStatus := false + for index, agentActivityStatus := range dps.agentActivityStatuses { + if _, ok := agentActivityStatus.GetStatus().(*proto.AgentActivityStatus_NginxConfigStatus); ok { + dps.agentActivityStatuses[index] = newAgentActivityStatus + log.Tracef("DataplaneStatus: Updated agentActivityStatus with new status %v", newAgentActivityStatus) + foundExistingNginxStatus = true + } + } + + if !foundExistingNginxStatus { + dps.agentActivityStatuses = append(dps.agentActivityStatuses, newAgentActivityStatus) + log.Tracef("DataplaneStatus: Added new status %v to agentActivityStatus", newAgentActivityStatus) + } + } } func (dps *DataPlaneStatus) sendDataplaneStatus(pipeline core.MessagePipeInterface, forceDetails bool) { @@ -133,6 +177,7 @@ func (dps *DataPlaneStatus) dataplaneStatus(forceDetails bool) *proto.DataplaneS Details: dps.detailsForProcess(processes, forceDetails), Healths: dps.healthForProcess(processes), DataplaneSoftwareDetails: dps.dataplaneSoftwareDetails(), + AgentActivityStatus: dps.agentActivityStatuses, } } diff --git a/src/plugins/dataplane_status_test.go b/src/plugins/dataplane_status_test.go index 35fa2e88d..b5377ff10 100644 --- a/src/plugins/dataplane_status_test.go +++ b/src/plugins/dataplane_status_test.go @@ -18,6 +18,83 @@ import ( ) func TestDataPlaneStatus(t *testing.T) { + tests := []struct { + testName string + message *core.Message + expectedMessage *core.Message + }{ + { + testName: "default status", + message: nil, + expectedMessage: core.NewMessage(core.CommStatus, &proto.Command{ + Meta: nil, + Data: &proto.Command_DataplaneStatus{ + DataplaneStatus: &proto.DataplaneStatus{}, + }, + }), + }, + { + testName: "successful nginx config apply", + message: core.NewMessage(core.NginxConfigApplySucceeded, &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: "123", + Status: proto.NginxConfigStatus_OK, + Message: "config applied", + }, + }, + }), + expectedMessage: core.NewMessage(core.CommStatus, &proto.Command{ + Meta: nil, + Data: &proto.Command_DataplaneStatus{ + DataplaneStatus: &proto.DataplaneStatus{ + AgentActivityStatus: []*proto.AgentActivityStatus{ + { + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: "123", + Status: proto.NginxConfigStatus_OK, + Message: "config applied", + }, + }, + }, + }, + }, + }, + }), + }, + { + testName: "nginx config apply failed", + message: core.NewMessage(core.NginxConfigApplySucceeded, &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: "123", + Status: proto.NginxConfigStatus_ERROR, + Message: "config applied failed", + }, + }, + }), + expectedMessage: core.NewMessage(core.CommStatus, &proto.Command{ + Meta: nil, + Data: &proto.Command_DataplaneStatus{ + DataplaneStatus: &proto.DataplaneStatus{ + AgentActivityStatus: []*proto.AgentActivityStatus{ + { + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: "123", + Status: proto.NginxConfigStatus_ERROR, + Message: "config applied failed", + }, + }, + }, + }, + }, + }, + }), + }, + } + processID := "12345" detailsMap := map[string]*proto.NginxDetails{ processID: { @@ -59,30 +136,30 @@ func TestDataPlaneStatus(t *testing.T) { messagePipe.Run() defer dataPlaneStatus.Close() - // Instance Service - t.Run("returns get response", func(t *testing.T) { - // sleep for 3 seconds - // check messages - // need to mock env - time.Sleep(3 * time.Second) - result := messagePipe.GetProcessedMessages() - - expectedMsg := []string{ - core.CommStatus, - } - assert.GreaterOrEqual(t, len(result), len(expectedMsg)) - for idx, expMsg := range expectedMsg { - message := result[idx] - assert.Equal(t, expMsg, message.Topic()) - if expMsg == core.CommStatus { - cmd := message.Data().(*proto.Command) - dps := cmd.Data.(*proto.Command_DataplaneStatus) - assert.NotNil(t, dps) - assert.NotNil(t, dps.DataplaneStatus.GetHost().GetHostname()) - assert.Len(t, dps.DataplaneStatus.GetDataplaneSoftwareDetails(), 1) + for _, test := range tests { + t.Run(test.testName, func(tt *testing.T) { + if test.message != nil { + messagePipe.Process(test.message) + messagePipe.RunWithoutInit() } - } - }) + + result := messagePipe.GetProcessedMessages() + + message := result[len(result)-1] + assert.Equal(t, test.expectedMessage.Topic(), message.Topic()) + + cmd := message.Data().(*proto.Command) + dps := cmd.Data.(*proto.Command_DataplaneStatus) + + expectedCmd := test.expectedMessage.Data().(*proto.Command) + expectedDps := expectedCmd.Data.(*proto.Command_DataplaneStatus) + + assert.NotNil(t, dps) + assert.NotNil(t, dps.DataplaneStatus.GetHost().GetHostname()) + assert.Len(t, dps.DataplaneStatus.GetDataplaneSoftwareDetails(), 1) + assert.EqualValues(t, expectedDps.DataplaneStatus.GetAgentActivityStatus(), dps.DataplaneStatus.GetAgentActivityStatus()) + }) + } } func TestDPSSyncAgentConfigChange(t *testing.T) { @@ -95,11 +172,11 @@ func TestDPSSyncAgentConfigChange(t *testing.T) { { testName: "ValuesToUpdate", config: &config.Config{ - Tags: tutils.InitialConfTags, + Tags: tutils.InitialConfTags, Features: config.Defaults.Features, }, expUpdatedConfig: &config.Config{ - Tags: updateTags, + Tags: updateTags, Features: config.Defaults.Features, }, updatedTags: true, @@ -107,11 +184,11 @@ func TestDPSSyncAgentConfigChange(t *testing.T) { { testName: "NoValuesToUpdate", config: &config.Config{ - Tags: tutils.InitialConfTags, + Tags: tutils.InitialConfTags, Features: config.Defaults.Features, }, expUpdatedConfig: &config.Config{ - Tags: tutils.InitialConfTags, + Tags: tutils.InitialConfTags, Features: config.Defaults.Features, }, updatedTags: false, @@ -245,3 +322,42 @@ func TestDPSSyncNAPDetails(t *testing.T) { }) } } + +func TestDataPlaneSubscriptions(t *testing.T) { + expectedSubscriptions := []string{ + core.AgentConfigChanged, + core.NginxAppProtectDetailsGenerated, + core.NginxConfigValidationPending, + core.NginxConfigApplyFailed, + core.NginxConfigApplySucceeded, + } + + processID := "12345" + + binary := tutils.NewMockNginxBinary() + binary.On("GetNginxDetailsMapFromProcesses", mock.Anything).Return(detailsMap) + binary.On("GetNginxIDForProcess", mock.Anything).Return(processID) + binary.On("GetNginxDetailsFromProcess", mock.Anything).Return(detailsMap[processID]) + + env := tutils.NewMockEnvironment() + env.On("Processes", mock.Anything).Return([]core.Process{}) + env.On("NewHostInfo", mock.Anything, mock.Anything, mock.Anything).Return(&proto.HostInfo{ + Hostname: "test-host", + }) + + config := &config.Config{ + Server: config.Server{}, + ConfigDirs: "", + Log: config.LogConfig{}, + TLS: config.TLSConfig{}, + Dataplane: config.Dataplane{ + Status: config.Status{PollInterval: time.Duration(1)}, + }, + AgentMetrics: config.AgentMetrics{}, + Tags: []string{}, + } + + dataPlaneStatus := NewDataPlaneStatus(config, grpc.NewMessageMeta(uuid.New().String()), binary, env, "") + + assert.Equal(t, expectedSubscriptions, dataPlaneStatus.Subscriptions()) +} diff --git a/src/plugins/nginx.go b/src/plugins/nginx.go index fdccce8aa..ae93ed929 100644 --- a/src/plugins/nginx.go +++ b/src/plugins/nginx.go @@ -11,6 +11,7 @@ import ( "github.com/nginx/agent/sdk/v2" "github.com/nginx/agent/sdk/v2/client" + "github.com/nginx/agent/sdk/v2/grpc" "github.com/nginx/agent/sdk/v2/proto" "github.com/nginx/agent/v2/src/core" @@ -47,6 +48,14 @@ type NginxReloadResponse struct { nginxDetails *proto.NginxDetails } +type NginxConfigValidationResponse struct { + err error + correlationId string + nginxDetails *proto.NginxDetails + config *proto.NginxConfig + configApply *sdk.ConfigApply +} + func NewNginx(cmdr client.Commander, nginxBinary core.NginxBinary, env core.Environment, loadedConfig *config.Config) *Nginx { var isNAPEnabled bool if loadedConfig.NginxAppProtect != (config.NginxAppProtect{}) { @@ -95,6 +104,16 @@ func (n *Nginx) Process(message *core.Message) { case core.AgentConfigChanged: // If the agent config on disk changed update this with relevant config info n.syncAgentConfigChange() + case core.NginxConfigValidationSucceeded: + switch response := message.Data().(type) { + case *NginxConfigValidationResponse: + n.completeConfigApply(response) + } + case core.NginxConfigValidationFailed: + switch response := message.Data().(type) { + case *NginxConfigValidationResponse: + n.rollbackConfigApply(response) + } case core.EnableExtension: switch data := message.Data().(type) { case string: @@ -113,6 +132,9 @@ func (n *Nginx) Subscriptions() []string { core.DataplaneChanged, core.AgentConfigChanged, core.EnableExtension, + core.NginxConfigValidationPending, + core.NginxConfigValidationSucceeded, + core.NginxConfigValidationFailed, } } @@ -203,20 +225,22 @@ func (n *Nginx) processCmd(cmd *proto.Command) { } } -// The applyConfig does the following: -// - Download config -// - Stop file watcher -// - Write the config -// - Valid config -// - Upload the config -// - Start file watcher -// - Reload nginx func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) (status *proto.Command_NginxConfigResponse) { log.Debugf("Applying config for message id, %s", cmd.GetMeta().MessageId) + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationPending, &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: cmd.Meta.MessageId, + Status: proto.NginxConfigStatus_PENDING, + Message: "config apply pending", + }, + }, + })) + status = &proto.Command_NginxConfigResponse{ NginxConfigResponse: &proto.NginxConfigResponse{ - Status: newOKStatus("config applied successfully").CmdStatus, + Status: newOKStatus("config apply request successfully processed").CmdStatus, Action: proto.NginxConfigAction_APPLY, ConfigData: cfg.NginxConfig.ConfigData, }, @@ -263,34 +287,54 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) } message := fmt.Sprintf("Config apply failed (write): " + err.Error()) - return n.handleErrorStatus(status, message) - } - err = n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationPending, &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: cmd.Meta.MessageId, + Status: proto.NginxConfigStatus_ERROR, + Message: message, + }, + }, + })) - if err != nil { - if configApply != nil { - succeeded := true + return n.handleErrorStatus(status, message) + } - if rollbackErr := configApply.Rollback(err); rollbackErr != nil { - log.Errorf("Config rollback failed: %v", rollbackErr) - succeeded = false - } + n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) + log.Debug("Validation of nginx config in progress") + return status +} - configRollbackResponse := ConfigRollbackResponse{ - succeeded: succeeded, - correlationId: cmd.Meta.MessageId, - timestamp: types.TimestampNow(), +func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) { + go func() { + err := n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) + if err != nil { + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, &NginxConfigValidationResponse{ + err: fmt.Errorf("error running nginx -t -c %s:\n %v", nginx.ConfPath, err), + correlationId: correlationId, nginxDetails: nginx, - } - n.messagePipeline.Process(core.NewMessage(core.ConfigRollbackResponse, configRollbackResponse)) + config: config, + configApply: configApply, + })) + } else { + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, &NginxConfigValidationResponse{ + err: nil, + correlationId: correlationId, + nginxDetails: nginx, + config: config, + configApply: configApply, + })) } + }() +} - message := fmt.Sprintf("Config apply failed (write): " + err.Error()) - return n.handleErrorStatus(status, message) - } else if configApply != nil { - if err = configApply.Complete(); err != nil { - log.Errorf("Config complete failed: %v", err) +func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) { + nginxConfigStatusMessage := "Config applied successfully" + if response.configApply != nil { + if err := response.configApply.Complete(); err != nil { + nginxConfigStatusMessage = fmt.Sprintf("Config complete failed: %v", err) + log.Errorf(nginxConfigStatusMessage) } } @@ -302,38 +346,93 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) }, } - err = n.uploadConfig( + err := n.uploadConfig( &proto.ConfigDescriptor{ SystemId: n.env.GetSystemUUID(), - NginxId: config.GetConfigData().GetNginxId(), + NginxId: response.config.GetConfigData().GetNginxId(), }, - cmd.Meta.GetMessageId(), + response.correlationId, ) if err != nil { - uploadResponse.NginxConfigResponse.Status = newErrStatus("config uploaded error: " + err.Error()).CmdStatus + uploadResponse.NginxConfigResponse.Status = newErrStatus("Config uploaded error: " + err.Error()).CmdStatus + nginxConfigStatusMessage = fmt.Sprintf("Config uploaded error: %v", err) + log.Errorf(nginxConfigStatusMessage) } - uploadResponseCommand := newStatusCommand(cmd) + uploadResponseCommand := &proto.Command{Meta: grpc.NewMessageMeta(response.correlationId)} uploadResponseCommand.Data = uploadResponse n.messagePipeline.Process(core.NewMessage(core.CommResponse, uploadResponseCommand)) log.Debug("Enabling file watcher") n.messagePipeline.Process(core.NewMessage(core.FileWatcherEnabled, true)) - reloadErr := n.nginxBinary.Reload(nginx.ProcessId, nginx.ProcessPath) + reloadErr := n.nginxBinary.Reload(response.nginxDetails.ProcessId, response.nginxDetails.ProcessPath) if reloadErr != nil { - status.NginxConfigResponse.Status = newErrStatus("Config apply failed (write): " + reloadErr.Error()).CmdStatus + nginxConfigStatusMessage = fmt.Sprintf("Config apply failed (write): %v", reloadErr) + log.Errorf(nginxConfigStatusMessage) } nginxReloadEventMeta := NginxReloadResponse{ succeeded: reloadErr == nil, - correlationId: cmd.Meta.MessageId, + correlationId: response.correlationId, timestamp: types.TimestampNow(), - nginxDetails: nginx, + nginxDetails: response.nginxDetails, } + n.messagePipeline.Process(core.NewMessage(core.NginxReloadComplete, nginxReloadEventMeta)) + + agentActivityStatus := &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: response.correlationId, + Status: proto.NginxConfigStatus_OK, + Message: nginxConfigStatusMessage, + }, + }, + } + + n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplySucceeded, agentActivityStatus)) + log.Debug("Config Apply Complete") - return status +} + +func (n *Nginx) rollbackConfigApply(response *NginxConfigValidationResponse) { + nginxConfigStatusMessage := fmt.Sprintf("Config apply failed (write): %v", response.err.Error()) + log.Error(nginxConfigStatusMessage) + + if response.configApply != nil { + succeeded := true + + if rollbackErr := response.configApply.Rollback(response.err); rollbackErr != nil { + nginxConfigStatusMessage := fmt.Sprintf("Config rollback failed: %v", rollbackErr) + log.Error(nginxConfigStatusMessage) + succeeded = false + } + + configRollbackResponse := ConfigRollbackResponse{ + succeeded: succeeded, + correlationId: response.correlationId, + timestamp: types.TimestampNow(), + nginxDetails: response.nginxDetails, + } + + n.messagePipeline.Process(core.NewMessage(core.ConfigRollbackResponse, configRollbackResponse)) + + agentActivityStatus := &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: response.correlationId, + Status: proto.NginxConfigStatus_ERROR, + Message: nginxConfigStatusMessage, + }, + }, + } + + n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplyFailed, agentActivityStatus)) + } + + log.Debug("Enabling file watcher") + n.messagePipeline.Process(core.NewMessage(core.FileWatcherEnabled, true)) } func (n *Nginx) handleErrorStatus(status *proto.Command_NginxConfigResponse, message string) *proto.Command_NginxConfigResponse { diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index d8b37c14f..91538a88e 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -2,9 +2,11 @@ package plugins import ( "context" + "errors" "fmt" "io/ioutil" "testing" + "time" "github.com/google/uuid" "github.com/stretchr/testify/assert" @@ -89,7 +91,7 @@ var ( }`) ) -func TestNginx_Config(t *testing.T) { +func TestNginxConfigApply(t *testing.T) { t.Parallel() tests := []struct { @@ -118,11 +120,10 @@ func TestNginx_Config(t *testing.T) { core.CommNginxConfig, core.NginxPluginConfigured, core.NginxInstancesFound, + core.NginxConfigValidationPending, core.FileWatcherEnabled, core.CommResponse, - core.FileWatcherEnabled, - core.NginxReloadComplete, - core.CommResponse, + core.NginxConfigValidationSucceeded, }, }, { @@ -147,11 +148,10 @@ func TestNginx_Config(t *testing.T) { core.CommNginxConfig, core.NginxPluginConfigured, core.NginxInstancesFound, + core.NginxConfigValidationPending, core.FileWatcherEnabled, core.CommResponse, - core.FileWatcherEnabled, - core.NginxReloadComplete, - core.CommResponse, + core.NginxConfigValidationSucceeded, }, }, { @@ -176,11 +176,10 @@ func TestNginx_Config(t *testing.T) { core.CommNginxConfig, core.NginxPluginConfigured, core.NginxInstancesFound, + core.NginxConfigValidationPending, core.FileWatcherEnabled, core.CommResponse, - core.FileWatcherEnabled, - core.NginxReloadComplete, - core.CommResponse, + core.NginxConfigValidationSucceeded, }, }, } @@ -220,12 +219,10 @@ func TestNginx_Config(t *testing.T) { binary := tutils.NewMockNginxBinary() binary.On("WriteConfig", mock.Anything).Return(config, nil) - binary.On("ReadConfig", mock.Anything, mock.Anything, mock.Anything).Return(&proto.NginxConfig{}, nil) binary.On("ValidateConfig", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) binary.On("GetNginxDetailsByID", "12345").Return(tutils.GetDetailsMap()["12345"]) binary.On("UpdateNginxDetailsFromProcesses", env.Processes()) binary.On("GetNginxDetailsMapFromProcesses", env.Processes()).Return((tutils.GetDetailsMap())) - binary.On("Reload", mock.Anything, mock.Anything) commandClient := tutils.GetMockCommandClient(test.config) @@ -234,15 +231,13 @@ func TestNginx_Config(t *testing.T) { messagePipe.Process(core.NewMessage(core.CommNginxConfig, cmd)) messagePipe.Run() + processedMessages := messagePipe.GetProcessedMessages() + assert.Eventually(tt, func() bool { return len(processedMessages) != len(test.msgTopics) }, time.Duration(5*time.Millisecond), 1*time.Millisecond) binary.AssertExpectations(tt) env.AssertExpectations(tt) cancel() - processedMessages := messagePipe.GetProcessedMessages() - if len(processedMessages) != len(test.msgTopics) { - tt.Fatalf("expected %d messages, received %d: %+v", len(test.msgTopics), len(processedMessages), processedMessages) - } for idx, msg := range processedMessages { if test.msgTopics[idx] != msg.Topic() { tt.Errorf("unexpected message topic: %s :: should have been: %s", msg.Topic(), test.msgTopics[idx]) @@ -419,6 +414,9 @@ func TestNginx_Subscriptions(t *testing.T) { core.DataplaneChanged, core.AgentConfigChanged, core.EnableExtension, + core.NginxConfigValidationPending, + core.NginxConfigValidationSucceeded, + core.NginxConfigValidationFailed, } pluginUnderTest := NewNginx(nil, nil, tutils.GetMockEnvWithProcess(), &loadedConfig.Config{}) @@ -430,3 +428,170 @@ func TestNginx_Info(t *testing.T) { assert.Equal(t, "NginxBinary", pluginUnderTest.Info().Name()) } + +func TestNginx_completeConfigApply(t *testing.T) { + expectedTopics := []string{ + core.NginxConfigValidationSucceeded, + core.NginxPluginConfigured, + core.NginxInstancesFound, + core.CommResponse, + core.FileWatcherEnabled, + core.NginxReloadComplete, + core.NginxConfigApplySucceeded, + } + + env := tutils.GetMockEnvWithProcess() + env.On("GetSystemUUID").Return("456") + + binary := tutils.NewMockNginxBinary() + binary.On("uploadConfig", mock.Anything, mock.Anything).Return(nil) + binary.On("GetNginxDetailsByID", "12345").Return(tutils.GetDetailsMap()["12345"]) + binary.On("ReadConfig", mock.Anything, mock.Anything, mock.Anything).Return(&proto.NginxConfig{}, nil) + binary.On("UpdateNginxDetailsFromProcesses", env.Processes()) + binary.On("GetNginxDetailsMapFromProcesses", env.Processes()).Return((tutils.GetDetailsMap())) + binary.On("Reload", mock.Anything, mock.Anything) + + commandClient := tutils.GetMockCommandClient( + &proto.NginxConfig{ + Action: proto.NginxConfigAction_APPLY, + ConfigData: &proto.ConfigDescriptor{ + NginxId: "12345", + Checksum: "2314365", + }, + Zconfig: &proto.ZippedFile{ + Contents: first, + Checksum: checksum.Checksum(first), + RootDirectory: "nginx.conf", + }, + Zaux: &proto.ZippedFile{}, + AccessLogs: &proto.AccessLogs{}, + ErrorLogs: &proto.ErrorLogs{}, + Ssl: &proto.SslCertificates{}, + DirectoryMap: &proto.DirectoryMap{}, + }, + ) + + pluginUnderTest := NewNginx(commandClient, binary, env, &loadedConfig.Config{Features: []string{loadedConfig.FeatureNginxConfig}}) + + dir := t.TempDir() + tempConf, err := ioutil.TempFile(dir, "nginx.conf") + assert.NoError(t, err) + allowedDirectoriesMap := map[string]struct{}{dir: {}} + configApply, err := sdk.NewConfigApply(tempConf.Name(), allowedDirectoriesMap) + + response := &NginxConfigValidationResponse{ + err: nil, + correlationId: "123", + nginxDetails: &proto.NginxDetails{ + NginxId: "12345", + ProcessId: "123456", + ProcessPath: "/var/test/", + }, + config: &proto.NginxConfig{ + Action: proto.NginxConfigAction_APPLY, + ConfigData: &proto.ConfigDescriptor{ + SystemId: "456", + NginxId: "12345", + Checksum: "2314365", + }, + }, + configApply: configApply, + } + + messagePipe := core.SetupMockMessagePipe(t, context.TODO(), pluginUnderTest) + messagePipe.Process(core.NewMessage(core.NginxConfigValidationSucceeded, response)) + messagePipe.Run() + + processedMessages := messagePipe.GetProcessedMessages() + + assert.Eventually(t, func() bool { return len(processedMessages) == len(expectedTopics) }, time.Duration(5*time.Millisecond), 1*time.Millisecond) + + for idx, msg := range processedMessages { + if expectedTopics[idx] != msg.Topic() { + t.Errorf("unexpected message topic: %s :: should have been: %s", msg.Topic(), expectedTopics[idx]) + } + } +} + +func TestNginx_rollbackConfigApply(t *testing.T) { + expectedTopics := []string{ + core.NginxConfigValidationFailed, + core.NginxPluginConfigured, + core.NginxInstancesFound, + core.ConfigRollbackResponse, + core.NginxConfigApplyFailed, + core.FileWatcherEnabled, + } + + env := tutils.GetMockEnvWithProcess() + env.On("GetSystemUUID").Return("456") + + binary := tutils.NewMockNginxBinary() + binary.On("uploadConfig", mock.Anything, mock.Anything).Return(nil) + binary.On("GetNginxDetailsByID", "12345").Return(tutils.GetDetailsMap()["12345"]) + binary.On("ReadConfig", mock.Anything, mock.Anything, mock.Anything).Return(&proto.NginxConfig{}, nil) + binary.On("UpdateNginxDetailsFromProcesses", env.Processes()) + binary.On("GetNginxDetailsMapFromProcesses", env.Processes()).Return((tutils.GetDetailsMap())) + binary.On("Reload", mock.Anything, mock.Anything) + + commandClient := tutils.GetMockCommandClient( + &proto.NginxConfig{ + Action: proto.NginxConfigAction_APPLY, + ConfigData: &proto.ConfigDescriptor{ + NginxId: "12345", + Checksum: "2314365", + }, + Zconfig: &proto.ZippedFile{ + Contents: first, + Checksum: checksum.Checksum(first), + RootDirectory: "nginx.conf", + }, + Zaux: &proto.ZippedFile{}, + AccessLogs: &proto.AccessLogs{}, + ErrorLogs: &proto.ErrorLogs{}, + Ssl: &proto.SslCertificates{}, + DirectoryMap: &proto.DirectoryMap{}, + }, + ) + + pluginUnderTest := NewNginx(commandClient, binary, env, &loadedConfig.Config{Features: []string{loadedConfig.FeatureNginxConfig}}) + + dir := t.TempDir() + tempConf, err := ioutil.TempFile(dir, "nginx.conf") + assert.NoError(t, err) + allowedDirectoriesMap := map[string]struct{}{dir: {}} + configApply, err := sdk.NewConfigApply(tempConf.Name(), allowedDirectoriesMap) + + response := &NginxConfigValidationResponse{ + err: errors.New("Failure"), + correlationId: "123", + nginxDetails: &proto.NginxDetails{ + NginxId: "12345", + ProcessId: "123456", + ProcessPath: "/var/test/", + }, + config: &proto.NginxConfig{ + Action: proto.NginxConfigAction_APPLY, + ConfigData: &proto.ConfigDescriptor{ + SystemId: "456", + NginxId: "12345", + Checksum: "2314365", + }, + }, + configApply: configApply, + } + + messagePipe := core.SetupMockMessagePipe(t, context.TODO(), pluginUnderTest) + messagePipe.Process(core.NewMessage(core.NginxConfigValidationFailed, response)) + messagePipe.Run() + + processedMessages := messagePipe.GetProcessedMessages() + + assert.Eventually(t, func() bool { return len(processedMessages) == len(expectedTopics) }, time.Duration(5*time.Millisecond), 1*time.Millisecond) + + for idx, msg := range processedMessages { + if expectedTopics[idx] != msg.Topic() { + t.Errorf("unexpected message topic: %s :: should have been: %s", msg.Topic(), expectedTopics[idx]) + } + } +} diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/command.pb.go b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/command.pb.go index d4b8a3870..2c617b1f5 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/command.pb.go +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/command.pb.go @@ -105,6 +105,34 @@ func (CommandStatusResponse_CommandErrorCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor_213c0bb044472049, []int{1, 1} } +type NginxConfigStatus_Status int32 + +const ( + NginxConfigStatus_PENDING NginxConfigStatus_Status = 0 + NginxConfigStatus_OK NginxConfigStatus_Status = 1 + NginxConfigStatus_ERROR NginxConfigStatus_Status = 2 +) + +var NginxConfigStatus_Status_name = map[int32]string{ + 0: "PENDING", + 1: "OK", + 2: "ERROR", +} + +var NginxConfigStatus_Status_value = map[string]int32{ + "PENDING": 0, + "OK": 1, + "ERROR": 2, +} + +func (x NginxConfigStatus_Status) String() string { + return proto.EnumName(NginxConfigStatus_Status_name, int32(x)) +} + +func (NginxConfigStatus_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_213c0bb044472049, []int{4, 0} +} + type UploadStatus_TransferStatus int32 const ( @@ -130,7 +158,7 @@ func (x UploadStatus_TransferStatus) String() string { } func (UploadStatus_TransferStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{5, 0} + return fileDescriptor_213c0bb044472049, []int{7, 0} } // Command is the envelope sent between the management plane and the data plane, requesting some action or reporting a response @@ -422,6 +450,7 @@ type DataplaneStatus struct { Host *HostInfo `protobuf:"bytes,3,opt,name=host,proto3" json:"host"` Healths []*NginxHealth `protobuf:"bytes,5,rep,name=healths,proto3" json:"healths"` DataplaneSoftwareDetails []*DataplaneSoftwareDetails `protobuf:"bytes,6,rep,name=dataplane_software_details,json=dataplaneSoftwareDetails,proto3" json:"dataplane_software_details"` + AgentActivityStatus []*AgentActivityStatus `protobuf:"bytes,7,rep,name=agent_activity_status,json=agentActivityStatus,proto3" json:"agent_activity_status"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -495,6 +524,151 @@ func (m *DataplaneStatus) GetDataplaneSoftwareDetails() []*DataplaneSoftwareDeta return nil } +func (m *DataplaneStatus) GetAgentActivityStatus() []*AgentActivityStatus { + if m != nil { + return m.AgentActivityStatus + } + return nil +} + +type AgentActivityStatus struct { + // Types that are valid to be assigned to Status: + // *AgentActivityStatus_NginxConfigStatus + Status isAgentActivityStatus_Status `protobuf_oneof:"Status"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AgentActivityStatus) Reset() { *m = AgentActivityStatus{} } +func (m *AgentActivityStatus) String() string { return proto.CompactTextString(m) } +func (*AgentActivityStatus) ProtoMessage() {} +func (*AgentActivityStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_213c0bb044472049, []int{3} +} +func (m *AgentActivityStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AgentActivityStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AgentActivityStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AgentActivityStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_AgentActivityStatus.Merge(m, src) +} +func (m *AgentActivityStatus) XXX_Size() int { + return m.Size() +} +func (m *AgentActivityStatus) XXX_DiscardUnknown() { + xxx_messageInfo_AgentActivityStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_AgentActivityStatus proto.InternalMessageInfo + +type isAgentActivityStatus_Status interface { + isAgentActivityStatus_Status() + MarshalTo([]byte) (int, error) + Size() int +} + +type AgentActivityStatus_NginxConfigStatus struct { + NginxConfigStatus *NginxConfigStatus `protobuf:"bytes,1,opt,name=nginx_config_status,json=nginxConfigStatus,proto3,oneof" json:"nginx_config_status"` +} + +func (*AgentActivityStatus_NginxConfigStatus) isAgentActivityStatus_Status() {} + +func (m *AgentActivityStatus) GetStatus() isAgentActivityStatus_Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *AgentActivityStatus) GetNginxConfigStatus() *NginxConfigStatus { + if x, ok := m.GetStatus().(*AgentActivityStatus_NginxConfigStatus); ok { + return x.NginxConfigStatus + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*AgentActivityStatus) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*AgentActivityStatus_NginxConfigStatus)(nil), + } +} + +type NginxConfigStatus struct { + CorrelationId string `protobuf:"bytes,1,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id"` + Status NginxConfigStatus_Status `protobuf:"varint,2,opt,name=status,proto3,enum=f5.nginx.agent.sdk.NginxConfigStatus_Status" json:"status"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NginxConfigStatus) Reset() { *m = NginxConfigStatus{} } +func (m *NginxConfigStatus) String() string { return proto.CompactTextString(m) } +func (*NginxConfigStatus) ProtoMessage() {} +func (*NginxConfigStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_213c0bb044472049, []int{4} +} +func (m *NginxConfigStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NginxConfigStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NginxConfigStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NginxConfigStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_NginxConfigStatus.Merge(m, src) +} +func (m *NginxConfigStatus) XXX_Size() int { + return m.Size() +} +func (m *NginxConfigStatus) XXX_DiscardUnknown() { + xxx_messageInfo_NginxConfigStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_NginxConfigStatus proto.InternalMessageInfo + +func (m *NginxConfigStatus) GetCorrelationId() string { + if m != nil { + return m.CorrelationId + } + return "" +} + +func (m *NginxConfigStatus) GetStatus() NginxConfigStatus_Status { + if m != nil { + return m.Status + } + return NginxConfigStatus_PENDING +} + +func (m *NginxConfigStatus) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + type DownloadRequest struct { Meta *Metadata `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -506,7 +680,7 @@ func (m *DownloadRequest) Reset() { *m = DownloadRequest{} } func (m *DownloadRequest) String() string { return proto.CompactTextString(m) } func (*DownloadRequest) ProtoMessage() {} func (*DownloadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{3} + return fileDescriptor_213c0bb044472049, []int{5} } func (m *DownloadRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -555,7 +729,7 @@ func (m *NginxConfigResponse) Reset() { *m = NginxConfigResponse{} } func (m *NginxConfigResponse) String() string { return proto.CompactTextString(m) } func (*NginxConfigResponse) ProtoMessage() {} func (*NginxConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{4} + return fileDescriptor_213c0bb044472049, []int{6} } func (m *NginxConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -618,7 +792,7 @@ func (m *UploadStatus) Reset() { *m = UploadStatus{} } func (m *UploadStatus) String() string { return proto.CompactTextString(m) } func (*UploadStatus) ProtoMessage() {} func (*UploadStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{5} + return fileDescriptor_213c0bb044472049, []int{7} } func (m *UploadStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -682,7 +856,7 @@ func (m *DataChunk) Reset() { *m = DataChunk{} } func (m *DataChunk) String() string { return proto.CompactTextString(m) } func (*DataChunk) ProtoMessage() {} func (*DataChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{6} + return fileDescriptor_213c0bb044472049, []int{8} } func (m *DataChunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -771,7 +945,7 @@ func (m *ChunkedResourceHeader) Reset() { *m = ChunkedResourceHeader{} } func (m *ChunkedResourceHeader) String() string { return proto.CompactTextString(m) } func (*ChunkedResourceHeader) ProtoMessage() {} func (*ChunkedResourceHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{7} + return fileDescriptor_213c0bb044472049, []int{9} } func (m *ChunkedResourceHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -841,7 +1015,7 @@ func (m *ChunkedResourceChunk) Reset() { *m = ChunkedResourceChunk{} } func (m *ChunkedResourceChunk) String() string { return proto.CompactTextString(m) } func (*ChunkedResourceChunk) ProtoMessage() {} func (*ChunkedResourceChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{8} + return fileDescriptor_213c0bb044472049, []int{10} } func (m *ChunkedResourceChunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -895,10 +1069,13 @@ func init() { proto.RegisterEnum("f5.nginx.agent.sdk.Command_CommandType", Command_CommandType_name, Command_CommandType_value) proto.RegisterEnum("f5.nginx.agent.sdk.CommandStatusResponse_CommandStatus", CommandStatusResponse_CommandStatus_name, CommandStatusResponse_CommandStatus_value) proto.RegisterEnum("f5.nginx.agent.sdk.CommandStatusResponse_CommandErrorCode", CommandStatusResponse_CommandErrorCode_name, CommandStatusResponse_CommandErrorCode_value) + proto.RegisterEnum("f5.nginx.agent.sdk.NginxConfigStatus_Status", NginxConfigStatus_Status_name, NginxConfigStatus_Status_value) proto.RegisterEnum("f5.nginx.agent.sdk.UploadStatus_TransferStatus", UploadStatus_TransferStatus_name, UploadStatus_TransferStatus_value) proto.RegisterType((*Command)(nil), "f5.nginx.agent.sdk.Command") proto.RegisterType((*CommandStatusResponse)(nil), "f5.nginx.agent.sdk.CommandStatusResponse") proto.RegisterType((*DataplaneStatus)(nil), "f5.nginx.agent.sdk.DataplaneStatus") + proto.RegisterType((*AgentActivityStatus)(nil), "f5.nginx.agent.sdk.AgentActivityStatus") + proto.RegisterType((*NginxConfigStatus)(nil), "f5.nginx.agent.sdk.NginxConfigStatus") proto.RegisterType((*DownloadRequest)(nil), "f5.nginx.agent.sdk.DownloadRequest") proto.RegisterType((*NginxConfigResponse)(nil), "f5.nginx.agent.sdk.NginxConfigResponse") proto.RegisterType((*UploadStatus)(nil), "f5.nginx.agent.sdk.UploadStatus") @@ -910,85 +1087,94 @@ func init() { func init() { proto.RegisterFile("command.proto", fileDescriptor_213c0bb044472049) } var fileDescriptor_213c0bb044472049 = []byte{ - // 1245 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x26, 0x65, 0x8b, 0xb2, 0x46, 0x72, 0x2c, 0x6c, 0x9c, 0x82, 0x31, 0x02, 0xd3, 0x60, 0x9b, - 0xc6, 0x2d, 0x1a, 0x09, 0x75, 0x10, 0x14, 0x48, 0x2e, 0x35, 0x25, 0xa5, 0x34, 0x62, 0x4b, 0xc5, - 0x3a, 0x4e, 0x80, 0x14, 0x85, 0xc0, 0x90, 0xab, 0x1f, 0xd8, 0x22, 0x55, 0x2e, 0x95, 0xc4, 0x41, - 0xef, 0x05, 0x8a, 0xde, 0x8a, 0xa2, 0xe8, 0x53, 0xf4, 0x35, 0x7a, 0xcc, 0x13, 0x10, 0x85, 0x8f, - 0x7c, 0x80, 0x9e, 0x8b, 0xfd, 0xa1, 0x2c, 0xd9, 0x94, 0xdc, 0xc0, 0xbd, 0x68, 0x67, 0x67, 0xbf, - 0xf9, 0xe6, 0x67, 0x77, 0x67, 0x29, 0x58, 0x75, 0x83, 0xe1, 0xd0, 0xf1, 0xbd, 0xea, 0x28, 0x0c, - 0xa2, 0x00, 0xa1, 0xee, 0xc3, 0xaa, 0xdf, 0x1b, 0xf8, 0x6f, 0xab, 0x4e, 0x8f, 0xf8, 0x51, 0x95, - 0x7a, 0xc7, 0x1b, 0xd0, 0x0b, 0x7a, 0x81, 0x58, 0xdf, 0x28, 0x33, 0x78, 0xe0, 0xcb, 0x59, 0x49, - 0x80, 0xc4, 0x04, 0xfa, 0x01, 0x4d, 0xe5, 0x92, 0xe0, 0x98, 0xd8, 0xf8, 0xdd, 0x41, 0x4f, 0xce, - 0x10, 0x79, 0x4d, 0xfc, 0x88, 0xd6, 0xf8, 0x20, 0x75, 0xb7, 0xbd, 0x51, 0x87, 0x06, 0xdd, 0xe8, - 0x8d, 0x13, 0x92, 0x8e, 0x47, 0x22, 0x67, 0x70, 0x42, 0xc5, 0x92, 0xf9, 0x2b, 0x40, 0xa1, 0x2e, - 0x42, 0x44, 0x8f, 0x60, 0x79, 0x48, 0x22, 0x47, 0x57, 0xb7, 0xd4, 0xed, 0xd2, 0xce, 0x9d, 0xea, - 0xe5, 0x58, 0xab, 0x07, 0x24, 0x72, 0x3c, 0x27, 0x72, 0xac, 0x95, 0x24, 0x36, 0x38, 0x1a, 0xf3, - 0x5f, 0xd4, 0x84, 0xe5, 0xe8, 0x74, 0x44, 0xf4, 0xdc, 0x96, 0xba, 0x7d, 0x63, 0xe7, 0x5e, 0x96, - 0xad, 0x74, 0x93, 0x8e, 0xcf, 0x4e, 0x47, 0x44, 0xd0, 0x30, 0x43, 0xcc, 0x7f, 0xd1, 0x4b, 0x00, - 0x77, 0xe8, 0x75, 0x68, 0xe4, 0x44, 0x63, 0xaa, 0x2f, 0xf1, 0x40, 0x3e, 0x5b, 0x40, 0x76, 0xc8, - 0x81, 0x98, 0xd0, 0x51, 0xe0, 0x53, 0x62, 0xdd, 0x48, 0x62, 0x63, 0x8a, 0xc0, 0x56, 0x70, 0xd1, - 0x1d, 0x4a, 0x10, 0x7a, 0x0e, 0x65, 0xce, 0xd2, 0x11, 0xf5, 0xd2, 0x97, 0x39, 0xbb, 0x91, 0xc5, - 0xde, 0x62, 0xf3, 0x3a, 0x87, 0x59, 0x95, 0x24, 0x36, 0x66, 0x0c, 0x6d, 0x05, 0x8b, 0xfa, 0x0b, - 0x00, 0x7a, 0x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f, 0xe5, 0xe0, 0x66, 0xc6, 0x1b, 0x89, 0x0e, 0x66, 0xae, 0xdf, 0x07, 0x7d, - 0x1b, 0x64, 0x5d, 0xb8, 0x3d, 0xd0, 0x1c, 0x37, 0x1a, 0x04, 0xbe, 0xbc, 0x6c, 0x77, 0xaf, 0x78, - 0xab, 0x77, 0x39, 0x58, 0x50, 0x09, 0x43, 0x2c, 0x47, 0xf4, 0x1c, 0x4a, 0xf2, 0x15, 0x61, 0x09, - 0xc9, 0x83, 0xf1, 0x49, 0x76, 0x78, 0x0c, 0xd6, 0x20, 0xd4, 0x0d, 0x07, 0xa3, 0x28, 0x08, 0xad, - 0xb5, 0x24, 0x36, 0xa6, 0x8d, 0x31, 0x88, 0x09, 0xdb, 0x26, 0xf3, 0x1f, 0x15, 0xca, 0x47, 0x23, - 0x56, 0x57, 0x79, 0xde, 0xaf, 0xf3, 0x95, 0x76, 0x38, 0x29, 0x9f, 0xc8, 0xb7, 0x96, 0x65, 0x3d, - 0xed, 0xad, 0xfa, 0x2c, 0x74, 0x7c, 0xda, 0x25, 0xe1, 0x82, 0xae, 0x65, 0x82, 0x16, 0x12, 0x87, - 0x06, 0xbe, 0xec, 0x24, 0x1c, 0x23, 0x34, 0x58, 0x8e, 0xe6, 0x97, 0x70, 0x63, 0x96, 0x09, 0x95, - 0xa0, 0x70, 0xde, 0x23, 0x34, 0xc8, 0xf1, 0xfe, 0x00, 0xa0, 0x3d, 0xd9, 0xdd, 0xdb, 0x6f, 0x36, - 0x2a, 0x39, 0xf3, 0x4f, 0x15, 0x8a, 0xac, 0x02, 0xf5, 0xfe, 0xd8, 0x3f, 0x46, 0x6d, 0xd0, 0xfa, - 0xc4, 0xf1, 0x48, 0xb8, 0x70, 0xe3, 0x19, 0x94, 0x78, 0x98, 0xd0, 0x60, 0x1c, 0xba, 0xc4, 0xe6, - 0x06, 0x22, 0x1e, 0x61, 0x6c, 0x2b, 0x58, 0x4a, 0xc8, 0x16, 0xad, 0x9e, 0x17, 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, 0x00, 0xff, 0xff, 0xc5, 0x05, 0x57, 0x2c, 0xb3, 0x0d, 0x00, 0x00, + // 1382 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4b, 0x6f, 0xdb, 0x46, + 0x10, 0x26, 0x15, 0x4b, 0xb2, 0x46, 0xb2, 0xad, 0xac, 0x9d, 0x56, 0x31, 0x02, 0xd3, 0x60, 0x9b, + 0xc6, 0x2d, 0x12, 0x09, 0x75, 0x10, 0x14, 0x4d, 0x2e, 0xb5, 0x2c, 0x25, 0x14, 0x12, 0x4b, 0xc1, + 0xe6, 0x05, 0xa4, 0x28, 0x04, 0x86, 0x5c, 0xc9, 0x84, 0x2d, 0xae, 0x4a, 0xd2, 0x4e, 0x1c, 0xf4, + 0x5e, 0xa0, 0x28, 0x50, 0x14, 0x45, 0x0f, 0xfd, 0x15, 0xfd, 0x1b, 0x3d, 0xe6, 0x17, 0x10, 0x45, + 0x8e, 0xbc, 0xf5, 0xd2, 0x73, 0xb1, 0x0f, 0xca, 0x94, 0x44, 0xc9, 0x0e, 0xdc, 0x8b, 0xf6, 0xf5, + 0xcd, 0x37, 0x8f, 0x9d, 0x9d, 0xa1, 0x60, 0xc9, 0xa2, 0x83, 0x81, 0xe9, 0xda, 0xd5, 0xa1, 0x47, + 0x03, 0x8a, 0x50, 0xef, 0x4e, 0xd5, 0xed, 0x3b, 0xee, 0x9b, 0xaa, 0xd9, 0x27, 0x6e, 0x50, 0xf5, + 0xed, 0x83, 0x75, 0xe8, 0xd3, 0x3e, 0x15, 0xe7, 0xeb, 0x25, 0x06, 0xa7, 0xae, 0x5c, 0x15, 0x05, + 0x48, 0x2c, 0x60, 0x9f, 0xfa, 0xf1, 0xbc, 0x28, 0x38, 0x46, 0x32, 0x6e, 0xcf, 0xe9, 0xcb, 0x15, + 0x22, 0xc7, 0xc4, 0x0d, 0xfc, 0x1a, 0x1f, 0xe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 0x6c, 0xde, 0xc4, + 0xb8, 0x83, 0xcb, 0x19, 0xbd, 0x06, 0xe5, 0x49, 0x9b, 0x19, 0xbc, 0x89, 0x31, 0x83, 0x2b, 0x8c, + 0x8b, 0xcd, 0x63, 0x2e, 0x55, 0xff, 0x65, 0x01, 0x56, 0x26, 0xf2, 0x1f, 0x7d, 0x01, 0x05, 0xff, + 0xc4, 0x0f, 0xc8, 0xa0, 0xeb, 0xd8, 0xfc, 0x52, 0x0a, 0xf5, 0xa5, 0x28, 0xd4, 0x4e, 0x37, 0xf1, + 0xa2, 0x98, 0xb6, 0x6c, 0xf4, 0x00, 0xf2, 0x71, 0x3e, 0x66, 0x36, 0x2f, 0x6d, 0x15, 0xb7, 0x37, + 0x67, 0x16, 0xe7, 0x38, 0x07, 0x79, 0x5c, 0xa4, 0x10, 0x8e, 0x27, 0xac, 0x55, 0xb2, 0x76, 0x2c, + 0x3b, 0x54, 0x6a, 0xab, 0x34, 0xa8, 0x1f, 0xb4, 0xdc, 0x1e, 0x15, 0x3d, 0x8e, 0xa1, 0x31, 0xff, + 0x45, 0xf7, 0x21, 0xbf, 0x4f, 0xcc, 0xc3, 0x60, 0xdf, 0xaf, 0x64, 0xb9, 0x11, 0xb3, 0x5b, 0x90, + 0xc1, 0x71, 0xc2, 0x06, 0x29, 0x83, 0xe3, 0x09, 0xfa, 0x69, 0xfe, 0x83, 0xcb, 0x71, 0xee, 0xff, + 0xf5, 0xc1, 0xcd, 0x7e, 0x6e, 0xe8, 0x38, 0x6e, 0x45, 0xa6, 0x15, 0x38, 0xc7, 0x4e, 0x70, 0x12, + 0x57, 0xb2, 0x3c, 0x37, 0x63, 0x76, 0x2b, 0xda, 0x91, 0x78, 0xf9, 0x2c, 0x12, 0xad, 0x68, 0x82, + 0x49, 0x36, 0xa2, 0x71, 0xbc, 0xfe, 0xab, 0x0a, 0xab, 0x29, 0x3c, 0x68, 0x08, 0xab, 0x63, 0xad, + 0x34, 0xf1, 0x68, 0x8b, 0xdb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 0x8b, 0x0b, 0x7c, 0xfe, 0xc4, 0x79, 0x4b, 0xf4, 0x3f, 0x54, 0x58, 0x4b, 0x0b, 0xc3, 0x85, + 0x3c, 0xba, 0xc1, 0xac, 0x65, 0xda, 0x1c, 0x5b, 0xfa, 0x24, 0xad, 0x15, 0x7b, 0x38, 0xcf, 0x67, + 0x2d, 0x1b, 0x5d, 0x93, 0x77, 0xc4, 0x5c, 0x2a, 0x9d, 0x46, 0x5e, 0xc6, 0xbd, 0xfd, 0xd7, 0xfb, + 0x0d, 0xf5, 0xdd, 0xfb, 0x0d, 0xf5, 0xef, 0xf7, 0x1b, 0xea, 0xcb, 0x6f, 0xfa, 0x4e, 0x70, 0x68, + 0xbe, 0xaa, 0x5a, 0x74, 0x70, 0xb7, 0x77, 0xa7, 0xc6, 0x8d, 0xa9, 0x71, 0x63, 0x6a, 0x43, 0x8f, + 0xda, 0x47, 0x56, 0x20, 0xf6, 0x6e, 0x89, 0x3d, 0xdf, 0x3e, 0xa8, 0x1d, 0x6f, 0xd7, 0xf8, 0x9f, + 0xe0, 0x7b, 0xfc, 0xf7, 0x55, 0x8e, 0x0f, 0xb7, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xbe, 0xbd, + 0x82, 0x5f, 0xb3, 0x0f, 0x00, 0x00, } func (m *Command) Marshal() (dAtA []byte, err error) { @@ -1329,6 +1515,20 @@ func (m *DataplaneStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.AgentActivityStatus) > 0 { + for iNdEx := len(m.AgentActivityStatus) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AgentActivityStatus[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommand(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } if len(m.DataplaneSoftwareDetails) > 0 { for iNdEx := len(m.DataplaneSoftwareDetails) - 1; iNdEx >= 0; iNdEx-- { { @@ -1393,6 +1593,109 @@ func (m *DataplaneStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AgentActivityStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AgentActivityStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentActivityStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Status != nil { + { + size := m.Status.Size() + i -= size + if _, err := m.Status.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *AgentActivityStatus_NginxConfigStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentActivityStatus_NginxConfigStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.NginxConfigStatus != nil { + { + size, err := m.NginxConfigStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommand(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *NginxConfigStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NginxConfigStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NginxConfigStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintCommand(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + } + if m.Status != 0 { + i = encodeVarintCommand(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if len(m.CorrelationId) > 0 { + i -= len(m.CorrelationId) + copy(dAtA[i:], m.CorrelationId) + i = encodeVarintCommand(dAtA, i, uint64(len(m.CorrelationId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *DownloadRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1935,6 +2238,62 @@ func (m *DataplaneStatus) Size() (n int) { n += 1 + l + sovCommand(uint64(l)) } } + if len(m.AgentActivityStatus) > 0 { + for _, e := range m.AgentActivityStatus { + l = e.Size() + n += 1 + l + sovCommand(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AgentActivityStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + n += m.Status.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AgentActivityStatus_NginxConfigStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NginxConfigStatus != nil { + l = m.NginxConfigStatus.Size() + n += 1 + l + sovCommand(uint64(l)) + } + return n +} +func (m *NginxConfigStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CorrelationId) + if l > 0 { + n += 1 + l + sovCommand(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovCommand(uint64(m.Status)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovCommand(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2905,6 +3264,260 @@ func (m *DataplaneStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentActivityStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AgentActivityStatus = append(m.AgentActivityStatus, &AgentActivityStatus{}) + if err := m.AgentActivityStatus[len(m.AgentActivityStatus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommand(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommand + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AgentActivityStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentActivityStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentActivityStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NginxConfigStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &NginxConfigStatus{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Status = &AgentActivityStatus_NginxConfigStatus{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommand(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommand + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NginxConfigStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NginxConfigStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NginxConfigStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorrelationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CorrelationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= NginxConfigStatus_Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCommand(dAtA[iNdEx:]) diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/command.proto b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/command.proto index efe97a327..84e24f03f 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/command.proto +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/command.proto @@ -86,6 +86,25 @@ message DataplaneStatus { HostInfo host = 3 [(gogoproto.jsontag) = "host" ]; repeated NginxHealth healths = 5 [(gogoproto.jsontag) = "healths" ]; repeated DataplaneSoftwareDetails dataplane_software_details = 6 [(gogoproto.jsontag) = "dataplane_software_details"]; + repeated AgentActivityStatus agent_activity_status = 7 [(gogoproto.jsontag) = "agent_activity_status" ]; +} + +message AgentActivityStatus { + oneof Status { + NginxConfigStatus nginx_config_status = 1 [(gogoproto.jsontag) = "nginx_config_status" ]; + } +} + +message NginxConfigStatus { + string correlation_id = 1 [(gogoproto.jsontag) = "correlation_id" ]; + Status status = 2 [(gogoproto.jsontag) = "status" ]; + string message = 3 [(gogoproto.jsontag) = "message" ]; + + enum Status { + PENDING = 0; + OK = 1; + ERROR = 2; + } } message DownloadRequest { diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go index f71592033..5492d746b 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go @@ -250,8 +250,8 @@ var ( Usage: "A comma-separated list of tags to add to the current instance or machine, to be used for inventory purposes.", }, &StringSliceFlag{ - Name: FeaturesKey, - Usage: "A comma-separated list of features enabled for the agent.", + Name: FeaturesKey, + Usage: "A comma-separated list of features enabled for the agent.", DefaultValue: Defaults.Features, }, // NGINX Config diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/sources/nginx_plus.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/sources/nginx_plus.go index c9a6ae3c3..29d2f7e25 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/sources/nginx_plus.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/sources/nginx_plus.go @@ -33,8 +33,8 @@ type NginxPlus struct { plusNamespace, plusAPI string // This is for keeping the previous stats. Need to report the delta. - prevStats *plusclient.Stats - init sync.Once + prevStats *plusclient.Stats + init sync.Once clientVersion int } 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 e3f3612d3..92efcb008 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 @@ -244,23 +244,14 @@ func (n *NginxBinaryType) Reload(processId, bin string) error { // ValidateConfig tests the config with nginx -t -c configLocation. func (n *NginxBinaryType) ValidateConfig(processId, bin, configLocation string, config *proto.NginxConfig, configApply *sdk.ConfigApply) error { log.Debugf("Validating config, %s for nginx process, %s", configLocation, processId) + response, err := runCmd(bin, "-t", "-c", configLocation) + if err != nil { + confFiles, auxFiles, err := sdk.GetNginxConfigFiles(config) + n.writeBackup(config, confFiles, auxFiles) + return fmt.Errorf("error running nginx -t -c %v:\n%s%v", configLocation, response, err) + } - errChan := make(chan error, 1) - responseChan := make(chan string) - - go func(responseChan chan string, errChan chan error) { - n.wg.Wait() - res, errResponse := runCmd(bin, "-t", "-c", configLocation) - if errResponse != nil { - confFiles, auxFiles, errResponse := sdk.GetNginxConfigFiles(config) - n.writeBackup(config, confFiles, auxFiles) - errChan <- fmt.Errorf("error running nginx -t -c %s:\n %s %v", configLocation, res, errResponse) - } - responseChan <- res.String() - defer n.wg.Done() - }(responseChan, errChan) - - log.Infof("Config validated:\n%s", <-responseChan) + log.Infof("Config validated:\n%s", response) return nil } diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/topics.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/topics.go index 6ae1c1eb0..9c251993c 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/topics.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/topics.go @@ -19,6 +19,11 @@ const ( NginxWorkerProcCreated = "nginx.worker.created" NginxWorkerProcKilled = "nginx.worker.killed" NginxDetailProcUpdate = "nginx.proc.update" + NginxConfigValidationPending = "nginx.config.validation.pending" + NginxConfigValidationFailed = "nginx.config.validation.failed" + NginxConfigValidationSucceeded = "nginx.config.validation.succeeded" + NginxConfigApplyFailed = "nginx.config.apply.failed" + NginxConfigApplySucceeded = "nginx.config.apply.succeeded" CommPrefix = "comms." CommStatus = CommPrefix + "status" CommMetrics = CommPrefix + "metrics" diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/dataplane_status.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/dataplane_status.go index bd5dd3ba4..bb52017f4 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/dataplane_status.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/dataplane_status.go @@ -15,22 +15,23 @@ import ( ) type DataPlaneStatus struct { - messagePipeline core.MessagePipeInterface - ctx context.Context - sendStatus chan bool - healthTicker *time.Ticker - interval time.Duration - meta *proto.Metadata - binary core.NginxBinary - env core.Environment - version string - tags *[]string - configDirs string - lastSendDetails time.Time - envHostInfo *proto.HostInfo - statusUrls map[string]string - reportInterval time.Duration - napDetails *proto.DataplaneSoftwareDetails_AppProtectWafDetails + messagePipeline core.MessagePipeInterface + ctx context.Context + sendStatus chan bool + healthTicker *time.Ticker + interval time.Duration + meta *proto.Metadata + binary core.NginxBinary + env core.Environment + version string + tags *[]string + configDirs string + lastSendDetails time.Time + envHostInfo *proto.HostInfo + statusUrls map[string]string + reportInterval time.Duration + napDetails *proto.DataplaneSoftwareDetails_AppProtectWafDetails + agentActivityStatuses []*proto.AgentActivityStatus } const ( @@ -87,11 +88,54 @@ func (dps *DataPlaneStatus) Process(msg *core.Message) { case msg.Exact(core.NginxAppProtectDetailsGenerated): // If a NAP report was generated sync it dps.syncNAPDetails(msg) + + case msg.Exact(core.NginxConfigValidationPending): + log.Tracef("DataplaneStatus: %T message from topic %s received", msg.Data(), msg.Topic()) + switch data := msg.Data().(type) { + case *proto.AgentActivityStatus: + dps.updateAgentActivityStatuses(data) + default: + log.Errorf("Expected the type %T but got %T", &proto.AgentActivityStatus{}, data) + } + case msg.Exact(core.NginxConfigApplyFailed) || msg.Exact(core.NginxConfigApplySucceeded): + log.Tracef("DataplaneStatus: %T message from topic %s received", msg.Data(), msg.Topic()) + switch data := msg.Data().(type) { + case *proto.AgentActivityStatus: + dps.updateAgentActivityStatuses(data) + dps.sendDataplaneStatus(dps.messagePipeline, false) + default: + log.Errorf("Expected the type %T but got %T", &proto.AgentActivityStatus{}, data) + } } } func (dps *DataPlaneStatus) Subscriptions() []string { - return []string{core.AgentConfigChanged, core.NginxAppProtectDetailsGenerated} + return []string{ + core.AgentConfigChanged, + core.NginxAppProtectDetailsGenerated, + core.NginxConfigValidationPending, + core.NginxConfigApplyFailed, + core.NginxConfigApplySucceeded, + } +} + +func (dps *DataPlaneStatus) updateAgentActivityStatuses(newAgentActivityStatus *proto.AgentActivityStatus) { + log.Tracef("DataplaneStatus: Adding %v to agentActivityStatuses", newAgentActivityStatus) + if _, ok := newAgentActivityStatus.GetStatus().(*proto.AgentActivityStatus_NginxConfigStatus); ok { + foundExistingNginxStatus := false + for index, agentActivityStatus := range dps.agentActivityStatuses { + if _, ok := agentActivityStatus.GetStatus().(*proto.AgentActivityStatus_NginxConfigStatus); ok { + dps.agentActivityStatuses[index] = newAgentActivityStatus + log.Tracef("DataplaneStatus: Updated agentActivityStatus with new status %v", newAgentActivityStatus) + foundExistingNginxStatus = true + } + } + + if !foundExistingNginxStatus { + dps.agentActivityStatuses = append(dps.agentActivityStatuses, newAgentActivityStatus) + log.Tracef("DataplaneStatus: Added new status %v to agentActivityStatus", newAgentActivityStatus) + } + } } func (dps *DataPlaneStatus) sendDataplaneStatus(pipeline core.MessagePipeInterface, forceDetails bool) { @@ -133,6 +177,7 @@ func (dps *DataPlaneStatus) dataplaneStatus(forceDetails bool) *proto.DataplaneS Details: dps.detailsForProcess(processes, forceDetails), Healths: dps.healthForProcess(processes), DataplaneSoftwareDetails: dps.dataplaneSoftwareDetails(), + AgentActivityStatus: dps.agentActivityStatuses, } } diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go index fdccce8aa..ae93ed929 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go @@ -11,6 +11,7 @@ import ( "github.com/nginx/agent/sdk/v2" "github.com/nginx/agent/sdk/v2/client" + "github.com/nginx/agent/sdk/v2/grpc" "github.com/nginx/agent/sdk/v2/proto" "github.com/nginx/agent/v2/src/core" @@ -47,6 +48,14 @@ type NginxReloadResponse struct { nginxDetails *proto.NginxDetails } +type NginxConfigValidationResponse struct { + err error + correlationId string + nginxDetails *proto.NginxDetails + config *proto.NginxConfig + configApply *sdk.ConfigApply +} + func NewNginx(cmdr client.Commander, nginxBinary core.NginxBinary, env core.Environment, loadedConfig *config.Config) *Nginx { var isNAPEnabled bool if loadedConfig.NginxAppProtect != (config.NginxAppProtect{}) { @@ -95,6 +104,16 @@ func (n *Nginx) Process(message *core.Message) { case core.AgentConfigChanged: // If the agent config on disk changed update this with relevant config info n.syncAgentConfigChange() + case core.NginxConfigValidationSucceeded: + switch response := message.Data().(type) { + case *NginxConfigValidationResponse: + n.completeConfigApply(response) + } + case core.NginxConfigValidationFailed: + switch response := message.Data().(type) { + case *NginxConfigValidationResponse: + n.rollbackConfigApply(response) + } case core.EnableExtension: switch data := message.Data().(type) { case string: @@ -113,6 +132,9 @@ func (n *Nginx) Subscriptions() []string { core.DataplaneChanged, core.AgentConfigChanged, core.EnableExtension, + core.NginxConfigValidationPending, + core.NginxConfigValidationSucceeded, + core.NginxConfigValidationFailed, } } @@ -203,20 +225,22 @@ func (n *Nginx) processCmd(cmd *proto.Command) { } } -// The applyConfig does the following: -// - Download config -// - Stop file watcher -// - Write the config -// - Valid config -// - Upload the config -// - Start file watcher -// - Reload nginx func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) (status *proto.Command_NginxConfigResponse) { log.Debugf("Applying config for message id, %s", cmd.GetMeta().MessageId) + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationPending, &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: cmd.Meta.MessageId, + Status: proto.NginxConfigStatus_PENDING, + Message: "config apply pending", + }, + }, + })) + status = &proto.Command_NginxConfigResponse{ NginxConfigResponse: &proto.NginxConfigResponse{ - Status: newOKStatus("config applied successfully").CmdStatus, + Status: newOKStatus("config apply request successfully processed").CmdStatus, Action: proto.NginxConfigAction_APPLY, ConfigData: cfg.NginxConfig.ConfigData, }, @@ -263,34 +287,54 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) } message := fmt.Sprintf("Config apply failed (write): " + err.Error()) - return n.handleErrorStatus(status, message) - } - err = n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationPending, &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: cmd.Meta.MessageId, + Status: proto.NginxConfigStatus_ERROR, + Message: message, + }, + }, + })) - if err != nil { - if configApply != nil { - succeeded := true + return n.handleErrorStatus(status, message) + } - if rollbackErr := configApply.Rollback(err); rollbackErr != nil { - log.Errorf("Config rollback failed: %v", rollbackErr) - succeeded = false - } + n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) + log.Debug("Validation of nginx config in progress") + return status +} - configRollbackResponse := ConfigRollbackResponse{ - succeeded: succeeded, - correlationId: cmd.Meta.MessageId, - timestamp: types.TimestampNow(), +func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) { + go func() { + err := n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) + if err != nil { + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, &NginxConfigValidationResponse{ + err: fmt.Errorf("error running nginx -t -c %s:\n %v", nginx.ConfPath, err), + correlationId: correlationId, nginxDetails: nginx, - } - n.messagePipeline.Process(core.NewMessage(core.ConfigRollbackResponse, configRollbackResponse)) + config: config, + configApply: configApply, + })) + } else { + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, &NginxConfigValidationResponse{ + err: nil, + correlationId: correlationId, + nginxDetails: nginx, + config: config, + configApply: configApply, + })) } + }() +} - message := fmt.Sprintf("Config apply failed (write): " + err.Error()) - return n.handleErrorStatus(status, message) - } else if configApply != nil { - if err = configApply.Complete(); err != nil { - log.Errorf("Config complete failed: %v", err) +func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) { + nginxConfigStatusMessage := "Config applied successfully" + if response.configApply != nil { + if err := response.configApply.Complete(); err != nil { + nginxConfigStatusMessage = fmt.Sprintf("Config complete failed: %v", err) + log.Errorf(nginxConfigStatusMessage) } } @@ -302,38 +346,93 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) }, } - err = n.uploadConfig( + err := n.uploadConfig( &proto.ConfigDescriptor{ SystemId: n.env.GetSystemUUID(), - NginxId: config.GetConfigData().GetNginxId(), + NginxId: response.config.GetConfigData().GetNginxId(), }, - cmd.Meta.GetMessageId(), + response.correlationId, ) if err != nil { - uploadResponse.NginxConfigResponse.Status = newErrStatus("config uploaded error: " + err.Error()).CmdStatus + uploadResponse.NginxConfigResponse.Status = newErrStatus("Config uploaded error: " + err.Error()).CmdStatus + nginxConfigStatusMessage = fmt.Sprintf("Config uploaded error: %v", err) + log.Errorf(nginxConfigStatusMessage) } - uploadResponseCommand := newStatusCommand(cmd) + uploadResponseCommand := &proto.Command{Meta: grpc.NewMessageMeta(response.correlationId)} uploadResponseCommand.Data = uploadResponse n.messagePipeline.Process(core.NewMessage(core.CommResponse, uploadResponseCommand)) log.Debug("Enabling file watcher") n.messagePipeline.Process(core.NewMessage(core.FileWatcherEnabled, true)) - reloadErr := n.nginxBinary.Reload(nginx.ProcessId, nginx.ProcessPath) + reloadErr := n.nginxBinary.Reload(response.nginxDetails.ProcessId, response.nginxDetails.ProcessPath) if reloadErr != nil { - status.NginxConfigResponse.Status = newErrStatus("Config apply failed (write): " + reloadErr.Error()).CmdStatus + nginxConfigStatusMessage = fmt.Sprintf("Config apply failed (write): %v", reloadErr) + log.Errorf(nginxConfigStatusMessage) } nginxReloadEventMeta := NginxReloadResponse{ succeeded: reloadErr == nil, - correlationId: cmd.Meta.MessageId, + correlationId: response.correlationId, timestamp: types.TimestampNow(), - nginxDetails: nginx, + nginxDetails: response.nginxDetails, } + n.messagePipeline.Process(core.NewMessage(core.NginxReloadComplete, nginxReloadEventMeta)) + + agentActivityStatus := &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: response.correlationId, + Status: proto.NginxConfigStatus_OK, + Message: nginxConfigStatusMessage, + }, + }, + } + + n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplySucceeded, agentActivityStatus)) + log.Debug("Config Apply Complete") - return status +} + +func (n *Nginx) rollbackConfigApply(response *NginxConfigValidationResponse) { + nginxConfigStatusMessage := fmt.Sprintf("Config apply failed (write): %v", response.err.Error()) + log.Error(nginxConfigStatusMessage) + + if response.configApply != nil { + succeeded := true + + if rollbackErr := response.configApply.Rollback(response.err); rollbackErr != nil { + nginxConfigStatusMessage := fmt.Sprintf("Config rollback failed: %v", rollbackErr) + log.Error(nginxConfigStatusMessage) + succeeded = false + } + + configRollbackResponse := ConfigRollbackResponse{ + succeeded: succeeded, + correlationId: response.correlationId, + timestamp: types.TimestampNow(), + nginxDetails: response.nginxDetails, + } + + n.messagePipeline.Process(core.NewMessage(core.ConfigRollbackResponse, configRollbackResponse)) + + agentActivityStatus := &proto.AgentActivityStatus{ + Status: &proto.AgentActivityStatus_NginxConfigStatus{ + NginxConfigStatus: &proto.NginxConfigStatus{ + CorrelationId: response.correlationId, + Status: proto.NginxConfigStatus_ERROR, + Message: nginxConfigStatusMessage, + }, + }, + } + + n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplyFailed, agentActivityStatus)) + } + + log.Debug("Enabling file watcher") + n.messagePipeline.Process(core.NewMessage(core.FileWatcherEnabled, true)) } func (n *Nginx) handleErrorStatus(status *proto.Command_NginxConfigResponse, message string) *proto.Command_NginxConfigResponse { diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/command.pb.go b/vendor/github.com/nginx/agent/sdk/v2/proto/command.pb.go index d4b8a3870..2c617b1f5 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/command.pb.go +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/command.pb.go @@ -105,6 +105,34 @@ func (CommandStatusResponse_CommandErrorCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor_213c0bb044472049, []int{1, 1} } +type NginxConfigStatus_Status int32 + +const ( + NginxConfigStatus_PENDING NginxConfigStatus_Status = 0 + NginxConfigStatus_OK NginxConfigStatus_Status = 1 + NginxConfigStatus_ERROR NginxConfigStatus_Status = 2 +) + +var NginxConfigStatus_Status_name = map[int32]string{ + 0: "PENDING", + 1: "OK", + 2: "ERROR", +} + +var NginxConfigStatus_Status_value = map[string]int32{ + "PENDING": 0, + "OK": 1, + "ERROR": 2, +} + +func (x NginxConfigStatus_Status) String() string { + return proto.EnumName(NginxConfigStatus_Status_name, int32(x)) +} + +func (NginxConfigStatus_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_213c0bb044472049, []int{4, 0} +} + type UploadStatus_TransferStatus int32 const ( @@ -130,7 +158,7 @@ func (x UploadStatus_TransferStatus) String() string { } func (UploadStatus_TransferStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{5, 0} + return fileDescriptor_213c0bb044472049, []int{7, 0} } // Command is the envelope sent between the management plane and the data plane, requesting some action or reporting a response @@ -422,6 +450,7 @@ type DataplaneStatus struct { Host *HostInfo `protobuf:"bytes,3,opt,name=host,proto3" json:"host"` Healths []*NginxHealth `protobuf:"bytes,5,rep,name=healths,proto3" json:"healths"` DataplaneSoftwareDetails []*DataplaneSoftwareDetails `protobuf:"bytes,6,rep,name=dataplane_software_details,json=dataplaneSoftwareDetails,proto3" json:"dataplane_software_details"` + AgentActivityStatus []*AgentActivityStatus `protobuf:"bytes,7,rep,name=agent_activity_status,json=agentActivityStatus,proto3" json:"agent_activity_status"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -495,6 +524,151 @@ func (m *DataplaneStatus) GetDataplaneSoftwareDetails() []*DataplaneSoftwareDeta return nil } +func (m *DataplaneStatus) GetAgentActivityStatus() []*AgentActivityStatus { + if m != nil { + return m.AgentActivityStatus + } + return nil +} + +type AgentActivityStatus struct { + // Types that are valid to be assigned to Status: + // *AgentActivityStatus_NginxConfigStatus + Status isAgentActivityStatus_Status `protobuf_oneof:"Status"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AgentActivityStatus) Reset() { *m = AgentActivityStatus{} } +func (m *AgentActivityStatus) String() string { return proto.CompactTextString(m) } +func (*AgentActivityStatus) ProtoMessage() {} +func (*AgentActivityStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_213c0bb044472049, []int{3} +} +func (m *AgentActivityStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AgentActivityStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AgentActivityStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AgentActivityStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_AgentActivityStatus.Merge(m, src) +} +func (m *AgentActivityStatus) XXX_Size() int { + return m.Size() +} +func (m *AgentActivityStatus) XXX_DiscardUnknown() { + xxx_messageInfo_AgentActivityStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_AgentActivityStatus proto.InternalMessageInfo + +type isAgentActivityStatus_Status interface { + isAgentActivityStatus_Status() + MarshalTo([]byte) (int, error) + Size() int +} + +type AgentActivityStatus_NginxConfigStatus struct { + NginxConfigStatus *NginxConfigStatus `protobuf:"bytes,1,opt,name=nginx_config_status,json=nginxConfigStatus,proto3,oneof" json:"nginx_config_status"` +} + +func (*AgentActivityStatus_NginxConfigStatus) isAgentActivityStatus_Status() {} + +func (m *AgentActivityStatus) GetStatus() isAgentActivityStatus_Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *AgentActivityStatus) GetNginxConfigStatus() *NginxConfigStatus { + if x, ok := m.GetStatus().(*AgentActivityStatus_NginxConfigStatus); ok { + return x.NginxConfigStatus + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*AgentActivityStatus) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*AgentActivityStatus_NginxConfigStatus)(nil), + } +} + +type NginxConfigStatus struct { + CorrelationId string `protobuf:"bytes,1,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id"` + Status NginxConfigStatus_Status `protobuf:"varint,2,opt,name=status,proto3,enum=f5.nginx.agent.sdk.NginxConfigStatus_Status" json:"status"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NginxConfigStatus) Reset() { *m = NginxConfigStatus{} } +func (m *NginxConfigStatus) String() string { return proto.CompactTextString(m) } +func (*NginxConfigStatus) ProtoMessage() {} +func (*NginxConfigStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_213c0bb044472049, []int{4} +} +func (m *NginxConfigStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NginxConfigStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NginxConfigStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NginxConfigStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_NginxConfigStatus.Merge(m, src) +} +func (m *NginxConfigStatus) XXX_Size() int { + return m.Size() +} +func (m *NginxConfigStatus) XXX_DiscardUnknown() { + xxx_messageInfo_NginxConfigStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_NginxConfigStatus proto.InternalMessageInfo + +func (m *NginxConfigStatus) GetCorrelationId() string { + if m != nil { + return m.CorrelationId + } + return "" +} + +func (m *NginxConfigStatus) GetStatus() NginxConfigStatus_Status { + if m != nil { + return m.Status + } + return NginxConfigStatus_PENDING +} + +func (m *NginxConfigStatus) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + type DownloadRequest struct { Meta *Metadata `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -506,7 +680,7 @@ func (m *DownloadRequest) Reset() { *m = DownloadRequest{} } func (m *DownloadRequest) String() string { return proto.CompactTextString(m) } func (*DownloadRequest) ProtoMessage() {} func (*DownloadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{3} + return fileDescriptor_213c0bb044472049, []int{5} } func (m *DownloadRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -555,7 +729,7 @@ func (m *NginxConfigResponse) Reset() { *m = NginxConfigResponse{} } func (m *NginxConfigResponse) String() string { return proto.CompactTextString(m) } func (*NginxConfigResponse) ProtoMessage() {} func (*NginxConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{4} + return fileDescriptor_213c0bb044472049, []int{6} } func (m *NginxConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -618,7 +792,7 @@ func (m *UploadStatus) Reset() { *m = UploadStatus{} } func (m *UploadStatus) String() string { return proto.CompactTextString(m) } func (*UploadStatus) ProtoMessage() {} func (*UploadStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{5} + return fileDescriptor_213c0bb044472049, []int{7} } func (m *UploadStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -682,7 +856,7 @@ func (m *DataChunk) Reset() { *m = DataChunk{} } func (m *DataChunk) String() string { return proto.CompactTextString(m) } func (*DataChunk) ProtoMessage() {} func (*DataChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{6} + return fileDescriptor_213c0bb044472049, []int{8} } func (m *DataChunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -771,7 +945,7 @@ func (m *ChunkedResourceHeader) Reset() { *m = ChunkedResourceHeader{} } func (m *ChunkedResourceHeader) String() string { return proto.CompactTextString(m) } func (*ChunkedResourceHeader) ProtoMessage() {} func (*ChunkedResourceHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{7} + return fileDescriptor_213c0bb044472049, []int{9} } func (m *ChunkedResourceHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -841,7 +1015,7 @@ func (m *ChunkedResourceChunk) Reset() { *m = ChunkedResourceChunk{} } func (m *ChunkedResourceChunk) String() string { return proto.CompactTextString(m) } func (*ChunkedResourceChunk) ProtoMessage() {} func (*ChunkedResourceChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_213c0bb044472049, []int{8} + return fileDescriptor_213c0bb044472049, []int{10} } func (m *ChunkedResourceChunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -895,10 +1069,13 @@ func init() { proto.RegisterEnum("f5.nginx.agent.sdk.Command_CommandType", Command_CommandType_name, Command_CommandType_value) proto.RegisterEnum("f5.nginx.agent.sdk.CommandStatusResponse_CommandStatus", CommandStatusResponse_CommandStatus_name, CommandStatusResponse_CommandStatus_value) proto.RegisterEnum("f5.nginx.agent.sdk.CommandStatusResponse_CommandErrorCode", CommandStatusResponse_CommandErrorCode_name, CommandStatusResponse_CommandErrorCode_value) + proto.RegisterEnum("f5.nginx.agent.sdk.NginxConfigStatus_Status", NginxConfigStatus_Status_name, NginxConfigStatus_Status_value) proto.RegisterEnum("f5.nginx.agent.sdk.UploadStatus_TransferStatus", UploadStatus_TransferStatus_name, UploadStatus_TransferStatus_value) proto.RegisterType((*Command)(nil), "f5.nginx.agent.sdk.Command") proto.RegisterType((*CommandStatusResponse)(nil), "f5.nginx.agent.sdk.CommandStatusResponse") proto.RegisterType((*DataplaneStatus)(nil), "f5.nginx.agent.sdk.DataplaneStatus") + proto.RegisterType((*AgentActivityStatus)(nil), "f5.nginx.agent.sdk.AgentActivityStatus") + proto.RegisterType((*NginxConfigStatus)(nil), "f5.nginx.agent.sdk.NginxConfigStatus") proto.RegisterType((*DownloadRequest)(nil), "f5.nginx.agent.sdk.DownloadRequest") proto.RegisterType((*NginxConfigResponse)(nil), "f5.nginx.agent.sdk.NginxConfigResponse") proto.RegisterType((*UploadStatus)(nil), "f5.nginx.agent.sdk.UploadStatus") @@ -910,85 +1087,94 @@ func init() { func init() { proto.RegisterFile("command.proto", fileDescriptor_213c0bb044472049) } var fileDescriptor_213c0bb044472049 = []byte{ - // 1245 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x26, 0x65, 0x8b, 0xb2, 0x46, 0x72, 0x2c, 0x6c, 0x9c, 0x82, 0x31, 0x02, 0xd3, 0x60, 0x9b, - 0xc6, 0x2d, 0x1a, 0x09, 0x75, 0x10, 0x14, 0x48, 0x2e, 0x35, 0x25, 0xa5, 0x34, 0x62, 0x4b, 0xc5, - 0x3a, 0x4e, 0x80, 0x14, 0x85, 0xc0, 0x90, 0xab, 0x1f, 0xd8, 0x22, 0x55, 0x2e, 0x95, 0xc4, 0x41, - 0xef, 0x05, 0x8a, 0xde, 0x8a, 0xa2, 0xe8, 0x53, 0xf4, 0x35, 0x7a, 0xcc, 0x13, 0x10, 0x85, 0x8f, - 0x7c, 0x80, 0x9e, 0x8b, 0xfd, 0xa1, 0x2c, 0xd9, 0x94, 0xdc, 0xc0, 0xbd, 0x68, 0x67, 0x67, 0xbf, - 0xf9, 0xe6, 0x67, 0x77, 0x67, 0x29, 0x58, 0x75, 0x83, 0xe1, 0xd0, 0xf1, 0xbd, 0xea, 0x28, 0x0c, - 0xa2, 0x00, 0xa1, 0xee, 0xc3, 0xaa, 0xdf, 0x1b, 0xf8, 0x6f, 0xab, 0x4e, 0x8f, 0xf8, 0x51, 0x95, - 0x7a, 0xc7, 0x1b, 0xd0, 0x0b, 0x7a, 0x81, 0x58, 0xdf, 0x28, 0x33, 0x78, 0xe0, 0xcb, 0x59, 0x49, - 0x80, 0xc4, 0x04, 0xfa, 0x01, 0x4d, 0xe5, 0x92, 0xe0, 0x98, 0xd8, 0xf8, 0xdd, 0x41, 0x4f, 0xce, - 0x10, 0x79, 0x4d, 0xfc, 0x88, 0xd6, 0xf8, 0x20, 0x75, 0xb7, 0xbd, 0x51, 0x87, 0x06, 0xdd, 0xe8, - 0x8d, 0x13, 0x92, 0x8e, 0x47, 0x22, 0x67, 0x70, 0x42, 0xc5, 0x92, 0xf9, 0x2b, 0x40, 0xa1, 0x2e, - 0x42, 0x44, 0x8f, 0x60, 0x79, 0x48, 0x22, 0x47, 0x57, 0xb7, 0xd4, 0xed, 0xd2, 0xce, 0x9d, 0xea, - 0xe5, 0x58, 0xab, 0x07, 0x24, 0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23, - 0x56, 0x57, 0x79, 0xde, 0xaf, 0xf3, 0x95, 0x76, 0x38, 0x29, 0x9f, 0xc8, 0xb7, 0x96, 0x65, 0x3d, - 0xed, 0xad, 0xfa, 0x2c, 0x74, 0x7c, 0xda, 0x25, 0xe1, 0x82, 0xae, 0x65, 0x82, 0x16, 0x12, 0x87, - 0x06, 0xbe, 0xec, 0x24, 0x1c, 0x23, 0x34, 0x58, 0x8e, 0xe6, 0x97, 0x70, 0x63, 0x96, 0x09, 0x95, - 0xa0, 0x70, 0xde, 0x23, 0x34, 0xc8, 0xf1, 0xfe, 0x00, 0xa0, 0x3d, 0xd9, 0xdd, 0xdb, 0x6f, 0x36, - 0x2a, 0x39, 0xf3, 0x4f, 0x15, 0x8a, 0xac, 0x02, 0xf5, 0xfe, 0xd8, 0x3f, 0x46, 0x6d, 0xd0, 0xfa, - 0xc4, 0xf1, 0x48, 0xb8, 0x70, 0xe3, 0x19, 0x94, 0x78, 0x98, 0xd0, 0x60, 0x1c, 0xba, 0xc4, 0xe6, - 0x06, 0x22, 0x1e, 0x61, 0x6c, 0x2b, 0x58, 0x4a, 0xc8, 0x16, 0xad, 0x9e, 0x17, 0x62, 0xce, 0xf7, - 0xca, 0x05, 0x3a, 0x3e, 0x15, 0x25, 0x65, 0x96, 0xb6, 0x82, 0xf9, 0x68, 0x15, 0x20, 0xef, 0xb2, - 0x25, 0xf3, 0xbd, 0x0a, 0xb7, 0x32, 0x43, 0xb8, 0xd6, 0x9e, 0x99, 0xa0, 0x71, 0x7a, 0xb1, 0x67, - 0x79, 0x91, 0x8e, 0xd0, 0x60, 0x39, 0xa2, 0x6d, 0x58, 0x71, 0xfb, 0xc4, 0x3d, 0xa6, 0xe3, 0xa1, - 0xdc, 0x84, 0x72, 0x12, 0x1b, 0x13, 0x1d, 0x9e, 0x48, 0xe8, 0x3e, 0x00, 0xb7, 0xe9, 0xd0, 0xc1, - 0x3b, 0xc2, 0xbb, 0x7a, 0x5e, 0x7e, 0x35, 0x4f, 0xb4, 0xb8, 0xc8, 0xe5, 0xc3, 0xc1, 0x3b, 0x62, - 0xfe, 0xa1, 0xc2, 0x7a, 0x56, 0x19, 0xae, 0x95, 0xd1, 0x3d, 0x16, 0x2d, 0xf3, 0x36, 0xf0, 0x64, - 0x4e, 0x32, 0x5a, 0xa1, 0xc3, 0x05, 0x2e, 0xed, 0x79, 0xe8, 0x8e, 0xdc, 0x23, 0x96, 0x52, 0xf9, - 0xbc, 0xf2, 0xb2, 0xee, 0xad, 0xbf, 0xce, 0x36, 0xd5, 0xf7, 0x67, 0x9b, 0xea, 0xdf, 0x67, 0x9b, - 0xea, 0xcb, 0xaf, 0x7b, 0x83, 0xe8, 0xc4, 0x79, 0x55, 0x75, 0x83, 0xe1, 0xa3, 0xee, 0xc3, 0x1a, - 0x0f, 0xa6, 0xc6, 0x83, 0xa9, 0x8d, 0xc2, 0xc0, 0x1b, 0xbb, 0x91, 0xd0, 0xdd, 0x17, 0x3a, 0xea, - 0x1d, 0xd7, 0x5e, 0xef, 0xd4, 0xf8, 0x9f, 0xa0, 0xc7, 0xfc, 0xf7, 0x95, 0xc6, 0x87, 0x07, 0xff, - 0x06, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x05, 0x57, 0x2c, 0xb3, 0x0d, 0x00, 0x00, + // 1382 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4b, 0x6f, 0xdb, 0x46, + 0x10, 0x26, 0x15, 0x4b, 0xb2, 0x46, 0xb2, 0xad, 0xac, 0x9d, 0x56, 0x31, 0x02, 0xd3, 0x60, 0x9b, + 0xc6, 0x2d, 0x12, 0x09, 0x75, 0x10, 0x14, 0x4d, 0x2e, 0xb5, 0x2c, 0x25, 0x14, 0x12, 0x4b, 0xc1, + 0xe6, 0x05, 0xa4, 0x28, 0x04, 0x86, 0x5c, 0xc9, 0x84, 0x2d, 0xae, 0x4a, 0xd2, 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x79, 0xba, 0x79, 0xf8, 0x84, 0xd7, 0x95, 0x28, + 0xd4, 0x52, 0x79, 0x0c, 0x05, 0x23, 0x73, 0x0a, 0xcf, 0xf2, 0x27, 0x89, 0xae, 0x14, 0x66, 0xe7, + 0x4f, 0x42, 0x9b, 0xc8, 0x9f, 0xa4, 0x20, 0xcb, 0x9f, 0x04, 0x3d, 0xea, 0x41, 0x99, 0x3d, 0xa9, + 0xe1, 0xa1, 0xe9, 0x92, 0x38, 0xf3, 0x8b, 0x9c, 0xfb, 0x93, 0x34, 0xee, 0x46, 0x8c, 0x15, 0x69, + 0x5d, 0x5f, 0x8b, 0x42, 0x6d, 0x8a, 0xc0, 0x50, 0xf0, 0x8a, 0x3d, 0x0e, 0x44, 0xdf, 0x41, 0x89, + 0x17, 0x85, 0xae, 0x47, 0x86, 0xd4, 0x0b, 0x2a, 0xa5, 0xd9, 0xd1, 0x12, 0x35, 0xa4, 0xda, 0x64, + 0x03, 0xe6, 0x68, 0xe1, 0x46, 0x52, 0x9e, 0xb9, 0x41, 0x4e, 0x01, 0xe8, 0x67, 0x15, 0xd6, 0x13, + 0x66, 0x4c, 0x94, 0x9b, 0xca, 0x12, 0xd7, 0x76, 0x73, 0xbe, 0x47, 0x52, 0xa8, 0x21, 0x64, 0xea, + 0x1b, 0x51, 0xa8, 0xcd, 0xe1, 0x34, 0x14, 0x5c, 0xb1, 0x67, 0xc8, 0xea, 0xb7, 0xa1, 0x98, 0x28, + 0x34, 0x08, 0x20, 0xd7, 0xee, 0xe0, 0xbd, 0x9d, 0x47, 0x65, 0x05, 0x95, 0x60, 0xb1, 0xd1, 0x79, + 0xd1, 0x7e, 0xd4, 0xd9, 0x69, 0x94, 0x55, 0x76, 0xf2, 0xec, 0x31, 0x9f, 0x67, 0xea, 0x39, 0x58, + 0x60, 0x84, 0xfa, 0xef, 0x97, 0xe0, 0x4a, 0x6a, 0x85, 0x41, 0xdf, 0x42, 0x4e, 0x5e, 0x91, 0xca, + 0x2b, 0xd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0xa9, 0x71, 0x63, 0x6a, 0x43, 0x8f, + 0xda, 0x47, 0x56, 0x20, 0xf6, 0x6e, 0x89, 0x3d, 0xdf, 0x3e, 0xa8, 0x1d, 0x6f, 0xd7, 0xf8, 0x9f, + 0xe0, 0x7b, 0xfc, 0xf7, 0x55, 0x8e, 0x0f, 0xb7, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xbe, 0xbd, + 0x82, 0x5f, 0xb3, 0x0f, 0x00, 0x00, } func (m *Command) Marshal() (dAtA []byte, err error) { @@ -1329,6 +1515,20 @@ func (m *DataplaneStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.AgentActivityStatus) > 0 { + for iNdEx := len(m.AgentActivityStatus) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AgentActivityStatus[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommand(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } if len(m.DataplaneSoftwareDetails) > 0 { for iNdEx := len(m.DataplaneSoftwareDetails) - 1; iNdEx >= 0; iNdEx-- { { @@ -1393,6 +1593,109 @@ func (m *DataplaneStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AgentActivityStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AgentActivityStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentActivityStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Status != nil { + { + size := m.Status.Size() + i -= size + if _, err := m.Status.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *AgentActivityStatus_NginxConfigStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentActivityStatus_NginxConfigStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.NginxConfigStatus != nil { + { + size, err := m.NginxConfigStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommand(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *NginxConfigStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NginxConfigStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NginxConfigStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintCommand(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + } + if m.Status != 0 { + i = encodeVarintCommand(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if len(m.CorrelationId) > 0 { + i -= len(m.CorrelationId) + copy(dAtA[i:], m.CorrelationId) + i = encodeVarintCommand(dAtA, i, uint64(len(m.CorrelationId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *DownloadRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1935,6 +2238,62 @@ func (m *DataplaneStatus) Size() (n int) { n += 1 + l + sovCommand(uint64(l)) } } + if len(m.AgentActivityStatus) > 0 { + for _, e := range m.AgentActivityStatus { + l = e.Size() + n += 1 + l + sovCommand(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AgentActivityStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + n += m.Status.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AgentActivityStatus_NginxConfigStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NginxConfigStatus != nil { + l = m.NginxConfigStatus.Size() + n += 1 + l + sovCommand(uint64(l)) + } + return n +} +func (m *NginxConfigStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CorrelationId) + if l > 0 { + n += 1 + l + sovCommand(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovCommand(uint64(m.Status)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovCommand(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2905,6 +3264,260 @@ func (m *DataplaneStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentActivityStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AgentActivityStatus = append(m.AgentActivityStatus, &AgentActivityStatus{}) + if err := m.AgentActivityStatus[len(m.AgentActivityStatus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommand(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommand + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AgentActivityStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentActivityStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentActivityStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NginxConfigStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &NginxConfigStatus{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Status = &AgentActivityStatus_NginxConfigStatus{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommand(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommand + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NginxConfigStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NginxConfigStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NginxConfigStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorrelationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CorrelationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= NginxConfigStatus_Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommand + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCommand + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommand + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCommand(dAtA[iNdEx:]) diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/command.proto b/vendor/github.com/nginx/agent/sdk/v2/proto/command.proto index efe97a327..84e24f03f 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/command.proto +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/command.proto @@ -86,6 +86,25 @@ message DataplaneStatus { HostInfo host = 3 [(gogoproto.jsontag) = "host" ]; repeated NginxHealth healths = 5 [(gogoproto.jsontag) = "healths" ]; repeated DataplaneSoftwareDetails dataplane_software_details = 6 [(gogoproto.jsontag) = "dataplane_software_details"]; + repeated AgentActivityStatus agent_activity_status = 7 [(gogoproto.jsontag) = "agent_activity_status" ]; +} + +message AgentActivityStatus { + oneof Status { + NginxConfigStatus nginx_config_status = 1 [(gogoproto.jsontag) = "nginx_config_status" ]; + } +} + +message NginxConfigStatus { + string correlation_id = 1 [(gogoproto.jsontag) = "correlation_id" ]; + Status status = 2 [(gogoproto.jsontag) = "status" ]; + string message = 3 [(gogoproto.jsontag) = "message" ]; + + enum Status { + PENDING = 0; + OK = 1; + ERROR = 2; + } } message DownloadRequest { From 25b03452f77e690c2458015989aadb89be37bc90 Mon Sep 17 00:00:00 2001 From: dhurley Date: Tue, 11 Oct 2022 17:21:10 +0100 Subject: [PATCH 04/15] Clean up --- src/core/metrics/collectors/nginx.go | 1 - src/core/nginx.go | 1 - .../nginx/agent/v2/src/core/metrics/collectors/nginx.go | 1 - .../vendor/github.com/nginx/agent/v2/src/core/nginx.go | 1 - 4 files changed, 4 deletions(-) diff --git a/src/core/metrics/collectors/nginx.go b/src/core/metrics/collectors/nginx.go index 07cf4e650..e8bdb03ed 100644 --- a/src/core/metrics/collectors/nginx.go +++ b/src/core/metrics/collectors/nginx.go @@ -23,7 +23,6 @@ type NginxCollector struct { collectorConf *metrics.NginxCollectorConfig env core.Environment binary core.NginxBinary - conf *config.Config } func NewNginxCollector(conf *config.Config, env core.Environment, collectorConf *metrics.NginxCollectorConfig, binary core.NginxBinary) *NginxCollector { diff --git a/src/core/nginx.go b/src/core/nginx.go index 968277178..984847555 100644 --- a/src/core/nginx.go +++ b/src/core/nginx.go @@ -63,7 +63,6 @@ type NginxBinaryType struct { errorLogs map[string]string accessLogsUpdated bool errorLogsUpdated bool - wg sync.WaitGroup } type nginxInfo struct { diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/collectors/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/collectors/nginx.go index 07cf4e650..e8bdb03ed 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/collectors/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/metrics/collectors/nginx.go @@ -23,7 +23,6 @@ type NginxCollector struct { collectorConf *metrics.NginxCollectorConfig env core.Environment binary core.NginxBinary - conf *config.Config } func NewNginxCollector(conf *config.Config, env core.Environment, collectorConf *metrics.NginxCollectorConfig, binary core.NginxBinary) *NginxCollector { 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 968277178..984847555 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 @@ -63,7 +63,6 @@ type NginxBinaryType struct { errorLogs map[string]string accessLogsUpdated bool errorLogsUpdated bool - wg sync.WaitGroup } type nginxInfo struct { From cce6a4a241cc49df232bff234d2d076e7d056e51 Mon Sep 17 00:00:00 2001 From: dhurley Date: Wed, 12 Oct 2022 09:43:29 +0100 Subject: [PATCH 05/15] Fix nginx config apply unit tests --- src/plugins/nginx_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index 91538a88e..43247cead 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -233,7 +233,7 @@ func TestNginxConfigApply(t *testing.T) { messagePipe.Run() processedMessages := messagePipe.GetProcessedMessages() - assert.Eventually(tt, func() bool { return len(processedMessages) != len(test.msgTopics) }, time.Duration(5*time.Millisecond), 1*time.Millisecond) + assert.Eventually(tt, func() bool { return len(processedMessages) != len(test.msgTopics) }, time.Duration(15*time.Millisecond), 3*time.Millisecond) binary.AssertExpectations(tt) env.AssertExpectations(tt) cancel() @@ -504,7 +504,7 @@ func TestNginx_completeConfigApply(t *testing.T) { processedMessages := messagePipe.GetProcessedMessages() - assert.Eventually(t, func() bool { return len(processedMessages) == len(expectedTopics) }, time.Duration(5*time.Millisecond), 1*time.Millisecond) + assert.Eventually(t, func() bool { return len(processedMessages) == len(expectedTopics) }, time.Duration(15*time.Millisecond), 3*time.Millisecond) for idx, msg := range processedMessages { if expectedTopics[idx] != msg.Topic() { From 40e13777cfd35fde02e939a5fdb016d9aaad5c41 Mon Sep 17 00:00:00 2001 From: dhurley Date: Wed, 12 Oct 2022 17:01:55 +0100 Subject: [PATCH 06/15] Updated config apply to return a response straight away if a config validation takes less than 15 seconds. --- src/plugins/nginx.go | 56 ++++++++++++++++--- src/plugins/nginx_test.go | 28 ++++++++-- .../nginx/agent/v2/src/plugins/nginx.go | 56 ++++++++++++++++--- 3 files changed, 117 insertions(+), 23 deletions(-) diff --git a/src/plugins/nginx.go b/src/plugins/nginx.go index ae93ed929..60e8a15dc 100644 --- a/src/plugins/nginx.go +++ b/src/plugins/nginx.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "time" "github.com/gogo/protobuf/types" "github.com/google/uuid" @@ -22,6 +23,10 @@ const ( appProtectMetadataFilePath = "/etc/nms/app_protect_metadata.json" ) +var ( + validationTimeout = 15 * time.Second +) + // Nginx is the metadata of our nginx binary type Nginx struct { messagePipeline core.MessagePipeInterface @@ -301,35 +306,67 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) return n.handleErrorStatus(status, message) } - n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) - log.Debug("Validation of nginx config in progress") - return status + validationResponse := n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) + if validationResponse != nil { + if validationResponse.err == nil { + agentActivityStatus := n.completeConfigApply(validationResponse) + if agentActivityStatus.GetNginxConfigStatus().GetStatus() == proto.NginxConfigStatus_ERROR { + status.NginxConfigResponse.Status = newErrStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus + } else { + status.NginxConfigResponse.Status = newOKStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus + } + return status + } else { + n.rollbackConfigApply(validationResponse) + message := fmt.Sprintf("Config apply failed (write): " + validationResponse.err.Error()) + return n.handleErrorStatus(status, message) + } + } else { + log.Debug("Validation of nginx config in progress") + return status + } } -func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) { +// This function will run a nginx config validation in a separate go routine. If the validation takes less than 15 seconds then the result is returned straight away, +// otherwise nil is returned and the validation continues on in the background until it is complete. The result is always added to the message pipeline for other plugins +// to use. +func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) *NginxConfigValidationResponse { + validationChannel := make(chan *NginxConfigValidationResponse, 1) + go func() { err := n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) if err != nil { - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, &NginxConfigValidationResponse{ + response := &NginxConfigValidationResponse{ err: fmt.Errorf("error running nginx -t -c %s:\n %v", nginx.ConfPath, err), correlationId: correlationId, nginxDetails: nginx, config: config, configApply: configApply, - })) + } + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, response)) + validationChannel <- response } else { - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, &NginxConfigValidationResponse{ + response := &NginxConfigValidationResponse{ err: nil, correlationId: correlationId, nginxDetails: nginx, config: config, configApply: configApply, - })) + } + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, response)) + validationChannel <- response } }() + + select { + case result := <-validationChannel: + return result + case <-time.After(validationTimeout): + return nil + } } -func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) { +func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) *proto.AgentActivityStatus { nginxConfigStatusMessage := "Config applied successfully" if response.configApply != nil { if err := response.configApply.Complete(); err != nil { @@ -394,6 +431,7 @@ func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) { n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplySucceeded, agentActivityStatus)) log.Debug("Config Apply Complete") + return agentActivityStatus } func (n *Nginx) rollbackConfigApply(response *NginxConfigValidationResponse) { diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index 43247cead..b5ca10885 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -92,6 +92,7 @@ var ( ) func TestNginxConfigApply(t *testing.T) { + validationTimeout = 0 * time.Millisecond t.Parallel() tests := []struct { @@ -209,7 +210,7 @@ func TestNginxConfigApply(t *testing.T) { err = ioutil.WriteFile(tempConf.Name(), fourth, 0644) assert.NoError(t, err) - ctx, cancel := context.WithCancel(context.Background()) + ctx := context.TODO() env := tutils.GetMockEnvWithProcess() allowedDirectoriesMap := map[string]struct{}{dir: {}} @@ -233,10 +234,15 @@ func TestNginxConfigApply(t *testing.T) { messagePipe.Run() processedMessages := messagePipe.GetProcessedMessages() - assert.Eventually(tt, func() bool { return len(processedMessages) != len(test.msgTopics) }, time.Duration(15*time.Millisecond), 3*time.Millisecond) + assert.Eventually( + tt, + func() bool { return len(processedMessages) != len(test.msgTopics) }, + time.Duration(15*time.Millisecond), + 3*time.Millisecond, + fmt.Sprintf("Expected %d messages but only processed %d messages", len(test.msgTopics), len(processedMessages)), + ) binary.AssertExpectations(tt) env.AssertExpectations(tt) - cancel() for idx, msg := range processedMessages { if test.msgTopics[idx] != msg.Topic() { @@ -504,7 +510,13 @@ func TestNginx_completeConfigApply(t *testing.T) { processedMessages := messagePipe.GetProcessedMessages() - assert.Eventually(t, func() bool { return len(processedMessages) == len(expectedTopics) }, time.Duration(15*time.Millisecond), 3*time.Millisecond) + assert.Eventually( + t, + func() bool { return len(processedMessages) == len(expectedTopics) }, + time.Duration(15*time.Millisecond), + 3*time.Millisecond, + fmt.Sprintf("Expected %d messages but only processed %d messages", len(expectedTopics), len(processedMessages)), + ) for idx, msg := range processedMessages { if expectedTopics[idx] != msg.Topic() { @@ -587,7 +599,13 @@ func TestNginx_rollbackConfigApply(t *testing.T) { processedMessages := messagePipe.GetProcessedMessages() - assert.Eventually(t, func() bool { return len(processedMessages) == len(expectedTopics) }, time.Duration(5*time.Millisecond), 1*time.Millisecond) + assert.Eventually( + t, + func() bool { return len(processedMessages) == len(expectedTopics) }, + time.Duration(5*time.Millisecond), + 1*time.Millisecond, + fmt.Sprintf("Expected %d messages but only processed %d messages", len(expectedTopics), len(processedMessages)), + ) for idx, msg := range processedMessages { if expectedTopics[idx] != msg.Topic() { diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go index ae93ed929..60e8a15dc 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "time" "github.com/gogo/protobuf/types" "github.com/google/uuid" @@ -22,6 +23,10 @@ const ( appProtectMetadataFilePath = "/etc/nms/app_protect_metadata.json" ) +var ( + validationTimeout = 15 * time.Second +) + // Nginx is the metadata of our nginx binary type Nginx struct { messagePipeline core.MessagePipeInterface @@ -301,35 +306,67 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) return n.handleErrorStatus(status, message) } - n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) - log.Debug("Validation of nginx config in progress") - return status + validationResponse := n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) + if validationResponse != nil { + if validationResponse.err == nil { + agentActivityStatus := n.completeConfigApply(validationResponse) + if agentActivityStatus.GetNginxConfigStatus().GetStatus() == proto.NginxConfigStatus_ERROR { + status.NginxConfigResponse.Status = newErrStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus + } else { + status.NginxConfigResponse.Status = newOKStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus + } + return status + } else { + n.rollbackConfigApply(validationResponse) + message := fmt.Sprintf("Config apply failed (write): " + validationResponse.err.Error()) + return n.handleErrorStatus(status, message) + } + } else { + log.Debug("Validation of nginx config in progress") + return status + } } -func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) { +// This function will run a nginx config validation in a separate go routine. If the validation takes less than 15 seconds then the result is returned straight away, +// otherwise nil is returned and the validation continues on in the background until it is complete. The result is always added to the message pipeline for other plugins +// to use. +func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) *NginxConfigValidationResponse { + validationChannel := make(chan *NginxConfigValidationResponse, 1) + go func() { err := n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) if err != nil { - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, &NginxConfigValidationResponse{ + response := &NginxConfigValidationResponse{ err: fmt.Errorf("error running nginx -t -c %s:\n %v", nginx.ConfPath, err), correlationId: correlationId, nginxDetails: nginx, config: config, configApply: configApply, - })) + } + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, response)) + validationChannel <- response } else { - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, &NginxConfigValidationResponse{ + response := &NginxConfigValidationResponse{ err: nil, correlationId: correlationId, nginxDetails: nginx, config: config, configApply: configApply, - })) + } + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, response)) + validationChannel <- response } }() + + select { + case result := <-validationChannel: + return result + case <-time.After(validationTimeout): + return nil + } } -func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) { +func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) *proto.AgentActivityStatus { nginxConfigStatusMessage := "Config applied successfully" if response.configApply != nil { if err := response.configApply.Complete(); err != nil { @@ -394,6 +431,7 @@ func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) { n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplySucceeded, agentActivityStatus)) log.Debug("Config Apply Complete") + return agentActivityStatus } func (n *Nginx) rollbackConfigApply(response *NginxConfigValidationResponse) { From 0dded6277d5fa48c88774e5d325e9d492e9cc97c Mon Sep 17 00:00:00 2001 From: dhurley Date: Wed, 12 Oct 2022 17:18:54 +0100 Subject: [PATCH 07/15] Update unit tests --- src/plugins/nginx_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index b5ca10885..0e77ca36e 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -237,7 +237,7 @@ func TestNginxConfigApply(t *testing.T) { assert.Eventually( tt, func() bool { return len(processedMessages) != len(test.msgTopics) }, - time.Duration(15*time.Millisecond), + time.Duration(2*time.Second), 3*time.Millisecond, fmt.Sprintf("Expected %d messages but only processed %d messages", len(test.msgTopics), len(processedMessages)), ) @@ -513,7 +513,7 @@ func TestNginx_completeConfigApply(t *testing.T) { assert.Eventually( t, func() bool { return len(processedMessages) == len(expectedTopics) }, - time.Duration(15*time.Millisecond), + time.Duration(2*time.Second), 3*time.Millisecond, fmt.Sprintf("Expected %d messages but only processed %d messages", len(expectedTopics), len(processedMessages)), ) @@ -602,7 +602,7 @@ func TestNginx_rollbackConfigApply(t *testing.T) { assert.Eventually( t, func() bool { return len(processedMessages) == len(expectedTopics) }, - time.Duration(5*time.Millisecond), + time.Duration(2*time.Second), 1*time.Millisecond, fmt.Sprintf("Expected %d messages but only processed %d messages", len(expectedTopics), len(processedMessages)), ) From 23d74c66d1110cbd688258d23ccc671b0a1ad5c0 Mon Sep 17 00:00:00 2001 From: dhurley Date: Thu, 13 Oct 2022 10:49:50 +0100 Subject: [PATCH 08/15] Update unit tests --- src/plugins/nginx_test.go | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index 0e77ca36e..f78de9081 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -232,19 +232,17 @@ func TestNginxConfigApply(t *testing.T) { messagePipe.Process(core.NewMessage(core.CommNginxConfig, cmd)) messagePipe.Run() - processedMessages := messagePipe.GetProcessedMessages() assert.Eventually( tt, - func() bool { return len(processedMessages) != len(test.msgTopics) }, + func() bool { return len(messagePipe.GetProcessedMessages()) != len(test.msgTopics) }, time.Duration(2*time.Second), 3*time.Millisecond, - fmt.Sprintf("Expected %d messages but only processed %d messages", len(test.msgTopics), len(processedMessages)), ) binary.AssertExpectations(tt) env.AssertExpectations(tt) - for idx, msg := range processedMessages { + for idx, msg := range messagePipe.GetProcessedMessages() { if test.msgTopics[idx] != msg.Topic() { tt.Errorf("unexpected message topic: %s :: should have been: %s", msg.Topic(), test.msgTopics[idx]) } @@ -508,17 +506,14 @@ func TestNginx_completeConfigApply(t *testing.T) { messagePipe.Process(core.NewMessage(core.NginxConfigValidationSucceeded, response)) messagePipe.Run() - processedMessages := messagePipe.GetProcessedMessages() - assert.Eventually( t, - func() bool { return len(processedMessages) == len(expectedTopics) }, + func() bool { return len(messagePipe.GetProcessedMessages()) == len(expectedTopics) }, time.Duration(2*time.Second), 3*time.Millisecond, - fmt.Sprintf("Expected %d messages but only processed %d messages", len(expectedTopics), len(processedMessages)), ) - for idx, msg := range processedMessages { + for idx, msg := range messagePipe.GetProcessedMessages() { if expectedTopics[idx] != msg.Topic() { t.Errorf("unexpected message topic: %s :: should have been: %s", msg.Topic(), expectedTopics[idx]) } @@ -597,17 +592,14 @@ func TestNginx_rollbackConfigApply(t *testing.T) { messagePipe.Process(core.NewMessage(core.NginxConfigValidationFailed, response)) messagePipe.Run() - processedMessages := messagePipe.GetProcessedMessages() - assert.Eventually( t, - func() bool { return len(processedMessages) == len(expectedTopics) }, + func() bool { return len(messagePipe.GetProcessedMessages()) == len(expectedTopics) }, time.Duration(2*time.Second), 1*time.Millisecond, - fmt.Sprintf("Expected %d messages but only processed %d messages", len(expectedTopics), len(processedMessages)), ) - for idx, msg := range processedMessages { + for idx, msg := range messagePipe.GetProcessedMessages() { if expectedTopics[idx] != msg.Topic() { t.Errorf("unexpected message topic: %s :: should have been: %s", msg.Topic(), expectedTopics[idx]) } From 8677babfd3d5f16664b639a84f74b7dab01c6310 Mon Sep 17 00:00:00 2001 From: dhurley Date: Thu, 13 Oct 2022 11:01:48 +0100 Subject: [PATCH 09/15] Update unit tests --- src/plugins/nginx_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index f78de9081..f9497c0d1 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -239,7 +239,12 @@ func TestNginxConfigApply(t *testing.T) { time.Duration(2*time.Second), 3*time.Millisecond, ) - binary.AssertExpectations(tt) + assert.Eventually( + tt, + func() bool { return binary.AssertExpectations(tt) }, + time.Duration(2*time.Second), + 3*time.Millisecond, + ) env.AssertExpectations(tt) for idx, msg := range messagePipe.GetProcessedMessages() { From 545bcc388bbe8e8b98e5c2acabb3784500961282 Mon Sep 17 00:00:00 2001 From: dhurley Date: Thu, 20 Oct 2022 14:07:40 +0100 Subject: [PATCH 10/15] Updated nginx config validation logic to stop nginx reload from getting executed twice --- src/plugins/nginx.go | 150 ++++++++++-------- src/plugins/nginx_test.go | 59 ++++++- .../nginx/agent/sdk/v2/config_helpers.go | 11 +- .../nginx/agent/v2/src/plugins/nginx.go | 150 ++++++++++-------- 4 files changed, 237 insertions(+), 133 deletions(-) diff --git a/src/plugins/nginx.go b/src/plugins/nginx.go index 963ffea63..58246d07a 100644 --- a/src/plugins/nginx.go +++ b/src/plugins/nginx.go @@ -29,14 +29,15 @@ var ( // Nginx is the metadata of our nginx binary type Nginx struct { - messagePipeline core.MessagePipeInterface - nginxBinary core.NginxBinary - processes []core.Process - env core.Environment - cmdr client.Commander - config *config.Config - isNAPEnabled bool - isConfUploadEnabled bool + messagePipeline core.MessagePipeInterface + nginxBinary core.NginxBinary + processes []core.Process + env core.Environment + cmdr client.Commander + config *config.Config + isNAPEnabled bool + isConfUploadEnabled bool + configApplyStatusChannel chan *proto.Command_NginxConfigResponse } type ConfigRollbackResponse struct { @@ -59,6 +60,7 @@ type NginxConfigValidationResponse struct { nginxDetails *proto.NginxDetails config *proto.NginxConfig configApply *sdk.ConfigApply + elapsedTime time.Duration } func NewNginx(cmdr client.Commander, nginxBinary core.NginxBinary, env core.Environment, loadedConfig *config.Config) *Nginx { @@ -69,7 +71,16 @@ func NewNginx(cmdr client.Commander, nginxBinary core.NginxBinary, env core.Envi isConfUploadEnabled := isConfUploadEnabled(loadedConfig) - return &Nginx{nginxBinary: nginxBinary, processes: env.Processes(), env: env, cmdr: cmdr, config: loadedConfig, isNAPEnabled: isNAPEnabled, isConfUploadEnabled: isConfUploadEnabled} + return &Nginx{ + nginxBinary: nginxBinary, + processes: env.Processes(), + env: env, + cmdr: cmdr, + config: loadedConfig, + isNAPEnabled: isNAPEnabled, + isConfUploadEnabled: isConfUploadEnabled, + configApplyStatusChannel: make(chan *proto.Command_NginxConfigResponse, 1), + } } // Init initializes the plugin @@ -112,12 +123,25 @@ func (n *Nginx) Process(message *core.Message) { case core.NginxConfigValidationSucceeded: switch response := message.Data().(type) { case *NginxConfigValidationResponse: - n.completeConfigApply(response) + status := n.completeConfigApply(response) + if response.elapsedTime < validationTimeout { + n.configApplyStatusChannel <- status + } } case core.NginxConfigValidationFailed: switch response := message.Data().(type) { case *NginxConfigValidationResponse: n.rollbackConfigApply(response) + status := &proto.Command_NginxConfigResponse{ + NginxConfigResponse: &proto.NginxConfigResponse{ + Status: newErrStatus(fmt.Sprintf("Config apply failed (write): " + response.err.Error())).CmdStatus, + Action: proto.NginxConfigAction_APPLY, + ConfigData: response.config.ConfigData, + }, + } + if response.elapsedTime < validationTimeout { + n.configApplyStatusChannel <- status + } } case core.EnableExtension: switch data := message.Data().(type) { @@ -293,7 +317,7 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) message := fmt.Sprintf("Config apply failed (write): " + err.Error()) - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationPending, &proto.AgentActivityStatus{ + n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplyFailed, &proto.AgentActivityStatus{ Status: &proto.AgentActivityStatus_NginxConfigStatus{ NginxConfigStatus: &proto.NginxConfigStatus{ CorrelationId: cmd.Meta.MessageId, @@ -306,70 +330,55 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) return n.handleErrorStatus(status, message) } - validationResponse := n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) - if validationResponse != nil { - if validationResponse.err == nil { - agentActivityStatus := n.completeConfigApply(validationResponse) - if agentActivityStatus.GetNginxConfigStatus().GetStatus() == proto.NginxConfigStatus_ERROR { - status.NginxConfigResponse.Status = newErrStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus - } else { - status.NginxConfigResponse.Status = newOKStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus - } + go n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) + + select { + case result := <-n.configApplyStatusChannel: + return result + case <-time.After(validationTimeout): + log.Debug("Validation of nginx config in progress") return status - } else { - n.rollbackConfigApply(validationResponse) - message := fmt.Sprintf("Config apply failed (write): " + validationResponse.err.Error()) - return n.handleErrorStatus(status, message) - } - } else { - log.Debug("Validation of nginx config in progress") - return status } } // This function will run a nginx config validation in a separate go routine. If the validation takes less than 15 seconds then the result is returned straight away, // otherwise nil is returned and the validation continues on in the background until it is complete. The result is always added to the message pipeline for other plugins // to use. -func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) *NginxConfigValidationResponse { - validationChannel := make(chan *NginxConfigValidationResponse, 1) +func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) { + start := time.Now() + + err := n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) + if err == nil { + _, err = n.nginxBinary.ReadConfig(nginx.GetConfPath(), config.GetConfigData().GetNginxId(), n.env.GetSystemUUID()) + } - go func() { - err := n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) - if err == nil { - _, err = n.nginxBinary.ReadConfig(nginx.GetConfPath(), config.GetConfigData().GetNginxId(), n.env.GetSystemUUID()) + elapsedTime := time.Since(start) + log.Tracef("nginx config validation took %s to complete", elapsedTime) + + if err != nil { + response := &NginxConfigValidationResponse{ + err: fmt.Errorf("error running nginx -t -c %s:\n %v", nginx.ConfPath, err), + correlationId: correlationId, + nginxDetails: nginx, + config: config, + configApply: configApply, + elapsedTime: elapsedTime, } - if err != nil { - response := &NginxConfigValidationResponse{ - err: fmt.Errorf("error running nginx -t -c %s:\n %v", nginx.ConfPath, err), - correlationId: correlationId, - nginxDetails: nginx, - config: config, - configApply: configApply, - } - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, response)) - validationChannel <- response - } else { - response := &NginxConfigValidationResponse{ - err: nil, - correlationId: correlationId, - nginxDetails: nginx, - config: config, - configApply: configApply, - } - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, response)) - validationChannel <- response + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, response)) + } else { + response := &NginxConfigValidationResponse{ + err: nil, + correlationId: correlationId, + nginxDetails: nginx, + config: config, + configApply: configApply, + elapsedTime: elapsedTime, } - }() - - select { - case result := <-validationChannel: - return result - case <-time.After(validationTimeout): - return nil + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, response)) } } -func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) *proto.AgentActivityStatus { +func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) *proto.Command_NginxConfigResponse { nginxConfigStatusMessage := "Config applied successfully" if response.configApply != nil { if err := response.configApply.Complete(); err != nil { @@ -433,8 +442,23 @@ func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) *pr n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplySucceeded, agentActivityStatus)) + status := &proto.Command_NginxConfigResponse{ + NginxConfigResponse: &proto.NginxConfigResponse{ + Status: newOKStatus("config apply request successfully processed").CmdStatus, + Action: proto.NginxConfigAction_APPLY, + ConfigData: response.config.ConfigData, + }, + } + + if agentActivityStatus.GetNginxConfigStatus().GetStatus() == proto.NginxConfigStatus_ERROR { + status.NginxConfigResponse.Status = newErrStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus + } else { + status.NginxConfigResponse.Status = newOKStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus + } + log.Debug("Config Apply Complete") - return agentActivityStatus + + return status } func (n *Nginx) rollbackConfigApply(response *NginxConfigValidationResponse) { diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index 414b3e142..18c0f59e4 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -237,13 +237,13 @@ func TestNginxConfigApply(t *testing.T) { assert.Eventually( tt, func() bool { return len(messagePipe.GetProcessedMessages()) != len(test.msgTopics) }, - time.Duration(2*time.Second), + time.Duration(5*time.Second), 3*time.Millisecond, ) assert.Eventually( tt, func() bool { return binary.AssertExpectations(tt) }, - time.Duration(2*time.Second), + time.Duration(5*time.Second), 3*time.Millisecond, ) env.AssertExpectations(tt) @@ -439,6 +439,61 @@ func TestNginx_Info(t *testing.T) { assert.Equal(t, "NginxBinary", pluginUnderTest.Info().Name()) } +func TestNginx_validateConfig(t *testing.T) { + tests := []struct { + name string + validationResult error + expectedTopic string + expectedError error + }{ + { + name: "successful validation", + validationResult: nil, + expectedTopic: core.NginxConfigValidationSucceeded, + }, + { + name: "failed validation", + validationResult: errors.New("failure"), + expectedTopic: core.NginxConfigValidationFailed, + }, + } + + for _, test := range tests { + t.Run(test.name, func(tt *testing.T) { + + env := tutils.GetMockEnvWithProcess() + binary := tutils.NewMockNginxBinary() + binary.On("ValidateConfig", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(test.validationResult) + binary.On("ReadConfig", mock.Anything, mock.Anything, mock.Anything).Return(&proto.NginxConfig{}, nil) + binary.On("GetNginxDetailsMapFromProcesses", env.Processes()).Return((tutils.GetDetailsMap())) + binary.On("UpdateNginxDetailsFromProcesses", env.Processes()) + + pluginUnderTest := NewNginx(&tutils.MockCommandClient{}, binary, env, &loadedConfig.Config{Features: []string{loadedConfig.FeatureNginxConfig}}) + + messagePipe := core.SetupMockMessagePipe(t, context.TODO(), pluginUnderTest) + messagePipe.Run() + + pluginUnderTest.validateConfig(&proto.NginxDetails{}, "123", &proto.NginxConfig{}, &sdk.ConfigApply{}) + + assert.Eventually( + t, + func() bool { return len(messagePipe.GetMessages()) == 1 }, + time.Duration(2*time.Second), + 3*time.Millisecond, + ) + + assert.Equal(t, test.expectedTopic, messagePipe.GetMessages()[0].Topic()) + assert.Equal(t, "123", messagePipe.GetMessages()[0].Data().(*NginxConfigValidationResponse).correlationId) + if test.validationResult == nil { + assert.Nil(t, messagePipe.GetMessages()[0].Data().(*NginxConfigValidationResponse).err) + } else { + assert.NotNil(t, messagePipe.GetMessages()[0].Data().(*NginxConfigValidationResponse).err) + } + assert.Greater(t, messagePipe.GetMessages()[0].Data().(*NginxConfigValidationResponse).elapsedTime, 0*time.Second) + }) + } +} + func TestNginx_completeConfigApply(t *testing.T) { expectedTopics := []string{ core.NginxConfigValidationSucceeded, diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/config_helpers.go b/test/performance/vendor/github.com/nginx/agent/sdk/v2/config_helpers.go index 3d6f2fc55..9622b2411 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/config_helpers.go +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/config_helpers.go @@ -283,10 +283,6 @@ func updateNginxConfigWithCert( } } - if !isAllowed { - return fmt.Errorf("file outside allowed directories %s", file) - } - if directive == "ssl_certificate" { cert, err := LoadCertificate(file) if err != nil { @@ -324,7 +320,7 @@ func updateNginxConfigWithCert( Fingerprint: convertToHexFormat(hex.EncodeToString(fingerprint[:])), FingerprintAlgorithm: cert.SignatureAlgorithm.String(), Version: int64(cert.Version), - AuthorityKeyIdentifier: convertToHexFormat((hex.EncodeToString(cert.AuthorityKeyId))), + AuthorityKeyIdentifier: convertToHexFormat(hex.EncodeToString(cert.AuthorityKeyId)), } certProto.Mtime = filesSDK.TimeConvert(info.ModTime()) certProto.Size_ = info.Size() @@ -332,6 +328,11 @@ func updateNginxConfigWithCert( nginxConfig.Ssl.SslCerts = append(nginxConfig.Ssl.SslCerts, certProto) } + if !isAllowed { + log.Infof("certs: %s outside allowed directory, not including in aux payloads", file) + // we want the meta information, but skip putting the files into the aux contents + return nil + } if err := directoryMap.appendFile(filepath.Dir(file), info); err != nil { return err } diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go index 963ffea63..58246d07a 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go @@ -29,14 +29,15 @@ var ( // Nginx is the metadata of our nginx binary type Nginx struct { - messagePipeline core.MessagePipeInterface - nginxBinary core.NginxBinary - processes []core.Process - env core.Environment - cmdr client.Commander - config *config.Config - isNAPEnabled bool - isConfUploadEnabled bool + messagePipeline core.MessagePipeInterface + nginxBinary core.NginxBinary + processes []core.Process + env core.Environment + cmdr client.Commander + config *config.Config + isNAPEnabled bool + isConfUploadEnabled bool + configApplyStatusChannel chan *proto.Command_NginxConfigResponse } type ConfigRollbackResponse struct { @@ -59,6 +60,7 @@ type NginxConfigValidationResponse struct { nginxDetails *proto.NginxDetails config *proto.NginxConfig configApply *sdk.ConfigApply + elapsedTime time.Duration } func NewNginx(cmdr client.Commander, nginxBinary core.NginxBinary, env core.Environment, loadedConfig *config.Config) *Nginx { @@ -69,7 +71,16 @@ func NewNginx(cmdr client.Commander, nginxBinary core.NginxBinary, env core.Envi isConfUploadEnabled := isConfUploadEnabled(loadedConfig) - return &Nginx{nginxBinary: nginxBinary, processes: env.Processes(), env: env, cmdr: cmdr, config: loadedConfig, isNAPEnabled: isNAPEnabled, isConfUploadEnabled: isConfUploadEnabled} + return &Nginx{ + nginxBinary: nginxBinary, + processes: env.Processes(), + env: env, + cmdr: cmdr, + config: loadedConfig, + isNAPEnabled: isNAPEnabled, + isConfUploadEnabled: isConfUploadEnabled, + configApplyStatusChannel: make(chan *proto.Command_NginxConfigResponse, 1), + } } // Init initializes the plugin @@ -112,12 +123,25 @@ func (n *Nginx) Process(message *core.Message) { case core.NginxConfigValidationSucceeded: switch response := message.Data().(type) { case *NginxConfigValidationResponse: - n.completeConfigApply(response) + status := n.completeConfigApply(response) + if response.elapsedTime < validationTimeout { + n.configApplyStatusChannel <- status + } } case core.NginxConfigValidationFailed: switch response := message.Data().(type) { case *NginxConfigValidationResponse: n.rollbackConfigApply(response) + status := &proto.Command_NginxConfigResponse{ + NginxConfigResponse: &proto.NginxConfigResponse{ + Status: newErrStatus(fmt.Sprintf("Config apply failed (write): " + response.err.Error())).CmdStatus, + Action: proto.NginxConfigAction_APPLY, + ConfigData: response.config.ConfigData, + }, + } + if response.elapsedTime < validationTimeout { + n.configApplyStatusChannel <- status + } } case core.EnableExtension: switch data := message.Data().(type) { @@ -293,7 +317,7 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) message := fmt.Sprintf("Config apply failed (write): " + err.Error()) - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationPending, &proto.AgentActivityStatus{ + n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplyFailed, &proto.AgentActivityStatus{ Status: &proto.AgentActivityStatus_NginxConfigStatus{ NginxConfigStatus: &proto.NginxConfigStatus{ CorrelationId: cmd.Meta.MessageId, @@ -306,70 +330,55 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) return n.handleErrorStatus(status, message) } - validationResponse := n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) - if validationResponse != nil { - if validationResponse.err == nil { - agentActivityStatus := n.completeConfigApply(validationResponse) - if agentActivityStatus.GetNginxConfigStatus().GetStatus() == proto.NginxConfigStatus_ERROR { - status.NginxConfigResponse.Status = newErrStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus - } else { - status.NginxConfigResponse.Status = newOKStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus - } + go n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) + + select { + case result := <-n.configApplyStatusChannel: + return result + case <-time.After(validationTimeout): + log.Debug("Validation of nginx config in progress") return status - } else { - n.rollbackConfigApply(validationResponse) - message := fmt.Sprintf("Config apply failed (write): " + validationResponse.err.Error()) - return n.handleErrorStatus(status, message) - } - } else { - log.Debug("Validation of nginx config in progress") - return status } } // This function will run a nginx config validation in a separate go routine. If the validation takes less than 15 seconds then the result is returned straight away, // otherwise nil is returned and the validation continues on in the background until it is complete. The result is always added to the message pipeline for other plugins // to use. -func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) *NginxConfigValidationResponse { - validationChannel := make(chan *NginxConfigValidationResponse, 1) +func (n *Nginx) validateConfig(nginx *proto.NginxDetails, correlationId string, config *proto.NginxConfig, configApply *sdk.ConfigApply) { + start := time.Now() + + err := n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) + if err == nil { + _, err = n.nginxBinary.ReadConfig(nginx.GetConfPath(), config.GetConfigData().GetNginxId(), n.env.GetSystemUUID()) + } - go func() { - err := n.nginxBinary.ValidateConfig(nginx.NginxId, nginx.ProcessPath, nginx.ConfPath, config, configApply) - if err == nil { - _, err = n.nginxBinary.ReadConfig(nginx.GetConfPath(), config.GetConfigData().GetNginxId(), n.env.GetSystemUUID()) + elapsedTime := time.Since(start) + log.Tracef("nginx config validation took %s to complete", elapsedTime) + + if err != nil { + response := &NginxConfigValidationResponse{ + err: fmt.Errorf("error running nginx -t -c %s:\n %v", nginx.ConfPath, err), + correlationId: correlationId, + nginxDetails: nginx, + config: config, + configApply: configApply, + elapsedTime: elapsedTime, } - if err != nil { - response := &NginxConfigValidationResponse{ - err: fmt.Errorf("error running nginx -t -c %s:\n %v", nginx.ConfPath, err), - correlationId: correlationId, - nginxDetails: nginx, - config: config, - configApply: configApply, - } - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, response)) - validationChannel <- response - } else { - response := &NginxConfigValidationResponse{ - err: nil, - correlationId: correlationId, - nginxDetails: nginx, - config: config, - configApply: configApply, - } - n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, response)) - validationChannel <- response + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationFailed, response)) + } else { + response := &NginxConfigValidationResponse{ + err: nil, + correlationId: correlationId, + nginxDetails: nginx, + config: config, + configApply: configApply, + elapsedTime: elapsedTime, } - }() - - select { - case result := <-validationChannel: - return result - case <-time.After(validationTimeout): - return nil + n.messagePipeline.Process(core.NewMessage(core.NginxConfigValidationSucceeded, response)) } } -func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) *proto.AgentActivityStatus { +func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) *proto.Command_NginxConfigResponse { nginxConfigStatusMessage := "Config applied successfully" if response.configApply != nil { if err := response.configApply.Complete(); err != nil { @@ -433,8 +442,23 @@ func (n *Nginx) completeConfigApply(response *NginxConfigValidationResponse) *pr n.messagePipeline.Process(core.NewMessage(core.NginxConfigApplySucceeded, agentActivityStatus)) + status := &proto.Command_NginxConfigResponse{ + NginxConfigResponse: &proto.NginxConfigResponse{ + Status: newOKStatus("config apply request successfully processed").CmdStatus, + Action: proto.NginxConfigAction_APPLY, + ConfigData: response.config.ConfigData, + }, + } + + if agentActivityStatus.GetNginxConfigStatus().GetStatus() == proto.NginxConfigStatus_ERROR { + status.NginxConfigResponse.Status = newErrStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus + } else { + status.NginxConfigResponse.Status = newOKStatus(agentActivityStatus.GetNginxConfigStatus().GetMessage()).CmdStatus + } + log.Debug("Config Apply Complete") - return agentActivityStatus + + return status } func (n *Nginx) rollbackConfigApply(response *NginxConfigValidationResponse) { From fa3b26450b8d279ae950d1d89adeda5f4588acb6 Mon Sep 17 00:00:00 2001 From: dhurley Date: Thu, 20 Oct 2022 16:43:25 +0100 Subject: [PATCH 11/15] clean up logging & tests --- src/plugins/nginx.go | 3 ++- src/plugins/nginx_test.go | 7 ------- .../vendor/github.com/nginx/agent/v2/src/plugins/nginx.go | 3 ++- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/plugins/nginx.go b/src/plugins/nginx.go index 58246d07a..cb45f5d71 100644 --- a/src/plugins/nginx.go +++ b/src/plugins/nginx.go @@ -332,11 +332,12 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) go n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) + // If the NGINX config can be validated with the validationTimeout the result will be returned straight away. select { case result := <-n.configApplyStatusChannel: return result case <-time.After(validationTimeout): - log.Debug("Validation of nginx config in progress") + log.Debugf("Validation of the NGINX config in taking longer than the validationTimeout %s", validationTimeout) return status } } diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index 18c0f59e4..3762f1220 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -240,13 +240,6 @@ func TestNginxConfigApply(t *testing.T) { time.Duration(5*time.Second), 3*time.Millisecond, ) - assert.Eventually( - tt, - func() bool { return binary.AssertExpectations(tt) }, - time.Duration(5*time.Second), - 3*time.Millisecond, - ) - env.AssertExpectations(tt) for idx, msg := range messagePipe.GetProcessedMessages() { if test.msgTopics[idx] != msg.Topic() { diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go index 58246d07a..cb45f5d71 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go @@ -332,11 +332,12 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) go n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) + // If the NGINX config can be validated with the validationTimeout the result will be returned straight away. select { case result := <-n.configApplyStatusChannel: return result case <-time.After(validationTimeout): - log.Debug("Validation of nginx config in progress") + log.Debugf("Validation of the NGINX config in taking longer than the validationTimeout %s", validationTimeout) return status } } From ecc5be22c7670d7471bc82c2cf0e1515627b0d44 Mon Sep 17 00:00:00 2001 From: "o.omahony" Date: Tue, 25 Oct 2022 18:15:57 +0100 Subject: [PATCH 12/15] added the default list of features to SDK --- sdk/agent/config/config_helpers.go | 35 ++++++ src/core/config/config.go | 9 +- src/core/config/config_test.go | 6 +- src/core/config/defaults.go | 100 +++++++----------- src/plugins/nginx.go | 27 ++--- src/plugins/nginx_test.go | 23 ++-- .../sdk/v2/agent/config/config_helpers.go | 35 ++++++ .../nginx/agent/v2/src/core/config/config.go | 9 +- .../agent/v2/src/core/config/defaults.go | 100 +++++++----------- .../nginx/agent/v2/src/plugins/nginx.go | 27 ++--- .../nginx/agent/v2/test/utils/agent_config.go | 4 +- test/performance/vendor/modules.txt | 1 + test/utils/agent_config.go | 4 +- .../sdk/v2/agent/config/config_helpers.go | 35 ++++++ vendor/modules.txt | 1 + 15 files changed, 243 insertions(+), 173 deletions(-) create mode 100644 sdk/agent/config/config_helpers.go create mode 100644 test/performance/vendor/github.com/nginx/agent/sdk/v2/agent/config/config_helpers.go create mode 100644 vendor/github.com/nginx/agent/sdk/v2/agent/config/config_helpers.go diff --git a/sdk/agent/config/config_helpers.go b/sdk/agent/config/config_helpers.go new file mode 100644 index 000000000..62e6492b5 --- /dev/null +++ b/sdk/agent/config/config_helpers.go @@ -0,0 +1,35 @@ +package config + +const ( + KeyDelimiter = "_" + + // viper keys used in config + FeaturesKey = "features" + FeatureRegistration = FeaturesKey + KeyDelimiter + "registration" + FeatureNginxConfig = FeaturesKey + KeyDelimiter + "nginx-config" + FeatureNginxConfigAsync = FeaturesKey + KeyDelimiter + "nginx-config-async" + FeatureNginxSSLConfig = FeaturesKey + KeyDelimiter + "nginx-ssl-config" + FeatureNginxCounting = FeaturesKey + KeyDelimiter + "nginx-counting" + FeatureMetrics = FeaturesKey + KeyDelimiter + "metrics" + FeatureMetricsThrottle = FeaturesKey + KeyDelimiter + "metrics-throttle" + FeatureDataPlaneStatus = FeaturesKey + KeyDelimiter + "dataplane-status" + FeatureProcessWatcher = FeaturesKey + KeyDelimiter + "process-watcher" + FeatureFileWatcher = FeaturesKey + KeyDelimiter + "file-watcher" + FeatureActivityEvents = FeaturesKey + KeyDelimiter + "activity-events" +) + +func GetDefaultFeatures() []string { + return []string{ + FeatureRegistration, + FeatureNginxConfig, + FeatureNginxSSLConfig, + FeatureNginxCounting, + FeatureNginxConfigAsync, + FeatureMetrics, + FeatureMetricsThrottle, + FeatureDataPlaneStatus, + FeatureProcessWatcher, + FeatureFileWatcher, + FeatureActivityEvents, + } +} diff --git a/src/core/config/config.go b/src/core/config/config.go index 9e7d36007..fbea6127f 100644 --- a/src/core/config/config.go +++ b/src/core/config/config.go @@ -10,6 +10,7 @@ import ( "strings" "time" + agent_config "github.com/nginx/agent/sdk/v2/agent/config" advanced_metrics "github.com/nginx/agent/v2/src/extensions/advanced-metrics/pkg/advanced-metrics" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -40,7 +41,7 @@ const ( ) var ( - Viper = viper.NewWithOptions(viper.KeyDelimiter(KeyDelimiter)) + Viper = viper.NewWithOptions(viper.KeyDelimiter(agent_config.KeyDelimiter)) ) func SetVersion(version, commit string) { @@ -168,7 +169,7 @@ func GetConfig(clientId string) (*Config, error) { Nginx: getNginx(), Dataplane: getDataplane(), AgentMetrics: getMetrics(), - Features: Viper.GetStringSlice(FeaturesKey), + Features: Viper.GetStringSlice(agent_config.FeaturesKey), Tags: Viper.GetStringSlice(TagsKey), Updated: filePathUTime(Viper.GetString(DynamicConfigPathKey)), AllowedDirectoriesMap: map[string]struct{}{}, @@ -221,8 +222,8 @@ func UpdateAgentConfig(systemId string, updateTags []string, updateFeatures []st sort.Strings(config.Features) synchronizedFeatures := reflect.DeepEqual(updateFeatures, config.Features) - Viper.Set(FeaturesKey, updateFeatures) - config.Features = Viper.GetStringSlice(FeaturesKey) + Viper.Set(agent_config.FeaturesKey, updateFeatures) + config.Features = Viper.GetStringSlice(agent_config.FeaturesKey) // If the features are already synchronized there is no need to overwrite if synchronizedTags && synchronizedFeatures { diff --git a/src/core/config/config_test.go b/src/core/config/config_test.go index 7eacef54e..7af6da135 100644 --- a/src/core/config/config_test.go +++ b/src/core/config/config_test.go @@ -12,6 +12,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + agent_config "github.com/nginx/agent/sdk/v2/agent/config" + sysutils "github.com/nginx/agent/v2/test/utils/system" ) @@ -455,7 +457,7 @@ func TestUpdateAgentConfig(t *testing.T) { } func setEnvVariable(t *testing.T, name string, value string) { - key := strings.ToUpper(EnvPrefix + KeyDelimiter + name) + key := strings.ToUpper(EnvPrefix + agent_config.KeyDelimiter + name) err := os.Setenv(key, value) require.NoError(t, err) } @@ -464,7 +466,7 @@ func cleanEnv(t *testing.T, confFileName, dynamicConfFileAbsPath string) { os.Clearenv() ROOT_COMMAND.ResetFlags() ROOT_COMMAND.ResetCommands() - Viper = viper.NewWithOptions(viper.KeyDelimiter(KeyDelimiter)) + Viper = viper.NewWithOptions(viper.KeyDelimiter(agent_config.KeyDelimiter)) SetDefaults() RegisterFlags() diff --git a/src/core/config/defaults.go b/src/core/config/defaults.go index 11ec40568..c4f8bb4e4 100644 --- a/src/core/config/defaults.go +++ b/src/core/config/defaults.go @@ -5,6 +5,8 @@ import ( "time" "github.com/google/uuid" + + agent_config "github.com/nginx/agent/sdk/v2/agent/config" advanced_metrics "github.com/nginx/agent/v2/src/extensions/advanced-metrics/pkg/advanced-metrics" log "github.com/sirupsen/logrus" ) @@ -78,18 +80,7 @@ var ( PriorityTableMaxSize: 1000, }, }, - Features: []string{ - FeatureRegistration, - FeatureNginxConfig, - FeatureNginxSSLConfig, - FeatureNginxCounting, - FeatureMetrics, - FeatureMetricsThrottle, - FeatureDataPlaneStatus, - FeatureProcessWatcher, - FeatureFileWatcher, - FeatureActivityEvents, - }, + Features: agent_config.GetDefaultFeatures(), } AllowedDirectoriesMap map[string]struct{} ) @@ -99,7 +90,6 @@ const ( DynamicConfigFileAbsPath = "/etc/nginx-agent/agent-dynamic.conf" ConfigFileName = "nginx-agent.conf" ConfigFileType = "yaml" - KeyDelimiter = "_" EnvPrefix = "nms" ConfigPathKey = "path" DynamicConfigPathKey = "dynamic-config-path" @@ -114,81 +104,67 @@ const ( // viper keys used in config LogKey = "log" - LogLevel = LogKey + KeyDelimiter + "level" - LogPath = LogKey + KeyDelimiter + "path" + LogLevel = LogKey + agent_config.KeyDelimiter + "level" + LogPath = LogKey + agent_config.KeyDelimiter + "path" // viper keys used in config ServerKey = "server" - ServerHost = ServerKey + KeyDelimiter + "host" - ServerGrpcport = ServerKey + KeyDelimiter + "grpcport" - ServerToken = ServerKey + KeyDelimiter + "token" - ServerMetrics = ServerKey + KeyDelimiter + "metrics" - ServerCommand = ServerKey + KeyDelimiter + "command" + ServerHost = ServerKey + agent_config.KeyDelimiter + "host" + ServerGrpcport = ServerKey + agent_config.KeyDelimiter + "grpcport" + ServerToken = ServerKey + agent_config.KeyDelimiter + "token" + ServerMetrics = ServerKey + agent_config.KeyDelimiter + "metrics" + ServerCommand = ServerKey + agent_config.KeyDelimiter + "command" // viper keys used in config TlsKey = "tls" - TlsEnable = TlsKey + KeyDelimiter + "enable" - TlsCert = TlsKey + KeyDelimiter + "cert" - TlsPrivateKey = TlsKey + KeyDelimiter + "key" - TlsCa = TlsKey + KeyDelimiter + "ca" - TlsSkipVerify = TlsKey + KeyDelimiter + "skip_verify" + TlsEnable = TlsKey + agent_config.KeyDelimiter + "enable" + TlsCert = TlsKey + agent_config.KeyDelimiter + "cert" + TlsPrivateKey = TlsKey + agent_config.KeyDelimiter + "key" + TlsCa = TlsKey + agent_config.KeyDelimiter + "ca" + TlsSkipVerify = TlsKey + agent_config.KeyDelimiter + "skip_verify" // viper keys used in config NginxKey = "nginx" - NginxExcludeLogs = NginxKey + KeyDelimiter + "exclude_logs" - NginxDebug = NginxKey + KeyDelimiter + "debug" - NginxCountingSocket = NginxKey + KeyDelimiter + "socket" - NginxClientVersion = NginxKey + KeyDelimiter + "client_version" + NginxExcludeLogs = NginxKey + agent_config.KeyDelimiter + "exclude_logs" + NginxDebug = NginxKey + agent_config.KeyDelimiter + "debug" + NginxCountingSocket = NginxKey + agent_config.KeyDelimiter + "socket" + NginxClientVersion = NginxKey + agent_config.KeyDelimiter + "client_version" // viper keys used in config DataplaneKey = "dataplane" - DataplaneEventsEnable = DataplaneKey + KeyDelimiter + "events_enable" - DataplaneSyncEnable = DataplaneKey + KeyDelimiter + "sync_enable" - DataplaneStatusPoll = DataplaneKey + KeyDelimiter + "status_poll_interval" - DataplaneStatusReportInterval = DataplaneKey + KeyDelimiter + "report_interval" + DataplaneEventsEnable = DataplaneKey + agent_config.KeyDelimiter + "events_enable" + DataplaneSyncEnable = DataplaneKey + agent_config.KeyDelimiter + "sync_enable" + DataplaneStatusPoll = DataplaneKey + agent_config.KeyDelimiter + "status_poll_interval" + DataplaneStatusReportInterval = DataplaneKey + agent_config.KeyDelimiter + "report_interval" // viper keys used in config MetricsKey = "metrics" - MetricsBulkSize = MetricsKey + KeyDelimiter + "bulk_size" - MetricsReportInterval = MetricsKey + KeyDelimiter + "report_interval" - MetricsCollectionInterval = MetricsKey + KeyDelimiter + "collection_interval" - MetricsMode = MetricsKey + KeyDelimiter + "mode" + MetricsBulkSize = MetricsKey + agent_config.KeyDelimiter + "bulk_size" + MetricsReportInterval = MetricsKey + agent_config.KeyDelimiter + "report_interval" + MetricsCollectionInterval = MetricsKey + agent_config.KeyDelimiter + "collection_interval" + MetricsMode = MetricsKey + agent_config.KeyDelimiter + "mode" // viper keys used in config AdvancedMetricsKey = "advanced_metrics" - AdvancedMetricsSocketPath = AdvancedMetricsKey + KeyDelimiter + "socket_path" - AdvancedMetricsAggregationPeriod = AdvancedMetricsKey + KeyDelimiter + "aggregation_period" - AdvancedMetricsPublishPeriod = AdvancedMetricsKey + KeyDelimiter + "publishing_period" - AdvancedMetricsTableSizesLimits = AdvancedMetricsKey + KeyDelimiter + "table_sizes_limits" - AdvancedMetricsTableSizesLimitsSTMS = AdvancedMetricsTableSizesLimits + KeyDelimiter + "staging_table_max_size" - AdvancedMetricsTableSizesLimitsSTT = AdvancedMetricsTableSizesLimits + KeyDelimiter + "staging_table_threshold" - AdvancedMetricsTableSizesLimitsPTMS = AdvancedMetricsTableSizesLimits + KeyDelimiter + "priority_table_max_size" - AdvancedMetricsTableSizesLimitsPTT = AdvancedMetricsTableSizesLimits + KeyDelimiter + "priority_table_threshold" + AdvancedMetricsSocketPath = AdvancedMetricsKey + agent_config.KeyDelimiter + "socket_path" + AdvancedMetricsAggregationPeriod = AdvancedMetricsKey + agent_config.KeyDelimiter + "aggregation_period" + AdvancedMetricsPublishPeriod = AdvancedMetricsKey + agent_config.KeyDelimiter + "publishing_period" + AdvancedMetricsTableSizesLimits = AdvancedMetricsKey + agent_config.KeyDelimiter + "table_sizes_limits" + AdvancedMetricsTableSizesLimitsSTMS = AdvancedMetricsTableSizesLimits + agent_config.KeyDelimiter + "staging_table_max_size" + AdvancedMetricsTableSizesLimitsSTT = AdvancedMetricsTableSizesLimits + agent_config.KeyDelimiter + "staging_table_threshold" + AdvancedMetricsTableSizesLimitsPTMS = AdvancedMetricsTableSizesLimits + agent_config.KeyDelimiter + "priority_table_max_size" + AdvancedMetricsTableSizesLimitsPTT = AdvancedMetricsTableSizesLimits + agent_config.KeyDelimiter + "priority_table_threshold" // viper keys used in config NginxAppProtectKey = "nginx_app_protect" - NginxAppProtectReportInterval = NginxAppProtectKey + KeyDelimiter + "report_interval" - - // viper keys used in config - FeaturesKey = "features" - - FeatureRegistration = FeaturesKey + KeyDelimiter + "registration" - FeatureNginxConfig = FeaturesKey + KeyDelimiter + "nginx-config" - FeatureNginxSSLConfig = FeaturesKey + KeyDelimiter + "nginx-ssl-config" - FeatureNginxCounting = FeaturesKey + KeyDelimiter + "nginx-counting" - FeatureMetrics = FeaturesKey + KeyDelimiter + "metrics" - FeatureMetricsThrottle = FeaturesKey + KeyDelimiter + "metrics-throttle" - FeatureDataPlaneStatus = FeaturesKey + KeyDelimiter + "dataplane-status" - FeatureProcessWatcher = FeaturesKey + KeyDelimiter + "process-watcher" - FeatureFileWatcher = FeaturesKey + KeyDelimiter + "file-watcher" - FeatureActivityEvents = FeaturesKey + KeyDelimiter + "activity-events" + NginxAppProtectReportInterval = NginxAppProtectKey + agent_config.KeyDelimiter + "report_interval" // DEPRECATED KEYS NginxBinPathKey = "nginx_bin_path" @@ -250,9 +226,9 @@ var ( Usage: "A comma-separated list of tags to add to the current instance or machine, to be used for inventory purposes.", }, &StringSliceFlag{ - Name: FeaturesKey, + Name: agent_config.FeaturesKey, Usage: "A comma-separated list of features enabled for the agent.", - DefaultValue: Defaults.Features, + DefaultValue: agent_config.GetDefaultFeatures(), }, // NGINX Config &StringFlag{ diff --git a/src/plugins/nginx.go b/src/plugins/nginx.go index cb45f5d71..f4d059dd3 100644 --- a/src/plugins/nginx.go +++ b/src/plugins/nginx.go @@ -14,6 +14,7 @@ import ( "github.com/nginx/agent/sdk/v2/client" "github.com/nginx/agent/sdk/v2/grpc" + agent_config "github.com/nginx/agent/sdk/v2/agent/config" "github.com/nginx/agent/sdk/v2/proto" "github.com/nginx/agent/v2/src/core" "github.com/nginx/agent/v2/src/core/config" @@ -72,13 +73,13 @@ func NewNginx(cmdr client.Commander, nginxBinary core.NginxBinary, env core.Envi isConfUploadEnabled := isConfUploadEnabled(loadedConfig) return &Nginx{ - nginxBinary: nginxBinary, - processes: env.Processes(), - env: env, - cmdr: cmdr, - config: loadedConfig, - isNAPEnabled: isNAPEnabled, - isConfUploadEnabled: isConfUploadEnabled, + nginxBinary: nginxBinary, + processes: env.Processes(), + env: env, + cmdr: cmdr, + config: loadedConfig, + isNAPEnabled: isNAPEnabled, + isConfUploadEnabled: isConfUploadEnabled, configApplyStatusChannel: make(chan *proto.Command_NginxConfigResponse, 1), } } @@ -334,11 +335,11 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) // If the NGINX config can be validated with the validationTimeout the result will be returned straight away. select { - case result := <-n.configApplyStatusChannel: - return result - case <-time.After(validationTimeout): - log.Debugf("Validation of the NGINX config in taking longer than the validationTimeout %s", validationTimeout) - return status + case result := <-n.configApplyStatusChannel: + return result + case <-time.After(validationTimeout): + log.Debugf("Validation of the NGINX config in taking longer than the validationTimeout %s", validationTimeout) + return status } } @@ -558,7 +559,7 @@ func (n *Nginx) syncAgentConfigChange() { func isConfUploadEnabled(conf *config.Config) bool { for _, feature := range conf.Features { - if feature == config.FeatureNginxConfig { + if feature == agent_config.FeatureNginxConfig { return true } } diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index 3762f1220..779386755 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -17,6 +17,7 @@ import ( "github.com/nginx/agent/sdk/v2/grpc" "github.com/nginx/agent/sdk/v2/proto" + agent_config "github.com/nginx/agent/sdk/v2/agent/config" "github.com/nginx/agent/v2/src/core" loadedConfig "github.com/nginx/agent/v2/src/core/config" @@ -228,7 +229,7 @@ func TestNginxConfigApply(t *testing.T) { commandClient := tutils.GetMockCommandClient(test.config) - pluginUnderTest := NewNginx(commandClient, binary, env, &loadedConfig.Config{Features: []string{loadedConfig.FeatureNginxConfig}}) + pluginUnderTest := NewNginx(commandClient, binary, env, &loadedConfig.Config{Features: []string{agent_config.FeatureNginxConfig}}) messagePipe := core.SetupMockMessagePipe(t, ctx, pluginUnderTest) messagePipe.Process(core.NewMessage(core.CommNginxConfig, cmd)) @@ -241,7 +242,7 @@ func TestNginxConfigApply(t *testing.T) { 3*time.Millisecond, ) - for idx, msg := range messagePipe.GetProcessedMessages() { + for idx, msg := range messagePipe.GetProcessedMessages() { if test.msgTopics[idx] != msg.Topic() { tt.Errorf("unexpected message topic: %s :: should have been: %s", msg.Topic(), test.msgTopics[idx]) } @@ -295,7 +296,7 @@ func TestUploadConfigs(t *testing.T) { cmdr := tutils.NewMockCommandClient() cmdr.On("Upload", mock.Anything, mock.Anything).Return(nil) - pluginUnderTest := NewNginx(cmdr, binary, env, &loadedConfig.Config{Features: []string{loadedConfig.FeatureNginxConfig}}) + pluginUnderTest := NewNginx(cmdr, binary, env, &loadedConfig.Config{Features: []string{agent_config.FeatureNginxConfig}}) messagePipe := core.SetupMockMessagePipe(t, context.Background(), pluginUnderTest) pluginUnderTest.Init(messagePipe) @@ -399,7 +400,7 @@ func TestNginx_Process_NginxConfigUpload(t *testing.T) { env := tutils.GetMockEnvWithProcess() - pluginUnderTest := NewNginx(cmdr, binary, env, &loadedConfig.Config{Features: []string{loadedConfig.FeatureNginxConfig}}) + pluginUnderTest := NewNginx(cmdr, binary, env, &loadedConfig.Config{Features: []string{agent_config.FeatureNginxConfig}}) pluginUnderTest.Process(core.NewMessage(core.NginxConfigUpload, configDesc)) binary.AssertExpectations(t) @@ -440,14 +441,14 @@ func TestNginx_validateConfig(t *testing.T) { expectedError error }{ { - name: "successful validation", + name: "successful validation", validationResult: nil, - expectedTopic: core.NginxConfigValidationSucceeded, + expectedTopic: core.NginxConfigValidationSucceeded, }, { - name: "failed validation", + name: "failed validation", validationResult: errors.New("failure"), - expectedTopic: core.NginxConfigValidationFailed, + expectedTopic: core.NginxConfigValidationFailed, }, } @@ -461,7 +462,7 @@ func TestNginx_validateConfig(t *testing.T) { binary.On("GetNginxDetailsMapFromProcesses", env.Processes()).Return((tutils.GetDetailsMap())) binary.On("UpdateNginxDetailsFromProcesses", env.Processes()) - pluginUnderTest := NewNginx(&tutils.MockCommandClient{}, binary, env, &loadedConfig.Config{Features: []string{loadedConfig.FeatureNginxConfig}}) + pluginUnderTest := NewNginx(&tutils.MockCommandClient{}, binary, env, &loadedConfig.Config{Features: []string{agent_config.FeatureNginxConfig}}) messagePipe := core.SetupMockMessagePipe(t, context.TODO(), pluginUnderTest) messagePipe.Run() @@ -529,7 +530,7 @@ func TestNginx_completeConfigApply(t *testing.T) { }, ) - pluginUnderTest := NewNginx(commandClient, binary, env, &loadedConfig.Config{Features: []string{loadedConfig.FeatureNginxConfig}}) + pluginUnderTest := NewNginx(commandClient, binary, env, &loadedConfig.Config{Features: []string{agent_config.FeatureNginxConfig}}) dir := t.TempDir() tempConf, err := ioutil.TempFile(dir, "nginx.conf") @@ -615,7 +616,7 @@ func TestNginx_rollbackConfigApply(t *testing.T) { }, ) - pluginUnderTest := NewNginx(commandClient, binary, env, &loadedConfig.Config{Features: []string{loadedConfig.FeatureNginxConfig}}) + pluginUnderTest := NewNginx(commandClient, binary, env, &loadedConfig.Config{Features: []string{agent_config.FeatureNginxConfig}}) dir := t.TempDir() tempConf, err := ioutil.TempFile(dir, "nginx.conf") diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/agent/config/config_helpers.go b/test/performance/vendor/github.com/nginx/agent/sdk/v2/agent/config/config_helpers.go new file mode 100644 index 000000000..62e6492b5 --- /dev/null +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/agent/config/config_helpers.go @@ -0,0 +1,35 @@ +package config + +const ( + KeyDelimiter = "_" + + // viper keys used in config + FeaturesKey = "features" + FeatureRegistration = FeaturesKey + KeyDelimiter + "registration" + FeatureNginxConfig = FeaturesKey + KeyDelimiter + "nginx-config" + FeatureNginxConfigAsync = FeaturesKey + KeyDelimiter + "nginx-config-async" + FeatureNginxSSLConfig = FeaturesKey + KeyDelimiter + "nginx-ssl-config" + FeatureNginxCounting = FeaturesKey + KeyDelimiter + "nginx-counting" + FeatureMetrics = FeaturesKey + KeyDelimiter + "metrics" + FeatureMetricsThrottle = FeaturesKey + KeyDelimiter + "metrics-throttle" + FeatureDataPlaneStatus = FeaturesKey + KeyDelimiter + "dataplane-status" + FeatureProcessWatcher = FeaturesKey + KeyDelimiter + "process-watcher" + FeatureFileWatcher = FeaturesKey + KeyDelimiter + "file-watcher" + FeatureActivityEvents = FeaturesKey + KeyDelimiter + "activity-events" +) + +func GetDefaultFeatures() []string { + return []string{ + FeatureRegistration, + FeatureNginxConfig, + FeatureNginxSSLConfig, + FeatureNginxCounting, + FeatureNginxConfigAsync, + FeatureMetrics, + FeatureMetricsThrottle, + FeatureDataPlaneStatus, + FeatureProcessWatcher, + FeatureFileWatcher, + FeatureActivityEvents, + } +} diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go index 9e7d36007..fbea6127f 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go @@ -10,6 +10,7 @@ import ( "strings" "time" + agent_config "github.com/nginx/agent/sdk/v2/agent/config" advanced_metrics "github.com/nginx/agent/v2/src/extensions/advanced-metrics/pkg/advanced-metrics" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -40,7 +41,7 @@ const ( ) var ( - Viper = viper.NewWithOptions(viper.KeyDelimiter(KeyDelimiter)) + Viper = viper.NewWithOptions(viper.KeyDelimiter(agent_config.KeyDelimiter)) ) func SetVersion(version, commit string) { @@ -168,7 +169,7 @@ func GetConfig(clientId string) (*Config, error) { Nginx: getNginx(), Dataplane: getDataplane(), AgentMetrics: getMetrics(), - Features: Viper.GetStringSlice(FeaturesKey), + Features: Viper.GetStringSlice(agent_config.FeaturesKey), Tags: Viper.GetStringSlice(TagsKey), Updated: filePathUTime(Viper.GetString(DynamicConfigPathKey)), AllowedDirectoriesMap: map[string]struct{}{}, @@ -221,8 +222,8 @@ func UpdateAgentConfig(systemId string, updateTags []string, updateFeatures []st sort.Strings(config.Features) synchronizedFeatures := reflect.DeepEqual(updateFeatures, config.Features) - Viper.Set(FeaturesKey, updateFeatures) - config.Features = Viper.GetStringSlice(FeaturesKey) + Viper.Set(agent_config.FeaturesKey, updateFeatures) + config.Features = Viper.GetStringSlice(agent_config.FeaturesKey) // If the features are already synchronized there is no need to overwrite if synchronizedTags && synchronizedFeatures { diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go index 11ec40568..c4f8bb4e4 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/defaults.go @@ -5,6 +5,8 @@ import ( "time" "github.com/google/uuid" + + agent_config "github.com/nginx/agent/sdk/v2/agent/config" advanced_metrics "github.com/nginx/agent/v2/src/extensions/advanced-metrics/pkg/advanced-metrics" log "github.com/sirupsen/logrus" ) @@ -78,18 +80,7 @@ var ( PriorityTableMaxSize: 1000, }, }, - Features: []string{ - FeatureRegistration, - FeatureNginxConfig, - FeatureNginxSSLConfig, - FeatureNginxCounting, - FeatureMetrics, - FeatureMetricsThrottle, - FeatureDataPlaneStatus, - FeatureProcessWatcher, - FeatureFileWatcher, - FeatureActivityEvents, - }, + Features: agent_config.GetDefaultFeatures(), } AllowedDirectoriesMap map[string]struct{} ) @@ -99,7 +90,6 @@ const ( DynamicConfigFileAbsPath = "/etc/nginx-agent/agent-dynamic.conf" ConfigFileName = "nginx-agent.conf" ConfigFileType = "yaml" - KeyDelimiter = "_" EnvPrefix = "nms" ConfigPathKey = "path" DynamicConfigPathKey = "dynamic-config-path" @@ -114,81 +104,67 @@ const ( // viper keys used in config LogKey = "log" - LogLevel = LogKey + KeyDelimiter + "level" - LogPath = LogKey + KeyDelimiter + "path" + LogLevel = LogKey + agent_config.KeyDelimiter + "level" + LogPath = LogKey + agent_config.KeyDelimiter + "path" // viper keys used in config ServerKey = "server" - ServerHost = ServerKey + KeyDelimiter + "host" - ServerGrpcport = ServerKey + KeyDelimiter + "grpcport" - ServerToken = ServerKey + KeyDelimiter + "token" - ServerMetrics = ServerKey + KeyDelimiter + "metrics" - ServerCommand = ServerKey + KeyDelimiter + "command" + ServerHost = ServerKey + agent_config.KeyDelimiter + "host" + ServerGrpcport = ServerKey + agent_config.KeyDelimiter + "grpcport" + ServerToken = ServerKey + agent_config.KeyDelimiter + "token" + ServerMetrics = ServerKey + agent_config.KeyDelimiter + "metrics" + ServerCommand = ServerKey + agent_config.KeyDelimiter + "command" // viper keys used in config TlsKey = "tls" - TlsEnable = TlsKey + KeyDelimiter + "enable" - TlsCert = TlsKey + KeyDelimiter + "cert" - TlsPrivateKey = TlsKey + KeyDelimiter + "key" - TlsCa = TlsKey + KeyDelimiter + "ca" - TlsSkipVerify = TlsKey + KeyDelimiter + "skip_verify" + TlsEnable = TlsKey + agent_config.KeyDelimiter + "enable" + TlsCert = TlsKey + agent_config.KeyDelimiter + "cert" + TlsPrivateKey = TlsKey + agent_config.KeyDelimiter + "key" + TlsCa = TlsKey + agent_config.KeyDelimiter + "ca" + TlsSkipVerify = TlsKey + agent_config.KeyDelimiter + "skip_verify" // viper keys used in config NginxKey = "nginx" - NginxExcludeLogs = NginxKey + KeyDelimiter + "exclude_logs" - NginxDebug = NginxKey + KeyDelimiter + "debug" - NginxCountingSocket = NginxKey + KeyDelimiter + "socket" - NginxClientVersion = NginxKey + KeyDelimiter + "client_version" + NginxExcludeLogs = NginxKey + agent_config.KeyDelimiter + "exclude_logs" + NginxDebug = NginxKey + agent_config.KeyDelimiter + "debug" + NginxCountingSocket = NginxKey + agent_config.KeyDelimiter + "socket" + NginxClientVersion = NginxKey + agent_config.KeyDelimiter + "client_version" // viper keys used in config DataplaneKey = "dataplane" - DataplaneEventsEnable = DataplaneKey + KeyDelimiter + "events_enable" - DataplaneSyncEnable = DataplaneKey + KeyDelimiter + "sync_enable" - DataplaneStatusPoll = DataplaneKey + KeyDelimiter + "status_poll_interval" - DataplaneStatusReportInterval = DataplaneKey + KeyDelimiter + "report_interval" + DataplaneEventsEnable = DataplaneKey + agent_config.KeyDelimiter + "events_enable" + DataplaneSyncEnable = DataplaneKey + agent_config.KeyDelimiter + "sync_enable" + DataplaneStatusPoll = DataplaneKey + agent_config.KeyDelimiter + "status_poll_interval" + DataplaneStatusReportInterval = DataplaneKey + agent_config.KeyDelimiter + "report_interval" // viper keys used in config MetricsKey = "metrics" - MetricsBulkSize = MetricsKey + KeyDelimiter + "bulk_size" - MetricsReportInterval = MetricsKey + KeyDelimiter + "report_interval" - MetricsCollectionInterval = MetricsKey + KeyDelimiter + "collection_interval" - MetricsMode = MetricsKey + KeyDelimiter + "mode" + MetricsBulkSize = MetricsKey + agent_config.KeyDelimiter + "bulk_size" + MetricsReportInterval = MetricsKey + agent_config.KeyDelimiter + "report_interval" + MetricsCollectionInterval = MetricsKey + agent_config.KeyDelimiter + "collection_interval" + MetricsMode = MetricsKey + agent_config.KeyDelimiter + "mode" // viper keys used in config AdvancedMetricsKey = "advanced_metrics" - AdvancedMetricsSocketPath = AdvancedMetricsKey + KeyDelimiter + "socket_path" - AdvancedMetricsAggregationPeriod = AdvancedMetricsKey + KeyDelimiter + "aggregation_period" - AdvancedMetricsPublishPeriod = AdvancedMetricsKey + KeyDelimiter + "publishing_period" - AdvancedMetricsTableSizesLimits = AdvancedMetricsKey + KeyDelimiter + "table_sizes_limits" - AdvancedMetricsTableSizesLimitsSTMS = AdvancedMetricsTableSizesLimits + KeyDelimiter + "staging_table_max_size" - AdvancedMetricsTableSizesLimitsSTT = AdvancedMetricsTableSizesLimits + KeyDelimiter + "staging_table_threshold" - AdvancedMetricsTableSizesLimitsPTMS = AdvancedMetricsTableSizesLimits + KeyDelimiter + "priority_table_max_size" - AdvancedMetricsTableSizesLimitsPTT = AdvancedMetricsTableSizesLimits + KeyDelimiter + "priority_table_threshold" + AdvancedMetricsSocketPath = AdvancedMetricsKey + agent_config.KeyDelimiter + "socket_path" + AdvancedMetricsAggregationPeriod = AdvancedMetricsKey + agent_config.KeyDelimiter + "aggregation_period" + AdvancedMetricsPublishPeriod = AdvancedMetricsKey + agent_config.KeyDelimiter + "publishing_period" + AdvancedMetricsTableSizesLimits = AdvancedMetricsKey + agent_config.KeyDelimiter + "table_sizes_limits" + AdvancedMetricsTableSizesLimitsSTMS = AdvancedMetricsTableSizesLimits + agent_config.KeyDelimiter + "staging_table_max_size" + AdvancedMetricsTableSizesLimitsSTT = AdvancedMetricsTableSizesLimits + agent_config.KeyDelimiter + "staging_table_threshold" + AdvancedMetricsTableSizesLimitsPTMS = AdvancedMetricsTableSizesLimits + agent_config.KeyDelimiter + "priority_table_max_size" + AdvancedMetricsTableSizesLimitsPTT = AdvancedMetricsTableSizesLimits + agent_config.KeyDelimiter + "priority_table_threshold" // viper keys used in config NginxAppProtectKey = "nginx_app_protect" - NginxAppProtectReportInterval = NginxAppProtectKey + KeyDelimiter + "report_interval" - - // viper keys used in config - FeaturesKey = "features" - - FeatureRegistration = FeaturesKey + KeyDelimiter + "registration" - FeatureNginxConfig = FeaturesKey + KeyDelimiter + "nginx-config" - FeatureNginxSSLConfig = FeaturesKey + KeyDelimiter + "nginx-ssl-config" - FeatureNginxCounting = FeaturesKey + KeyDelimiter + "nginx-counting" - FeatureMetrics = FeaturesKey + KeyDelimiter + "metrics" - FeatureMetricsThrottle = FeaturesKey + KeyDelimiter + "metrics-throttle" - FeatureDataPlaneStatus = FeaturesKey + KeyDelimiter + "dataplane-status" - FeatureProcessWatcher = FeaturesKey + KeyDelimiter + "process-watcher" - FeatureFileWatcher = FeaturesKey + KeyDelimiter + "file-watcher" - FeatureActivityEvents = FeaturesKey + KeyDelimiter + "activity-events" + NginxAppProtectReportInterval = NginxAppProtectKey + agent_config.KeyDelimiter + "report_interval" // DEPRECATED KEYS NginxBinPathKey = "nginx_bin_path" @@ -250,9 +226,9 @@ var ( Usage: "A comma-separated list of tags to add to the current instance or machine, to be used for inventory purposes.", }, &StringSliceFlag{ - Name: FeaturesKey, + Name: agent_config.FeaturesKey, Usage: "A comma-separated list of features enabled for the agent.", - DefaultValue: Defaults.Features, + DefaultValue: agent_config.GetDefaultFeatures(), }, // NGINX Config &StringFlag{ diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go index cb45f5d71..f4d059dd3 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go @@ -14,6 +14,7 @@ import ( "github.com/nginx/agent/sdk/v2/client" "github.com/nginx/agent/sdk/v2/grpc" + agent_config "github.com/nginx/agent/sdk/v2/agent/config" "github.com/nginx/agent/sdk/v2/proto" "github.com/nginx/agent/v2/src/core" "github.com/nginx/agent/v2/src/core/config" @@ -72,13 +73,13 @@ func NewNginx(cmdr client.Commander, nginxBinary core.NginxBinary, env core.Envi isConfUploadEnabled := isConfUploadEnabled(loadedConfig) return &Nginx{ - nginxBinary: nginxBinary, - processes: env.Processes(), - env: env, - cmdr: cmdr, - config: loadedConfig, - isNAPEnabled: isNAPEnabled, - isConfUploadEnabled: isConfUploadEnabled, + nginxBinary: nginxBinary, + processes: env.Processes(), + env: env, + cmdr: cmdr, + config: loadedConfig, + isNAPEnabled: isNAPEnabled, + isConfUploadEnabled: isConfUploadEnabled, configApplyStatusChannel: make(chan *proto.Command_NginxConfigResponse, 1), } } @@ -334,11 +335,11 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) // If the NGINX config can be validated with the validationTimeout the result will be returned straight away. select { - case result := <-n.configApplyStatusChannel: - return result - case <-time.After(validationTimeout): - log.Debugf("Validation of the NGINX config in taking longer than the validationTimeout %s", validationTimeout) - return status + case result := <-n.configApplyStatusChannel: + return result + case <-time.After(validationTimeout): + log.Debugf("Validation of the NGINX config in taking longer than the validationTimeout %s", validationTimeout) + return status } } @@ -558,7 +559,7 @@ func (n *Nginx) syncAgentConfigChange() { func isConfUploadEnabled(conf *config.Config) bool { for _, feature := range conf.Features { - if feature == config.FeatureNginxConfig { + if feature == agent_config.FeatureNginxConfig { return true } } diff --git a/test/performance/vendor/github.com/nginx/agent/v2/test/utils/agent_config.go b/test/performance/vendor/github.com/nginx/agent/v2/test/utils/agent_config.go index 80fd1a5bb..58fa133dd 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/test/utils/agent_config.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/test/utils/agent_config.go @@ -9,7 +9,9 @@ import ( "github.com/spf13/viper" + agent_config "github.com/nginx/agent/sdk/v2/agent/config" "github.com/nginx/agent/v2/src/core/config" + sysutils "github.com/nginx/agent/v2/test/utils/system" log "github.com/sirupsen/logrus" ) @@ -116,7 +118,7 @@ func setupRoutine(wg *sync.WaitGroup) error { os.Clearenv() config.ROOT_COMMAND.ResetFlags() config.ROOT_COMMAND.ResetCommands() - config.Viper = viper.NewWithOptions(viper.KeyDelimiter(config.KeyDelimiter)) + config.Viper = viper.NewWithOptions(viper.KeyDelimiter(agent_config.KeyDelimiter)) config.SetDefaults() config.RegisterFlags() diff --git a/test/performance/vendor/modules.txt b/test/performance/vendor/modules.txt index d8831ec8f..f617b1fc3 100644 --- a/test/performance/vendor/modules.txt +++ b/test/performance/vendor/modules.txt @@ -113,6 +113,7 @@ github.com/nats-io/nuid # github.com/nginx/agent/sdk/v2 v2.0.0-00010101000000-000000000000 => ./../../sdk ## explicit; go 1.18 github.com/nginx/agent/sdk/v2 +github.com/nginx/agent/sdk/v2/agent/config github.com/nginx/agent/sdk/v2/checksum github.com/nginx/agent/sdk/v2/client github.com/nginx/agent/sdk/v2/files diff --git a/test/utils/agent_config.go b/test/utils/agent_config.go index 80fd1a5bb..58fa133dd 100644 --- a/test/utils/agent_config.go +++ b/test/utils/agent_config.go @@ -9,7 +9,9 @@ import ( "github.com/spf13/viper" + agent_config "github.com/nginx/agent/sdk/v2/agent/config" "github.com/nginx/agent/v2/src/core/config" + sysutils "github.com/nginx/agent/v2/test/utils/system" log "github.com/sirupsen/logrus" ) @@ -116,7 +118,7 @@ func setupRoutine(wg *sync.WaitGroup) error { os.Clearenv() config.ROOT_COMMAND.ResetFlags() config.ROOT_COMMAND.ResetCommands() - config.Viper = viper.NewWithOptions(viper.KeyDelimiter(config.KeyDelimiter)) + config.Viper = viper.NewWithOptions(viper.KeyDelimiter(agent_config.KeyDelimiter)) config.SetDefaults() config.RegisterFlags() diff --git a/vendor/github.com/nginx/agent/sdk/v2/agent/config/config_helpers.go b/vendor/github.com/nginx/agent/sdk/v2/agent/config/config_helpers.go new file mode 100644 index 000000000..62e6492b5 --- /dev/null +++ b/vendor/github.com/nginx/agent/sdk/v2/agent/config/config_helpers.go @@ -0,0 +1,35 @@ +package config + +const ( + KeyDelimiter = "_" + + // viper keys used in config + FeaturesKey = "features" + FeatureRegistration = FeaturesKey + KeyDelimiter + "registration" + FeatureNginxConfig = FeaturesKey + KeyDelimiter + "nginx-config" + FeatureNginxConfigAsync = FeaturesKey + KeyDelimiter + "nginx-config-async" + FeatureNginxSSLConfig = FeaturesKey + KeyDelimiter + "nginx-ssl-config" + FeatureNginxCounting = FeaturesKey + KeyDelimiter + "nginx-counting" + FeatureMetrics = FeaturesKey + KeyDelimiter + "metrics" + FeatureMetricsThrottle = FeaturesKey + KeyDelimiter + "metrics-throttle" + FeatureDataPlaneStatus = FeaturesKey + KeyDelimiter + "dataplane-status" + FeatureProcessWatcher = FeaturesKey + KeyDelimiter + "process-watcher" + FeatureFileWatcher = FeaturesKey + KeyDelimiter + "file-watcher" + FeatureActivityEvents = FeaturesKey + KeyDelimiter + "activity-events" +) + +func GetDefaultFeatures() []string { + return []string{ + FeatureRegistration, + FeatureNginxConfig, + FeatureNginxSSLConfig, + FeatureNginxCounting, + FeatureNginxConfigAsync, + FeatureMetrics, + FeatureMetricsThrottle, + FeatureDataPlaneStatus, + FeatureProcessWatcher, + FeatureFileWatcher, + FeatureActivityEvents, + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index a610d8a94..379e37d16 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -115,6 +115,7 @@ github.com/mwitkow/go-proto-validators/protoc-gen-govalidators # github.com/nginx/agent/sdk/v2 v2.0.0-00010101000000-000000000000 => ./sdk ## explicit; go 1.18 github.com/nginx/agent/sdk/v2 +github.com/nginx/agent/sdk/v2/agent/config github.com/nginx/agent/sdk/v2/checksum github.com/nginx/agent/sdk/v2/client github.com/nginx/agent/sdk/v2/files From d66c78b37d1543b214321cf672ec1fc8e0635beb Mon Sep 17 00:00:00 2001 From: "o.omahony" Date: Wed, 26 Oct 2022 12:11:25 +0100 Subject: [PATCH 13/15] added details to connect request --- sdk/proto/agent.pb.go | 197 ++++++++++++------ sdk/proto/agent.proto | 1 + src/core/config/types.go | 1 + src/plugins/registration.go | 6 + .../nginx/agent/sdk/v2/proto/agent.pb.go | 197 ++++++++++++------ .../nginx/agent/sdk/v2/proto/agent.proto | 1 + .../nginx/agent/v2/src/core/config/types.go | 1 + .../agent/v2/src/plugins/registration.go | 6 + .../nginx/agent/sdk/v2/proto/agent.pb.go | 197 ++++++++++++------ .../nginx/agent/sdk/v2/proto/agent.proto | 1 + 10 files changed, 404 insertions(+), 204 deletions(-) diff --git a/sdk/proto/agent.pb.go b/sdk/proto/agent.pb.go index 61affae6b..f0335e02e 100644 --- a/sdk/proto/agent.pb.go +++ b/sdk/proto/agent.pb.go @@ -553,6 +553,7 @@ type AgentMeta struct { InstanceGroup string `protobuf:"bytes,5,opt,name=instance_group,json=instanceGroup,proto3" json:"instance_group"` Updated *types.Timestamp `protobuf:"bytes,6,opt,name=updated,proto3" json:"updated"` SystemUid string `protobuf:"bytes,7,opt,name=system_uid,json=systemUid,proto3" json:"system_uid"` + AgentDetails *AgentDetails `protobuf:"bytes,8,opt,name=agent_details,json=agentDetails,proto3" json:"agent_details"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -633,6 +634,13 @@ func (m *AgentMeta) GetSystemUid() string { return "" } +func (m *AgentMeta) GetAgentDetails() *AgentDetails { + if m != nil { + return m.AgentDetails + } + return nil +} + func init() { proto.RegisterEnum("f5.nginx.agent.sdk.AgentConnectStatus_StatusCode", AgentConnectStatus_StatusCode_name, AgentConnectStatus_StatusCode_value) proto.RegisterEnum("f5.nginx.agent.sdk.AgentLogging_Level", AgentLogging_Level_name, AgentLogging_Level_value) @@ -649,74 +657,75 @@ func init() { func init() { proto.RegisterFile("agent.proto", fileDescriptor_56ede974c0020f77) } var fileDescriptor_56ede974c0020f77 = []byte{ - // 1060 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0xde, 0xf1, 0x4f, 0x6c, 0x97, 0xb3, 0xd9, 0x51, 0xef, 0x0a, 0xbc, 0x66, 0xc9, 0x58, 0x16, - 0x2c, 0x46, 0x82, 0x31, 0x78, 0x85, 0x10, 0x2c, 0x17, 0x3b, 0xf6, 0x66, 0x37, 0x1b, 0x6c, 0xd4, - 0x71, 0xb4, 0x12, 0x97, 0x51, 0xc7, 0xd3, 0x9e, 0x1d, 0xe2, 0x99, 0x36, 0xd3, 0xed, 0xe0, 0xec, - 0x23, 0xf0, 0x22, 0x5c, 0x78, 0x00, 0x1e, 0x80, 0x03, 0x47, 0x9e, 0xc0, 0x42, 0x39, 0xa1, 0x39, - 0x73, 0xe1, 0x86, 0xfa, 0x67, 0x12, 0x87, 0xfc, 0xc0, 0xa5, 0xbb, 0xea, 0xeb, 0xaa, 0xea, 0xaa, - 0xea, 0xaa, 0x9a, 0x81, 0x2a, 0x09, 0x68, 0x2c, 0xdc, 0x79, 0xc2, 0x04, 0x43, 0x68, 0xfa, 0x99, - 0x1b, 0x07, 0x61, 0xbc, 0x74, 0x35, 0xca, 0xfd, 0xe3, 0x3a, 0x04, 0x2c, 0x60, 0xfa, 0xbc, 0x0e, - 0xaf, 0x19, 0x37, 0xb2, 0xf5, 0xcd, 0x09, 0x8b, 0xa7, 0x61, 0x60, 0xb8, 0xaa, 0x56, 0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0x75, 0x5f, 0xea, 0x63, 0xb4, - 0x07, 0x1b, 0x3a, 0x61, 0xa6, 0xfc, 0x1f, 0xff, 0xbf, 0x27, 0xe8, 0x41, 0xba, 0x72, 0x8c, 0x26, - 0x36, 0x7b, 0xf3, 0xc1, 0xc5, 0x43, 0xcb, 0x7b, 0x74, 0x7b, 0x35, 0xff, 0xb4, 0xa0, 0xba, 0x06, - 0xaf, 0x77, 0x8c, 0x0e, 0xa1, 0x71, 0xe3, 0x95, 0xb7, 0x77, 0xcc, 0x2e, 0x94, 0x66, 0x2c, 0x08, - 0x68, 0x92, 0xf9, 0x7e, 0xb3, 0xa1, 0x7d, 0x16, 0x04, 0x61, 0x1c, 0x68, 0x43, 0x46, 0x09, 0x67, - 0x84, 0x34, 0xa4, 0x53, 0xc3, 0x55, 0x05, 0xdc, 0x60, 0x28, 0x8b, 0x6a, 0xce, 0x12, 0xa1, 0x0d, - 0x19, 0x25, 0x9c, 0x11, 0xcd, 0x9f, 0x2c, 0xd8, 0x5c, 0x77, 0x1c, 0xb5, 0xa0, 0x3c, 0xa5, 0x44, - 0x2c, 0x12, 0x2a, 0x83, 0xcd, 0xb7, 0x2a, 0xbd, 0xcd, 0x74, 0xe5, 0x9c, 0x63, 0xf8, 0x9c, 0x42, - 0x2e, 0x00, 0x5d, 0x0a, 0x1a, 0xf3, 0x90, 0xc5, 0x32, 0x1e, 0x29, 0xbb, 0x95, 0xae, 0x9c, 0x35, - 0x14, 0xaf, 0xd1, 0xe8, 0x11, 0x14, 0x04, 0x09, 0xf4, 0xd0, 0xa9, 0xe8, 0x81, 0x20, 0x79, 0xac, - 0x56, 0x59, 0xd1, 0x64, 0x16, 0x12, 0xae, 0xa6, 0x89, 0xa9, 0x68, 0x05, 0x60, 0xbd, 0x35, 0xff, - 0xce, 0x19, 0x4f, 0x4d, 0x66, 0xd0, 0x2e, 0x14, 0x67, 0xf4, 0x84, 0xce, 0x4c, 0x27, 0x3e, 0xfe, - 0xaf, 0x54, 0xba, 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2c, - 0xa0, 0x08, 0x00, 0x00, + // 1081 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xcd, 0x72, 0x1b, 0x45, + 0x10, 0xce, 0xea, 0xc7, 0x92, 0x5a, 0xb6, 0xb3, 0x4c, 0x52, 0xa0, 0x88, 0xe0, 0x55, 0xa9, 0x20, + 0x88, 0x2a, 0x58, 0x81, 0x52, 0x14, 0x05, 0xe1, 0x22, 0x59, 0x8a, 0x63, 0xc7, 0x48, 0xd4, 0x58, + 0xae, 0x50, 0x5c, 0xb6, 0xc6, 0xda, 0xd1, 0x66, 0xb1, 0x76, 0x57, 0xec, 0x8c, 0x8c, 0x9c, 0x47, + 0xe0, 0x21, 0xb8, 0x72, 0xe1, 0x01, 0x78, 0x04, 0x8e, 0x3c, 0xc1, 0x16, 0xe5, 0x13, 0xb5, 0x67, + 0x2e, 0xdc, 0xa8, 0xf9, 0x59, 0x5b, 0xc6, 0x3f, 0xc9, 0x65, 0xb6, 0xfb, 0x9b, 0xee, 0x9e, 0x9e, + 0x6f, 0xa6, 0x7b, 0x16, 0xaa, 0xc4, 0xa3, 0x21, 0xb7, 0xe7, 0x71, 0xc4, 0x23, 0x84, 0xa6, 0x9f, + 0xdb, 0xa1, 0xe7, 0x87, 0x4b, 0x5b, 0xa1, 0xcc, 0x3d, 0xae, 0x83, 0x17, 0x79, 0x91, 0x9a, 0xaf, + 0xc3, 0xcb, 0x88, 0x69, 0xdb, 0xfa, 0xfa, 0x24, 0x0a, 0xa7, 0xbe, 0xa7, 0xb5, 0xaa, 0x72, 0x53, + 0x8a, 0xe5, 0x45, 0x91, 0x37, 0xa3, 0x6d, 0xa9, 0x1d, 0x2d, 0xa6, 0x6d, 0xee, 0x07, 0x94, 0x71, + 0x12, 0xcc, 0xb5, 0xc1, 0x03, 0x77, 0xee, 0xb0, 0x68, 0xca, 0x7f, 0x22, 0x31, 0x75, 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x11, 0x79, 0x16, 0x9c, 0x78, 0x58, + 0x0c, 0xe8, 0x4b, 0xd8, 0xf4, 0x43, 0xc6, 0x49, 0x38, 0xa1, 0x8e, 0x17, 0x47, 0x8b, 0xb9, 0xe4, + 0xb1, 0xd2, 0x43, 0x69, 0x62, 0xfd, 0x6f, 0x06, 0x6f, 0x64, 0xfa, 0x8e, 0x50, 0x51, 0x17, 0x4a, + 0x8b, 0xb9, 0x4b, 0x38, 0x75, 0x25, 0x9b, 0xd5, 0x4e, 0xdd, 0x56, 0xaf, 0xb2, 0x9d, 0xbd, 0xca, + 0xf6, 0x38, 0x7b, 0x95, 0xd5, 0x6e, 0xb4, 0x39, 0xce, 0x04, 0xf4, 0x09, 0x00, 0x3b, 0x65, 0x9c, + 0x06, 0xce, 0xc2, 0x77, 0x25, 0xd9, 0xfa, 0xb6, 0x5f, 0xa0, 0xb8, 0xa2, 0xe4, 0x43, 0xdf, 0x45, + 0xdf, 0xc1, 0x86, 0xea, 0x60, 0x59, 0xe3, 0x28, 0xbf, 0x61, 0xe3, 0x78, 0x2b, 0x4d, 0xac, 0xcb, + 0xae, 0x58, 0xf5, 0xc2, 0x8b, 0xc7, 0xaa, 0x60, 0x16, 0x2f, 0x36, 0x28, 0x39, 0xec, 0x7d, 0xf1, + 0xc7, 0xd9, 0x96, 0xf1, 0xe7, 0xd9, 0x96, 0xf1, 0xd7, 0xd9, 0x96, 0xf1, 0xfd, 0x47, 0x9e, 0xcf, + 0x5f, 0x2e, 0x8e, 0xec, 0x49, 0x14, 0xb4, 0xe5, 0x62, 0x6d, 0x19, 0xa1, 0xcd, 0xdc, 0xe3, 0xf6, + 0x49, 0x47, 0xfd, 0x89, 0x3c, 0x51, 0x3b, 0x5f, 0x93, 0x9f, 0xc7, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0xb4, 0x95, 0x5a, 0x2d, 0xfa, 0x08, 0x00, 0x00, } func (m *AgentConnectRequest) Marshal() (dAtA []byte, err error) { @@ -1141,6 +1150,18 @@ func (m *AgentMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.AgentDetails != nil { + { + size, err := m.AgentDetails.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAgent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } if len(m.SystemUid) > 0 { i -= len(m.SystemUid) copy(dAtA[i:], m.SystemUid) @@ -1416,6 +1437,10 @@ func (m *AgentMeta) Size() (n int) { if l > 0 { n += 1 + l + sovAgent(uint64(l)) } + if m.AgentDetails != nil { + l = m.AgentDetails.Size() + n += 1 + l + sovAgent(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2701,6 +2726,42 @@ func (m *AgentMeta) Unmarshal(dAtA []byte) error { } m.SystemUid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentDetails", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAgent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AgentDetails == nil { + m.AgentDetails = &AgentDetails{} + } + if err := m.AgentDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAgent(dAtA[iNdEx:]) diff --git a/sdk/proto/agent.proto b/sdk/proto/agent.proto index 92894732f..7aa32e2e0 100644 --- a/sdk/proto/agent.proto +++ b/sdk/proto/agent.proto @@ -78,4 +78,5 @@ message AgentMeta { string instance_group = 5 [(gogoproto.jsontag) = "instance_group"]; google.protobuf.Timestamp updated = 6 [(gogoproto.jsontag) = "updated"]; string system_uid = 7 [(gogoproto.jsontag) = "system_uid"]; + AgentDetails agent_details = 8 [(gogoproto.jsontag) = "agent_details"]; } diff --git a/src/core/config/types.go b/src/core/config/types.go index 66ab795b6..721095a9c 100644 --- a/src/core/config/types.go +++ b/src/core/config/types.go @@ -20,6 +20,7 @@ type Config struct { AgentMetrics AgentMetrics `mapstructure:"metrics" yaml:"-"` Tags []string `mapstructure:"tags" yaml:"tags,omitempty"` Features []string `mapstructure:"features" yaml:"features,omitempty"` + Extensions []string `mapstructure:"extensions" yaml:"extensions,omitempty"` Updated time.Time `yaml:"-"` // update time of the config file AllowedDirectoriesMap map[string]struct{} `yaml:"-"` DisplayName string `mapstructure:"display_name" yaml:"display_name,omitempty"` diff --git a/src/plugins/registration.go b/src/plugins/registration.go index 71edbb816..5e170bce5 100644 --- a/src/plugins/registration.go +++ b/src/plugins/registration.go @@ -131,6 +131,12 @@ func (r *OneTimeRegistration) registerAgent() { InstanceGroup: r.config.InstanceGroup, Updated: updated, SystemUid: r.env.GetSystemUUID(), + AgentDetails: &proto.AgentDetails{ + Features: r.config.Features, + Extensions: r.config.Extensions, + Tags: *r.tags, + Alias: "", + }, }, Details: details, DataplaneSoftwareDetails: r.dataplaneSoftwareDetailsSlice(), diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/agent.pb.go b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/agent.pb.go index 61affae6b..f0335e02e 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/agent.pb.go +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/agent.pb.go @@ -553,6 +553,7 @@ type AgentMeta struct { InstanceGroup string `protobuf:"bytes,5,opt,name=instance_group,json=instanceGroup,proto3" json:"instance_group"` Updated *types.Timestamp `protobuf:"bytes,6,opt,name=updated,proto3" json:"updated"` SystemUid string `protobuf:"bytes,7,opt,name=system_uid,json=systemUid,proto3" json:"system_uid"` + AgentDetails *AgentDetails `protobuf:"bytes,8,opt,name=agent_details,json=agentDetails,proto3" json:"agent_details"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -633,6 +634,13 @@ func (m *AgentMeta) GetSystemUid() string { return "" } +func (m *AgentMeta) GetAgentDetails() *AgentDetails { + if m != nil { + return m.AgentDetails + } + return nil +} + func init() { proto.RegisterEnum("f5.nginx.agent.sdk.AgentConnectStatus_StatusCode", AgentConnectStatus_StatusCode_name, AgentConnectStatus_StatusCode_value) proto.RegisterEnum("f5.nginx.agent.sdk.AgentLogging_Level", AgentLogging_Level_name, AgentLogging_Level_value) @@ -649,74 +657,75 @@ func init() { func init() { proto.RegisterFile("agent.proto", fileDescriptor_56ede974c0020f77) } var fileDescriptor_56ede974c0020f77 = []byte{ - // 1060 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0xde, 0xf1, 0x4f, 0x6c, 0x97, 0xb3, 0xd9, 0x51, 0xef, 0x0a, 0xbc, 0x66, 0xc9, 0x58, 0x16, - 0x2c, 0x46, 0x82, 0x31, 0x78, 0x85, 0x10, 0x2c, 0x17, 0x3b, 0xf6, 0x66, 0x37, 0x1b, 0x6c, 0xd4, - 0x71, 0xb4, 0x12, 0x97, 0x51, 0xc7, 0xd3, 0x9e, 0x1d, 0xe2, 0x99, 0x36, 0xd3, 0xed, 0xe0, 0xec, - 0x23, 0xf0, 0x22, 0x5c, 0x78, 0x00, 0x1e, 0x80, 0x03, 0x47, 0x9e, 0xc0, 0x42, 0x39, 0xa1, 0x39, - 0x73, 0xe1, 0x86, 0xfa, 0x67, 0x12, 0x87, 0xfc, 0xc0, 0xa5, 0xbb, 0xea, 0xeb, 0xaa, 0xea, 0x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0xdb, 0xfa, 0xe3, 0x6c, 0xdb, 0xfa, 0xf6, 0xc3, 0x20, 0x14, 0xaf, 0x17, 0x47, 0xee, 0x84, - 0x45, 0x6d, 0x55, 0xb7, 0x6d, 0x55, 0xb7, 0x6d, 0xee, 0x1f, 0xb7, 0x4f, 0x3a, 0xfa, 0x7f, 0xe1, - 0xa9, 0xf6, 0x6f, 0x43, 0x6d, 0x4f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x02, 0x48, 0xb6, 0x2c, - 0xa0, 0x08, 0x00, 0x00, + // 1081 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xcd, 0x72, 0x1b, 0x45, + 0x10, 0xce, 0xea, 0xc7, 0x92, 0x5a, 0xb6, 0xb3, 0x4c, 0x52, 0xa0, 0x88, 0xe0, 0x55, 0xa9, 0x20, + 0x88, 0x2a, 0x58, 0x81, 0x52, 0x14, 0x05, 0xe1, 0x22, 0x59, 0x8a, 0x63, 0xc7, 0x48, 0xd4, 0x58, + 0xae, 0x50, 0x5c, 0xb6, 0xc6, 0xda, 0xd1, 0x66, 0xb1, 0x76, 0x57, 0xec, 0x8c, 0x8c, 0x9c, 0x47, + 0xe0, 0x21, 0xb8, 0x72, 0xe1, 0x01, 0x78, 0x04, 0x8e, 0x3c, 0xc1, 0x16, 0xe5, 0x13, 0xb5, 0x67, + 0x2e, 0xdc, 0xa8, 0xf9, 0x59, 0x5b, 0xc6, 0x3f, 0xc9, 0x65, 0xb6, 0xfb, 0x9b, 0xee, 0x9e, 0x9e, + 0x6f, 0xa6, 0x7b, 0x16, 0xaa, 0xc4, 0xa3, 0x21, 0xb7, 0xe7, 0x71, 0xc4, 0x23, 0x84, 0xa6, 0x9f, + 0xdb, 0xa1, 0xe7, 0x87, 0x4b, 0x5b, 0xa1, 0xcc, 0x3d, 0xae, 0x83, 0x17, 0x79, 0x91, 0x9a, 0x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x2e, 0x8e, 0xec, 0x49, 0x14, 0xb4, 0xe5, 0x62, 0x6d, 0x19, 0xa1, 0xcd, 0xdc, 0xe3, 0xf6, + 0x49, 0x47, 0xfd, 0x89, 0x3c, 0x51, 0x3b, 0x5f, 0x93, 0x9f, 0xc7, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0xb4, 0x95, 0x5a, 0x2d, 0xfa, 0x08, 0x00, 0x00, } func (m *AgentConnectRequest) Marshal() (dAtA []byte, err error) { @@ -1141,6 +1150,18 @@ func (m *AgentMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.AgentDetails != nil { + { + size, err := m.AgentDetails.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAgent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } if len(m.SystemUid) > 0 { i -= len(m.SystemUid) copy(dAtA[i:], m.SystemUid) @@ -1416,6 +1437,10 @@ func (m *AgentMeta) Size() (n int) { if l > 0 { n += 1 + l + sovAgent(uint64(l)) } + if m.AgentDetails != nil { + l = m.AgentDetails.Size() + n += 1 + l + sovAgent(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2701,6 +2726,42 @@ func (m *AgentMeta) Unmarshal(dAtA []byte) error { } m.SystemUid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentDetails", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAgent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AgentDetails == nil { + m.AgentDetails = &AgentDetails{} + } + if err := m.AgentDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAgent(dAtA[iNdEx:]) diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/agent.proto b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/agent.proto index 92894732f..7aa32e2e0 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/agent.proto +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/agent.proto @@ -78,4 +78,5 @@ message AgentMeta { string instance_group = 5 [(gogoproto.jsontag) = "instance_group"]; google.protobuf.Timestamp updated = 6 [(gogoproto.jsontag) = "updated"]; string system_uid = 7 [(gogoproto.jsontag) = "system_uid"]; + AgentDetails agent_details = 8 [(gogoproto.jsontag) = "agent_details"]; } diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/types.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/types.go index 66ab795b6..721095a9c 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/types.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/types.go @@ -20,6 +20,7 @@ type Config struct { AgentMetrics AgentMetrics `mapstructure:"metrics" yaml:"-"` Tags []string `mapstructure:"tags" yaml:"tags,omitempty"` Features []string `mapstructure:"features" yaml:"features,omitempty"` + Extensions []string `mapstructure:"extensions" yaml:"extensions,omitempty"` Updated time.Time `yaml:"-"` // update time of the config file AllowedDirectoriesMap map[string]struct{} `yaml:"-"` DisplayName string `mapstructure:"display_name" yaml:"display_name,omitempty"` diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/registration.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/registration.go index 71edbb816..5e170bce5 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/registration.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/registration.go @@ -131,6 +131,12 @@ func (r *OneTimeRegistration) registerAgent() { InstanceGroup: r.config.InstanceGroup, Updated: updated, SystemUid: r.env.GetSystemUUID(), + AgentDetails: &proto.AgentDetails{ + Features: r.config.Features, + Extensions: r.config.Extensions, + Tags: *r.tags, + Alias: "", + }, }, Details: details, DataplaneSoftwareDetails: r.dataplaneSoftwareDetailsSlice(), diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/agent.pb.go b/vendor/github.com/nginx/agent/sdk/v2/proto/agent.pb.go index 61affae6b..f0335e02e 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/agent.pb.go +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/agent.pb.go @@ -553,6 +553,7 @@ type AgentMeta struct { InstanceGroup string `protobuf:"bytes,5,opt,name=instance_group,json=instanceGroup,proto3" json:"instance_group"` Updated *types.Timestamp `protobuf:"bytes,6,opt,name=updated,proto3" json:"updated"` SystemUid string `protobuf:"bytes,7,opt,name=system_uid,json=systemUid,proto3" json:"system_uid"` + AgentDetails *AgentDetails `protobuf:"bytes,8,opt,name=agent_details,json=agentDetails,proto3" json:"agent_details"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -633,6 +634,13 @@ func (m *AgentMeta) GetSystemUid() string { return "" } +func (m *AgentMeta) GetAgentDetails() *AgentDetails { + if m != nil { + return m.AgentDetails + } + return nil +} + func init() { proto.RegisterEnum("f5.nginx.agent.sdk.AgentConnectStatus_StatusCode", AgentConnectStatus_StatusCode_name, AgentConnectStatus_StatusCode_value) proto.RegisterEnum("f5.nginx.agent.sdk.AgentLogging_Level", AgentLogging_Level_name, AgentLogging_Level_value) @@ -649,74 +657,75 @@ func init() { func init() { proto.RegisterFile("agent.proto", fileDescriptor_56ede974c0020f77) } var fileDescriptor_56ede974c0020f77 = []byte{ - // 1060 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0xde, 0xf1, 0x4f, 0x6c, 0x97, 0xb3, 0xd9, 0x51, 0xef, 0x0a, 0xbc, 0x66, 0xc9, 0x58, 0x16, - 0x2c, 0x46, 0x82, 0x31, 0x78, 0x85, 0x10, 0x2c, 0x17, 0x3b, 0xf6, 0x66, 0x37, 0x1b, 0x6c, 0xd4, - 0x71, 0xb4, 0x12, 0x97, 0x51, 0xc7, 0xd3, 0x9e, 0x1d, 0xe2, 0x99, 0x36, 0xd3, 0xed, 0xe0, 0xec, - 0x23, 0xf0, 0x22, 0x5c, 0x78, 0x00, 0x1e, 0x80, 0x03, 0x47, 0x9e, 0xc0, 0x42, 0x39, 0xa1, 0x39, - 0x73, 0xe1, 0x86, 0xfa, 0x67, 0x12, 0x87, 0xfc, 0xc0, 0xa5, 0xbb, 0xea, 0xeb, 0xaa, 0xea, 0xaa, - 0xea, 0xaa, 0x9a, 0x81, 0x2a, 0x09, 0x68, 0x2c, 0xdc, 0x79, 0xc2, 0x04, 0x43, 0x68, 0xfa, 0x99, - 0x1b, 0x07, 0x61, 0xbc, 0x74, 0x35, 0xca, 0xfd, 0xe3, 0x3a, 0x04, 0x2c, 0x60, 0xfa, 0xbc, 0x0e, - 0xaf, 0x19, 0x37, 0xb2, 0xf5, 0xcd, 0x09, 0x8b, 0xa7, 0x61, 0x60, 0xb8, 0xaa, 0x56, 0xd3, 0x8c, - 0x13, 0x30, 0x16, 0xcc, 0x68, 0x5b, 0x71, 0x47, 0x8b, 0x69, 0x5b, 0x84, 0x11, 0xe5, 0x82, 0x44, - 0x73, 0x23, 0xf0, 0xd0, 0x9f, 0x7b, 0x9c, 0x4d, 0xc5, 0x0f, 0x24, 0xa1, 0x9e, 0x4f, 0x05, 0x09, - 0x67, 0x5c, 0x1f, 0x35, 0xff, 0xca, 0xc1, 0xfd, 0xae, 0xbc,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17, 0x24, 0x9e, 0x50, 0x2f, 0x48, 0xd8, 0x62, 0xae, 0xf2, 0x58, - 0xe9, 0xa1, 0x74, 0xe5, 0xfc, 0xeb, 0x04, 0xdf, 0xcd, 0xf8, 0x5d, 0xc9, 0xa2, 0x2e, 0x94, 0x16, - 0x73, 0x9f, 0x08, 0xea, 0xab, 0x6c, 0x56, 0x3b, 0x75, 0x57, 0x7f, 0x95, 0xdd, 0xec, 0xab, 0xec, - 0x8e, 0xb3, 0xaf, 0xb2, 0x8e, 0xc6, 0x88, 0xe3, 0x8c, 0x40, 0x1f, 0x03, 0xf0, 0x53, 0x2e, 0x68, - 0xe4, 0x2d, 0x42, 0x5f, 0x25, 0xdb, 0x54, 0xfb, 0x05, 0x8a, 0x2b, 0x9a, 0x3e, 0x0c, 0xfd, 0xbd, - 0x42, 0xb9, 0x60, 0x17, 0x2f, 0xdc, 0x50, 0x91, 0xf6, 0x3e, 0xff, 0xed, 0x6c, 0xdb, 0xfa, 0xfd, - 0x6c, 0xdb, 0xfa, 0xe3, 0x6c, 0xdb, 0xfa, 0xf6, 0xc3, 0x20, 0x14, 0xaf, 0x17, 0x47, 0xee, 0x84, - 0x45, 0x6d, 0x55, 0xb7, 0x6d, 0x55, 0xb7, 0x6d, 0xee, 0x1f, 0xb7, 0x4f, 0x3a, 0xfa, 0x7f, 0xe1, - 0xa9, 0xf6, 0x6f, 0x43, 0x6d, 0x4f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x02, 0x48, 0xb6, 0x2c, - 0xa0, 0x08, 0x00, 0x00, + // 1081 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xcd, 0x72, 0x1b, 0x45, + 0x10, 0xce, 0xea, 0xc7, 0x92, 0x5a, 0xb6, 0xb3, 0x4c, 0x52, 0xa0, 0x88, 0xe0, 0x55, 0xa9, 0x20, + 0x88, 0x2a, 0x58, 0x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xbe, 0xa1, 0x9c, 0xf4, 0xca, 0x69, 0x62, + 0x49, 0x73, 0x2c, 0x47, 0xb4, 0x03, 0x25, 0xbd, 0x4a, 0x2d, 0xdf, 0xc8, 0xb7, 0xaa, 0x9d, 0xc6, + 0x75, 0xfe, 0x43, 0xa1, 0xf7, 0x95, 0x5d, 0xaf, 0x9a, 0x26, 0x56, 0xe6, 0x84, 0x33, 0x01, 0x7d, + 0x05, 0x05, 0x41, 0x41, 0xad, 0x20, 0xb3, 0x78, 0x78, 0x5d, 0x94, 0x67, 0x11, 0xe3, 0xbb, 0xe1, + 0x34, 0x52, 0x49, 0x08, 0x6b, 0x2c, 0x47, 0xf4, 0xb3, 0x01, 0x75, 0x97, 0x70, 0x32, 0x9f, 0x91, + 0x90, 0x5e, 0xd9, 0x7e, 0xad, 0x28, 0x13, 0xfb, 0xf8, 0xba, 0x90, 0xfd, 0xcc, 0xeb, 0x40, 0x3b, + 0x65, 0x49, 0x6e, 0xa5, 0x89, 0x75, 0x4b, 0x4c, 0x5c, 0x73, 0x6f, 0xf0, 0xdc, 0x2b, 0x94, 0x0d, + 0x33, 0x87, 0xcb, 0xbe, 0x4b, 0x43, 0xee, 0xf3, 0xd3, 0xe6, 0x6f, 0x39, 0x40, 0xab, 0xb4, 0x1f, + 0x70, 0xc2, 0x17, 0x0c, 0x1d, 0x01, 0x30, 0x29, 0x6d, 0x47, 0x2e, 0xad, 0x19, 0x0d, 0xa3, 0xb5, + 0xd9, 0xf9, 0xec, 0x46, 0xee, 0x2f, 0xf9, 0xda, 0x07, 0xe7, 0x8e, 0xbd, 0xbb, 0x69, 0x62, 0x55, + 0x55, 0x20, 0x67, 0x12, 0xb9, 0x14, 0xaf, 0x44, 0x45, 0x1f, 0x40, 0x29, 0xa0, 0x8c, 0x11, 0x8f, + 0xca, 0xc3, 0xad, 0x28, 0xea, 0x35, 0x84, 0x33, 0x01, 0x59, 0x50, 0xa4, 0x71, 0x1c, 0xc5, 0xb5, + 0xbc, 0x34,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 0x9b, 0xd5, 0x4e, 0xdd, 0x56, 0xaf, 0xb2, 0x9d, 0xbd, 0xca, + 0xf6, 0x38, 0x7b, 0x95, 0xd5, 0x6e, 0xb4, 0x39, 0xce, 0x04, 0xf4, 0x09, 0x00, 0x3b, 0x65, 0x9c, + 0x06, 0xce, 0xc2, 0x77, 0x25, 0xd9, 0xfa, 0xb6, 0x5f, 0xa0, 0xb8, 0xa2, 0xe4, 0x43, 0xdf, 0x45, + 0xdf, 0xc1, 0x86, 0xea, 0x60, 0x59, 0xe3, 0x28, 0xbf, 0x61, 0xe3, 0x78, 0x2b, 0x4d, 0xac, 0xcb, + 0xae, 0x58, 0xf5, 0xc2, 0x8b, 0xc7, 0xaa, 0x60, 0x16, 0x2f, 0x36, 0x28, 0x39, 0xec, 0x7d, 0xf1, + 0xc7, 0xd9, 0x96, 0xf1, 0xe7, 0xd9, 0x96, 0xf1, 0xd7, 0xd9, 0x96, 0xf1, 0xfd, 0x47, 0x9e, 0xcf, + 0x5f, 0x2e, 0x8e, 0xec, 0x49, 0x14, 0xb4, 0xe5, 0x62, 0x6d, 0x19, 0xa1, 0xcd, 0xdc, 0xe3, 0xf6, + 0x49, 0x47, 0xfd, 0x89, 0x3c, 0x51, 0x3b, 0x5f, 0x93, 0x9f, 0xc7, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0xb4, 0x95, 0x5a, 0x2d, 0xfa, 0x08, 0x00, 0x00, } func (m *AgentConnectRequest) Marshal() (dAtA []byte, err error) { @@ -1141,6 +1150,18 @@ func (m *AgentMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.AgentDetails != nil { + { + size, err := m.AgentDetails.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAgent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } if len(m.SystemUid) > 0 { i -= len(m.SystemUid) copy(dAtA[i:], m.SystemUid) @@ -1416,6 +1437,10 @@ func (m *AgentMeta) Size() (n int) { if l > 0 { n += 1 + l + sovAgent(uint64(l)) } + if m.AgentDetails != nil { + l = m.AgentDetails.Size() + n += 1 + l + sovAgent(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2701,6 +2726,42 @@ func (m *AgentMeta) Unmarshal(dAtA []byte) error { } m.SystemUid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentDetails", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAgent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAgent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AgentDetails == nil { + m.AgentDetails = &AgentDetails{} + } + if err := m.AgentDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAgent(dAtA[iNdEx:]) diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/agent.proto b/vendor/github.com/nginx/agent/sdk/v2/proto/agent.proto index 92894732f..7aa32e2e0 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/agent.proto +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/agent.proto @@ -78,4 +78,5 @@ message AgentMeta { string instance_group = 5 [(gogoproto.jsontag) = "instance_group"]; google.protobuf.Timestamp updated = 6 [(gogoproto.jsontag) = "updated"]; string system_uid = 7 [(gogoproto.jsontag) = "system_uid"]; + AgentDetails agent_details = 8 [(gogoproto.jsontag) = "agent_details"]; } From 6c458db222d80e1b60d12debd20ec5eae34b9429 Mon Sep 17 00:00:00 2001 From: dhurley Date: Wed, 2 Nov 2022 13:54:26 +0000 Subject: [PATCH 14/15] Updated DataplaneStatus to remove agent activities when they are completed --- src/plugins/dataplane_status.go | 13 +++++++++++++ .../nginx/agent/v2/src/plugins/dataplane_status.go | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/plugins/dataplane_status.go b/src/plugins/dataplane_status.go index bb52017f4..8a8eda177 100644 --- a/src/plugins/dataplane_status.go +++ b/src/plugins/dataplane_status.go @@ -103,6 +103,7 @@ func (dps *DataPlaneStatus) Process(msg *core.Message) { case *proto.AgentActivityStatus: dps.updateAgentActivityStatuses(data) dps.sendDataplaneStatus(dps.messagePipeline, false) + dps.removeAgentActivityStatus(data) default: log.Errorf("Expected the type %T but got %T", &proto.AgentActivityStatus{}, data) } @@ -138,6 +139,18 @@ func (dps *DataPlaneStatus) updateAgentActivityStatuses(newAgentActivityStatus * } } +func (dps *DataPlaneStatus) removeAgentActivityStatus(agentActivityStatus *proto.AgentActivityStatus) { + log.Tracef("DataplaneStatus: Removing %v from agentActivityStatuses", agentActivityStatus) + if _, ok := agentActivityStatus.GetStatus().(*proto.AgentActivityStatus_NginxConfigStatus); ok { + for index, agentActivityStatus := range dps.agentActivityStatuses { + if _, ok := agentActivityStatus.GetStatus().(*proto.AgentActivityStatus_NginxConfigStatus); ok { + dps.agentActivityStatuses = append(dps.agentActivityStatuses[:index], dps.agentActivityStatuses[index+1:]...) + log.Tracef("DataplaneStatus: Removed %v from agentActivityStatus", agentActivityStatus) + } + } + } +} + func (dps *DataPlaneStatus) sendDataplaneStatus(pipeline core.MessagePipeInterface, forceDetails bool) { meta := *dps.meta meta.MessageId = uuid.New().String() diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/dataplane_status.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/dataplane_status.go index bb52017f4..8a8eda177 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/dataplane_status.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/dataplane_status.go @@ -103,6 +103,7 @@ func (dps *DataPlaneStatus) Process(msg *core.Message) { case *proto.AgentActivityStatus: dps.updateAgentActivityStatuses(data) dps.sendDataplaneStatus(dps.messagePipeline, false) + dps.removeAgentActivityStatus(data) default: log.Errorf("Expected the type %T but got %T", &proto.AgentActivityStatus{}, data) } @@ -138,6 +139,18 @@ func (dps *DataPlaneStatus) updateAgentActivityStatuses(newAgentActivityStatus * } } +func (dps *DataPlaneStatus) removeAgentActivityStatus(agentActivityStatus *proto.AgentActivityStatus) { + log.Tracef("DataplaneStatus: Removing %v from agentActivityStatuses", agentActivityStatus) + if _, ok := agentActivityStatus.GetStatus().(*proto.AgentActivityStatus_NginxConfigStatus); ok { + for index, agentActivityStatus := range dps.agentActivityStatuses { + if _, ok := agentActivityStatus.GetStatus().(*proto.AgentActivityStatus_NginxConfigStatus); ok { + dps.agentActivityStatuses = append(dps.agentActivityStatuses[:index], dps.agentActivityStatuses[index+1:]...) + log.Tracef("DataplaneStatus: Removed %v from agentActivityStatus", agentActivityStatus) + } + } + } +} + func (dps *DataPlaneStatus) sendDataplaneStatus(pipeline core.MessagePipeInterface, forceDetails bool) { meta := *dps.meta meta.MessageId = uuid.New().String() From 584e59789f29458c6c97184a4d73702553c0bc65 Mon Sep 17 00:00:00 2001 From: dhurley Date: Wed, 2 Nov 2022 14:47:38 +0000 Subject: [PATCH 15/15] Add comments to nginx plugin --- src/plugins/nginx.go | 2 ++ .../vendor/github.com/nginx/agent/v2/src/plugins/nginx.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/plugins/nginx.go b/src/plugins/nginx.go index f4d059dd3..e22d871ce 100644 --- a/src/plugins/nginx.go +++ b/src/plugins/nginx.go @@ -334,6 +334,8 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) go n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) // If the NGINX config can be validated with the validationTimeout the result will be returned straight away. + // This is timeout is temporary to ensure we support backwards compatibility. In a future release this timeout + // will be removed. select { case result := <-n.configApplyStatusChannel: return result diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go index f4d059dd3..e22d871ce 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nginx.go @@ -334,6 +334,8 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig) go n.validateConfig(nginx, cmd.Meta.MessageId, config, configApply) // If the NGINX config can be validated with the validationTimeout the result will be returned straight away. + // This is timeout is temporary to ensure we support backwards compatibility. In a future release this timeout + // will be removed. select { case result := <-n.configApplyStatusChannel: return result