aboutsummaryrefslogtreecommitdiffstats
path: root/syz-cluster/run-local.sh
blob: f4d311a32aea7c74c621bea73d4722d2029c88a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
# Copyright 2024 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

if [ -z "$1" ]; then
  echo "Error: No command/service name provided."
  exit 1
fi

name="$1"
shift

alias kubectl="minikube kubectl --"
# Clean up in case the run comand was prematurely aborted.
# TODO: find out how to rely on envs from overlays/dev/global-config.yaml.
kubectl delete pod run-local >/dev/null 2>&1 || true
kubectl run run-local --image="local/$name" \
  --image-pull-policy=Never \
  --restart=Never \
  --env="SPANNER_EMULATOR_HOST=cloud-spanner-emulator:9010" \
  --env="SPANNER_DATABASE_URI=projects/my-project/instances/my-instance/databases/db" \
  --env="LOCAL_BLOB_STORAGE_PATH=/tmp/blobs/" \
  --rm \
  --labels="app=db-mgmt" \
  --attach -- "$@"