Commit graph

215 commits

Author SHA1 Message Date
aac65001e5 [#1522] adm/frostfsid: Remove unreachable condition
All checks were successful
Vulncheck / Vulncheck (push) Successful in 2m35s
Tests and linters / Staticcheck (push) Successful in 2m52s
Tests and linters / Run gofumpt (push) Successful in 2m55s
Build / Build Components (push) Successful in 3m13s
Pre-commit hooks / Pre-commit (push) Successful in 3m15s
Tests and linters / gopls check (push) Successful in 3m53s
Tests and linters / Lint (push) Successful in 4m4s
Tests and linters / Tests (push) Successful in 4m21s
Tests and linters / Tests with -race (push) Successful in 4m59s
SendConsensusTx() modifies SendTxs field, if it is not the case, there
is a bug in code.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
1170370753 [#1522] adm/helper: Rename createSingleAccounts() -> getSingleAccounts()
It doesn't create any accounts, purely finds them in the wallet.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
9e275d44c8 [#1522] adm/helper: Unexport DefaultClientContext()
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
2469e0c683 [#1522] adm/helper: Remove NewActor() helper
It is used once, it is used only internally and it is single-statement.
I see no justification in having it as a separate function.
It introduces confusion, because we also have NewLocalActor().

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
a6ef4ab524 [#1522] adm/helper: Rename GetN3Client() -> NewRemoteClient()
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
49959c4166 [#1522] adm/helper: Unexport GetFrostfsIDAdmin()
It is used in `helper` package only, besides unit-tests.
Move unit-tests to the same package, where they belong.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
61ee1b5610 [#1522] adm: Simplify LocalClient.SendRawTransaction()
The old code was there before Copy() method was introduced.
It was also supposed to check errors, however, they are already checked
server-side.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
b10c954377 [#1522] adm: Split NewLocalClient() into functions
No functional changes.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
1605391628 [#1522] adm/helper: Simplify Client interface
Just reuse `actor.RPCActor`. No functional changes.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
b1766e47c7 [#1522] adm/helper: Remove unused GetCommittee() method from the Client interface
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
caa4253249 [#1522] adm: Remove unnecessary variable declaration
It is better to have small scope.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-26 08:13:35 +00:00
0e5524dac7 [#1515] adm: Print address in base58 format in morph ape get-admin
All checks were successful
Tests and linters / Run gofumpt (push) Successful in 1m45s
Pre-commit hooks / Pre-commit (push) Successful in 2m39s
Vulncheck / Vulncheck (push) Successful in 2m30s
Tests and linters / gopls check (push) Successful in 3m6s
Build / Build Components (push) Successful in 3m27s
Tests and linters / Staticcheck (push) Successful in 3m50s
Tests and linters / Lint (push) Successful in 4m43s
Tests and linters / Tests (push) Successful in 4m50s
Tests and linters / Tests with -race (push) Successful in 6m9s
Signed-off-by: George Bartolomey <george@bh4.ru>
2024-11-25 10:38:05 +00:00
99f9e59de9 [#1514] adm: Remove --alphabet-wallets flag from readonly commands
All checks were successful
Vulncheck / Vulncheck (push) Successful in 2m24s
Tests and linters / Run gofumpt (push) Successful in 3m1s
Pre-commit hooks / Pre-commit (push) Successful in 3m11s
Build / Build Components (push) Successful in 3m17s
Tests and linters / Staticcheck (push) Successful in 3m16s
Tests and linters / gopls check (push) Successful in 3m44s
Tests and linters / Lint (push) Successful in 3m57s
Tests and linters / Tests (push) Successful in 4m34s
Tests and linters / Tests with -race (push) Successful in 4m44s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-21 14:37:34 +00:00
256f96e252 [#1514] adm/nns: Rename getRPCClient() to nnsWriter()
Make it more specific and similar to nnsReader().

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-21 14:37:34 +00:00
e5ea95c045 [#1514] adm/nns: Do not return hash from getRPCClient()
It was unused and we employ better abstractions now.
gopatch:
```
@@
var a, b expression
@@
-a, b, _ := getRPCClient(...)
+a, b := getRPCClient(...)
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-21 14:37:34 +00:00
9073e555db [#1514] adm/nns: Do not create actor for readonly commands
`nns get-records` and `nns tokens` command do not need to sign anything,
so remove useless actor and use invoker directly.
`NewLocalActor()` is only used in `ape` and `nns` packages. `ape`
package seem to use it correctly, only when alphabet wallets are
provided, so no changes there.
Also, remove --alphabet-wallets flag from commands that do not need it.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-21 14:37:34 +00:00
2771fdb8c7 [#1514] adm/nns: Use nns.GetAllRecords() wrapper
It was not possible previously, because GetAllRecords() was not declared
safe in frostfs-contract.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-21 14:37:34 +00:00
2e2c62147d
[#1513] adm: Move ProtoConfigPath from constants to commonflags package
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 1m47s
DCO action / DCO (pull_request) Successful in 2m4s
Vulncheck / Vulncheck (pull_request) Successful in 2m41s
Pre-commit hooks / Pre-commit (pull_request) Successful in 3m2s
Build / Build Components (pull_request) Successful in 3m18s
Tests and linters / Staticcheck (pull_request) Successful in 3m31s
Tests and linters / gopls check (pull_request) Successful in 3m33s
Tests and linters / Lint (pull_request) Successful in 4m25s
Tests and linters / Tests (pull_request) Successful in 5m7s
Tests and linters / Tests with -race (pull_request) Successful in 6m23s
Tests and linters / Run gofumpt (push) Successful in 3m29s
Tests and linters / Staticcheck (push) Successful in 4m3s
Vulncheck / Vulncheck (push) Successful in 3m57s
Pre-commit hooks / Pre-commit (push) Successful in 4m11s
Build / Build Components (push) Successful in 4m33s
Tests and linters / gopls check (push) Successful in 4m53s
Tests and linters / Tests with -race (push) Successful in 5m15s
Tests and linters / Lint (push) Successful in 5m27s
Tests and linters / Tests (push) Successful in 10m1s
Refs #932

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-21 09:39:06 +03:00
a339b52a60 [#1501] adm: Refactor APE-chains managing subcommands
* Use `cmd/internal/common/ape` parser commands within `ape`
  subcommands
* Use flag names from `cmd/internal/common/ape

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-11-20 07:58:32 +00:00
ffe9906266 [#1501] cli: Move APE-chain parser methods to pkg/util
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-11-20 07:58:32 +00:00
ae31ef3602 [#1501] cli: Move PrintHumanReadableAPEChain to a common package
* Both `frostfs-cli` and `frostfs-adm` APE-related subcommands use
  `PrintHumanReadableAPEChain` to print a parsed APE-chain. So, it's
  more correct to have it in a common package over `frostfs-cli` and
  `frostfs-adm` folders.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-11-20 07:58:32 +00:00
9f4ce600ac
[#1505] adm: Allow to manage additional keys in frostfsid
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 1m29s
DCO action / DCO (pull_request) Successful in 1m56s
Vulncheck / Vulncheck (pull_request) Successful in 2m22s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m41s
Build / Build Components (pull_request) Successful in 2m58s
Tests and linters / gopls check (pull_request) Successful in 3m14s
Tests and linters / Staticcheck (pull_request) Successful in 3m16s
Tests and linters / Lint (pull_request) Successful in 4m2s
Tests and linters / Tests (pull_request) Successful in 4m47s
Tests and linters / Tests with -race (pull_request) Successful in 5m55s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-11-19 16:25:16 +03:00
d336f2d487 [#1393] adm: Make NewLocalActor receive accout name
* Some RPC-clients for contracts require different wallet account types.
  Since, `Policy` contract gets `consensus` accounts while `NNS` gets
  `committee` accounts.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-11-08 13:57:51 +00:00
7ac0852364 [#1459] .golangci.yml: Add intrange linter, fix issues
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-10-30 15:18:22 +00:00
07ce40e119 [#1430] adm/morph: Add NNS address display in 'deploy'
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-10-15 13:56:37 +00:00
42bf03e5cc
[#1411] adm/nns: Add 'delRecord'
All checks were successful
DCO action / DCO (pull_request) Successful in 34s
Tests and linters / Run gofumpt (pull_request) Successful in 1m12s
Vulncheck / Vulncheck (pull_request) Successful in 2m5s
Build / Build Components (pull_request) Successful in 2m21s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m30s
Tests and linters / gopls check (pull_request) Successful in 2m24s
Tests and linters / Staticcheck (pull_request) Successful in 3m9s
Tests and linters / Lint (pull_request) Successful in 3m40s
Tests and linters / Tests (pull_request) Successful in 4m3s
Tests and linters / Tests with -race (pull_request) Successful in 5m45s
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-10-11 11:33:56 +03:00
94302235d0
[#1425] adm: Remove eACL fetching from dump-containers
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-10-09 10:56:48 +03:00
4190fba86d
[#1425] Remove SetEACL-related code
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-10-09 10:56:48 +03:00
8093e145b3
[#1412] adm: Resolve container type by metabase upgrade
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-10-08 11:41:51 +03:00
f83f7feb8c [#1391] adm: Properly check whether transfers were made
All checks were successful
DCO action / DCO (pull_request) Successful in 35s
Tests and linters / Run gofumpt (pull_request) Successful in 1m16s
Vulncheck / Vulncheck (pull_request) Successful in 1m25s
Build / Build Components (pull_request) Successful in 2m17s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m26s
Tests and linters / gopls check (pull_request) Successful in 2m45s
Tests and linters / Staticcheck (pull_request) Successful in 2m56s
Tests and linters / Lint (pull_request) Successful in 3m32s
Tests and linters / Tests (pull_request) Successful in 4m17s
Tests and linters / Tests with -race (pull_request) Successful in 5m59s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-10-02 11:41:33 +03:00
62028cd7ee [#1409] adm: Uncommonize DeltaFlag
It is used only in `force-new-epoch`, it is not _common_ between
multiple commands.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-10-02 11:41:27 +03:00
f45e75e3eb [#1409] adm: Do not bind DeltaFlag to viper
We bind flag that could be specified in config.
This is not a config flag, just a command option.
Also fix TestInitialize failures:
```
                Error:          Received unexpected error:
                                number of epochs cannot be less than 1
                Test:           TestInitialize/16_nodes/force-new-epoch
```
Refs #1372 (945b7c740b)

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-10-02 11:41:22 +03:00
7f8a1dcf8e [#1400] adm: Support flag alphabet-wallets for commands proxy-add/remove-account
All checks were successful
DCO action / DCO (pull_request) Successful in 1m20s
Tests and linters / Run gofumpt (pull_request) Successful in 1m31s
Vulncheck / Vulncheck (pull_request) Successful in 1m58s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m10s
Build / Build Components (pull_request) Successful in 2m26s
Tests and linters / gopls check (pull_request) Successful in 2m39s
Tests and linters / Staticcheck (pull_request) Successful in 3m9s
Tests and linters / Lint (pull_request) Successful in 3m30s
Tests and linters / Tests (pull_request) Successful in 4m5s
Tests and linters / Tests with -race (pull_request) Successful in 5m43s
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2024-09-30 14:15:13 +03:00
f71418b73c [#1386] frostfs-adm: Add info to error messages
These error messages bubble up to human users - adding more context helps
to find the cause of the issue faster.

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-09-23 07:47:03 +00:00
53a90634fc [#1301] adm/morph: Add 'delete' domains
All checks were successful
DCO action / DCO (pull_request) Successful in 54s
Tests and linters / Run gofumpt (pull_request) Successful in 1m13s
Vulncheck / Vulncheck (pull_request) Successful in 2m0s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m12s
Build / Build Components (pull_request) Successful in 2m25s
Tests and linters / Staticcheck (pull_request) Successful in 2m36s
Tests and linters / gopls check (pull_request) Successful in 2m43s
Tests and linters / Lint (pull_request) Successful in 3m19s
Tests and linters / Tests (pull_request) Successful in 4m16s
Tests and linters / Tests with -race (pull_request) Successful in 5m32s
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-09-20 11:54:18 +03:00
1361db91ee [#1301] adm/morph: Add flag -v to 'Tokens'
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-09-20 11:54:18 +03:00
945b7c740b [#1372] adm/morph: Add delta flag to 'force-new-epoch'
All checks were successful
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m47s
Tests and linters / Run gofumpt (pull_request) Successful in 3m59s
Tests and linters / gopls check (pull_request) Successful in 4m8s
Build / Build Components (pull_request) Successful in 4m31s
Vulncheck / Vulncheck (pull_request) Successful in 4m29s
Tests and linters / Staticcheck (pull_request) Successful in 5m3s
Tests and linters / Lint (pull_request) Successful in 5m23s
Tests and linters / Tests with -race (pull_request) Successful in 7m25s
DCO action / DCO (pull_request) Successful in 1m6s
Tests and linters / Tests (pull_request) Successful in 2m40s
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-09-20 11:42:04 +03:00
ec8da40567 [#1369] Update obsolete URLs
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-09-11 11:31:10 +00:00
654d970fad [#1355] adm: Run metabase upgrade concurrently
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-09-06 15:54:40 +03:00
a685fcdc96 [#1317] go.mod: Use range over int
All checks were successful
DCO action / DCO (pull_request) Successful in 2m41s
Tests and linters / Run gofumpt (pull_request) Successful in 2m32s
Vulncheck / Vulncheck (pull_request) Successful in 2m38s
Build / Build Components (1.23) (pull_request) Successful in 3m0s
Build / Build Components (1.22) (pull_request) Successful in 3m3s
Pre-commit hooks / Pre-commit (pull_request) Successful in 3m33s
Tests and linters / Tests (1.22) (pull_request) Successful in 3m34s
Tests and linters / Tests (1.23) (pull_request) Successful in 3m36s
Tests and linters / Staticcheck (pull_request) Successful in 3m35s
Tests and linters / Lint (pull_request) Successful in 4m18s
Tests and linters / Tests with -race (pull_request) Successful in 4m20s
Tests and linters / gopls check (pull_request) Successful in 4m25s
Since Go 1.22 a "for" statement with a "range" clause is able
to iterate through integer values from zero to an upper limit.

gopatch script:
@@
var i, e expression
@@
-for i := 0; i <= e - 1; i++ {
+for i := range e {
    ...
}

@@
var i, e expression
@@
-for i := 0; i <= e; i++ {
+for i := range e + 1 {
    ...
}

@@
var i, e expression
@@
-for i := 0; i < e; i++ {
+for i := range e {
    ...
}

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
2024-09-03 13:00:54 +03:00
6c2146bbc1 [#1334] metabase: Add upgrade from v2 to v3
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-08-30 09:06:20 +03:00
03976c6ed5 [#1341] .golangci.yml: Replace exportloopref with copyloopvar
exportloopref is deprecated.
gopatch:
```
@@
var index, value identifier
var slice expression
@@
for index, value := range slice {
...
-value := value
...
}

@@
var index, value identifier
var slice expression
@@
for index, value := range slice {
...
-index := index
...
}

@@
var value identifier
var channel expression
@@
for value := range channel {
...
-value := value
...
}
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-28 15:44:41 +00:00
85a77b7c21 [#1279] adm: Interpret "root" name as empty for namespace target type
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-07-29 12:57:40 +00:00
08953a2f94 [#1239] adm/morph: Fix transfer GAS to alphabet nodes
All checks were successful
DCO action / DCO (pull_request) Successful in 7m55s
Vulncheck / Vulncheck (pull_request) Successful in 8m4s
Build / Build Components (1.21) (pull_request) Successful in 10m21s
Build / Build Components (1.22) (pull_request) Successful in 10m21s
Tests and linters / Staticcheck (pull_request) Successful in 11m45s
Tests and linters / Lint (pull_request) Successful in 12m23s
Tests and linters / gopls check (pull_request) Successful in 14m17s
Pre-commit hooks / Pre-commit (pull_request) Successful in 16m26s
Tests and linters / Tests (1.21) (pull_request) Successful in 17m5s
Tests and linters / Tests with -race (pull_request) Successful in 17m17s
Tests and linters / Tests (1.22) (pull_request) Successful in 17m26s
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-07-11 18:28:32 +03:00
36956db123 [#1159] adm/frostfsid: Remove wallet requirement for list-*
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-07-11 14:04:37 +00:00
74842e7f43 [#1210] adm: Fix error handling when contract not found
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-07-02 13:03:40 +00:00
56eeb630b6 [#1217] Fix grammar mistakes and misspelling
All checks were successful
DCO action / DCO (pull_request) Successful in 13m23s
Tests and linters / gopls check (pull_request) Successful in 16m29s
Tests and linters / Lint (pull_request) Successful in 17m2s
Build / Build Components (1.21) (pull_request) Successful in 16m26s
Build / Build Components (1.22) (pull_request) Successful in 16m21s
Vulncheck / Vulncheck (pull_request) Successful in 16m40s
Tests and linters / Staticcheck (pull_request) Successful in 19m9s
Pre-commit hooks / Pre-commit (pull_request) Successful in 21m37s
Tests and linters / Tests with -race (pull_request) Successful in 22m33s
Tests and linters / Tests (1.22) (pull_request) Successful in 3m46s
Tests and linters / Tests (1.21) (pull_request) Successful in 3m51s
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
2024-07-01 19:14:25 +03:00
36eab4059c [#218] adm: Refactor helper in part of reading alphabet wallets
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2024-07-01 06:56:02 +00:00
72ab373b71 [#218] adm: Update doc for morph generate-alphabet
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2024-07-01 06:56:02 +00:00
a0e49fa5a5 [#1170] adm: Support morph mTLS
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-06-14 09:27:06 +03:00