Skip to content

Commit

Permalink
add minified versions to address prometheus-community/helm-charts#1500
Browse files Browse the repository at this point in the history
  • Loading branch information
bergerx committed Jun 2, 2022
1 parent b063f50 commit db407cf
Show file tree
Hide file tree
Showing 6 changed files with 63,215 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
This is a temporary workaround for having all prometheus-operaotr CRDs in a single file:

We also host a minified version of the merged CRD files which has the description fields cropped.
This causes inconvenince when dealing with CRDs with commands like `kubectl
explain`, but is essentially an effective workaround for the
https://github.com/prometheus-community/helm-charts/issues/1500 issue.

Follow these steps to get the file ready.

```bash
Expand All @@ -8,7 +13,10 @@ NEW_MERGED_CRD_FILE=prometheus-operator-crds-${PROMETHEUS_OPERATOR_VERSION:?}.ya
test -d prometheus-operator || git clone https://github.com/prometheus-operator/prometheus-operator
pushd ./prometheus-operator; git pull -a; git co ${PROMETHEUS_OPERATOR_VERSION:?}; popd
cat ./prometheus-operator/example/prometheus-operator-crd/*.yaml > ${NEW_MERGED_CRD_FILE:?}
git add ${NEW_MERGED_CRD_FILE:?}
MERGED_MINIFIED_CRD_FILE=${NEW_MERGED_CRD_FILE/.yaml/-minified.yaml}
# see https://github.com/prometheus-community/helm-charts/issues/1500#issuecomment-1065572519 for more details on this
yq eval 'del(.. | .description?)' ${NEW_MERGED_CRD_FILE:?} > ${MERGED_MINIFIED_CRD_FILE:?}
git add ${NEW_MERGED_CRD_FILE:?} ${MERGED_MINIFIED_CRD_FILE:?}
git commit -m "Added prometheus operator CRDs file for ${PROMETHEUS_OPERATOR_VERSION:?}"
git push
```
Loading

0 comments on commit db407cf

Please sign in to comment.