Skip to content

Commit

Permalink
Display an error message on edition mismatch
Browse files Browse the repository at this point in the history
This change will show a warning when setting up a commercial edition but
connecting to a raw one, or when setting a raw edition and connecting to
a commercial one. In the last case the message warns about some
unavailable functionality unless commercial editions is selected
  • Loading branch information
lpetrora committed Oct 19, 2023
1 parent cc59510 commit 6daafee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/backend/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@ export default class RestApiBackend implements Backend {
`Checkmk version 2.1.0 has been detected, but this plugin is configured to use version 2.2.0 and above. Please set the backend option to '< 2.2'.`
);
}
if (this.datasource.getEdition() === 'CEE' && result.data.edition === 'raw') {
if (this.datasource.getEdition() !== 'RAW' && result.data.edition === 'cre') {
throw new Error(
'The data source specified the Checkmk Enterprise Edition, but Checkmk Raw Edition was detected. Please choose the raw edition in the data source settings.'
'The data source specified the Checkmk commercial editions, but Checkmk Raw Edition was detected. Choose the raw edition in the data source settings.'
);
}
if (this.datasource.getEdition() === 'RAW' && result.data.edition !== 'cre') {
throw new Error(
'The data source specified the Checkmk Raw Edition, but a Checkmk commercial edition was detected. Some functionality may not be available. Choose commercial editions in the data source settings to enable all features.'
);
}
// The REST API would be ok with other users, but the autocompleter are not
Expand Down

0 comments on commit 6daafee

Please sign in to comment.