'Get the list of checks applied to a container from the identifier_to_checks cache in the config store.
Use the DATADOG_ID label or the image.'

def _get_checks_to_refresh(self, state, c_id):

    inspect = state.inspect_container(c_id)
    if ((not inspect) or ((not inspect.get('State', {}).get('Running')) and Platform.is_k8s() and (not self.agentConfig.get('sd_config_backend')))):
        self.reload_check_configs = True
        return
    labels = inspect.get('Config', {}).get('Labels', {})
    identifier = (labels.get(DATADOG_ID) or self.dockerutil.image_name_extractor(inspect))
    platform_kwargs = {}
    if Platform.is_k8s():
        kube_metadata = (state.get_kube_config(c_id, 'metadata') or {})
        platform_kwargs = {'kube_annotations': kube_metadata.get('annotations'), 'kube_container_name': state.get_kube_container_name(c_id)}
    if labels:
        platform_kwargs['docker_labels'] = labels
    return self.config_store.get_checks_to_refresh(identifier, **platform_kwargs)
