• Kubernetes Submit Queue's avatar
    Merge pull request #44196 from xiangpengzhao/cmd-cleanup · 55f802b7
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue
    
    Delete "hard-coded" default value in flags usage.
    
    **What this PR does / why we need it**:
    Some flags of kubernetes components have "hard-coded" default values in their usage info. In fact, [pflag pkg](https://github.com/kubernetes/kubernetes/blob/master/vendor/github.com/spf13/pflag/flag.go#L602-L608) has already added a string `(default value)` automatically in the usage info if the flag is initialized. Then we don't need to hard-code the default value in usage info. After this PR, if we want to update the default value of a flag, we only need to update the flag where it is initialized. `pflag` will update the usage info for us. This will avoid inconsistency.
    
    For example:
    Before
    ```
    kubelet -h
    ...
    --node-status-update-frequency duration                   Specifies how often kubelet posts node status to master. Note: be cautious when changing the constant, it must work with nodeMonitorGracePeriod in nodecontroller. Default: 10s (default 10s)
    ...
    ```
    
    After
    ```
    kubelet -h
    ...
    --node-status-update-frequency duration                   Specifies how often kubelet posts node status to master. Note: be cautious when changing the constant, it must work with nodeMonitorGracePeriod in nodecontroller. (default 10s)
    ...
    ```
    
    **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
    
    **Special notes for your reviewer**:
    This PR doesn't delete some "hard-coded" default values because they are not explicitly initialized. We still need to hard-code them to give users friendly info.
    
    ```
    --allow-privileged                                        If true, allow containers to request privileged mode. [default=false]
    ```
    
    **Release note**:
    
    ```release-note
    None
    ```
    55f802b7
Name
Last commit
Last update
..
federation-apiserver Loading commit data...
federation-controller-manager Loading commit data...
genfeddocs Loading commit data...
kubefed Loading commit data...