(self)
return monitored_containers
Return filtered running container objects list
Return filtered running container objects list
Return filtered running container objects list
def monitor_filter(self):
        """Return filtered running container objects list"""
        running_containers = self.running_filter()
        monitored_containers = []

        for container in running_containers:
            ouro_label = container.labels.get('com.ouroboros.enable', False)
            # if labels enabled, use the label. 'true/yes' trigger monitoring.
            if self.config.label_enable and ouro_label:
                if ouro_label.lower() in ["true", "yes"]:
                    monitored_containers.append(container)
                else:
                    continue
            elif not self.config.labels_only:
                if self.config.monitor:
                    if container.name in self.config.monitor and container.name not in self.config.ignore:
                        monitored_containers.append(container)
                elif container.name not in self.config.ignore:
                    monitored_containers.append(container)

        self.data_manager.monitored_containers[self.socket] = len(monitored_containers)
        self.data_manager.set(self.socket)

        return monitored_containers
def monitor_filter ( self ) : running_containers = self . running_filter ( ) monitored_containers = [ ] for container in running_containers : ouro_label = container . labels . get ( 'com.ouroboros.enable' , False ) # if labels enabled, use the label. 'true/yes' trigger monitoring. if self . config . label_enable and ouro_label : if ouro_label . lower ( ) in [ "true" , "yes" ] : monitored_containers . append ( container ) else : continue elif not self . config . labels_only : if self . config . monitor : if container . name in self . config . monitor and container . name not in self . config . ignore : monitored_containers . append ( container ) elif container . name not in self . config . ignore : monitored_containers . append ( container ) self . data_manager . monitored_containers [ self . socket ] = len ( monitored_containers ) self . data_manager . set ( self . socket ) return monitored_containers