Skip to content

Commit

Permalink
chore: create task to run images in kind
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Jul 21, 2024
1 parent cbb26fa commit 6d40fb2
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions dev/tasks/run-in-kind
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT="$(git rev-parse --show-toplevel)"
cd ${REPO_ROOT}

. dev/tasks/build-images

kind load docker-image ${OPERATOR_IMG}

kind load docker-image ${CONTROLLER_IMG} ${RECORDER_IMG} ${WEBHOOK_IMG} ${DELETION_DEFENDER_IMG} ${UNMANAGED_DETECTOR_IMG}

cd ${REPO_ROOT}/operator
kustomize build config/crd | kubectl apply -f -
kustomize build config/default | sed -e s@imagePullPolicy:@#imagePullPolicy:@g | kubectl apply -f -


kubectl apply -f - <<EOF
apiVersion: core.cnrm.cloud.google.com/v1beta1
kind: ConfigConnector
metadata:
name: configconnector.core.cnrm.cloud.google.com
spec:
mode: namespaced
EOF

kubectl apply -f - <<EOF
apiVersion: core.cnrm.cloud.google.com/v1beta1
kind: ConfigConnectorContext
metadata:
name: configconnectorcontext.core.cnrm.cloud.google.com
namespace: default
spec:
#version: 1.2.3
googleServiceAccount: "kcc@fake-project.iam.gserviceaccount.com"
EOF

0 comments on commit 6d40fb2

Please sign in to comment.