def update()

in src/lambda/ecr/lambda.py [0:0]


def update(repo, props, event, context):
    # use existing repository if available
    update_policy = props.get("UpdateReplacePolicy")
    try:
        if update_policy and update_policy.lower() == "retain":
            put_lifecycle_policy(repo, props)
        else:
            # replace the repo
            delete(repo, props, event, context)
            create(repo, props, event, context)
    except Exception as e:
        send(event, context, FAILED, None)
        raise(e)