Skip to content

Commit

Permalink
Fix undefined var
Browse files Browse the repository at this point in the history
  • Loading branch information
Jont828 committed Dec 17, 2024
1 parent 044d38e commit 5a0efc2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ TAG ?= dev
ARCH ?= $(GOARCH)
ALL_ARCH = amd64 arm arm64 ppc64le s390x

USE_AKS_MANAGEMENT_CLUSTER ?= false

# Allow overriding manifest generation destination directory
MANIFEST_ROOT ?= config
CRD_ROOT ?= $(MANIFEST_ROOT)/crd/bases
Expand Down Expand Up @@ -315,10 +317,10 @@ install-tools: $(ENVSUBST) $(KUSTOMIZE) $(KUBECTL) $(HELM) $(GINKGO) $(KIND) $(A
.PHONY: create-management-cluster
create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create a management cluster.
# Create management cluster.
if [ -z "${USE_AKS_MANAGEMENT_CLUSTER}" ]; then \
$(MAKE) kind-create ; \
else \
if "${USE_AKS_MANAGEMENT_CLUSTER}" ; then \
$(MAKE) aks-create ; \
else \
$(MAKE) kind-create ; \
fi

# Install cert manager and wait for availability
Expand All @@ -335,7 +337,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create
timeout --foreground 300 bash -c "until curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm/releases/download/v0.2.5/addon-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -; do sleep 5; done"

# Deploy CAPZ
@if [ -z "${USE_AKS_MANAGEMENT_CLUSTER}" ]; then \
@if ! "${USE_AKS_MANAGEMENT_CLUSTER}" ; then \
$(KIND) load docker-image $(CONTROLLER_IMG)-$(ARCH):$(TAG) --name=$(KIND_CLUSTER_NAME) ; \
fi
timeout --foreground 300 bash -c "until $(KUSTOMIZE) build config/default | $(ENVSUBST) | $(KUBECTL) apply -f - --server-side=true; do sleep 5; done"
Expand Down Expand Up @@ -758,10 +760,10 @@ aks-create: $(KUBECTL) ## Create aks cluster as mgmt cluster.
.PHONY: tilt-up
tilt-up: install-tools ## Start tilt and build kind cluster if needed.
# Create management cluster.
if [ -z "${USE_AKS_MANAGEMENT_CLUSTER}" ]; then \
$(MAKE) kind-create ; \
else \
if ${USE_AKS_MANAGEMENT_CLUSTER}" ; then \
$(MAKE) aks-create ; \
else \
$(MAKE) kind-create ; \
fi

@if [ -z "${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}" ]; then \
Expand Down
8 changes: 5 additions & 3 deletions scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export KIND_CLUSTER_NAME
export KUBECTL
export HELM

export USE_AKS_MANAGEMENT_CLUSTER="${USE_AKS_MANAGEMENT_CLUSTER:-false}"

# shellcheck source=hack/ensure-go.sh
source "${REPO_ROOT}/hack/ensure-go.sh"
# shellcheck source=hack/ensure-tags.sh
Expand Down Expand Up @@ -133,14 +135,14 @@ select_cluster_template() {

create_cluster() {
"${REPO_ROOT}/hack/create-dev-cluster.sh"
if [ -z "${USE_AKS_MANAGEMENT_CLUSTER}" ]; then
if "${USE_AKS_MANAGEMENT_CLUSTER}"; then
"${KUBECTL}" get clusters -A
else
if [ ! -f "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" ]; then
echo "Unable to find kubeconfig for kind mgmt cluster ${KIND_CLUSTER_NAME}"
exit 1
fi
"${KUBECTL}" --kubeconfig "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" get clusters -A
else
"${KUBECTL}" get clusters -A
fi;


Expand Down

0 comments on commit 5a0efc2

Please sign in to comment.