MCPcopy
hub / github.com/istio/istio / initMeshConfiguration

Method initMeshConfiguration

pilot/pkg/bootstrap/mesh.go:48–58  ·  view source on GitHub ↗

initMeshConfiguration creates the mesh in the pilotConfig from the input arguments. Original/default behavior: - use the mounted file, if it exists. - use istio-REVISION if k8s is enabled - fallback to default If the 'SHARED_MESH_CONFIG' env is set (experimental feature in 1.10): - if a file exist,

(args *PilotArgs, fileWatcher filewatcher.FileWatcher)

Source from the content-addressed store, hash-verified

46// - if istio-REVISION exists, will be used, even if the file is present.
47// - the SHARED_MESH_CONFIG config map will also be loaded and merged.
48func (s *Server) initMeshConfiguration(args *PilotArgs, fileWatcher filewatcher.FileWatcher) {
49 log.Infof("initializing mesh configuration %v", args.MeshConfigFile)
50 col := s.getMeshConfiguration(args, fileWatcher)
51 col.AsCollection().WaitUntilSynced(s.internalStop)
52 s.environment.Watcher = meshwatcher.ConfigAdapter(col)
53
54 log.Infof("mesh configuration: %s", meshwatcher.PrettyFormatOfMeshConfig(s.environment.Mesh()))
55 log.Infof("version: %s", version.Info.String())
56 argsdump, _ := yaml.Marshal(args)
57 log.Infof("flags: %s", argsdump)
58}
59
60// getMeshConfiguration builds up MeshConfig.
61func (s *Server) getMeshConfiguration(args *PilotArgs, fileWatcher filewatcher.FileWatcher) krt.Singleton[meshwatcher.MeshConfigResource] {

Callers 1

NewServerFunction · 0.95

Calls 9

getMeshConfigurationMethod · 0.95
InfofFunction · 0.92
ConfigAdapterFunction · 0.92
PrettyFormatOfMeshConfigFunction · 0.92
MarshalMethod · 0.80
WaitUntilSyncedMethod · 0.65
AsCollectionMethod · 0.65
MeshMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected