Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor Flux base manifests #2

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
- name: Prepare
id: prep
run: |
make data

VERSION="${{ github.event.inputs.tag }}-${GITHUB_SHA::8}"
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF/refs\/tags\//}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@
# Go workspace file
go.work
bin/
data/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ WORKDIR /

# Copy the binary and manifests data.
COPY --from=builder /workspace/flux-operator .
COPY data/ /data/
COPY config/data/ /data/

# Run the operator as a non-root user.
USER 65532:65532
Expand Down
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Copyright 2024 Stefan Prodan.
# SPDX-License-Identifier: AGPL-3.0

# Makefile for building, testing, and deploying the Flux Operator.

# Image URL to use all building/pushing image targets
IMG ?= ghcr.io/controlplaneio-fluxcd/flux-operator:latest

# FLUX_VERSION refers to the version of Flux to be vendored.
FLUX_VERSION = $(shell gh release view --repo fluxcd/flux2 --json tagName -q '.tagName')

# ENVTEST_K8S_VERSION refers to the version of kubebuilder
# assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.30.0
Expand All @@ -29,7 +35,7 @@ all: build
##@ Development

.PHONY: manifests
manifests: data controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd paths="./..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate
Expand Down Expand Up @@ -75,9 +81,9 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
go run ./cmd/main.go

.PHONY: data
data: ## Download Flux manifests to data dir.
hack/data.sh v2.3.0 v2.2.3
.PHONY: vendor-flux
vendor-flux: ## Download Flux base manifests to config/flux dir.
hack/vendor-flux-manifests.sh $(FLUX_VERSION)

# If you wish to build the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
Expand All @@ -93,13 +99,10 @@ docker-push: ## Push docker image with the manager.
PLATFORMS ?= linux/arm64,linux/amd64
.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support.
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name flux-operator-builder
$(CONTAINER_TOOL) buildx use flux-operator-builder
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
- $(CONTAINER_TOOL) buildx rm flux-operator-builder
rm Dockerfile.cross

.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
Expand Down
2,343 changes: 2,343 additions & 0 deletions config/data/flux/v2.2.3/helm-controller.yaml

Large diffs are not rendered by default.

400 changes: 400 additions & 0 deletions config/data/flux/v2.2.3/image-automation-controller.yaml

Large diffs are not rendered by default.

Loading