def METHOD_NAME(cmd, namespace):
    client = cf_spring_cloud_20220101preview(cmd.cli_ctx)
    name = _get_app_name_from_namespace(namespace)
    if not name or not namespace.service or not namespace.resource_group:
        return
    if namespace.deployment:
        namespace.deployment = _ensure_deployment_exist(client, namespace.resource_group, namespace.service, name, namespace.deployment)
    else:
        namespace.deployment = _get_active_deployment(client, namespace.resource_group, namespace.service, name)
        if not namespace.deployment:
            logger.warning(NO_PRODUCTION_DEPLOYMENT_SET_ERROR)