jiangzho commented on code in PR #279:
URL:
https://github.com/apache/spark-kubernetes-operator/pull/279#discussion_r2198302562
##########
spark-operator-api/src/main/resources/finalize-generated-crd.sh:
##########
@@ -23,5 +23,15 @@
SCRIPT_PATH=$(cd "$(dirname "$0")"; pwd)
for f in $(ls
${SCRIPT_PATH}/../../../build/classes/java/main/META-INF/fabric8/*.spark.apache.org-v1.yml);
do
yq -i '.spec.versions[0] += ({"additionalPrinterColumns": [{"jsonPath":
".status.currentState.currentStateSummary", "name": "Current State", "type":
"string"}, {"jsonPath": ".metadata.creationTimestamp", "name": "Age", "type":
"date"}]})' $f
+ filename=$(basename "$f")
+
template_file_path="${SCRIPT_PATH}/../../../../build-tools/crd-templates/${filename}"
+
target_dir="${SCRIPT_PATH}/../../../../build-tools/helm/spark-kubernetes-operator/crds"
+ mkdir -p "${target_dir}"
+ target_file_path="${target_dir}/${filename}"
+ yq eval-all '
+ select(fileIndex == 1) as $source
+ | select(fileIndex == 0)
+ | .spec.versions += [$source.spec.versions[0]]
Review Comment:
I understand there's still concern about this auto-generation. The
automation was intended to reduce potential human error in maintaining the
large yaml file.
While this PR itself can be a bit big for that purpose, can we at least
reduce this to a test scenario validating the automated generated yaml in build
is fully contained in the checked-in CRD yaml?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]