Skip to content

Commit

Permalink
Sync from server repo (2220c12038e3)
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoYang0000 committed Sep 9, 2024
1 parent 7aac987 commit 13e80a7
Show file tree
Hide file tree
Showing 76 changed files with 2,292 additions and 546 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
# When changing this, be sure to update the version at:
# vertica/make/build-container/*Dockerfile
go-version: "1.20.13"
go-version: "1.22.5"

- name: Run unit tests
run: make vet lint test
Expand Down
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
default: help

# Note: This file and siblings are under github.com/vertica/vcluster/

##@ General

# The help target prints out all targets with their descriptions organized
Expand Down Expand Up @@ -47,14 +49,13 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)

GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
# Make sure that whenever changing this, you also change
# vertica/make/build-container/*Dockerfile
GOLANGCI_LINT_VER ?= 1.54.2
# see [sandbox]/__golint_version__.txt
GOLANGCI_LINT_VERSION ?= 1.56.0

.PHONY: golangci-lint $(GOLANGCI_LINT)
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint
$(GOLANGCI_LINT): $(LOCALBIN)
ifneq (${GOLANGCI_LINT_VER}, $(shell [ -f $(GOLANGCI_LINT) ] && $(GOLANGCI_LINT) version --format short 2>&1))
@echo "golangci-lint missing or not version '${GOLANGCI_LINT_VER}', downloading..."
curl --retry 10 --retry-max-time 1800 -sSfL "https://raw.githubusercontent.com/golangci/golangci-lint/v${GOLANGCI_LINT_VER}/install.sh" | sh -s -- -b ./bin "v${GOLANGCI_LINT_VER}"
ifneq (${GOLANGCI_LINT_VERSION}, $(shell [ -f $(GOLANGCI_LINT) ] && $(GOLANGCI_LINT) version --format short 2>&1))
@echo "golangci-lint missing or not version '${GOLANGCI_LINT_VERSION}', downloading..."
curl --retry 10 --retry-max-time 1800 -sSfL "https://raw.githubusercontent.com/golangci/golangci-lint/v${GOLANGCI_LINT_VERSION}/install.sh" | sh -s -- -b ./bin "v${GOLANGCI_LINT_VERSION}"
endif
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ We can use similar way to set up and call other vcluster-ops commands.


## Licensing
vcluster is open source code and is under the Apache 2.0 license. Please see `LICENSE` for details.
vcluster is open source and is under the Apache 2.0 license. Please see `LICENSE` for details.
28 changes: 25 additions & 3 deletions commands/cluster_command_launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const (
dataPathKey = "dataPath"
communalStorageLocationFlag = "communal-storage-location"
communalStorageLocationKey = "communalStorageLocation"
archiveNameFlag = "archive-name"
archiveNameKey = "archiveName"
ipv6Flag = "ipv6"
ipv6Key = "ipv6"
eonModeFlag = "eon-mode"
Expand Down Expand Up @@ -118,8 +120,18 @@ const (
targetPasswordFileKey = "targetPasswordFile"
targetConnFlag = "target-conn"
targetConnKey = "targetConn"
asyncFlag = "async"
asyncKey = "async"
sourceTLSConfigFlag = "source-tlsconfig"
sourceTLSConfigKey = "sourceTLSConfig"
tableOrSchemaNameFlag = "table-or-schema-name"
tableOrSchemaNameKey = "tableOrSchemaName"
includePatternFlag = "include-pattern"
includePatternKey = "includePattern"
excludePatternFlag = "exclude-pattern"
excludePatternKey = "excludePattern"
targetNamespaceFlag = "target-namespace"
targetNamespaceKey = "targetNamespace"
)

// flags to viper key map
Expand All @@ -146,11 +158,17 @@ var flagKeyMap = map[string]string{
verboseFlag: verboseKey,
outputFileFlag: outputFileKey,
sandboxFlag: sandboxKey,
archiveNameFlag: archiveNameKey,
targetDBNameFlag: targetDBNameKey,
targetHostsFlag: targetHostsKey,
targetUserNameFlag: targetUserNameKey,
targetPasswordFileFlag: targetPasswordFileKey,
asyncFlag: asyncKey,
sourceTLSConfigFlag: sourceTLSConfigKey,
tableOrSchemaNameFlag: tableOrSchemaNameKey,
includePatternFlag: includePatternKey,
excludePatternFlag: excludePatternKey,
targetNamespaceFlag: targetNamespaceKey,
}

// target database flags to viper key map
Expand Down Expand Up @@ -198,7 +216,10 @@ const (
showRestorePointsSubCmd = "show_restore_points"
installPkgSubCmd = "install_packages"
// hidden Cmds (for internal testing only)
promoteSandboxSubCmd = "promote_sandbox"
promoteSandboxSubCmd = "promote_sandbox"
createArchiveCmd = "create_archive"
saveRestorePointsSubCmd = "save_restore_point"
getDrainingStatusSubCmd = "get_draining_status"
)

// cmdGlobals holds global variables shared by multiple
Expand Down Expand Up @@ -562,9 +583,10 @@ func constructCmds() []*cobra.Command {
makeCmdReplication(),
makeCmdCreateConnection(),
// hidden cmds (for internal testing only)
makeCmdGetDrainingStatus(),
makeCmdPromoteSandbox(),

makeCmdCheckVClusterServerPid(),
makeCmdCreateArchive(),
makeCmdSaveRestorePoint(),
}
}

Expand Down
4 changes: 1 addition & 3 deletions commands/cmd_add_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ func (c *CmdAddNode) setLocalFlags(cmd *cobra.Command) {
&c.addNodeOptions.DepotSize,
"depot-size",
"",
util.GetEonFlagMsg("Size of depot in one of the following formats:\n"+
"integer{K|M|G|T}, where K is kilobytes, M is megabytes, G is gigabytes, and T is terabytes.\n"+
"integer%, which expresses the depot size as a percentage of the total disk size."),
util.GetEonFlagMsg(util.DepotFmtMsg+util.DepotSizeKMGTMsg+util.DepotSizeHint),
)
cmd.Flags().StringVar(
&c.nodeNameListStr,
Expand Down
3 changes: 1 addition & 2 deletions commands/cmd_add_subcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ func (c *CmdAddSubcluster) setLocalFlags(cmd *cobra.Command) {
&c.addSubclusterOptions.DepotSize,
"depot-size",
"",
util.GetEonFlagMsg("Size of depot in one of the following formats:\n"+
"integer{K|M|G|T}, where K is kilobytes, M is megabytes, G is gigabytes, and T is terabytes.\n"+
util.GetEonFlagMsg(util.DepotFmtMsg+util.DepotSizeKMGTMsg+
"integer%, which expresses the depot size as a percentage of the total disk size.\n"),
)
}
Expand Down
86 changes: 0 additions & 86 deletions commands/cmd_check_vcluster_server_pid.go

This file was deleted.

Loading

0 comments on commit 13e80a7

Please sign in to comment.