adm/morph: Support global unique domains #1301

Merged
dstepanov-yadro merged 1 commit from achuprov/frostfs-node:feat/global_domain into master 2024-10-26 11:30:25 +00:00
Member

In this PR

  • Add frostfs-adm morph nns delete
  • Add flag -v to frostfs-adm morph nns tokens
frostfs-adm morph nns tokens     --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml -v
balance.frostfs
group.frostfs
container
container.frostfs
animals
proxy.frostfs
bober.poland
policy.frostfs
bober.animals ( CNAME: bober.poland )
alphabet0.frostfs
sweden
frostfsid.frostfs
netmap.frostfs
frostfs
poland

Ref: TrueCloudLab/frostfs-contract#102
Signed-off-by: Alexander Chuprov a.chuprov@yadro.com

In this PR - Add `frostfs-adm morph nns delete` - Add flag `-v` to `frostfs-adm morph nns tokens` ``` frostfs-adm morph nns tokens --config /home/achuprov/Documents/work/frostfs-dev-env/frostfs-adm.yml -v balance.frostfs group.frostfs container container.frostfs animals proxy.frostfs bober.poland policy.frostfs bober.animals ( CNAME: bober.poland ) alphabet0.frostfs sweden frostfsid.frostfs netmap.frostfs frostfs poland ``` Ref: https://git.frostfs.info/TrueCloudLab/frostfs-contract/pulls/102 Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
aarifullin reviewed 2024-08-08 14:09:48 +00:00
@ -7,2 +7,4 @@
)
const (
longFormat = "long"
Member

This comment is not a change request but haven't you considered -v, --verbose flag for this purpose? :)

This comment is not a change request but haven't you considered `-v, --verbose` flag for this purpose? :)
Author
Member

You’re right, that would be better. Initially, I wanted to do it like ls -l.

You’re right, that would be better. Initially, I wanted to do it like `ls -l`.
achuprov marked this conversation as resolved
fyrchik added the
blocked
label 2024-08-09 06:31:01 +00:00
achuprov force-pushed feat/global_domain from 2283b5c08c to 80f6c38dc6 2024-09-02 12:34:28 +00:00 Compare
achuprov removed the
blocked
label 2024-09-02 12:37:45 +00:00
achuprov requested review from storage-core-committers 2024-09-02 13:17:01 +00:00
achuprov requested review from storage-core-developers 2024-09-02 13:17:02 +00:00
acid-ant reviewed 2024-09-02 13:33:32 +00:00
@ -7,2 +11,4 @@
)
const (
verboseLong = "verbose"
Member

We already have such flag here

We already have such flag [here](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/2b3fc50681f7e463a74c6075ad16788fc52cfa3f/cmd/frostfs-adm/internal/commonflags/flags.go#L11)
achuprov marked this conversation as resolved
achuprov force-pushed feat/global_domain from 80f6c38dc6 to 05f92f2901 2024-09-02 15:09:24 +00:00 Compare
dstepanov-yadro approved these changes 2024-09-04 06:49:21 +00:00
Dismissed
acid-ant reviewed 2024-09-04 07:10:50 +00:00
@ -20,2 +29,3 @@
for _, token := range toks {
cmd.Println(string(token))
output := string(token)
if longFlag, err := cmd.Flags().GetBool(commonflags.Verbose); err == nil && longFlag {
Member

Let's skip checking for error at all:

			if verbose, _ := cmd.Flags().GetBool(commonflags.Verbose); verbose {
Let's skip checking for error at all: ``` if verbose, _ := cmd.Flags().GetBool(commonflags.Verbose); verbose { ```
Author
Member

fixed

fixed
achuprov marked this conversation as resolved
acid-ant reviewed 2024-09-04 07:15:45 +00:00
@ -25,0 +40,4 @@
func getCnameRecord(c *client.Contract, token []byte) string {
items, err := c.GetRecords(string(token), big.NewInt(int64(nns.CNAME)))
if err != nil {
Member

Why this error should not important for us?

Why this error should not important for us?
Author
Member

You are right; only one type of error is considered valid

You are right; only one type of error is considered valid
achuprov marked this conversation as resolved
fyrchik requested changes 2024-09-05 08:05:57 +00:00
@ -7,2 +11,4 @@
)
const (
verboseDesc = "Includes additional information about CNAME record."
Owner

Includes -> Include

`Includes` -> `Include`
achuprov marked this conversation as resolved
@ -25,0 +41,4 @@
func getCnameRecord(c *client.Contract, token []byte) string {
items, err := c.GetRecords(string(token), big.NewInt(int64(nns.CNAME)))
if err != nil {
return ""
Owner

The error should be reported, otherwise, we cannot rely on the output.

The error should be reported, otherwise, we cannot rely on the output.
achuprov marked this conversation as resolved
achuprov force-pushed feat/global_domain from 05f92f2901 to 89d0435b1d 2024-09-13 14:24:47 +00:00 Compare
achuprov added 1 commit 2024-09-13 14:36:32 +00:00
[#1301] adm/morph: Support global unique names
All checks were successful
DCO action / DCO (pull_request) Successful in 1m4s
Tests and linters / Run gofumpt (pull_request) Successful in 1m11s
Vulncheck / Vulncheck (pull_request) Successful in 1m30s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m9s
Build / Build Components (pull_request) Successful in 2m21s
Tests and linters / gopls check (pull_request) Successful in 2m37s
Tests and linters / Staticcheck (pull_request) Successful in 2m39s
Tests and linters / Lint (pull_request) Successful in 3m48s
Tests and linters / Tests (pull_request) Successful in 5m8s
Tests and linters / Tests with -race (pull_request) Successful in 6m4s
e5ad46ca80
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
achuprov dismissed dstepanov-yadro's review 2024-09-13 14:36:32 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

achuprov force-pushed feat/global_domain from e5ad46ca80 to 32845c1814 2024-09-13 14:39:57 +00:00 Compare
achuprov changed title from adm/morph: Support global domain to adm/morph: Support global unique domains 2024-09-13 14:40:01 +00:00
fyrchik reviewed 2024-09-13 15:13:52 +00:00
@ -25,0 +43,4 @@
func getCnameRecord(c *client.Contract, token []byte) (string, error) {
items, err := c.GetRecords(string(token), big.NewInt(int64(nns.CNAME)))
if err != nil && strings.Contains(err.Error(), "not an array") {
Owner

Could you explain when does this error occur?
A comment would be helpful.

Could you explain when does this error occur? A comment would be helpful.
Author
Member

fixed

fixed
achuprov marked this conversation as resolved
achuprov force-pushed feat/global_domain from 32845c1814 to 4632a3d2ff 2024-09-16 08:10:22 +00:00 Compare
achuprov force-pushed feat/global_domain from 4632a3d2ff to 5e9880037f 2024-09-16 08:11:04 +00:00 Compare
achuprov force-pushed feat/global_domain from 5e9880037f to 7f145897a8 2024-09-18 11:21:39 +00:00 Compare
achuprov force-pushed feat/global_domain from 7f145897a8 to e56cdd94e0 2024-09-18 11:22:23 +00:00 Compare
Author
Member

⬆️Add frostfs-adm morph nns delete⬆️

⬆️Add `frostfs-adm morph nns delete`⬆️
achuprov requested review from storage-core-committers 2024-09-18 11:36:32 +00:00
aarifullin approved these changes 2024-09-18 11:45:16 +00:00
Dismissed
achuprov force-pushed feat/global_domain from e56cdd94e0 to f8fea4f994 2024-09-19 11:09:32 +00:00 Compare
achuprov dismissed aarifullin's review 2024-09-19 11:09:32 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

achuprov force-pushed feat/global_domain from f8fea4f994 to 7b295f826a 2024-09-19 11:20:31 +00:00 Compare
dstepanov-yadro approved these changes 2024-09-19 11:26:22 +00:00
Dismissed
aarifullin approved these changes 2024-09-20 07:50:48 +00:00
achuprov force-pushed feat/global_domain from 7b295f826a to 29a1574969 2024-09-20 08:41:51 +00:00 Compare
achuprov force-pushed feat/global_domain from 29a1574969 to 53a90634fc 2024-09-20 08:54:26 +00:00 Compare
dstepanov-yadro approved these changes 2024-09-20 09:04:06 +00:00
dstepanov-yadro merged commit 53a90634fc into master 2024-09-20 09:04:17 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
5 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#1301
No description provided.