Skip to content

Commit b8b1684

Browse files
xzxiongclaude
andauthored
fix: fix CI checks — CRD regeneration, license config, and lint (#588)
* fix: fix webhook tests and regenerate CRDs for controller-gen v0.16.0 ImageRepository was incorrectly marked +required but is an optional override field. Webhook tests created ExternalLogSet without the required HAKeeperEndpoint field. CRDs were stale and inconsistent with the Go type markers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update copyright year to 2025-2026 for modified files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add copyright-year and pattern to licenserc for year-range headers The license checker rejects headers like "Copyright 2025-2026" without a pattern that accepts year ranges. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: rename unused parameters to _ in fakeKubeClient.Patch Fixes golangci-lint revive/unused-parameter warning. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: change InitialConfig fields from +required to +optional LogShards, DNShards, and LogShardReplicas all have webhook defaults and are pointer types with omitempty — they are optional fields that get defaulted, not required inputs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eb9b356 commit b8b1684

32 files changed

Lines changed: 178 additions & 570 deletions

api/core/v1alpha1/logset_types.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Matrix Origin
1+
// Copyright 2025-2026 Matrix Origin
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -105,25 +105,25 @@ type InitialConfig struct {
105105
// LogShards is the initial number of log shards,
106106
// cannot be tuned after cluster creation currently.
107107
// default to 1
108-
// +required
108+
// +optional
109109
LogShards *int `json:"logShards,omitempty"`
110110

111111
// DNShards is the initial number of DN shards,
112112
// cannot be tuned after cluster creation currently.
113113
// default to 1
114-
// +required
114+
// +optional
115115
DNShards *int `json:"dnShards,omitempty"`
116116

117117
// HAKeeperReplicas is the initial number of HAKeeper replicas,
118118
// cannot be tuned after cluster creation currently.
119119
// default to 3 if LogSet replicas >= 3, to 1 otherwise
120-
// +required
120+
// +optional
121121
// HAKeeperReplicas *int `json:"haKeeperReplicas,omitempty"`
122122

123123
// LogShardReplicas is the replica numbers of each log shard,
124124
// cannot be tuned after cluster creation currently.
125125
// default to 3 if LogSet replicas >= 3, to 1 otherwise
126-
// +required
126+
// +optional
127127
LogShardReplicas *int `json:"logShardReplicas,omitempty"`
128128

129129
// RestoreFrom declares the HAKeeper data should be restored

api/core/v1alpha1/matrixonecluster_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Matrix Origin
1+
// Copyright 2025-2026 Matrix Origin
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@ type MatrixOneClusterSpec struct {
6666
// ImageRepository allows user to override the default image
6767
// repository in order to use a docker registry proxy or private
6868
// registry.
69-
// +required
69+
// +optional
7070
ImageRepository string `json:"imageRepository,omitempty"`
7171

7272
// TopologyEvenSpread specifies default topology policy for all components,

charts/matrixone-operator/templates/crds/core.matrixorigin.io_backupjobs.yaml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: backupjobs.core.matrixorigin.io
88
spec:
99
group: core.matrixorigin.io
@@ -211,7 +211,6 @@ spec:
211211
description: |-
212212
Name of the referent.
213213
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
214-
TODO: Add other useful fields. apiVersion, kind, uid?
215214
type: string
216215
type: object
217216
x-kubernetes-map-type: atomic
@@ -239,16 +238,8 @@ spec:
239238
type: string
240239
conditions:
241240
items:
242-
description: "Condition contains details for one aspect of the current
243-
state of this API Resource.\n---\nThis struct is intended for
244-
direct use as an array at the field path .status.conditions. For
245-
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
246-
observations of a foo's current state.\n\t // Known .status.conditions.type
247-
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
248-
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
249-
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
250-
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
251-
\ // other fields\n\t}"
241+
description: Condition contains details for one aspect of the current
242+
state of this API Resource.
252243
properties:
253244
lastTransitionTime:
254245
description: |-
@@ -289,12 +280,7 @@ spec:
289280
- Unknown
290281
type: string
291282
type:
292-
description: |-
293-
type of condition in CamelCase or in foo.example.com/CamelCase.
294-
---
295-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
296-
useful (see .node.status.conditions), the ability to deconflict is important.
297-
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
283+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
298284
maxLength: 316
299285
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
300286
type: string

charts/matrixone-operator/templates/crds/core.matrixorigin.io_backups.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: backups.core.matrixorigin.io
88
spec:
99
group: core.matrixorigin.io
@@ -126,7 +126,6 @@ spec:
126126
description: |-
127127
Name of the referent.
128128
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
129-
TODO: Add other useful fields. apiVersion, kind, uid?
130129
type: string
131130
type: object
132131
x-kubernetes-map-type: atomic

charts/matrixone-operator/templates/crds/core.matrixorigin.io_bucketclaims.yaml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: bucketclaims.core.matrixorigin.io
88
spec:
99
group: core.matrixorigin.io
@@ -106,7 +106,6 @@ spec:
106106
description: |-
107107
Name of the referent.
108108
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
109-
TODO: Add other useful fields. apiVersion, kind, uid?
110109
type: string
111110
type: object
112111
x-kubernetes-map-type: atomic
@@ -120,6 +119,7 @@ spec:
120119
type: object
121120
required:
122121
- logSetSpec
122+
- s3
123123
type: object
124124
status:
125125
description: Status is the current state of BucketClaim
@@ -130,16 +130,8 @@ spec:
130130
type: string
131131
conditions:
132132
items:
133-
description: "Condition contains details for one aspect of the current
134-
state of this API Resource.\n---\nThis struct is intended for
135-
direct use as an array at the field path .status.conditions. For
136-
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
137-
observations of a foo's current state.\n\t // Known .status.conditions.type
138-
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
139-
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
140-
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
141-
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
142-
\ // other fields\n\t}"
133+
description: Condition contains details for one aspect of the current
134+
state of this API Resource.
143135
properties:
144136
lastTransitionTime:
145137
description: |-
@@ -180,12 +172,7 @@ spec:
180172
- Unknown
181173
type: string
182174
type:
183-
description: |-
184-
type of condition in CamelCase or in foo.example.com/CamelCase.
185-
---
186-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
187-
useful (see .node.status.conditions), the ability to deconflict is important.
188-
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
175+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
189176
maxLength: 316
190177
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
191178
type: string

charts/matrixone-operator/templates/crds/core.matrixorigin.io_cnclaims.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: cnclaims.core.matrixorigin.io
88
spec:
99
group: core.matrixorigin.io

charts/matrixone-operator/templates/crds/core.matrixorigin.io_cnclaimsets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: cnclaimsets.core.matrixorigin.io
88
spec:
99
group: core.matrixorigin.io

charts/matrixone-operator/templates/crds/core.matrixorigin.io_cnpools.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: cnpools.core.matrixorigin.io
88
spec:
99
group: core.matrixorigin.io
@@ -53,11 +53,12 @@ spec:
5353
description: |-
5454
An external LogSet the CNSet should connected to,
5555
mutual exclusive with LogSet
56-
TODO: rethink the schema of ExternalLogSet
5756
properties:
5857
haKeeperEndpoint:
5958
description: HAKeeperEndpoint of the ExternalLogSet
6059
type: string
60+
required:
61+
- haKeeperEndpoint
6162
type: object
6263
logSet:
6364
description: The LogSet it depends on, mutual exclusive with ExternalLogSet
@@ -121,6 +122,8 @@ spec:
121122
StorageClassName reference to the storageclass of the desired volume,
122123
the default storageclass of the cluster would be used if no specified.
123124
type: string
125+
required:
126+
- size
124127
type: object
125128
clusterDomain:
126129
description: |-
@@ -228,11 +231,9 @@ spec:
228231
Claims lists the names of resources, defined in spec.resourceClaims,
229232
that are used by this container.
230233
231-
232234
This is an alpha field and requires enabling the
233235
DynamicResourceAllocation feature gate.
234236
235-
236237
This field is immutable. It can only be set for containers.
237238
items:
238239
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -289,11 +290,9 @@ spec:
289290
Claims lists the names of resources, defined in spec.resourceClaims,
290291
that are used by this container.
291292
292-
293293
This is an alpha field and requires enabling the
294294
DynamicResourceAllocation feature gate.
295295
296-
297296
This field is immutable. It can only be set for containers.
298297
items:
299298
description: ResourceClaim references one entry in PodSpec.ResourceClaims.

charts/matrixone-operator/templates/crds/core.matrixorigin.io_cnsets.yaml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.16.0
77
name: cnsets.core.matrixorigin.io
88
spec:
99
group: core.matrixorigin.io
@@ -47,11 +47,12 @@ spec:
4747
description: |-
4848
An external LogSet the CNSet should connected to,
4949
mutual exclusive with LogSet
50-
TODO: rethink the schema of ExternalLogSet
5150
properties:
5251
haKeeperEndpoint:
5352
description: HAKeeperEndpoint of the ExternalLogSet
5453
type: string
54+
required:
55+
- haKeeperEndpoint
5556
type: object
5657
logSet:
5758
description: The LogSet it depends on, mutual exclusive with ExternalLogSet
@@ -95,6 +96,8 @@ spec:
9596
StorageClassName reference to the storageclass of the desired volume,
9697
the default storageclass of the cluster would be used if no specified.
9798
type: string
99+
required:
100+
- size
98101
type: object
99102
clusterDomain:
100103
description: |-
@@ -202,11 +205,9 @@ spec:
202205
Claims lists the names of resources, defined in spec.resourceClaims,
203206
that are used by this container.
204207
205-
206208
This is an alpha field and requires enabling the
207209
DynamicResourceAllocation feature gate.
208210
209-
210211
This field is immutable. It can only be set for containers.
211212
items:
212213
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -262,11 +263,9 @@ spec:
262263
Claims lists the names of resources, defined in spec.resourceClaims,
263264
that are used by this container.
264265
265-
266266
This is an alpha field and requires enabling the
267267
DynamicResourceAllocation feature gate.
268268
269-
270269
This field is immutable. It can only be set for containers.
271270
items:
272271
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -429,16 +428,8 @@ spec:
429428
properties:
430429
conditions:
431430
items:
432-
description: "Condition contains details for one aspect of the current
433-
state of this API Resource.\n---\nThis struct is intended for
434-
direct use as an array at the field path .status.conditions. For
435-
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
436-
observations of a foo's current state.\n\t // Known .status.conditions.type
437-
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
438-
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
439-
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
440-
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
441-
\ // other fields\n\t}"
431+
description: Condition contains details for one aspect of the current
432+
state of this API Resource.
442433
properties:
443434
lastTransitionTime:
444435
description: |-
@@ -479,12 +470,7 @@ spec:
479470
- Unknown
480471
type: string
481472
type:
482-
description: |-
483-
type of condition in CamelCase or in foo.example.com/CamelCase.
484-
---
485-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
486-
useful (see .node.status.conditions), the ability to deconflict is important.
487-
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
473+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
488474
maxLength: 316
489475
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
490476
type: string

0 commit comments

Comments
 (0)