Skip to content

Commit f293121

Browse files
authored
Merge pull request #3353 from kcp-ci-bot/cherry-pick-3349-to-release-0.27
[release-0.27] 🐛 Bump WorkspaceType `APIResourceSchema` name
2 parents 8747e45 + e385d19 commit f293121

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ verify-codegen: ## Verify codegen
224224
exit 1; \
225225
fi
226226

227+
./hack/verify-apiresourceschemas.sh
228+
227229
.PHONY: imports
228230
imports: WHAT ?=
229231
imports: $(GOLANGCI_LINT) verify-go-versions

config/root-phase0/apiexport-tenancy.kcp.io.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ metadata:
55
name: tenancy.kcp.io
66
spec:
77
latestResourceSchemas:
8-
- v240903-d6797056a.workspacetypes.tenancy.kcp.io
98
- v241020-fce06d31d.workspaces.tenancy.kcp.io
9+
- v250326-15b435656.workspacetypes.tenancy.kcp.io
1010
maximalPermissionPolicy:
1111
local: {}
1212
status: {}

config/root-phase0/apiresourceschema-workspacetypes.tenancy.kcp.io.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apis.kcp.io/v1alpha1
22
kind: APIResourceSchema
33
metadata:
44
creationTimestamp: null
5-
name: v240903-d6797056a.workspacetypes.tenancy.kcp.io
5+
name: v250326-15b435656.workspacetypes.tenancy.kcp.io
66
spec:
77
group: tenancy.kcp.io
88
names:

hack/verify-apiresourceschemas.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 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 ensures that the generated client code checked into git is up-to-date
18+
# with the generator. If it is not, re-generate the configuration to update it.
19+
20+
set -o errexit
21+
set -o nounset
22+
set -o pipefail
23+
24+
TARGET_REF=${PULL_BASE_REF:-main}
25+
26+
find config/root-phase0 -name 'apiresourceschema-*.yaml' | while read schema
27+
do
28+
if ! git diff --exit-code ${TARGET_REF} -- ${schema} 2>&1 >/dev/null; then
29+
current_name=$(yq '.metadata.name' ${schema})
30+
previous_name=$(git show ${TARGET_REF}:${schema} | yq '.metadata.name')
31+
32+
if [ "${current_name}" == "${previous_name}" ]; then
33+
echo "${schema} has changed in comparison to '${TARGET_REF}', but object name is the same (${current_name} == ${previous_name})."
34+
echo "This is not valid as APIResourceSchemas are immutable."
35+
echo "Please run \`make crds\` without modifying APIResourceSchema files manually."
36+
exit 1
37+
fi
38+
fi
39+
done

0 commit comments

Comments
 (0)