Skip to content

Commit

Permalink
Fix nesting with unsorted groups (#4711)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon authored Feb 5, 2025
1 parent 873c265 commit cc6fe63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/utils/config/api-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ export async function servicesResponse() {
// this is a nested group, so find the parent group and merge the services
mergeSubgroups(configuredServices, mergedGroup);
} else unsortedGroups.push(mergedGroup);
} else if (configuredGroup.parent) {
// this is a nested group, so find the parent group and merge the services
mergeSubgroups(configuredServices, mergedGroup);
} else {
unsortedGroups.push(mergedGroup);
}
Expand Down
10 changes: 5 additions & 5 deletions src/utils/config/service-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export async function servicesFromKubernetes() {
.then((response) => response.body)
.catch((error) => {
logger.error("Error getting ingresses: %d %s %s", error.statusCode, error.body, error.response);
logger.debug(error);
if (error) logger.debug(error);
return null;
});

Expand All @@ -232,7 +232,7 @@ export async function servicesFromKubernetes() {
error.body,
error.response,
);
logger.debug(error);
if (error) logger.debug(error);
}

return [];
Expand All @@ -249,7 +249,7 @@ export async function servicesFromKubernetes() {
error.body,
error.response,
);
logger.debug(error);
if (error) logger.debug(error);
}

return [];
Expand Down Expand Up @@ -319,7 +319,7 @@ export async function servicesFromKubernetes() {
constructedService = JSON.parse(substituteEnvironmentVars(JSON.stringify(constructedService)));
} catch (e) {
logger.error("Error attempting k8s environment variable substitution.");
logger.debug(e);
if (e) logger.debug(e);
}

return constructedService;
Expand Down Expand Up @@ -703,7 +703,7 @@ export function findGroupByName(groups, name) {
} else if (group.groups) {
const foundGroup = findGroupByName(group.groups, name);
if (foundGroup) {
foundGroup.parent = group;
foundGroup.parent = group.name;
return foundGroup;
}
}
Expand Down

0 comments on commit cc6fe63

Please sign in to comment.