Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 6d9fc1f

Browse files
committed
operator: bump operator-sdk to v1.17.0, enhance bundle validation
v1.16.0 added "good-practices" checks. Apparently optional checks cannot be combined, so we now run validation twice. There is one warning (#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.
1 parent fef4764 commit 6d9fc1f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

operator/operator.make

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
OPERATOR_SDK_VERSION=1.15.0
1+
OPERATOR_SDK_VERSION=1.17.0
22
CONTROLLER_GEN_VERSION=v0.7.0
33
CONTROLLER_GEN=_work/bin/controller-gen-$(CONTROLLER_GEN_VERSION)
44

@@ -78,10 +78,16 @@ endif
7878
@make operator-validate-bundle
7979

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

8793
.PHONY: operator-generate

0 commit comments

Comments
 (0)