Skip to content

karmadactl: add the ability to automatically generate user guidance documents for the command line#2260

Closed
Fish-pro wants to merge 1 commit intokarmada-io:masterfrom
Fish-pro:feature-command-docs
Closed

karmadactl: add the ability to automatically generate user guidance documents for the command line#2260
Fish-pro wants to merge 1 commit intokarmada-io:masterfrom
Fish-pro:feature-command-docs

Conversation

@Fish-pro
Copy link
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

When using Karmadactl, the user lacks the command execution document, now add the ability to automatically generate guidance documents from the code, just need to execute make ctldocsgen, can generate the help document in the code in docs/usergide/commands

➜  make ctldocsgen
go run tools/cmd-docs/main.go

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 26, 2022
@karmada-bot karmada-bot requested review from Garrybest and Tingtal July 26, 2022 10:22
@karmada-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign kevin-wangzefeng after the PR has been reviewed.
You can assign the PR to them by writing /assign @kevin-wangzefeng in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 26, 2022
@Fish-pro
Copy link
Member Author

karmadactl

karmadactl controls a Kubernetes Cluster Federation.

Synopsis

karmadactl controls a Kubernetes Cluster Federation.

karmadactl [flags]

Options

      --add-dir-header                   If true, adds the file directory to the header of the log messages
      --alsologtostderr                  log to standard error as well as files
  -h, --help                             help for karmadactl
      --kubeconfig string                Paths to a kubeconfig. Only required if out-of-cluster.
      --log-backtrace-at traceLocation   when logging hits line file:N, emit a stack trace (default :0)
      --log-dir string                   If non-empty, write log files in this directory
      --log-file string                  If non-empty, use this log file
      --log-file-max-size uint           Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
      --logtostderr                      log to standard error instead of files (default true)
      --one-output                       If true, only write logs to their native severity level (vs also writing to each lower severity level)
      --skip-headers                     If true, avoid header prefixes in the log messages
      --skip-log-headers                 If true, avoid headers when opening log files
      --stderrthreshold severity         logs at or above this threshold go to stderr (default 2)
  -v, --v Level                          number for the log level verbosity
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging

SEE ALSO

Auto generated by spf13/cobra on 26-Jul-2022

@Fish-pro
Copy link
Member Author

/cc @lonelyCZ @RainbowMango

@Fish-pro Fish-pro force-pushed the feature-command-docs branch from a82f283 to 845e7be Compare July 26, 2022 10:24
Signed-off-by: chen zechun <zechun.chen@daocloud.io>
@Fish-pro Fish-pro force-pushed the feature-command-docs branch from 845e7be to ef169c3 Compare July 26, 2022 10:27
@Fish-pro
Copy link
Member Author

/cc @Tingtal

Copy link
Contributor

@Tingtal Tingtal left a comment

Choose a reason for hiding this comment

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

Pls check my edits on the language. Thanks

### Options

```
--add-dir-header If true, adds the file directory to the header of the log messages
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--add-dir-header If true, adds the file directory to the header of the log messages
--add-dir-header If true, add the file directory to the header of the log messages

--alsologtostderr log to standard error as well as files
-h, --help help for karmadactl
--kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster.
--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log-backtrace-at traceLocation When logging hits line file:N, emit a stack trace (default 0)


```
--add-dir-header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--alsologtostderr log to standard error as well as files
--alsologtostderr Log to standard error as well as files

```
--add-dir-header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
-h, --help help for karmadactl
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
-h, --help help for karmadactl
-h, --help Help for karmadactl

--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log-dir string If non-empty, write log files in this directory
--log-file string If non-empty, use this log file
--log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--log-file-max-size uint Define the maximum size a log file can grow to, in unit of megabyte. Value 0 indicates unlimited file size. (Default to 1800)

--cluster-kubeconfig string Path of the cluster's kubeconfig.
--cluster-namespace string Namespace in the control plane where member cluster secrets are stored. (default "karmada-cluster")
--dry-run Run the command in dry-run mode, without making any server requests.
--force Delete cluster and secret resources even if resources in the cluster targeted for unjoin are not removed successfully.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--force Delete cluster and secret resources even if resources in the cluster targeted for unjoin are not removed successfully.
--force Delete cluster and secret resources even if resources in the unjoining cluster are not removed successfully.

--force Delete cluster and secret resources even if resources in the cluster targeted for unjoin are not removed successfully.
-h, --help help for unjoin
--karmada-context string Name of the cluster context in control plane kubeconfig file.
--wait duration wait for the unjoin command execution process(default 60s), if there is no success after this time, timeout will be returned. (default 1m0s)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--wait duration wait for the unjoin command execution process(default 60s), if there is no success after this time, timeout will be returned. (default 1m0s)
--wait duration Wait for the unjoin command execution to succeed (default to 60s). Execution failures will return timeout.

### Options inherited from parent commands

```
--add-dir-header If true, adds the file directory to the header of the log messages
Copy link
Contributor

Choose a reason for hiding this comment

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

Same changes for this part

### Options

```
-h, --help help for version
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
-h, --help help for version
-h, --help Help for version

### Options inherited from parent commands

```
--add-dir-header If true, adds the file directory to the header of the log messages
Copy link
Contributor

Choose a reason for hiding this comment

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

Same changes for this part

@RainbowMango
Copy link
Member

I'm not sure if it really helps. @lonelyCZ What's your opinion here? Should we postpone this until the command line tools are stable?

@lonelyCZ
Copy link
Member

lonelyCZ commented Aug 5, 2022

Should we postpone this until the command line tools are stable?

Yes, now the karmadactl isn't complicated and is developed actively that could be possibly changed frequently.

@Fish-pro
Copy link
Member Author

Fish-pro commented Aug 8, 2022

Pls check my edits on the language. Thanks

@Tingtal thx a lot, All the documents are automatically generated by the code, and I will address the modification suggestions you put forward in the code

@Fish-pro
Copy link
Member Author

Fish-pro commented Aug 8, 2022

Should we postpone this until the command line tools are stable?

Yes, now the karmadactl isn't complicated and is developed actively that could be possibly changed frequently.

@lonelyCZ thx, All documentation is easily generated automatically by code, which is recommended if introduced in the future

@Poor12
Copy link
Member

Poor12 commented Sep 22, 2022

Hi @Fish-pro, in 1.3 version, we have moved docs to our website and I think it's time to move this pr on. Would you like to keep this going?

@Fish-pro Fish-pro deleted the feature-command-docs branch March 18, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants