"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/config/mesh/watcher.go" between
istio-1.10.0.tar.gz and istio-1.10.1.tar.gz

About: Istio is a platform-independent service mesh that provides a uniform way to connect, secure, control, and observe microservices.

watcher.go  (istio-1.10.0):watcher.go  (istio-1.10.1)
skipping to change at line 48 skipping to change at line 48
Holder Holder
// AddMeshHandler registers a callback handler for changes to the mesh co nfig. // AddMeshHandler registers a callback handler for changes to the mesh co nfig.
AddMeshHandler(func()) AddMeshHandler(func())
// HandleUserMeshConfig keeps track of user mesh config overrides. These are merged with the standard // HandleUserMeshConfig keeps track of user mesh config overrides. These are merged with the standard
// mesh config, which takes precedence. // mesh config, which takes precedence.
HandleUserMeshConfig(string) HandleUserMeshConfig(string)
} }
// MultiWatcher is a struct wrapping the internal injector to let users know tha
t both
type MultiWatcher struct {
InternalWatcher
InternalNetworkWatcher
}
var _ Watcher = &InternalWatcher{} var _ Watcher = &InternalWatcher{}
type InternalWatcher struct { type InternalWatcher struct {
mutex sync.Mutex mutex sync.Mutex
handlers []func() handlers []func()
// Current merged mesh config // Current merged mesh config
MeshConfig *meshconfig.MeshConfig MeshConfig *meshconfig.MeshConfig
userMeshConfig string userMeshConfig string
revMeshConfig string revMeshConfig string
skipping to change at line 89 skipping to change at line 95
} }
w := &InternalWatcher{ w := &InternalWatcher{
MeshConfig: meshConfig, MeshConfig: meshConfig,
revMeshConfig: meshConfigYaml, revMeshConfig: meshConfigYaml,
} }
// Watch the config file for changes and reload if it got modified // Watch the config file for changes and reload if it got modified
addFileWatcher(fileWatcher, filename, func() { addFileWatcher(fileWatcher, filename, func() {
if multiWatch { if multiWatch {
meshConfig, _ := ReadMeshConfigData(filename) meshConfig, err := ReadMeshConfigData(filename)
if err != nil {
log.Warnf("failed to read mesh configuration, usi
ng default: %v", err)
return
}
w.HandleMeshConfigData(meshConfig) w.HandleMeshConfigData(meshConfig)
return return
} }
// Reload the config file // Reload the config file
meshConfig, err = ReadMeshConfig(filename) meshConfig, err = ReadMeshConfig(filename)
if err != nil { if err != nil {
log.Warnf("failed to read mesh configuration, using defau lt: %v", err) log.Warnf("failed to read mesh configuration, using defau lt: %v", err)
return return
} }
w.HandleMeshConfig(meshConfig) w.HandleMeshConfig(meshConfig)
 End of changes. 2 change blocks. 
1 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)