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

allow for different args with conduit > 12 #53

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ssicard
Copy link

@ssicard ssicard commented Feb 26, 2025

Description

Conduit > 0.12 changed the formatting for args. Allow for different args on container creation to accommodate future upgrade.

Quick checks:

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

@ssicard ssicard marked this pull request as ready for review February 26, 2025 15:30
@ssicard ssicard requested a review from a team as a code owner February 26, 2025 15:30
// runtime container depending on the conduit version.
func ArgsByVersion(version string, pipelineFile string, connectorsPath string, dbPath string, processorsPath string) []string {
var args []string
if version < "v0.12.0" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this comparison work?;-)

Copy link
Author

Choose a reason for hiding this comment

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

I checked it in go playground and the unit tests worked

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, but this is true because the strings are compared lexically. Even though 'v0.12.0.' and 'v0.12' are the same the comparison will return one being larger. So while the comparison here holds true, this is a side effect because versions are made of increasing numbers. Using the semver pkg provides a deterministic comparison between any version string.

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense, updated to use the semver package for version comparison

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