This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new 2226b92  [SPARK-49316] Generalize `printer-columns.sh` to handle 
`*.spark.apache.org-v1.yml` files
2226b92 is described below

commit 2226b921f79e6aba973445138945f127cf9a828a
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Mon Aug 19 21:00:06 2024 -0700

    [SPARK-49316] Generalize `printer-columns.sh` to handle 
`*.spark.apache.org-v1.yml` files
    
    ### What changes were proposed in this pull request?
    
    This PR aims to generalize `printer-columns.sh` to handle 
`*.spark.apache.org-v1.yml` files
    
    ### Why are the changes needed?
    
    To support the future CRDs generally.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs for now.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #73 from dongjoon-hyun/SPARK-49316.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 spark-operator-api/src/main/resources/printer-columns.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/spark-operator-api/src/main/resources/printer-columns.sh 
b/spark-operator-api/src/main/resources/printer-columns.sh
index d681d04..f49d2b2 100755
--- a/spark-operator-api/src/main/resources/printer-columns.sh
+++ b/spark-operator-api/src/main/resources/printer-columns.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,6 +21,7 @@
 # We do a yq to add printer columns
 
 SCRIPT_PATH=$(cd "$(dirname "$0")"; pwd)
-CRD_PATH="${SCRIPT_PATH}/../../../build/classes/java/main/META-INF/fabric8/sparkapplications.spark.apache.org-v1.yml"
-yq -i '.spec.versions[0] += ({"additionalPrinterColumns": [{"jsonPath": 
".status.currentState.currentStateSummary", "name": "Current State", "type": 
"string"}, {"jsonPath": ".metadata.creationTimestamp", "name": "Age", "type": 
"date"}]})' ${CRD_PATH}
+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
+done
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to