plugin-barman-cloud/scripts/run.sh
Leonardo Cecchi dd6548c4a2
feat: operator plugin and manifests (#18)
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-10-01 15:40:48 +02:00

23 lines
696 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
cd "$(dirname "$0")/.." || exit
if [ -f .env ]; then
source .env
fi
current_context=$(kubectl config view --raw -o json | jq -r '."current-context"' | sed "s/kind-//")
operator_image=$(KIND_CLUSTER_NAME="$current_context" KO_DOCKER_REPO=kind.local ko build -BP ./cmd/operator)
instance_image=$(KIND_CLUSTER_NAME="$current_context" KO_DOCKER_REPO=kind.local ko build -BP ./cmd/instance)
(
cd kubernetes;
kustomize edit set image "plugin-barman-cloud=$operator_image"
kustomize edit set secret plugin-barman-cloud "--from-literal=SIDECAR_IMAGE=$instance_image"
)
# Now we deploy the plugin inside the `cnpg-system` workspace
kubectl apply -k kubernetes/