Skip to content

Commit

Permalink
Merge pull request #27 from spectrocloud/PPD-1477
Browse files Browse the repository at this point in the history
PPD-1477: Include vCluster chart to enable airgap installation
  • Loading branch information
tiwarisumit3 authored Nov 7, 2024
2 parents 09fed0e + 41a6f13 commit 557624b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ WORKDIR /workspace

# Copy binaries
COPY --from=thirdparty /binaries/helm/latest/$BIN_TYPE/$TARGETARCH/helm helm
COPY ${HELM_CHART} vcluster-0.16.4.tgz

# Install Delve for debugging
RUN if [ "${TARGETARCH}" = "amd64" ]; then go install github.com/go-delve/delve/cmd/dlv@latest; fi
Expand All @@ -33,6 +32,9 @@ COPY api/ api/
COPY controllers/ controllers/
COPY pkg/ pkg/

# Copy vCluster charts
COPY /charts/ /charts/

# Build
RUN CGO_ENABLED=0 go build -a -o manager main.go

Expand All @@ -42,7 +44,7 @@ FROM --platform=linux/amd64 gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=builder /workspace/helm .
COPY --from=builder /workspace/vcluster-0.16.4.tgz .
COPY --from=builder /charts/ /charts/
USER 65532:65532

ENTRYPOINT ["/manager"]
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ SHELL = /usr/bin/env bash -o pipefail
all: build

BIN_DIR ?= ./bin
CHARTS_DIR ?= ./charts
bin-dir:
test -d $(BIN_DIR) || mkdir $(BIN_DIR)
test -d $(CHARTS_DIR) || mkdir $(CHARTS_DIR)

##@ General

Expand Down Expand Up @@ -185,4 +187,4 @@ HELM=$(BIN_DIR)/helm-$(GOOS)-$(GOARCH)
.PHONY: download-chart
download-chart: bin-dir ## Download vcluster chart
helm repo add loft https://charts.loft.sh
helm pull loft/vcluster --version $(VCLUSTER_CHART_VERSION) -d $(BIN_DIR)
helm pull loft/vcluster --version $(VCLUSTER_CHART_VERSION) -d $(CHARTS_DIR)
Binary file added charts/vcluster-0.16.4.tgz
Binary file not shown.
Binary file added charts/vcluster-k8s-0.16.4.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion controllers/vcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func (r *VClusterReconciler) redeployIfNeeded(ctx context.Context, vCluster *v1a

r.Log.Infof("Deploy virtual cluster %s/%s with values: %s", vCluster.Namespace, vCluster.Name, values)

chartPath := "./" + chartName + "-" + chartVersion + ".tgz"
chartPath := "/charts/" + chartName + "-" + chartVersion + ".tgz"
_, err = os.Stat(chartPath)
if err != nil {
// we have to upgrade / install the chart
Expand Down

0 comments on commit 557624b

Please sign in to comment.