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

Fix Docker tag logic to prevent undefined in dev tag #3524

Merged
merged 6 commits into from
Jan 16, 2024
Merged

Conversation

busma13
Copy link
Contributor

@busma13 busma13 commented Jan 12, 2024

This PR makes the following changes:

  • Pass in the node version to getDevDockerImage - this fixes the undefined, but results in the node version being added to the tag twice.
  • Automatically add node suffix to all tags.
  • Create removeNodeSuffixFromTag function. This turns something like v0.91.0-nodev18.18.2 into v0.91.0.
  • Add checks for options.nodeSuffix and removes the tag if false.

I chose to add the node suffix by default to make the transition simple when we decide that having a tag without a node suffix will never be necessary. At that point we can update formatDailyTag() to take nodeVersion as a parameter and update its test.

with node suffix:
daily         terascope/teraslice:daily-2024.01.12-fe31c87bf9f-nodev16.20.2
dev           terascope/teraslice:dev-local-nodev18.18.2
latest        terascope/teraslice:latest-nodev16.20.2
prerelease    terascope/teraslice:v0.91.1-rc.0-nodev16.20.2
tag           terascope/teraslice:v0.91.0-nodev18.18.2

without node suffix:
daily         terascope/teraslice:daily-2024.01.12-fe31c87bf9f
dev           terascope/teraslice:dev-local
latest        terascope/teraslice:latest
prerelease    terascope/teraslice:v0.91.1-rc.0
tag           terascope/teraslice:v0.91.0

@busma13 busma13 requested review from sotojn and godber January 12, 2024 21:28
@busma13 busma13 marked this pull request as ready for review January 12, 2024 21:35
});

it('should not modify a tag without -nodev', async () => {
const tagBefore = 'v0.91.0-v18.18.2';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an actual case that would be encountered? v0.91.0-v18.18.2

If not what are more realistic cases that could be tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could test the daily tags: daily-2024.01.12-fe31c87bf9f and daily-2024.01.12-fe31c87bf9f-nodev16.20.2
This would test a tag with a hyphen in it.

@godber godber merged commit e646f9d into master Jan 16, 2024
39 checks passed
@godber godber deleted the dockerTagFix branch January 16, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants