Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hepto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hepto
Commits
9d40f32e
Commit
9d40f32e
authored
2 years ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Hide unwanted k8s global flags more properly
parent
84b47e5d
No related branches found
No related tags found
No related merge requests found
Pipeline
#23864
passed
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/hepto/config.go
+4
-5
4 additions, 5 deletions
cmd/hepto/config.go
with
4 additions
and
5 deletions
cmd/hepto/config.go
+
4
−
5
View file @
9d40f32e
...
@@ -29,7 +29,8 @@ type Config struct {
...
@@ -29,7 +29,8 @@ type Config struct {
var
config
Config
var
config
Config
func
(
c
*
Config
)
Complete
()
error
{
func
(
c
*
Config
)
Complete
()
error
{
// Print version if requested
// Print version if requested, verflag flags are declared
// by init() functions deep in k8s code
verflag
.
PrintAndExitIfRequested
()
verflag
.
PrintAndExitIfRequested
()
// Mount a shell if required
// Mount a shell if required
if
c
.
Shell
!=
""
{
if
c
.
Shell
!=
""
{
...
@@ -70,10 +71,8 @@ func (c *Config) Complete() error {
...
@@ -70,10 +71,8 @@ func (c *Config) Complete() error {
}
}
func
init
()
{
func
init
()
{
verflag
.
AddFlags
(
Hepto
.
Flags
())
// Expose k8s version directly
// Hide unwanted flags declared inside k8s init() directly
// Force-reinit pflag global cli object, because k8s has a nasty habit of
pflag
.
CommandLine
.
MarkHidden
(
"azure-container-registry-config"
)
// globally registering flags in init()
pflag
.
CommandLine
=
pflag
.
NewFlagSet
(
"hepto"
,
pflag
.
ExitOnError
)
cobra
.
OnInitialize
(
viper
.
AutomaticEnv
)
cobra
.
OnInitialize
(
viper
.
AutomaticEnv
)
// General config
// General config
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment