Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] add bs status copyset #2520

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

Cyber-SiKu
Copy link
Contributor

What problem does this PR solve?

Issue Number: #xxx

Problem Summary:

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@Cyber-SiKu
Copy link
Contributor Author

cicheck

}

func (cCmd *CopysetCommand) Init(cmd *cobra.Command, args []string) error {
config.AddBsFilterOptionFlag(cCmd.Cmd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add flag in AddFlags?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add flag in AddFlags?

This is for the called command, not a parameter of the command.

fmt.Sprintf("--%s", config.CURVEBS_LOGIC_POOL_ID), strings.Join(poolIds, ","),
})

checkRes, err := checkcopyset.GatCopysetsStaus(cCmd.Cmd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GatCopysetsStaus spell error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GatCopysetsStaus spell error

fix

@@ -167,6 +168,34 @@ func AlignFlagsValue(caller *cobra.Command, callee *cobra.Command, flagNames []s
}
}

type stringSlice struct {
value []string
change bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seem useless?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seem useless?

This is to make the flag names of the calling command and the called command consistent, but one is prepared when the string slice and the other is string. There is a problem with the design of pflag, which can be avoided by this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func (s *stringSliceValue) Set(val string) error {
 v, err := readAsCSV(val)
 if err != nil {
  return err
 }
 if !s.changed {
  *s.value = v
 } else {
  *s.value = append(*s.value, v...)
 }
 s.changed = true
 return nil
}

Here is an additional write.

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Xinlong-Chen
Copy link
Contributor

cicheck

Signed-off-by: Cyber-SiKu <Cyber-SiKu@outlook.com>
@Cyber-SiKu Cyber-SiKu merged commit 1279ee9 into opencurve:master Jun 9, 2023
2 checks passed
@Cyber-SiKu Cyber-SiKu deleted the feat/status/copyset branch June 9, 2023 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants