-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: check version compatibility with core #236
Conversation
const coreVersion = request.headers['x-version'] | ||
const countryConfigVersion = process.env.npm_package_version | ||
if ( | ||
coreVersion && | ||
coreVersion !== 'undefined' && | ||
countryConfigVersion && | ||
countryConfigVersion !== 'undefined' && | ||
coreVersion !== countryConfigVersion | ||
) { | ||
const errorMessage = `Version mismatch!! Opencrvs-Core is running on: ${coreVersion}, Opencrvs-Countryconfig is running on: ${countryConfigVersion}` | ||
console.error(errorMessage) | ||
return h.response({ message: errorMessage }).code(426).takeover() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const coreVersion = request.headers['x-version'] | |
const countryConfigVersion = process.env.npm_package_version | |
if ( | |
coreVersion && | |
coreVersion !== 'undefined' && | |
countryConfigVersion && | |
countryConfigVersion !== 'undefined' && | |
coreVersion !== countryConfigVersion | |
) { | |
const errorMessage = `Version mismatch!! Opencrvs-Core is running on: ${coreVersion}, Opencrvs-Countryconfig is running on: ${countryConfigVersion}` | |
console.error(errorMessage) | |
return h.response({ message: errorMessage }).code(426).takeover() | |
} |
I'm thinking we could make an assumption here that the client is always up to date as its core's responsibility to verify it. One of our design goals is to hide country config completely behind gateway which would also eliminate this issue
closing this in favor of previous comment |
No description provided.