-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to use NATS v2 image by default
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
- Loading branch information
Showing
8 changed files
with
76 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package versionCheck | ||
|
||
import ( | ||
"strconv" | ||
"strings" | ||
) | ||
|
||
const ( | ||
// OldNatsBinaryPath is the path to the NATS binary inside the | ||
// main container, before NATS Server v2. | ||
OldNatsBinaryPath = "/gnatsd" | ||
|
||
// NatsBinaryPath after v2 release. | ||
NatsBinaryPath = "/nats-server" | ||
) | ||
|
||
func ServerBinaryPath(version string) string { | ||
v := strings.Split(version, ".") | ||
if len(v) > 0 { | ||
majorVersion, err := strconv.Atoi(v[0]) | ||
if err != nil { | ||
return NatsBinaryPath | ||
} | ||
if majorVersion < 2 { | ||
return OldNatsBinaryPath | ||
} | ||
} | ||
return NatsBinaryPath | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters