From 26de92d359e3ca854d5f240446918dbb3b17b0b8 Mon Sep 17 00:00:00 2001 From: Abdullah Yildirim Date: Tue, 9 Apr 2024 13:47:40 -0400 Subject: [PATCH] chore: update server info field name (#116) Signed-off-by: a3hadi --- pkg/info/server_info_test.go | 10 +++++----- pkg/info/types.go | 13 +++++++------ pkg/shared/util.go | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/pkg/info/server_info_test.go b/pkg/info/server_info_test.go index c10e66d5..75fdde1f 100644 --- a/pkg/info/server_info_test.go +++ b/pkg/info/server_info_test.go @@ -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) diff --git a/pkg/info/types.go b/pkg/info/types.go index fcbd7d1a..2711e498 100644 --- a/pkg/info/types.go +++ b/pkg/info/types.go @@ -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"` } diff --git a/pkg/shared/util.go b/pkg/shared/util.go index 751327d9..ad4cb9e7 100644 --- a/pkg/shared/util.go +++ b/pkg/shared/util.go @@ -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 }