Skip to content

Commit

Permalink
rebase && make gen-check
Browse files Browse the repository at this point in the history
  • Loading branch information
tedteng committed Oct 26, 2022
1 parent d872590 commit c0b7c25
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
14 changes: 7 additions & 7 deletions docs/help/gardenctl_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ gardenctl info [flags]

```
--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
--alsologtostderr log to standard error as well as files (no effect when -logtostderr=true)
--config string config file (default is ~/.garden/gardenctl-v2.yaml)
--control-plane target control plane of shoot, use together with shoot argument
--garden string target the given garden 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)
--log-dir string If non-empty, write log files in this directory (no effect when -logtostderr=true)
--log-file string If non-empty, use this log file (no effect when -logtostderr=true)
--log-file-max-size uint Defines the maximum size a log file can grow to (no effect when -logtostderr=true). 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)
--one-output If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)
--project string target the given project
--seed string target the given seed cluster
--shoot string target the given shoot cluster
--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)
--skip-log-headers If true, avoid headers when opening log files (no effect when -logtostderr=true)
--stderrthreshold severity logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=false) (default 2)
-v, --v Level number for the log level verbosity
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/info/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

// NewCmdInfo returns a new info command.
func NewCmdInfo(f util.Factory, o *InfoOptions) *cobra.Command {
func NewCmdInfo(f util.Factory, o *options) *cobra.Command {
cmd := &cobra.Command{
Use: "info",
Short: "Get landscape informations and shows the number of shoots per seed, e.g. \"gardenctl info\"",
Expand Down
16 changes: 9 additions & 7 deletions pkg/cmd/info/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@ import (

// InfoOptions is a struct to support Info command
// nolint
type InfoOptions struct {
type options struct {
base.Options
// Allocatable is the seed allocatable
Allocatable int64
Capacity int64
// Capacity is the seed capacity
Capacity int64
}

// NewInfoOptions returns initialized InfoOptions
func NewInfoOptions(ioStreams util.IOStreams) *InfoOptions {
return &InfoOptions{
func NewInfoOptions(ioStreams util.IOStreams) *options {
return &options{
Options: base.Options{
IOStreams: ioStreams,
},
}
}

// Run does the actual work of the command
func (o *InfoOptions) Run(f util.Factory) error {
func (o *options) Run(f util.Factory) error {
manager, err := f.Manager()
if err != nil {
return err
Expand Down Expand Up @@ -67,7 +69,7 @@ func (o *InfoOptions) Run(f util.Factory) error {
totalShootsCountPerSeed = make(map[string]int)
hibernatedShootsCountPerSeed = make(map[string]int)
unscheduledList = make([]string, 0)
infoOptions = make(map[string]InfoOptions)
infoOptions = make(map[string]options)
valAllocatable int64
valCapacity int64
)
Expand All @@ -88,7 +90,7 @@ func (o *InfoOptions) Run(f util.Factory) error {
return fmt.Errorf("capacity conversion is not possible")
}

infoOptions[seed.Name] = InfoOptions{Allocatable: valAllocatable, Capacity: valCapacity}
infoOptions[seed.Name] = options{Allocatable: valAllocatable, Capacity: valCapacity}
}

for _, shoot := range shootList.Items {
Expand Down

0 comments on commit c0b7c25

Please sign in to comment.