feat: set labels in NodeContext/Info
This commit is contained in:
@@ -9,23 +9,21 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
NodeContext ctx;
|
||||
NodeContext ctx({
|
||||
{"app", "base"},
|
||||
{"role", "demo"}
|
||||
});
|
||||
NetworkManager network(ctx);
|
||||
TaskManager taskManager(ctx);
|
||||
ClusterManager cluster(ctx, taskManager);
|
||||
ApiServer apiServer(ctx, taskManager, ctx.config.api_server_port);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Setup WiFi first
|
||||
network.setupWiFi();
|
||||
|
||||
// Add example labels for this node
|
||||
auto it = ctx.memberList->find(ctx.hostname);
|
||||
if (it != ctx.memberList->end()) {
|
||||
it->second.labels["app"] = "base";
|
||||
it->second.labels["role"] = "demo";
|
||||
}
|
||||
|
||||
// Initialize and start all tasks
|
||||
taskManager.initialize();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user