Skip to content

Commit

Permalink
Jv change config endpoint to runtime config (#1980)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoukoVirtanen authored Dec 16, 2024
1 parent 3ff9d2d commit 9abd6f8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "CollectorConfigInspector.h"
#include "CollectorRuntimeConfigInspector.h"

#include <Logging.h>
#include <string>
Expand All @@ -7,7 +7,7 @@

namespace collector {

const std::string CollectorConfigInspector::kBaseRoute = "/state/config";
const std::string CollectorConfigInspector::kBaseRoute = "/state/runtime-config";

CollectorConfigInspector::CollectorConfigInspector(const CollectorConfig& config) : config_(config) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef COLLECTOR_CONFIG_INSPECTOR_H
#define COLLECTOR_CONFIG_INSPECTOR_H
#ifndef COLLECTOR_RUNTIME_CONFIG_INSPECTOR_H
#define COLLECTOR_RUNTIME_CONFIG_INSPECTOR_H

#include <json/writer.h>

Expand Down
2 changes: 1 addition & 1 deletion collector/lib/CollectorService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern "C" {
#include <memory>

#include "CivetServer.h"
#include "CollectorConfigInspector.h"
#include "CollectorRuntimeConfigInspector.h"
#include "CollectorStatsExporter.h"
#include "ConnTracker.h"
#include "Containers.h"
Expand Down
4 changes: 2 additions & 2 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ $ curl "http://<collector>:8080/state/network/connection?container=c6f030bc4b42&
}
```

### Config endpoint
### Runtime config endpoint
The runtime configuration can be obtained using
$ curl "http://<collector>:8080/state/config"
$ curl "http://<collector>:8080/state/runtime-config"

4 changes: 2 additions & 2 deletions integration-tests/pkg/assert/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func AssertExternalIps(t *testing.T, enabled bool, collectorIP string) {
tickTime := 1 * time.Second
timeout := 3 * time.Minute
AssertRepeated(t, tickTime, timeout, runtimeConfigErrorMsg, func() bool {
body, err := collector.IntrospectionQuery(collectorIP, "/state/config")
body, err := collector.IntrospectionQuery(collectorIP, "/state/runtime-config")
assert.NoError(t, err)
var response types.RuntimeConfig
err = json.Unmarshal(body, &response)
Expand All @@ -37,7 +37,7 @@ func AssertNoRuntimeConfig(t *testing.T, collectorIP string) {
tickTime := 1 * time.Second
timeout := 3 * time.Minute
AssertRepeated(t, tickTime, timeout, runtimeConfigErrorMsg, func() bool {
body, err := collector.IntrospectionQuery(collectorIP, "/state/config")
body, err := collector.IntrospectionQuery(collectorIP, "/state/runtime-config")
assert.NoError(t, err)
return strings.TrimSpace(string(body)) == "{}"
})
Expand Down

0 comments on commit 9abd6f8

Please sign in to comment.