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

Optimize: move experimental cmd to alpha stage #1577

Merged
merged 4 commits into from
Jul 14, 2022

Conversation

kakaZhou719
Copy link
Member

Describe what this PR does / why we need it

move below experimental cmd to alpha stage to incubate.

  1. sealer prune
  2. sealer gen
  3. sealer debug
  4. sealer exec
  5. sealer cert
  6. sealer merge
  7. sealer upgrade

Does this pull request fix one issue?

fix #1522

Describe how you did it

Describe how to verify it

Special notes for reviews

func NewCmdAlpha() *cobra.Command {
cmd := &cobra.Command{
Use: "alpha",
Short: "Sealer experimental sub-commands",
Copy link
Member

Choose a reason for hiding this comment

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

Please add a long field to add more description of sealer alpha command. This is very useful for end users. Thanks. And do not make sealer uppercase. sealer is a reserved word, then it has no uppercase mode, just like etcd. sealer and etcd both have a lowercase first letter.

Copy link
Member Author

Choose a reason for hiding this comment

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

alpha command has sub command which has their own long description. i am ok with adding long description on alpha command, but seems like there is very little to describe.

Copy link
Member

@allencloud allencloud Jul 13, 2022

Choose a reason for hiding this comment

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

😄, we should explain to help end-users to understand what is alpha command for. Please take the following paragraph into consideration.

alpha command of sealer is used to provide functionality incubation from immature to mature. Each function will experience a growing procedure. Alpha command policy calls on end users to experience alpha functionality as early as possible, and actively feedback the experience results to sealer community, and finally cooperate to promote function from incubation to graduation. Please file an issue at https://github.com/sealerio/sealer/issues when you have any feedback on alpha commands.


var altNames []string

var longCertCmdDescription = `Add domain or ip in certs: you had better backup old certs first. this command will update cluster API server cert, you need to restart your API server manually after using sealer cert. then, you can using cmd "openssl x509 -noout -text -in apiserver.crt" to check the cert details.
Copy link
Member

Choose a reason for hiding this comment

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

Please make sure that first word of every sentence should be uppercase. It is minor mistake. But I think we should pay more attention to this minor cases.

Example: exampleForCertCmd,
RunE: func(cmd *cobra.Command, args []string) error {
if len(altNames) == 0 {
return fmt.Errorf("ip address or DNS domain needed for cert Subject Alternative Names")
Copy link
Member

Choose a reason for hiding this comment

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

s/ip/IP/g, IP is a reserved word. While I think quite lot of people use ip, which is lowercase. And lowercase is incorrect.

},
}

certCmd.Flags().StringSliceVar(&altNames, "alt-names", []string{}, "add domain or ip in certs, sealer.cool or 10.103.97.2")
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a default domain name? If we have, we should add it explicitly in the flag description.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, we have a default domain in the cert process builtin, i will add it explicitly in the flag description.

ipList = append(ipList, cluster.GetIPSByRole(role)...)
}
if len(ipList) == 0 {
return fmt.Errorf("failed to get target ipList by roles label %s", roles)
Copy link
Member

Choose a reason for hiding this comment

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

should add the detailed failure reason:

return fmt.Errorf("failed to get target ipList: no IP gotten by role(%s)", roles)

@allencloud
Copy link
Member

cmd/sealer/cmd/alpha/merge.go:38: File is not gofmt-ed with -s (gofmt) @kakaZhou719

@codecov-commenter
Copy link

codecov-commenter commented Jul 13, 2022

Codecov Report

Merging #1577 (7a716e5) into main (a9919aa) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1577   +/-   ##
=======================================
  Coverage   11.19%   11.19%           
=======================================
  Files          88       88           
  Lines        8067     8067           
=======================================
  Hits          903      903           
  Misses       7052     7052           
  Partials      112      112           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9919aa...7a716e5. Read the comment docs.

},
}

certCmd.Flags().StringSliceVar(&altNames, "alt-names", []string{}, "add DNS domain or IP in certs, if it already in the cert subject alternative names list, nothing will changed")
Copy link
Member

Choose a reason for hiding this comment

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

add DNS domain or IP in certs. If it is already in the cert subject alternative names list, nothing will be changed.

"github.com/spf13/cobra"
)

var exampleForPruneCmd = `The following command will prune sealer data directory such as, image db ,image layer, build tmp.
Copy link
Member

Choose a reason for hiding this comment

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

The following command will prune sealer data directory, such as: image db, image layer and build tmp.

@allencloud
Copy link
Member

LGTM unless the above suggestion updated.

@allencloud allencloud added command sealer terminal command related alpha-feature labels Jul 13, 2022
@github-actions github-actions bot removed the command sealer terminal command related label Jul 14, 2022
@allencloud allencloud merged commit 08df4e0 into sealerio:main Jul 14, 2022
@kakaZhou719 kakaZhou719 deleted the optimize-move-cmd-to-alpha branch March 8, 2023 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support sealer alpha command to incubate some alpha features
3 participants