Skip to content

Commit

Permalink
Merge pull request #54 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.10.3
  • Loading branch information
andyone authored Apr 1, 2024
2 parents 48183ea + 043b16e commit 887f25a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 54 deletions.
69 changes: 34 additions & 35 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (

const (
APP = "RDS"
VER = "1.10.2"
VER = "1.10.3"
DESC = "Tool for Redis orchestration"
)

Expand All @@ -63,23 +63,23 @@ const EMPTY_RESULT = "-none-"

// Command line options list
const (
OPT_PRIVATE = "p:private"
OPT_EXTRA = "x:extra"
OPT_TAGS = "t:tags"
OPT_FORMAT = "f:format"
OPT_SECURE = "s:secure"
OPT_DISABLE_SAVES = "ds:disable-saves"
OPT_YES = "y:yes"
OPT_PAGER = "P:pager"
OPT_SIMPLE = "S:simple"
OPT_RAW = "R:raw"
OPT_NO_COLOR = "nc:no-color"
OPT_HELP = "h:help"
OPT_VERSION = "v:version"
OPT_VERBOSE_VERSION = "vv:verbose-version"
OPT_PRIVATE = "p:private"
OPT_EXTRA = "x:extra"
OPT_TAGS = "t:tags"
OPT_FORMAT = "f:format"
OPT_SECURE = "s:secure"
OPT_DISABLE_SAVES = "ds:disable-saves"
OPT_YES = "y:yes"
OPT_PAGER = "P:pager"
OPT_SIMPLE = "S:simple"
OPT_RAW = "R:raw"
OPT_NO_COLOR = "nc:no-color"
OPT_HELP = "h:help"
OPT_VERSION = "v:version"

OPT_GENERATE_MAN = "generate-man"
OPT_COMPLETION = "completion"
OPT_VERBOSE_VERSION = "vv:verbose-version"
OPT_GENERATE_MAN = "generate-man"
OPT_COMPLETION = "completion"
)

// Supported commands
Expand Down Expand Up @@ -190,23 +190,23 @@ type CommandRoutine struct {

// optMap is map with options data
var optMap = options.Map{
OPT_PRIVATE: {Type: options.BOOL},
OPT_EXTRA: {Type: options.BOOL},
OPT_TAGS: {},
OPT_FORMAT: {},
OPT_SECURE: {Type: options.BOOL},
OPT_DISABLE_SAVES: {Type: options.BOOL},
OPT_PAGER: {Type: options.BOOL},
OPT_SIMPLE: {Type: options.BOOL},
OPT_RAW: {Type: options.BOOL},
OPT_YES: {Type: options.BOOL},
OPT_NO_COLOR: {Type: options.BOOL},
OPT_HELP: {Type: options.BOOL},
OPT_VERSION: {Type: options.MIXED},
OPT_VERBOSE_VERSION: {Type: options.BOOL},
OPT_PRIVATE: {Type: options.BOOL},
OPT_EXTRA: {Type: options.BOOL},
OPT_TAGS: {},
OPT_FORMAT: {},
OPT_SECURE: {Type: options.BOOL},
OPT_DISABLE_SAVES: {Type: options.BOOL},
OPT_PAGER: {Type: options.BOOL},
OPT_SIMPLE: {Type: options.BOOL},
OPT_RAW: {Type: options.BOOL},
OPT_YES: {Type: options.BOOL},
OPT_NO_COLOR: {Type: options.BOOL},
OPT_HELP: {Type: options.BOOL},
OPT_VERSION: {Type: options.MIXED},

OPT_GENERATE_MAN: {Type: options.BOOL},
OPT_COMPLETION: {},
OPT_VERBOSE_VERSION: {Type: options.BOOL},
OPT_GENERATE_MAN: {Type: options.BOOL},
OPT_COMPLETION: {},
}

// aliases is map [alias → command]
Expand Down Expand Up @@ -1287,12 +1287,11 @@ func genAbout(gitRev string) *usage.About {
License: "Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>",
Owner: "ESSENTIAL KAOS",
BugTracker: "https://kaos.sh/rds",

UpdateChecker: usage.UpdateChecker{"essentialkaos/rds", update.GitHubChecker},
}

if gitRev != "" {
about.Build = "git:" + gitRev
about.UpdateChecker = usage.UpdateChecker{"essentialkaos/rds", update.GitHubChecker}
}

return about
Expand Down
9 changes: 7 additions & 2 deletions common/rds.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Summary: Redis orchestration tool
Name: rds
Version: 1.10.2
Version: 1.10.3
Release: 0%{?dist}
Group: Applications/System
License: Apache License, Version 2.0
Expand All @@ -36,7 +36,7 @@ Tool for Redis orchestration.

%package sync
Summary: RDS Sync daemon
Version: 1.3.5
Version: 1.3.6
Release: 0%{?dist}
Group: Applications/System

Expand Down Expand Up @@ -186,6 +186,11 @@ systemctl daemon-reload &>/dev/null || :
################################################################################

%changelog
* Sat Mar 30 2024 Anton Novojilov <[email protected]> - 1.10.3-0
- [sync] Improved systemd support
- Code refactoring
- Dependencies update

* Fri Mar 22 2024 Anton Novojilov <[email protected]> - 1.10.2-0
- [cli] Fixed bug with checking keepalived status while changing node role
- [sync] Fixed bug with updating instances states on minion
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/essentialkaos/rds
go 1.20

require (
github.com/essentialkaos/ek/v12 v12.110.1
github.com/essentialkaos/ek/v12 v12.113.1
github.com/essentialkaos/go-linenoise/v3 v3.4.0
github.com/essentialkaos/redy/v4 v4.4.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk=
github.com/essentialkaos/depsy v1.1.0 h1:U6dp687UkQwXlZU17Hg2KMxbp3nfZAoZ8duaeUFYvJI=
github.com/essentialkaos/depsy v1.1.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8=
github.com/essentialkaos/ek/v12 v12.110.1 h1:hoUVzw8sg5kAF/hs2b6PDqLh2vx0aN8nvFlD33q224k=
github.com/essentialkaos/ek/v12 v12.110.1/go.mod h1:SslW97Se34YQKc08Ume2V/8h/HPTgLS1+Iok64cNF/U=
github.com/essentialkaos/ek/v12 v12.113.1 h1:3opV9dwRpIQq1fqg5mkaSEt6ogECL4VLzrH/829qeYg=
github.com/essentialkaos/ek/v12 v12.113.1/go.mod h1:SslW97Se34YQKc08Ume2V/8h/HPTgLS1+Iok64cNF/U=
github.com/essentialkaos/go-linenoise/v3 v3.4.0 h1:g72w8x+/HIwOMBVvNaPYp+wMWVHrYZwzFAF7OfZR5Ts=
github.com/essentialkaos/go-linenoise/v3 v3.4.0/go.mod h1:t1kNLY2bSMQCy1JXOefD2BDLs/TTPMtTv3DFNV5uDSI=
github.com/essentialkaos/redy/v4 v4.4.0 h1:6r6AkZiDkFWPqnvl0M+u7mcaaWQaeeiZOoLqLAMcnzQ=
Expand Down
27 changes: 13 additions & 14 deletions sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"fmt"
"os"
"runtime"
"strings"

"github.com/essentialkaos/ek/v12/fmtc"
"github.com/essentialkaos/ek/v12/log"
Expand All @@ -37,7 +36,7 @@ import (

const (
APP = "RDS Sync"
VER = "1.3.5"
VER = "1.3.6"
DESC = "Syncing daemon for RDS"
)

Expand All @@ -48,12 +47,12 @@ const CONFIG_FILE = "/etc/rds.knf"

// Command line options
const (
OPT_NO_COLOR = "nc:no-color"
OPT_HELP = "h:help"
OPT_VERSION = "v:version"
OPT_VERBOSE_VERSION = "vv:verbose-version"
OPT_NO_COLOR = "nc:no-color"
OPT_HELP = "h:help"
OPT_VERSION = "v:version"

OPT_GENERATE_MAN = "generate-man"
OPT_VERBOSE_VERSION = "vv:verbose-version"
OPT_GENERATE_MAN = "generate-man"
)

// Exit codes
Expand All @@ -66,12 +65,12 @@ const (

// optMap is map with options data
var optMap = options.Map{
OPT_NO_COLOR: {Type: options.BOOL},
OPT_HELP: {Type: options.BOOL},
OPT_VERSION: {Type: options.MIXED},
OPT_VERBOSE_VERSION: {Type: options.BOOL},
OPT_NO_COLOR: {Type: options.BOOL},
OPT_HELP: {Type: options.BOOL},
OPT_VERSION: {Type: options.MIXED},

OPT_GENERATE_MAN: {Type: options.BOOL},
OPT_VERBOSE_VERSION: {Type: options.BOOL},
OPT_GENERATE_MAN: {Type: options.BOOL},
}

// colors for usage info
Expand Down Expand Up @@ -113,7 +112,7 @@ func Init(gitRev string, gomod []byte) {
setupLogger()

req.Global.SetUserAgent("RDS-Sync", VER)
log.Aux(strings.Repeat("-", 88))
log.Divider()

validateConfig()
checkVirtualIP()
Expand All @@ -132,7 +131,7 @@ func Init(gitRev string, gomod []byte) {

// preConfigureUI configure user interface
func preConfigureUI() {
if !tty.IsTTY() {
if !tty.IsTTY() || tty.IsSystemd() {
fmtc.DisableColors = true
}

Expand Down

0 comments on commit 887f25a

Please sign in to comment.