WIP: adm: Allow to use local-dump from every command #1511

Draft
fyrchik wants to merge 2 commits from fyrchik/frostfs-node:adm-improve into master
Owner

Currently, we allow using --local-dump in morph init command.
We also have this flag in other commands, but no --protocol which is
also needed. And in new command we do not have the ability to use local
dump at all.

This commit makes it possible to work either with an RPC or with
local-dump in every command.

Refs #1035.
Refs TrueCloudLab/frostfs-dev-env#42.

Writing gopatch this time was really satisfying, btw:

@@
var flags expression
@@
-flags.StringP(commonflags.EndpointFlag, ...)
+commonflags.InitRPC(flags)

@@
var flags expression
@@
-_ = viper.BindPFlag(commonflags.EndpointFlag, flags.Lookup(...))
+commonflags.BindRPC(flags)
Currently, we allow using `--local-dump` in `morph init` command. We also have this flag in other commands, but no `--protocol` which is also needed. And in new command we do not have the ability to use local dump at all. This commit makes it possible to work either with an RPC or with local-dump in every command. Refs #1035. Refs TrueCloudLab/frostfs-dev-env#42. Writing gopatch this time was really satisfying, btw: ``` @@ var flags expression @@ -flags.StringP(commonflags.EndpointFlag, ...) +commonflags.InitRPC(flags) @@ var flags expression @@ -_ = viper.BindPFlag(commonflags.EndpointFlag, flags.Lookup(...)) +commonflags.BindRPC(flags) ```
fyrchik added 3 commits 2024-11-20 11:32:30 +00:00
adm: Move ProtoConfigPath from constants to commonflags package
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 1m48s
DCO action / DCO (pull_request) Failing after 2m14s
Vulncheck / Vulncheck (pull_request) Successful in 2m34s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m44s
Build / Build Components (pull_request) Successful in 3m8s
Tests and linters / gopls check (pull_request) Successful in 3m13s
Tests and linters / Staticcheck (pull_request) Successful in 3m33s
Tests and linters / Lint (pull_request) Successful in 4m17s
Tests and linters / Tests (pull_request) Successful in 4m57s
Tests and linters / Tests with -race (pull_request) Successful in 6m36s
70f77a53d9
Refs #932

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
adm: Allow to use --local-dump everywhere --rpc-endpoint is present
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 2m37s
DCO action / DCO (pull_request) Failing after 2m53s
Build / Build Components (pull_request) Successful in 4m9s
Tests and linters / Staticcheck (pull_request) Successful in 4m15s
Pre-commit hooks / Pre-commit (pull_request) Successful in 5m0s
Vulncheck / Vulncheck (pull_request) Successful in 4m54s
Tests and linters / Lint (pull_request) Successful in 5m7s
Tests and linters / gopls check (pull_request) Successful in 6m27s
Tests and linters / Tests (pull_request) Successful in 8m21s
Tests and linters / Tests with -race (pull_request) Successful in 8m28s
39e3339df6
Currently, we allow using `--local-dump` in `morph init` command.
We also have this flag in other commands, but no `--protocol` which is
also needed. And in new command we do not have the ability to use local
dump at all.

This commit makes it possible to work either with an RPC or with
local-dump in every command.

Refs #1035.
Refs TrueCloudLab/frostfs-dev-env#42.

Writing gopatch this time was really satisfying, btw:
```
@@
var flags expression
@@

-flags.StringP(commonflags.EndpointFlag, ...)
+commonflags.InitRPC(flags)

@@
var flags expression
@@
-_ = viper.BindPFlag(commonflags.EndpointFlag, flags.Lookup(...))
+commonflags.BindRPC(flags)
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
fyrchik force-pushed adm-improve from 39e3339df6 to 08f197c905 2024-11-20 11:32:50 +00:00 Compare
fyrchik requested review from storage-core-committers 2024-11-20 11:32:50 +00:00
fyrchik requested review from storage-core-developers 2024-11-20 11:32:53 +00:00
fyrchik force-pushed adm-improve from 08f197c905 to 53c2a96258 2024-11-20 11:38:06 +00:00 Compare
fyrchik force-pushed adm-improve from 53c2a96258 to e82f79b0a8 2024-11-20 11:38:39 +00:00 Compare
fyrchik changed title from adm: Allow to use local-dump from every command to WIP: adm: Allow to use local-dump from every command 2024-11-20 11:40:35 +00:00
dstepanov-yadro approved these changes 2024-11-20 12:27:54 +00:00
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 3m21s
Required
Details
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m10s
Required
Details
Tests and linters / Tests (pull_request) Successful in 4m16s
Required
Details
DCO action / DCO (pull_request) Failing after 4m29s
Required
Details
Vulncheck / Vulncheck (pull_request) Successful in 5m44s
Required
Details
Tests and linters / Tests with -race (pull_request) Successful in 6m13s
Required
Details
Build / Build Components (pull_request) Successful in 6m23s
Required
Details
Tests and linters / Staticcheck (pull_request) Successful in 6m25s
Required
Details
Tests and linters / gopls check (pull_request) Successful in 6m27s
Required
Details
Tests and linters / Lint (pull_request) Successful in 7m27s
Required
Details
This pull request has changes conflicting with the target branch.
  • cmd/frostfs-adm/internal/modules/morph/initialize/root.go
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u adm-improve:fyrchik-adm-improve
git checkout fyrchik-adm-improve
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1511
No description provided.