Skip to content

Commit

Permalink
feat: add --github-badge flag to core options (#502)
Browse files Browse the repository at this point in the history
## What type of PR is this?

/kind feature

## What this PR does / why we need it:

Add `--github-badge` flag to core options.

## Which issue(s) this PR fixes:

Prepare for #501
  • Loading branch information
elliotxx committed Jun 6, 2024
1 parent d385b4e commit 2fa048b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/app/options/core_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

type CoreOptions struct {
ReadOnlyMode bool
GithubBadge bool
}

func NewCoreOptions() *CoreOptions {
Expand All @@ -33,6 +34,7 @@ func (o *CoreOptions) Validate() []error {

func (o *CoreOptions) ApplyTo(config *registry.ExtraConfig) error {
config.ReadOnlyMode = o.ReadOnlyMode
config.GithubBadge = o.GithubBadge
return nil
}

Expand All @@ -43,4 +45,5 @@ func (o *CoreOptions) AddFlags(fs *pflag.FlagSet) {
}

fs.BoolVar(&o.ReadOnlyMode, "read-only-mode", false, "turn on the read only mode")
fs.BoolVar(&o.GithubBadge, "github-badge", false, "whether to display the github badge")
}
1 change: 1 addition & 0 deletions pkg/kubernetes/registry/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ type ExtraConfig struct {
ElasticSearchUsername string
ElasticSearchPassword string
ReadOnlyMode bool
GithubBadge bool
}

0 comments on commit 2fa048b

Please sign in to comment.