Skip to content

Commit 7d9ef4d

Browse files
committed
Handling the crds correctly in helm folder strucuture
Signed-off-by: kunal-511 <[email protected]>
1 parent efc4bd5 commit 7d9ef4d

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

experimental/helm/scripts/synchronize-cert-manager.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ COMPONENT="cert-manager"
1111
VERSION="v1.16.1"
1212
REPO="https://charts.jetstack.io"
1313
TEMPLATES_DIR="$CHART_DIR/templates/external/${COMPONENT}"
14+
CRDS_DIR="$CHART_DIR/crds"
1415
NAMESPACE="cert-manager"
1516

1617
rm -rf "$TEMPLATES_DIR"
1718
mkdir -p "$TEMPLATES_DIR"
19+
mkdir -p "$CRDS_DIR"
1820

1921
TEMP_DIR=$(mktemp -d)
2022
cd "$TEMP_DIR"
@@ -31,12 +33,12 @@ helm template "$COMPONENT" "$COMPONENT" \
3133
--set startupapicheck.enabled=false \
3234
--output-dir .
3335

34-
cp -r "$COMPONENT/templates/"* "$TEMPLATES_DIR/"
35-
36-
[ -d "$COMPONENT/crds" ] && {
37-
mkdir -p "$TEMPLATES_DIR/crds"
38-
cp -r "$COMPONENT/crds/"* "$TEMPLATES_DIR/crds/"
39-
}
36+
for file in "$COMPONENT/templates/"*.yaml; do
37+
if [ -f "$file" ] && [[ ! "$(basename "$file")" == crds.yaml ]]; then
38+
cp "$file" "$TEMPLATES_DIR/"
39+
fi
40+
done
41+
cat "$COMPONENT/templates/crds.yaml" > "$CRDS_DIR/cert-manager-crds.yaml"
4042

4143
python3 "$SCRIPT_DIR/patch-templates.py" "$TEMPLATES_DIR" "$COMPONENT"
4244

experimental/helm/scripts/synchronize-spark-operator.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ COMPONENT="spark-operator"
1111
VERSION="2.2.0"
1212
REPO="https://kubeflow.github.io/spark-operator"
1313
TEMPLATES_DIR="$CHART_DIR/templates/external/${COMPONENT}"
14+
CRDS_DIR="$CHART_DIR/crds"
1415
NAMESPACE="kubeflow"
1516

1617
rm -rf "$TEMPLATES_DIR"
1718
mkdir -p "$TEMPLATES_DIR"
19+
mkdir -p "$CRDS_DIR"
1820

1921
TEMP_DIR=$(mktemp -d)
2022
cd "$TEMP_DIR"
@@ -33,8 +35,7 @@ helm template "$COMPONENT" "$COMPONENT" \
3335
cp -r "$COMPONENT/templates/"* "$TEMPLATES_DIR/"
3436

3537
[ -d "$COMPONENT/crds" ] && {
36-
mkdir -p "$TEMPLATES_DIR/crds"
37-
cp -r "$COMPONENT/crds/"* "$TEMPLATES_DIR/crds/"
38+
cp -r "$COMPONENT/crds/"* "$CRDS_DIR/"
3839
}
3940

4041
python3 "$SCRIPT_DIR/patch-templates.py" "$TEMPLATES_DIR" "$COMPONENT"

0 commit comments

Comments
 (0)