Skip to content

Commit 05b184f

Browse files
committed
don't attempt to parse the minimum compiler version from the runtime enumeration
1 parent a521b9a commit 05b184f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

aws_lambda_builders/workflows/go_modules/validator.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@ def validate(self, runtime_path):
5252

5353
runtime_path = super(GoRuntimeValidator, self).validate(runtime_path)
5454

55-
expected_major_version = int(self.runtime.replace(self.LANGUAGE, "").split(".")[0])
56-
min_expected_minor_version = 11 if expected_major_version == 1 else 0
55+
5756

5857
p = subprocess.Popen([runtime_path, "version"], cwd=os.getcwd(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
5958
version_string, _ = p.communicate()
6059

6160
if p.returncode == 0:
6261
major_version, minor_version = GoRuntimeValidator.get_go_versions(version_string.decode())
63-
if major_version == expected_major_version and minor_version >= min_expected_minor_version:
62+
min_expected_major_version = 1
63+
min_expected_minor_version = 11 if major_version == 1 else 0
64+
if major_version >= min_expected_major_version and minor_version >= min_expected_minor_version:
6465
self._valid_runtime_path = runtime_path
6566
return self._valid_runtime_path
6667

aws_lambda_builders/workflows/go_modules/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ def __init__(
3535
self.actions = [GoModulesBuildAction(source_dir, output_path, builder)]
3636

3737
def get_validators(self):
38-
return [GoRuntimeValidator(runtime="go1.x", architecture=self.architecture)]
38+
return [GoRuntimeValidator(runtime=self.runtime, architecture=self.architecture)]

0 commit comments

Comments
 (0)