Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
fix flag include problem
Browse files Browse the repository at this point in the history
  • Loading branch information
magicwang-cn committed Dec 4, 2018
1 parent a63dc48 commit 37e6842
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/controller-manager/app/controller-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package app

import (
"flag"
"fmt"
"os"

Expand All @@ -29,6 +30,7 @@ import (
extv1b1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilfeature "k8s.io/apiserver/pkg/util/feature"
utilflag "k8s.io/apiserver/pkg/util/flag"
"k8s.io/apiserver/pkg/util/logs"

"github.com/kubernetes-sigs/federation-v2/cmd/controller-manager/app/options"
Expand Down Expand Up @@ -67,9 +69,18 @@ member clusters and does the necessary reconciliation`,
},
}

// Add the command line flags from other dependencies, but do not
// warn if they contain underscores.
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)

opts.AddFlags(cmd.Flags())
cmd.PersistentFlags().AddFlagSet(pflag.CommandLine)
cmd.Flags().BoolVar(&verFlag, "version", false, "Prints the Version info of controller-manager")

// We get warnings on flags that contain "_" separators
cmd.Flags().SetNormalizeFunc(utilflag.WarnWordSepNormalizeFunc)

return cmd
}

Expand Down

0 comments on commit 37e6842

Please sign in to comment.