Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

[WIP] stacks: Put CRD yaml files in apiGroup directories #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bin/kubectl-crossplane-stack-init
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function create_manifest {
mkdir -p config/stack/manifests
touch config/stack/manifests/app.yaml
cat > config/stack/manifests/app.yaml <<EOF
apiVersion: 0.1.0
title: ""
readme: ""
overview: ""
Expand Down Expand Up @@ -262,8 +263,11 @@ bundle: $(STACK_PACKAGE_REGISTRY)
# An alternate and simpler-looking approach would
# be to cat all of the files into a single crd.yaml.
find $(CRD_DIR) -type f -name '*.yaml' | \
while read filename ; do cat $$filename > \
$(STACK_PACKAGE_REGISTRY)/resources/$$( basename $$(echo $$filename | sed s/.yaml$$/.crd.yaml/)) \
while read filename ; do \
mkdir -p $(STACK_PACKAGE_REGISTRY)/resources/$$(basename $${filename%_*}); \
concise=$${filename#*_}; \
cat $$filename > \
$(STACK_PACKAGE_REGISTRY)/resources/$$( basename $${filename%_*} )/$$( basename $${concise/.yaml/.crd.yaml} ) \
; done

cp -r $(STACK_PACKAGE_REGISTRY_SOURCE)/* $(STACK_PACKAGE_REGISTRY)
Expand Down