Skip to content
Open
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
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ rm -rf $$TMP_DIR ;\
endef

.PHONY: bundle
bundle: operator-sdk manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
bundle: operator-sdk propagate-manifests manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Decouple remote manifest sync from the default bundle target.

Because this target now shells into hack/propagate.sh, and that script does a live git clone from argocd-operator (Line 42 in hack/propagate.sh), every make bundle depends on GitHub availability and the current tip of $(ARGOCD_OPERATOR_BRANCH)/master. That makes bundle generation non-reproducible and can break existing CI/E2E/docs workflows that already call make bundle as a normal local generation step.

Possible fix
-bundle: operator-sdk propagate-manifests manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
+bundle: operator-sdk manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
@@
 .PHONY: propagate-manifests
 propagate-manifests: ## compare and propagate manifests from argocd-operator repo
 	./hack/propagate.sh --skip-make --from-branch $(ARGOCD_OPERATOR_BRANCH)
+
+.PHONY: bundle-with-propagation
+bundle-with-propagation: propagate-manifests bundle

Also applies to: 284-293

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` at line 270, The default bundle generation path is too tightly
coupled to remote manifest syncing because the bundle target invokes
propagate-manifests, which shells into the live git clone flow in
hack/propagate.sh. Update the Makefile so bundle only performs local,
reproducible generation steps (operator-sdk, manifests, kustomize), and move the
remote sync behavior behind a separate explicit target or opt-in step. Keep the
existing bundle-related targets consistent by adjusting any adjacent
bundle/propagate-manifests definitions so make bundle no longer depends on
GitHub availability or upstream branch tip.

Source: Linked repositories

$(OPERATOR_SDK) generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
Expand All @@ -281,6 +281,16 @@ bundle-build: ## Build the bundle image.
bundle-push: ## Push the bundle image.
$(MAKE) docker-push IMG=$(BUNDLE_IMG)

ARGOCD_OPERATOR_BRANCH ?= master

# To run propagate-manifests target with the default argocd-operator master brach:
# make propagate-manifests
# To run propagate-manifests target with a custom argocd-operator branch or tag:
# ARGOCD_OPERATOR_BRANCH=release-0.19 make propagate-manifests
.PHONY: propagate-manifests
propagate-manifests: ## compare and propagate manifests from argocd-operator repo
./hack/propagate.sh --skip-make --from-branch $(ARGOCD_OPERATOR_BRANCH)

.PHONY: opm
OPM = ./bin/opm
opm: ## Download opm locally if necessary.
Expand Down
40 changes: 36 additions & 4 deletions hack/propagate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@

set -e

FROM_BRANCH="master"
SKIP_MAKE=false

usage() {
echo "Usage: $0 [--from-branch <branch>] [--skip-make]"
echo ""
echo "Options:"
echo " --from-branch <branch> argocd-operator repo branch or tag to source manifests from (default: master)"
echo " --skip-make skip running 'make bundle' after copying changed files (default: false)"
exit 1
}

while [[ $# -gt 0 ]]; do
case "$1" in
--from-branch)
FROM_BRANCH="$2"
shift 2
;;
--skip-make)
SKIP_MAKE=true
shift
;;
*)
usage
;;
esac
done

trap cleanup EXIT

function cleanup {
Expand All @@ -11,7 +39,7 @@ function cleanup {

mkdir -p /tmp/argocd-operator-hack

git clone https://github.com/argoproj-labs/argocd-operator.git /tmp/argocd-operator-hack/
git clone --depth 1 --branch "$FROM_BRANCH" --single-branch --no-tags https://github.com/argoproj-labs/argocd-operator.git /tmp/argocd-operator-hack/

changedFiles=$(diff -qr /tmp/argocd-operator-hack/config/crd/bases/ ../config/crd/bases/ | grep -v argoproj.io_argocdexports.yaml | grep differ | awk -F ' ' '{print $2}')

Expand All @@ -22,7 +50,11 @@ if [ -z "$changedFiles" ]
then
echo "No difference found"
else
cp ${changedFiles} ../config/crd/bases/
cd ..
make bundle
cp ${changedFiles} ../config/crd/bases/
if [ "$SKIP_MAKE" = false ]; then
cd ..
make bundle
else
echo "Skipping 'make bundle' (--skip-make specified)"
fi
fi