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: update server info field name #116

Merged
merged 3 commits into from
Apr 9, 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
10 changes: 5 additions & 5 deletions pkg/info/server_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func Test_Read_Write(t *testing.T) {
filepath := os.TempDir() + "/server-info"
defer os.Remove(filepath)
info := &ServerInfo{
Protocol: TCP,
Language: Java,
MinimumClientVersion: MinimumClientVersion,
Version: "11",
Metadata: map[string]string{"key1": "value1", "key2": "value2"},
Protocol: TCP,
Language: Java,
MinimumNumaflowVersion: MinimumNumaflowVersion,
Version: "11",
Metadata: map[string]string{"key1": "value1", "key2": "value2"},
}
err := Write(info, WithServerInfoFilePath(filepath))
assert.NoError(t, err)
Expand Down
13 changes: 7 additions & 6 deletions pkg/info/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ const (
Java Language = "java"
)

const MinimumClientVersion = ">= 1.2.0-0"
// MinimumNumaflowVersion specifies the minimum Numaflow version required by the current SDK version
const MinimumNumaflowVersion = "1.2.0-0"

// ServerInfo is the information about the server
type ServerInfo struct {
Protocol Protocol `json:"protocol"`
Language Language `json:"language"`
MinimumClientVersion string `json:"minimumClientVersion"`
Version string `json:"version"`
Metadata map[string]string `json:"metadata"`
Protocol Protocol `json:"protocol"`
Language Language `json:"language"`
MinimumNumaflowVersion string `json:"minimum_numaflow_version"`
Version string `json:"version"`
Metadata map[string]string `json:"metadata"`
}
2 changes: 1 addition & 1 deletion pkg/shared/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const (
func PrepareServer(sockAddr string, infoFilePath string) (net.Listener, error) {
// If infoFilePath is not empty, write the server info to the file.
if infoFilePath != "" {
serverInfo := &info.ServerInfo{Protocol: info.UDS, Language: info.Go, MinimumClientVersion: info.MinimumClientVersion, Version: info.GetSDKVersion()}
serverInfo := &info.ServerInfo{Protocol: info.UDS, Language: info.Go, MinimumNumaflowVersion: info.MinimumNumaflowVersion, Version: info.GetSDKVersion()}
if err := info.Write(serverInfo, info.WithServerInfoFilePath(infoFilePath)); err != nil {
return nil, err
}
Expand Down
Loading