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

chore(docker): include python suffix tags on rc images #1194

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions extras/github/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,9 @@ def extract_pyver(filename):

tags = set()

# We don't want a tag with a python suffix for release-candidates
if is_release_candidate:
version = base_version
else:
version = base_version + '-' + suffix
tags.add(version)
# Always include -python{Version} suffix variant
version = base_version + '-' + suffix
tags.add(version)

if suffix == default_python:
tags.add(base_version)
Expand Down
15 changes: 10 additions & 5 deletions extras/github/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,14 @@ def test_release_candidate_non_default_python(self):
self.assertEqual(base_version, 'v0.53.0-rc.1')

output = prep_tags(os.environ, base_version, is_release_candidate)
version_with_python = f'{base_version}-python{NON_DEFAULT_PYTHON_VERSION}'

self.assertNotIn('slack-notification-version', output)
self.assertEqual(output['version'], base_version)
self.assertEqual(output['version'], version_with_python)
self.assertEqual(output['login-dockerhub'], 'true')
self.assertEqual(output['login-ghcr'], 'false')
self.assertEqual(output['tags'], 'dont-push--local-only')
self.assertEqual(output['push'], 'false')
self.assertEqual(output['tags'], f'mock_image:{version_with_python}')
self.assertEqual(output['push'], 'true')
self.assertEqual(output['dockerfile'], 'Dockerfile')

def test_release_candidate_default_python(self):
Expand All @@ -127,12 +128,16 @@ def test_release_candidate_default_python(self):
self.assertEqual(base_version, 'v0.53.0-rc.1')

output = prep_tags(os.environ, base_version, is_release_candidate)
version_with_python = f'{base_version}-python{DEFAULT_PYTHON_VERSION}'

self.assertEqual(output['slack-notification-version'], base_version)
self.assertEqual(output['version'], base_version)
self.assertEqual(output['version'], version_with_python)
self.assertEqual(output['login-dockerhub'], 'true')
self.assertEqual(output['login-ghcr'], 'false')
self.assertEqual(output['tags'], 'mock_image:v0.53.0-rc.1')
self.assertEqual(
set(output['tags'].split(',')),
{f'mock_image:{version_with_python}', 'mock_image:v0.53.0-rc.1'},
)
self.assertEqual(output['push'], 'true')
self.assertEqual(output['dockerfile'], 'Dockerfile')

Expand Down
Loading