Merge "Update versions of addons"
[icn.git] / deploy / qat-plugin / qat-plugin.sh
1 #!/usr/bin/env bash
2 set -eEux -o pipefail
3
4 SCRIPTDIR="$(readlink -f $(dirname ${BASH_SOURCE[0]}))"
5 LIBDIR="$(dirname $(dirname ${SCRIPTDIR}))/env/lib"
6
7 source $LIBDIR/common.sh
8
9 # Upstream QAT plugin includes a kustomization already, but it
10 # references the intel-qat-plugin.yaml instead of the
11 # intel-qat-kernel-plugin.yaml, so recreate a kustomization in-tree.
12 function build_source {
13     mkdir -p ${SCRIPTDIR}/base
14     curl -sL https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/${QAT_VERSION}/deployments/qat_plugin/base/intel-qat-kernel-plugin.yaml -o ${SCRIPTDIR}/base/instal-qat-kernel-plugin.yaml
15     rm -f ${SCRIPTDIR}/base/kustomization.yaml
16     pushd ${SCRIPTDIR}/base && kustomize create --autodetect && popd
17 }
18
19 case $1 in
20     "build-source") build_source ;;
21     *) cat <<EOF
22 Usage: $(basename $0) COMMAND
23
24 Commands:
25   build-source  - Rebuild the in-tree YAML files
26 EOF
27        ;;
28 esac