#!/usr/bin/env bash

echo "Importing CSP resources"

namespace="csp-system"
import_dir="${IMPORT_DIR}/csp"

if [[ "${EXCLUDE_COMPONENTS}" == *"cluster-identity"* ]]; then
  echo "Skipping manifest import (cluster-identity excluded)"
else
  if [ -d "${import_dir}/manifests" ]; then
    kubectl apply -n $namespace -f "${import_dir}/manifests"
  fi
fi