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 check for version to contain scheduler. #1417

Merged
merged 1 commit into from
Jul 6, 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
6 changes: 5 additions & 1 deletion pkg/standalone/standalone.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ func isSchedulerIncluded(runtimeVersion string) (bool, error) {
return false, err
}

return c.Check(v), nil
vNoPrerelease, err := v.SetPrerelease("")
if err != nil {
return false, err
}
return c.Check(&vNoPrerelease), nil
}

// Init installs Dapr on a local machine using the supplied runtimeVersion.
Expand Down
22 changes: 22 additions & 0 deletions pkg/standalone/standalone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,25 @@ func TestInitLogActualContainerRuntimeName(t *testing.T) {
})
}
}

func TestIsSchedulerIncluded(t *testing.T) {
scenarios := []struct {
version string
isIncluded bool
}{
{"1.13.0-rc.1", false},
{"1.13.0", false},
{"1.13.1", false},
{"1.14.0", true},
{"1.14.0-rc.1", true},
{"1.14.0-mycompany.1", true},
{"1.14.1", true},
}
for _, scenario := range scenarios {
t.Run("isSchedulerIncludedIn"+scenario.version, func(t *testing.T) {
included, err := isSchedulerIncluded(scenario.version)
assert.NoError(t, err)
assert.Equal(t, scenario.isIncluded, included)
})
}
}
Loading