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

API-1835: make it easy to replace operator integration output #98

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions make/targets/openshift/operator/mom.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ test-operator-integration: build
bash $(scripts_dir)/test-operator-integration.sh
.PHONY: test-operator-integration

update-test-operator-integration: build
REPLACE_TEST_OUTPUT=true bash $(scripts_dir)/test-operator-integration.sh

.PHONY: update-test-operator-integration
9 changes: 9 additions & 0 deletions scripts/test-operator-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ if ! command -v multi-operator-manager &> /dev/null; then
exit 1
fi

REPLACE_TEST_OUTPUT="${REPLACE_TEST_OUTPUT:-false}"

# Define the path to the operator binary
MOM_CMD="${MOM_CMD:-multi-operator-manager}"

Expand All @@ -39,5 +41,12 @@ APPLY_CONFIG_ARGS=(
--output-dir="$APPLY_CONFIG_OUTPUT_DIR"
)

if [ "$REPLACE_TEST_OUTPUT" == "true" ]
then
APPLY_CONFIG_ARGS=("${APPLY_CONFIG_ARGS[@]}" "--replace-expected-output=true")
else
APPLY_CONFIG_ARGS=("${APPLY_CONFIG_ARGS[@]}" "--preserve-policy=KeepAlways")
fi

# Run the apply-configuration command from the operator
"${MOM_CMD}" "${APPLY_CONFIG_ARGS[@]}"