Skip to content

Commit

Permalink
Set correct arch in fleet status reports
Browse files Browse the repository at this point in the history
  • Loading branch information
archigup committed Nov 7, 2024
1 parent 882606c commit fe077ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion gg-fleet-statusd/src/fleet_status_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ static GglError retrieve_component_health_status(
return GGL_ERR_OK;
}

static const GglBuffer ARCHITECTURE =
#if defined(__x86_64__)
GGL_STR("amd64");
#elif defined(__i386__)
GGL_STR("x86");
#elif defined(__aarch64__)
GGL_STR("aarch64");
#elif defined(__arm__)
GGL_STR("arm");
#else
#error "Unknown target architecture"
{ 0 };
#endif

// TODO: Split this function up
// NOLINTNEXTLINE(readability-function-cognitive-complexity)
GglError publish_fleet_status_update(GglFleetStatusServiceThreadArgs *args) {
Expand Down Expand Up @@ -300,7 +314,7 @@ GglError publish_fleet_status_update(GglFleetStatusServiceThreadArgs *args) {
GglObject payload_obj = GGL_OBJ_MAP(GGL_MAP(
{ GGL_STR("ggcVersion"), GGL_OBJ_BUF(GGL_STR("1.0.0")) },
{ GGL_STR("platform"), GGL_OBJ_BUF(GGL_STR("linux")) },
{ GGL_STR("architecture"), GGL_OBJ_BUF(GGL_STR("amd64")) },
{ GGL_STR("architecture"), GGL_OBJ_BUF(ARCHITECTURE) },
{ GGL_STR("runtime"), GGL_OBJ_BUF(GGL_STR("NucleusLite")) },
{ GGL_STR("thing"), GGL_OBJ_BUF(thing_name) },
{ GGL_STR("sequenceNumber"), sequence },
Expand Down
4 changes: 2 additions & 2 deletions ggl-recipe/src/recipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ static GglBuffer get_current_architecture(void) {
current_arch = GGL_STR("amd64");
#elif defined(__i386__)
current_arch = GGL_STR("x86");
#elif defined(__aarch64__)
current_arch = GGL_STR("arm");
#elif defined(__aarch64__)
current_arch = GGL_STR("aarch64");
#elif defined(__arm__)
current_arch = GGL_STR("arm");
#endif
return current_arch;
}
Expand Down

0 comments on commit fe077ba

Please sign in to comment.