Commit 30181d1
committed
Tighten CredentialRotation API per kube-api-linter
Surface a couple of guardrails that kube-api-linter (KAL) flagged
on the new types:
- Add an explicit MaxLength=36 on status.rotationID. The existing
Pattern constrains the value to a canonical UUID, but MaxLength
is the convention KAL expects and also limits the OpenAPI/CRD
schema explicitly.
- Promote the Conditions field's SSA tags (patchStrategy=merge,
patchMergeKey=type) into godoc markers in addition to the
struct tag. This matches the modern style upstream Kubernetes
uses on metav1.Condition slices and what KAL recommends.
Remaining KAL findings on the rest of the v1beta2 API (godoc
should start with the json field name, +default vs
+kubebuilder:default, etc.) are pre-existing project-wide and
are not addressed here to avoid churn unrelated to this PR.
Signed-off-by: shunki-fujita <shunki-fujita@cybozu.co.jp>1 parent aefab17 commit 30181d1
4 files changed
Lines changed: 8 additions & 1 deletion
File tree
- api/v1beta2
- charts/moco/templates/generated/crds
- config/crd
- bases
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2906 | 2906 | | |
2907 | 2907 | | |
2908 | 2908 | | |
| 2909 | + | |
2909 | 2910 | | |
2910 | 2911 | | |
2911 | 2912 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
0 commit comments