github.com/cilium/cilium@v1.16.2/clustermesh-apiserver/option/config.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package option
     5  
     6  import (
     7  	"time"
     8  
     9  	"github.com/spf13/pflag"
    10  
    11  	"github.com/cilium/cilium/pkg/option"
    12  )
    13  
    14  const (
    15  	// PprofAddressAPIServer is the default value for pprof in the clustermesh-apiserver
    16  	PprofAddress = "localhost"
    17  
    18  	// PprofPortClusterMesh is the default value for pprof in the clustermesh-apiserver (clustermesh)
    19  	PprofPortClusterMesh = 6063
    20  
    21  	// PprofPortKVStoreMesh is the default value for pprof in clustermesh-apiserver (kvstoremesh)
    22  	PprofPortKVStoreMesh = 6064
    23  )
    24  
    25  // LegacyClusterMeshConfig is used to register the flags for the options which
    26  // are still accessed through the global DaemonConfig variable.
    27  type LegacyClusterMeshConfig struct {
    28  	Debug          bool
    29  	CRDWaitTimeout time.Duration
    30  }
    31  
    32  var DefaultLegacyClusterMeshConfig = LegacyClusterMeshConfig{
    33  	Debug:          false,
    34  	CRDWaitTimeout: 5 * time.Minute,
    35  }
    36  
    37  func (def LegacyClusterMeshConfig) Flags(flags *pflag.FlagSet) {
    38  	flags.BoolP(option.DebugArg, "D", def.Debug, "Enable debugging mode")
    39  	flags.Duration(option.CRDWaitTimeout, def.CRDWaitTimeout, "Cilium will exit if CRDs are not available within this duration upon startup")
    40  }
    41  
    42  // LegacyKVStoreMeshConfig is used to register the flags for the options which
    43  // are still accessed through the global DaemonConfig variable.
    44  type LegacyKVStoreMeshConfig struct {
    45  	Debug bool
    46  }
    47  
    48  var DefaultLegacyKVStoreMeshConfig = LegacyKVStoreMeshConfig{
    49  	Debug: false,
    50  }
    51  
    52  func (def LegacyKVStoreMeshConfig) Flags(flags *pflag.FlagSet) {
    53  	flags.BoolP(option.DebugArg, "D", def.Debug, "Enable debugging mode")
    54  }