
KURYR_HOME=${KURYR_HOME:-$DEST/kuryr-libnetwork}
KURYR_ACTIVATOR_FILENAME=${KURYR_ACTIVATOR_FILENAME:-kuryr.spec}
KURYR_DEFAULT_ACTIVATOR=${KURYR_HOME}/etc/${KURYR_ACTIVATOR_FILENAME}

# See libnetwork's plugin discovery mechanism:
#   https://github.com/docker/docker/blob/c4d45b6a29a91f2fb5d7a51ac36572f2a9b295c6/docs/extend/plugin_api.md#plugin-discovery
KURYR_ACTIVATOR_DIR=${KURYR_ACTIVATOR_DIR:-/usr/lib/docker/plugins/kuryr}
KURYR_ACTIVATOR=${KURYR_ACTIVATOR_DIR}/${KURYR_ACTIVATOR_FILENAME}

KURYR_CONFIG_FILENAME=kuryr.conf
KURYR_DEFAULT_CONFIG=${KURYR_HOME}/etc/${KURYR_CONFIG_FILENAME}
KURYR_CONFIG_DIR=${KURYR_CONFIG_DIR:-/etc/kuryr}
KURYR_CONFIG=${KURYR_CONFIG_DIR}/${KURYR_CONFIG_FILENAME}
KURYR_AUTH_CACHE_DIR=${KURYR_AUTH_CACHE_DIR:-/var/cache/kuryr}
KURYR_LOG_DIR=${KURYR_LOG_DIR:-/var/log/kuryr}
KURYR_BIN_DIR=$(get_python_exec_prefix)

KURYR_POOL_PREFIX=${KURYR_POOL_PREFIX:-10.10.0.0/16}
KURYR_POOL_PREFIX_LEN=${KURYR_POOL_PREFIX_LEN:-24}

KURYR_CAPABILITY_SCOPE=${KURYR_CAPABILITY_SCOPE:-local}
KURYR_PROCESS_EXTERNAL_CONNECTIVITY=${KURYR_PROCESS_EXTERNAL_CONNECTIVITY:-True}

KURYR_DOCKER_ENGINE_PORT=${KURYR_DOCKER_ENGINE_PORT:-2375}
DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-etcd://$SERVICE_HOST:$ETCD_PORT}

GITREPO["kuryr"]=${KURYR_REPO:-${GIT_BASE}/openstack/kuryr.git}
GITBRANCH["kuryr"]=${KURYR_BRANCH:-$TARGET_BRANCH}
GITDIR["kuryr"]=$DEST/kuryr

enable_service kuryr-libnetwork docker-engine

if [[ ${HOST_IP} == ${SERVICE_HOST} ]] || [[ "[${HOST_IPV6}]" == "${SERVICE_HOST}" ]]; then
    enable_service etcd3
fi
