github.com/crossplane-contrib/function-cue@v0.2.2-0.20240508161918-5100fcb5a058/hacking/setup-crossplane.sh (about)

     1  #!/bin/bash
     2  
     3  set -euo pipefail
     4  
     5  SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
     6  source "${SCRIPT_DIR}/.env"
     7  
     8  XP_CROSSPLANE_VERSION="${XP_CROSSPLANE_VERSION:-1.14.3}"
     9  
    10  $RUN_KUBECTL apply -f - <<EOF
    11  apiVersion: v1
    12  kind: Namespace
    13  metadata:
    14    name: ${XP_CROSSPLANE_NS}
    15  EOF
    16  
    17  ${RUN_HELM} repo add --force-update crossplane-stable https://charts.crossplane.io/stable/
    18  ${RUN_HELM} repo update > /dev/null
    19  
    20  # shellcheck disable=SC2089
    21  OPTS="crossplane --set args={\"--enable-environment-configs\"} --namespace ${XP_CROSSPLANE_NS} --create-namespace crossplane-stable/crossplane --version $XP_CROSSPLANE_VERSION"
    22  
    23  # shellcheck disable=SC2090
    24  ${RUN_HELM} template --include-crds ${OPTS} | ${RUN_KUBECTL} apply -f -
    25  
    26  echo "Waiting for Crossplane to be ready..."
    27  ${RUN_KUBECTL} wait --timeout=180s --for=condition=Available -n ${XP_CROSSPLANE_NS} deployments crossplane
    28  ${RUN_KUBECTL} wait --timeout=180s --for=condition=Established customresourcedefinition.apiextensions.k8s.io providers.pkg.crossplane.io