Skip to content

Commit 486fba0

Browse files
Merge pull request #5988 from nimrod-becker/backport_to_5_4
Backport to 5.4
2 parents 4fe9f33 + 8a86507 commit 486fba0

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

src/deploy/NVA_build/NooBaa.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ENV ENDPOINT_NODE_OPTIONS ''
5757
# Size: ~ 379 MB
5858
# Cache: Rebuild when we adding/removing requirments
5959
##############################################################
60-
# RUN dnf install -y -q bash \
60+
6161
RUN dnf install -y -q bash \
6262
lsof \
6363
openssl \

src/deploy/NVA_build/Tests.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ COPY ./src/deploy/NVA_build/set_mongo_repo.sh /tmp/
1818
RUN chmod +x /tmp/set_mongo_repo.sh && \
1919
/bin/bash -xc "/tmp/set_mongo_repo.sh"
2020

21-
RUN dnf install -y -q vim \
21+
RUN dnf install -y -q --nogpgcheck vim \
2222
mongodb-org-3.6.3 \
2323
mongodb-org-server-3.6.3 \
2424
mongodb-org-shell-3.6.3 \

src/server/system_services/system_server.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -985,30 +985,36 @@ async function update_endpoint_group(req) {
985985
.some(group => group.name === group_name);
986986

987987
if (exists) {
988+
const group = cluster.endpoint_groups.find(grp => grp.name === group_name);
988989
if (!_.isUndefined(is_remote)) {
989-
const group = cluster.endpoint_groups.find(grp => grp.name === group_name);
990990
if (group.is_remote !== is_remote) {
991991
// We do not throw in order to not fail the noobaa operator.
992992
dbg.warn('update_endpoint_group: Conflicted is_remote value of ',
993993
is_remote, ' for group: ', group, ' - aborting request');
994994
return;
995995
}
996+
996997
}
997998

998-
await system_store.make_changes({
999-
update: {
1000-
clusters: [{
1001-
$find: {
1002-
_id: cluster._id,
1003-
'endpoint_groups.name': group_name
1004-
},
1005-
$set: {
1006-
'endpoint_groups.$.region': region,
1007-
'endpoint_groups.$.endpoint_range': endpoint_range
1008-
}
1009-
}]
1010-
}
1011-
});
999+
// call make_changes only if there are actual changes to make.
1000+
// this check fixes a bug where make_changes sends a load_system_store notification
1001+
// to the operator, which in its own reconcile sends back update_endpoint_group, and so forth
1002+
if (group.region !== region || !_.isEqual(group.endpoint_range, endpoint_range)) {
1003+
await system_store.make_changes({
1004+
update: {
1005+
clusters: [{
1006+
$find: {
1007+
_id: cluster._id,
1008+
'endpoint_groups.name': group_name
1009+
},
1010+
$set: {
1011+
'endpoint_groups.$.region': region,
1012+
'endpoint_groups.$.endpoint_range': endpoint_range
1013+
}
1014+
}]
1015+
}
1016+
});
1017+
}
10121018

10131019
} else {
10141020
await system_store.make_changes({

0 commit comments

Comments
 (0)