Skip to content

Commit 5a0fae1

Browse files
authored
Merge pull request #3466 from mikkeldamsgaard/add-crds-release
Add a bundled crds to the release
2 parents 8c661e0 + 1906b21 commit 5a0fae1

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.goreleaser.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,15 @@ archives:
100100
- kubectl-create-workspace
101101
name_template: "kubectl-create-workspace-plugin_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
102102

103+
before:
104+
hooks:
105+
- config/crds/crd-bundler.sh
106+
103107
release:
104108
draft: true
105109
mode: keep-existing
110+
extra_files:
111+
- glob: ./config/crds/crds.yaml
106112

107113
krews:
108114
- name: kcp

config/crds/crd-bundler.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2024 The KCP Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# This script bundles CRDs to be used in relation to goreleaser.
18+
CRDS_DIR=$(dirname "${0}")
19+
20+
CRDS_FILE="${CRDS_DIR}/crds.yaml"
21+
rm -f "${CRDS_FILE}"
22+
for file in "${CRDS_DIR}"/apis.kcp.*.yaml "${CRDS_DIR}"/cache.kcp.*.yaml \
23+
"${CRDS_DIR}"/core.kcp.*.yaml "${CRDS_DIR}"/tenancy.kcp.*.yaml \
24+
"${CRDS_DIR}"/topology.kcp.*.yaml; do
25+
cat "${file}" >> "${CRDS_FILE}"
26+
echo "--" >> "${CRDS_FILE}"
27+
echo "${file}" >> /tmp/debug
28+
done

0 commit comments

Comments
 (0)