Skip to content

Commit

Permalink
operator: bump operator-sdk to v1.17.0, enhance bundle validation
Browse files Browse the repository at this point in the history
v1.16.0 added "good-practices" checks. Apparently optional checks cannot be
combined, so we now run validation twice. There is one
warning (intel#1067) which wasn't seen
earlier when using "make operator-validate-bundle" because warnings are not
treated as failures and the output was suppressed. Now we check for warnings
and at least show them, but still don't treat them as failure.
  • Loading branch information
pohly committed Mar 17, 2022
1 parent fef4764 commit 6d9fc1f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions operator/operator.make
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OPERATOR_SDK_VERSION=1.15.0
OPERATOR_SDK_VERSION=1.17.0
CONTROLLER_GEN_VERSION=v0.7.0
CONTROLLER_GEN=_work/bin/controller-gen-$(CONTROLLER_GEN_VERSION)

Expand Down Expand Up @@ -78,10 +78,16 @@ endif
@make operator-validate-bundle

operator-validate-bundle: _work/bin/operator-sdk-$(OPERATOR_SDK_VERSION) $(BUNDLE_DIR)
@if ! OUT="$$($< bundle validate --select-optional name=operatorhub $(BUNDLE_DIR))"; then \
@if ! OUT="$$($< bundle validate --select-optional name=operatorhub $(BUNDLE_DIR) 2>&1 && \
$< bundle validate --select-optional name=good-practices $(BUNDLE_DIR) 2>&1 )"; then \
echo >&2 "ERROR: Operator bundle in $(BUNDLE_DIR) did not pass validation:"; \
echo >&2 "$$OUT"; \
exit 1; \
elif echo "$$OUT" | grep -q -i -e "WARN" -e Warning; then \
echo "Operator bundle in $(BUNDLE_DIR) passed validation with warnings:"; \
echo "$$OUT"; \
else \
echo "Operator bundle in $(BUNDLE_DIR) passed validation without warnings."; \
fi

.PHONY: operator-generate
Expand Down

0 comments on commit 6d9fc1f

Please sign in to comment.