istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pilot/cmd/pilot-agent/options/agent_proxy.go (about)

     1  // Copyright Istio Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package options
    16  
    17  import (
    18  	istioagent "istio.io/istio/pkg/istio-agent"
    19  )
    20  
    21  // ProxyArgs provides all of the configuration parameters for the Pilot proxy.
    22  type ProxyArgs struct {
    23  	istioagent.Proxy
    24  
    25  	StsPort            int
    26  	TokenManagerPlugin string
    27  
    28  	MeshConfigFile string
    29  
    30  	// proxy config flags (named identically)
    31  	ServiceCluster         string
    32  	ProxyLogLevel          string
    33  	ProxyComponentLogLevel string
    34  	Concurrency            int
    35  	TemplateFile           string
    36  	OutlierLogPath         string
    37  
    38  	PodName      string
    39  	PodNamespace string
    40  
    41  	// enableProfiling enables profiling via web interface host:port/debug/pprof/
    42  	EnableProfiling bool
    43  }
    44  
    45  // NewProxyArgs constructs proxyArgs with default values.
    46  func NewProxyArgs() ProxyArgs {
    47  	p := ProxyArgs{}
    48  
    49  	// Apply Default Values.
    50  	p.applyDefaults()
    51  
    52  	return p
    53  }
    54  
    55  // applyDefaults apply default value to ProxyArgs
    56  func (node *ProxyArgs) applyDefaults() {
    57  	node.PodName = PodNameVar.Get()
    58  	node.PodNamespace = PodNamespaceVar.Get()
    59  }