Skip to content

Commit

Permalink
Fix crd path
Browse files Browse the repository at this point in the history
  • Loading branch information
jswoods committed Jul 19, 2022
1 parent 6b6b9cd commit e66a644
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion charts/humio-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -14454,4 +14455,4 @@ status:
kind: ""
plural: ""
conditions: []
storedVersions: []
storedVersions: []
7 changes: 4 additions & 3 deletions hack/gen-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ echo "detected OSTYPE = $OSTYPE"

export RELEASE_VERSION=$(cat VERSION)

mkdir -p charts/humio-operator/crds || true
>charts/humio-operator/crds/crds.yaml
for c in $(find config/crd/bases/ -iname '*.yaml' | sort); do
# Write base CRD to helm chart file
mkdir -p charts/humio-operator/crds || true
cat $c >> charts/humio-operator/crds/crds.yaml

# Update base CRD's in-place with static values
Expand All @@ -33,10 +34,10 @@ done

# Update helm chart CRD's with additional chart install values.
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sed -i "/^spec:/i \ labels:\n app: '{{ .Chart.Name }}'\n app.kubernetes.io/name: '{{ .Chart.Name }}'\n app.kubernetes.io/instance: '{{ .Release.Name }}'\n app.kubernetes.io/managed-by: '{{ .Release.Service }}'\n helm.sh/chart: '{{ template \"humio.chart\" . }}'" charts/humio-operator/crds.yaml
sed -i "/^spec:/i \ labels:\n app: '{{ .Chart.Name }}'\n app.kubernetes.io/name: '{{ .Chart.Name }}'\n app.kubernetes.io/instance: '{{ .Release.Name }}'\n app.kubernetes.io/managed-by: '{{ .Release.Service }}'\n helm.sh/chart: '{{ template \"humio.chart\" . }}'" charts/humio-operator/crds/crds.yaml
elif [[ "$OSTYPE" == "darwin"* ]]; then
if [[ $(which gsed) ]]; then
gsed -i "/^spec:/i \ labels:\n app: '{{ .Chart.Name }}'\n app.kubernetes.io/name: '{{ .Chart.Name }}'\n app.kubernetes.io/instance: '{{ .Release.Name }}'\n app.kubernetes.io/managed-by: '{{ .Release.Service }}'\n helm.sh/chart: '{{ template \"humio.chart\" . }}'" charts/humio-operator/crds.yaml
gsed -i "/^spec:/i \ labels:\n app: '{{ .Chart.Name }}'\n app.kubernetes.io/name: '{{ .Chart.Name }}'\n app.kubernetes.io/instance: '{{ .Release.Name }}'\n app.kubernetes.io/managed-by: '{{ .Release.Service }}'\n helm.sh/chart: '{{ template \"humio.chart\" . }}'" charts/humio-operator/crds/crds.yaml
else
sed -i '' -E '/^spec:/i\ '$'\n''\ labels:'$'\n' charts/humio-operator/crds/crds.yaml
sed -i '' -E '/^spec:/i\ '$'\n''\ app: '"'{{ .Chart.Name }}'"$'\n' charts/humio-operator/crds/crds.yaml
Expand Down

0 comments on commit e66a644

Please sign in to comment.