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)
| 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. |
| 48 | func (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. |
| 61 | func (s *Server) getMeshConfiguration(args *PilotArgs, fileWatcher filewatcher.FileWatcher) krt.Singleton[meshwatcher.MeshConfigResource] { |
no test coverage detected