Skip to content

Commit

Permalink
chore: update server info field name (#116)
Browse files Browse the repository at this point in the history
Signed-off-by: a3hadi <[email protected]>
  • Loading branch information
ayildirim21 authored Apr 9, 2024
1 parent 100a9a4 commit 26de92d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
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

0 comments on commit 26de92d

Please sign in to comment.