Skip to content

Commit

Permalink
Merge pull request #4026 from mendersoftware/cherry-3.6.x-fix/tags-re…
Browse files Browse the repository at this point in the history
…trieval

[Cherry 3.6.x]: fix: realigned hosted checking with passed environment info
  • Loading branch information
mzedel authored Sep 8, 2023
2 parents 2afcaab + 23e614f commit 84774cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ -n "$GATEWAY_PORT" ]; then
HOSTNAME=$HOSTNAME':'$GATEWAY_PORT
fi

if [ -n "$MENDER_HOSTED" ]; then
if [ -n "$STRIPE_API_KEY" ]; then
wget -O /var/www/mender-gui/dist/tags.json https://api.github.com/repos/mendersoftware/gui/tags?per_page=10
else
echo "[]" >> /var/www/mender-gui/dist/tags.json
Expand All @@ -40,8 +40,7 @@ cat >/var/www/mender-gui/dist/env.js <<EOF
hasMultitenancy: "$HAVE_MULTITENANT",
hasReleaseTags: "$HAVE_RELEASE_TAGS",
hasReporting: "$HAVE_REPORTING",
isEnterprise: "$HAVE_ENTERPRISE",
isHosted: "$MENDER_HOSTED"
isEnterprise: "$HAVE_ENTERPRISE"
},
trackerCode: "$TRACKER_CODE",
recaptchaSiteKey: "$RECAPTCHA_SITE_KEY",
Expand Down
4 changes: 2 additions & 2 deletions src/js/actions/appActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const parseEnvironmentInfo = () => (dispatch, getState) => {
};
environmentFeatures = {
...featureFlags.reduce((accu, flag) => ({ ...accu, [flag]: stringToBoolean(features[flag]) }), {}),
isHosted: stringToBoolean(features.isHosted) || window.location.hostname.includes('hosted.mender.io'),
isHosted: window.location.hostname.includes('hosted.mender.io'),
isDemoMode: stringToBoolean(isDemoMode || features.isDemoMode)
};
versionInfo = {
Expand Down Expand Up @@ -301,7 +301,7 @@ const repoKeyMap = {
};

const deductSaasState = (latestRelease, guiTags, saasReleases) => {
const latestGuiTag = guiTags[0].name;
const latestGuiTag = guiTags.length ? guiTags[0].name : '';
const latestSaasRelease = latestGuiTag.startsWith('saas-v') ? { date: latestGuiTag.split('-v')[1].replaceAll('.', '-'), tag: latestGuiTag } : saasReleases[0];
return latestSaasRelease.date > latestRelease.release_date ? latestSaasRelease.tag : latestRelease.release;
};
Expand Down

0 comments on commit 84774cf

Please sign in to comment.