Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
13cd810
add webhook v1
TylerGillson Jun 28, 2022
743da08
revert module rename
TylerGillson Jul 20, 2022
bfb7b08
Merge remote-tracking branch 'upstream/main' into main
TylerGillson Aug 15, 2022
06b75ce
remove ENABLE_WEBHOOKS var - check webhookPort arg
TylerGillson Aug 15, 2022
bac6eb5
make img tag consistent w/ Spectro repos
TylerGillson Aug 15, 2022
4930092
fix CVE-2014-9357
TylerGillson Aug 22, 2022
6b27ee8
add dev image make command
TylerGillson Aug 22, 2022
b96811d
fix log levels & ensure consistent errors upon failure
TylerGillson Aug 22, 2022
577d08d
update vcluster spec with correct k8s version
TylerGillson Aug 24, 2022
3bc0cc6
Merge branch 'spectrocloud' into tyler/k8s-version-fix
TylerGillson Aug 24, 2022
066fc8f
allow K8s version change; disallow name change
TylerGillson Aug 24, 2022
c1c838d
Merge pull request #2 from spectrocloud/tyler/fix-webhook
TylerGillson Aug 24, 2022
880d4cf
Merge pull request #1 from spectrocloud/tyler/k8s-version-fix
TylerGillson Aug 24, 2022
766698d
do not obfuscate helm upgrade err
TylerGillson Aug 25, 2022
391744f
Add support for VCluster pause/resume (#3)
TylerGillson Aug 30, 2022
44bbbb4
PPD-232: fix webhook naming; add spectro kustomizations (#4)
TylerGillson Sep 20, 2022
5790058
docs: remove Readme section for older clusterctl versions
matskiv Aug 31, 2022
10fc181
docs: add Readme section about vcluster CR
matskiv Aug 31, 2022
7d59dff
fix merge issues
TylerGillson Dec 13, 2022
b728c3c
default to v0.13.0 chart
TylerGillson Dec 13, 2022
f869737
rename img; fix devspace config & resource specs
TylerGillson Dec 13, 2022
f48c100
fix logger
TylerGillson Dec 13, 2022
7e3d9b9
upgrade helm; fix devspace config
TylerGillson Dec 22, 2022
b465d60
address CVEs (#6)
TylerGillson Feb 28, 2023
5f43ca7
use spectro helm fork (#8)
TylerGillson Mar 27, 2023
322be1f
fix PSS-10752
TylerGillson May 4, 2023
a3e38b0
fix PSS-10529, PSS-10751
TylerGillson May 4, 2023
7fd8796
PPD-1276: added vcluster chart into the capvc image
shubhamrajvanshi Jun 6, 2023
a86ca7e
Merge pull request #10 from spectrocloud/PPD-1276
shubhamrajvanshi Jun 6, 2023
9bfeb12
PSS-2862: security fixes (#11)
TylerGillson Jun 23, 2023
9378fce
bulwark gitleaks - pr validation action (#7)
afayasa Jun 27, 2023
09410bc
PSS-2862: additional security fixes (#12)
TylerGillson Jun 27, 2023
ff78a01
fix getK8sImageVersionFromValues; make image lookup order-agnostic (#13)
TylerGillson Aug 14, 2023
ba19450
PCP-2001: updated builder image and makefile
shubhamrajvanshi Oct 18, 2023
5b441b4
Merge pull request #15 from spectrocloud/PCP-2001
shubhamrajvanshi Oct 18, 2023
21ce33f
PPD-1395: upgrade vcluster to v0.16.4
a-kad Nov 6, 2023
4695a0a
Merge pull request #17 from spectrocloud/ppd-1395
tiwarisumit3 Nov 7, 2023
e644659
PPD-1395: fix typo
a-kad Nov 7, 2023
393fd39
Merge pull request #18 from spectrocloud/ppd-1395-2
a-kad Nov 7, 2023
d7dc306
PPD-1435: Upgrade vCluster to v0.19.5
a-kad May 2, 2024
21242b9
Merge pull request #19 from spectrocloud/PPD-1435
a-kad May 3, 2024
d8a0a3d
Upgrade Go to v1.22
a-kad May 8, 2024
ebea9d5
Merge pull request #20 from spectrocloud/PSS-23736
a-kad May 8, 2024
1cfbf9e
Update Helm binary
a-kad May 16, 2024
df4929f
Update Helm binary
a-kad May 16, 2024
bf07237
Update Helm binary
a-kad May 16, 2024
30a5328
Merge pull request #21 from spectrocloud/PSS-23736-2
a-kad May 17, 2024
3e7e1e4
Upgrade CAPVC
a-kad May 17, 2024
05aa110
Upgrade CAPVC
a-kad May 23, 2024
598d1b0
Upgrade CAPVC, update Dockerfile
a-kad May 24, 2024
074ffcb
Upgrade CAPVC, update controller
a-kad May 24, 2024
dbf1630
Update Dockerfile
shubhamrajvanshi May 30, 2024
85766ad
Update Dockerfile and Makefile for Helm binary update
shubhamrajvanshi May 31, 2024
6a090b6
Revert Vcluster version
a-kad May 31, 2024
62e01a0
Revert Vcluster version, Makefile
a-kad May 31, 2024
d0ed347
Merge pull request #23 from spectrocloud/vcluster-version-revert
a-kad May 31, 2024
873343b
update
a-kad Jun 10, 2024
a7d2ec7
Merge branch 'spectrocloud' into PPD-1435
a-kad Jun 10, 2024
c4e2b37
Fix versions
a-kad Jun 10, 2024
efe397e
update webhook port
a-kad Jun 11, 2024
fccbc1d
Merge pull request #22 from spectrocloud/PPD-1435
a-kad Jun 11, 2024
4974aa5
Revert "PPD-1435: Upgrade CAPVC"
a-kad Jul 1, 2024
656833c
Merge pull request #24 from spectrocloud/revert-22-PPD-1435
a-kad Jul 2, 2024
5704ef8
PCP-3117: Fixed dockerfile and updated dependencies
shubhamrajvanshi Jul 3, 2024
c705e83
Merge pull request #25 from spectrocloud/PCP-3117
shubhamrajvanshi Jul 3, 2024
a500e5e
PEM-5500: Upgrade Go packages
a-kad Aug 1, 2024
d56f42f
PEM-5500: clean up unused vendor files
a-kad Aug 1, 2024
09fed0e
Merge pull request #26 from spectrocloud/PEM-5500
a-kad Aug 7, 2024
a50e6f9
PPD-1477: Include vCluster chart to enable airgap installation
a-kad Nov 7, 2024
41a6f13
PPD-1477: Include vCluster chart to enable airgap installation, add K…
a-kad Nov 7, 2024
557624b
Merge pull request #27 from spectrocloud/PPD-1477
tiwarisumit3 Nov 7, 2024
a58d70f
PPD-1477: refactor (non-breaking typo)
a-kad Nov 7, 2024
3911852
PPD-1477: refactor (non-breaking typo)
a-kad Nov 7, 2024
afa9019
Merge pull request #28 from spectrocloud/PPD-1477
shubhamrajvanshi Nov 7, 2024
302f5b7
PPD-1435: Upgrade CAPVC to v0.18.1
a-kad Nov 20, 2024
7f8c4ac
Merge pull request #29 from spectrocloud/PPD-1435-3
shubhamrajvanshi Nov 25, 2024
0413373
PPD-1489: Add vcluster service FQDN
a-kad Nov 29, 2024
528e349
Merge pull request #30 from spectrocloud/PPD-1489
tiwarisumit3 Dec 2, 2024
42d2320
PPD-1452: Upgrade CAPVC
a-kad Feb 6, 2025
f076e36
PPD-1452: Upgrade CAPVC, update
a-kad Feb 6, 2025
7b5c2bf
PPD-1452: Upgrade CAPVC, update
a-kad Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
# Ignore build and test binaries.
bin/
# Ignore test binaries.
testbin/
40 changes: 40 additions & 0 deletions .github/workflows/bulwark-gitleaks-pr-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: BulwarkGitLeaks
on: [pull_request]

concurrency:
group: gitleaks-${{ github.ref }}
cancel-in-progress: true

jobs:
gitleaks-scan:
runs-on: ubuntu-latest
container:
image: gcr.io/spectro-dev-public/bulwark/gitleaks:latest
env:
REPO: ${{ github.event.repository.name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_CONFIG: config.toml
steps:

- name: run-bulwark-gitleaks-scan
shell: sh
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
run: /workspace/bulwark -name CodeSASTGitLeaks -target $REPO -tags "branch:$BRANCH,options:--log-opts origin..HEAD"

- name: check-result
shell: sh
run: |
resultPath=./$REPO/gitleaks.json
if ! [ -f $resultPath ]; then
echo "GitLeaks validation check skipped"
exit 0
fi
cat $resultPath | grep -v \"Match\"\: | grep -v \"Secret\"\:
total_failed_tests=`cat $resultPath | grep \"Fingerprint\"\: | wc -l`
if [ "$total_failed_tests" -gt 0 ]; then
echo "GitLeaks validation check failed with above findings..."
exit 1
else
echo "GitLeaks validation check passed"
fi
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ testbin/*

# editor and IDE paraphernalia
.idea
.vscode
*.swp
*.swo
*~

# release dir where infrastructure-components.yaml and other release artifacts will be created
/release/

# devlopment tmp files
# development tmp files
/.devspace/
devvalues.yaml
kubeconfig.yaml
kubeconfig.yaml

config/manager/secret.yaml
24 changes: 0 additions & 24 deletions .vscode/launch.json

This file was deleted.

26 changes: 16 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
ARG BUILDER_GOLANG_VERSION
ARG BUILDER_3RDPARTY_VERSION
# Build the manager binary
FROM golang:1.18 as builder
FROM --platform=$TARGETPLATFORM gcr.io/spectro-images-public/builders/spectro-third-party:${BUILDER_3RDPARTY_VERSION} as thirdparty
FROM --platform=linux/amd64 gcr.io/spectro-images-public/golang:${BUILDER_GOLANG_VERSION}-alpine as builder

ENV BIN_TYPE=${CRYPTO_LIB:+vertex}
ENV BIN_TYPE=${BIN_TYPE:-palette}

ARG TARGETOS
ARG TARGETARCH

WORKDIR /workspace

# Copy binaries
COPY --from=thirdparty /binaries/helm/latest/$BIN_TYPE/$TARGETARCH/helm helm

# Install Delve for debugging
RUN if [ "${TARGETARCH}" = "amd64" ]; then go install github.com/go-delve/delve/cmd/dlv@latest; fi

# Install Helm 3
RUN curl -s https://get.helm.sh/helm-v3.1.2-linux-amd64.tar.gz > helm3.tar.gz \
&& tar -zxvf helm3.tar.gz linux-amd64/helm \
&& chmod +x linux-amd64/helm \
&& mv linux-amd64/helm $PWD/helm \
&& rm helm3.tar.gz \
&& rm -R linux-amd64

# Copy the Go Modules manifests
COPY go.mod go.mod
Expand All @@ -30,15 +32,19 @@ COPY api/ api/
COPY controllers/ controllers/
COPY pkg/ pkg/

# Copy vCluster charts
COPY charts/ /charts/

# Build
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager main.go
RUN CGO_ENABLED=0 go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
FROM --platform=linux/amd64 gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=builder /workspace/helm .
COPY --from=builder /charts/ /charts/
USER 65532:65532

ENTRYPOINT ["/manager"]
21 changes: 21 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Build the manager binary
FROM golang:alpine3.16 as builder

RUN apk add --no-cache gcc g++ bash curl tar

# Install Delve for debugging
RUN go install github.com/go-delve/delve/cmd/dlv@latest

ARG HELM=./bin/helm-linux-amd64

WORKDIR /

# Copy binaries
COPY ${HELM} helm

# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
58 changes: 52 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
# If you update this file, please follow:
# https://suva.sh/posts/well-documented-makefiles/

.DEFAULT_GOAL:=help

VERSION_SUFFIX ?= -dev
PROD_VERSION ?= 4.4.0${VERSION_SUFFIX}
BUILDER_GOLANG_VERSION ?= 1.22
TARGETARCH ?= amd64
BUILDER_3RDPARTY_VERSION ?= $(shell echo $(PROD_VERSION) | cut -d. -f1,2)
BUILD_DATE:=$(shell date +%Y%m%d)
IMG_NAME ?= cluster-api-virtual-controller
# IMG_URL ?= gcr.io/spectro-images-public/release/cluster-api-virtual/
IMG_URL ?= gcr.io/spectro-dev-public/${USER}/cluster-api-virtual
IMG_TAG ?= v0.1.3-spectro-${BUILD_DATE}
IMG ?= $(IMG_URL)/$(IMG_NAME):$(IMG_TAG)
BUILD_ARGS = --build-arg CRYPTO_LIB=${FIPS_ENABLE} --build-arg BUILDER_GOLANG_VERSION=${BUILDER_GOLANG_VERSION} --build-arg BUILDER_3RDPARTY_VERSION=${BUILDER_3RDPARTY_VERSION}

TAG ?= main
# Image URL to use all building/pushing image targets
IMG ?= docker.io/loftsh/cluster-api-provider-vcluster:$(TAG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.23
# HELM_VERSION = 3.12.0
HELM_VERSION = 3.11.2-20230627
VCLUSTER_CHART_VERSION = 0.18.1

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
GOARCH ?= $(shell go env GOARCH)
GOOS ?= $(shell go env GOOS)

# Setting SHELL to bash allows bash commands to be executed by recipes.
# This is a requirement for 'setup-envtest.sh' in the test target.
Expand All @@ -21,6 +40,12 @@ SHELL = /usr/bin/env bash -o pipefail
.PHONY: all
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

# The help target prints out all targets with their descriptions organized
Expand Down Expand Up @@ -71,13 +96,21 @@ run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go

.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
docker build -t ${IMG} .
docker-build: binaries ## Build docker image with the manager.
docker build --platform linux/${TARGETARCH} ${BUILD_ARGS} -t ${IMG} .

.PHONY: docker-push
docker-push: ## Push docker image with the manager.
docker push ${IMG}

.PHONY: docker
docker: binaries docker-build docker-push ## Build & push docker image with the manager.

.PHONY: docker-build-dev
docker-build-dev: binaries ## Build & push docker dev image with the manager.
docker build -f ./Dockerfile.dev -t ${IMG} .
docker push ${IMG}

##@ Deployment

ifndef ignore-not-found
Expand Down Expand Up @@ -142,4 +175,17 @@ release: manifests kustomize ## Builds the manifests to publish with a release.
# revert the values back to development ones
sed -i'' -e 's@image: .*@image: docker.io/loftsh/cluster-api-provider-vcluster:main@' ./config/default/manager_image_patch.yaml
sed -i'' -e 's@imagePullPolicy: '"$(PULL_POLICY)"'@imagePullPolicy: IfNotPresent@' ./config/default/manager_pull_policy_patch.yaml
sed -i'' -e 's@name: $${CLUSTER_ROLE:=cluster-admin}@name: cluster-admin@' ./config/rbac/provider_role_binding.yaml
sed -i'' -e 's@name: $${CLUSTER_ROLE:=cluster-admin}@name: cluster-admin@' ./config/rbac/provider_role_binding.yaml

##@ Binaries

.PHONY: binaries
binaries: download-chart ## Download binaries

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 $(CHARTS_DIR)
helm pull loft/vcluster-k8s --version $(VCLUSTER_CHART_VERSION) -d $(CHARTS_DIR)
4 changes: 4 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ resources:
kind: VCluster
path: github.com/loft-sh/cluster-api-provider-vcluster/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
version: "3"
Loading