def _update_conf(conf, target, project, repository):
    """Update configuration target with given ``project`` and ``repository``"""
    if project:
        conf.projects[target] = project
    if repository:
        if target == 'default':
            conf.images[target] = repository
        else:
            if not isinstance(conf.projects[target], dict):
                conf.projects[target] = {'id': conf.projects[target]}
            conf.projects[target]['image'] = repository
