Skip to content
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

Fixes #12950: We don't correctly check plugin version to see if we need to disable it during upgrade #1614

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 11 additions & 9 deletions rudder-server-relay/SOURCES/rudder-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,6 @@ def package_check(metadata):
name = metadata['name']
if 'version' not in metadata:
fail("Package version undefined")
# version check
match = re.match(r'(\d+\.\d+)-(\d+)\.(\d+)', metadata['version'])
if not match:
fail("Invalid package version " + metadata['version'])
rudder_version = match.group(1)
major_version = match.group(2)
minor_version = match.group(3)
if rudder_version != RUDDER_VERSION:
fail("Package not compatible with current Rudder version")
# incompatibility check
if metadata['type'] == 'plugin':
if not check_plugin_compatibility(metadata):
Expand All @@ -163,6 +154,17 @@ def package_check(metadata):


def check_plugin_compatibility(metadata):
# check that the given version is compatible with Rudder one
match = re.match(r'(\d+\.\d+)-(\d+)\.(\d+)', metadata['version'])
if not match:
fail("Invalid package version " + metadata['version'])
rudder_version = match.group(1)
major_version = match.group(2)
minor_version = match.group(3)
if rudder_version != RUDDER_VERSION:
print("Package '"+ metadata['name'] +"' is not compatible with current version of rudder")
return False
# check specific constraints
full_name = metadata['name'] + '-' + metadata['version']
if full_name in COMPATIBILITY_DB['incompatibles']:
return False
Expand Down