Skip to content

Commit d678562

Browse files
dependabot[bot]camilamacedo86
authored andcommitted
Replace deprecated marker for required fields
1 parent e224f78 commit d678562

4 files changed

Lines changed: 33 additions & 33 deletions

File tree

api/v1/clustercatalog_types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type ClusterCatalog struct {
6262

6363
// spec is a required field that defines the desired state of the ClusterCatalog.
6464
// The controller ensures that the catalog is unpacked and served over the catalog content HTTP server.
65-
// +kubebuilder:validation:Required
65+
// +required
6666
Spec ClusterCatalogSpec `json:"spec"`
6767

6868
// status contains the following information about the state of the ClusterCatalog:
@@ -85,7 +85,7 @@ type ClusterCatalogList struct {
8585

8686
// items is a list of ClusterCatalogs.
8787
// items is required.
88-
// +kubebuilder:validation:Required
88+
// +required
8989
Items []ClusterCatalog `json:"items"`
9090
}
9191

@@ -105,7 +105,7 @@ type ClusterCatalogSpec struct {
105105
// image:
106106
// ref: quay.io/operatorhubio/catalog:latest
107107
//
108-
// +kubebuilder:validation:Required
108+
// +required
109109
Source CatalogSource `json:"source"`
110110

111111
// priority is an optional field that defines a priority for this ClusterCatalog.
@@ -199,7 +199,7 @@ type ClusterCatalogURLs struct {
199199
//
200200
// New endpoints may be added as needs evolve.
201201
//
202-
// +kubebuilder:validation:Required
202+
// +required
203203
// +kubebuilder:validation:MaxLength:=525
204204
// +kubebuilder:validation:XValidation:rule="isURL(self)",message="must be a valid URL"
205205
// +kubebuilder:validation:XValidation:rule="isURL(self) ? (url(self).getScheme() == \"http\" || url(self).getScheme() == \"https\") : true",message="scheme must be either http or https"
@@ -220,7 +220,7 @@ type CatalogSource struct {
220220
//
221221
// +unionDiscriminator
222222
// +kubebuilder:validation:Enum:="Image"
223-
// +kubebuilder:validation:Required
223+
// +required
224224
Type SourceType `json:"type"`
225225
// image configures how catalog contents are sourced from an OCI image.
226226
// It is required when type is Image, and forbidden otherwise.
@@ -241,7 +241,7 @@ type ResolvedCatalogSource struct {
241241
//
242242
// +unionDiscriminator
243243
// +kubebuilder:validation:Enum:="Image"
244-
// +kubebuilder:validation:Required
244+
// +required
245245
Type SourceType `json:"type"`
246246
// image contains resolution information for a catalog sourced from an image.
247247
// It must be set when type is Image, and forbidden otherwise.
@@ -253,7 +253,7 @@ type ResolvedImageSource struct {
253253
// ref contains the resolved image digest-based reference.
254254
// The digest format allows you to use other tooling to fetch the exact OCI manifests
255255
// that were used to extract the catalog contents.
256-
// +kubebuilder:validation:Required
256+
// +required
257257
// +kubebuilder:validation:MaxLength:=1000
258258
// +kubebuilder:validation:XValidation:rule="self.matches('^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])((\\\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(:[0-9]+)?\\\\b')",message="must start with a valid domain. valid domains must be alphanumeric characters (lowercase and uppercase) separated by the \".\" character."
259259
// +kubebuilder:validation:XValidation:rule="self.find('(\\\\/[a-z0-9]+((([._]|__|[-]*)[a-z0-9]+)+)?((\\\\/[a-z0-9]+((([._]|__|[-]*)[a-z0-9]+)+)?)+)?)') != \"\"",message="a valid name is required. valid names must contain lowercase alphanumeric characters separated only by the \".\", \"_\", \"__\", \"-\" characters."
@@ -307,7 +307,7 @@ type ImageSource struct {
307307
// An example of a valid digest-based image reference is "quay.io/operatorhubio/catalog@sha256:200d4ddb2a73594b91358fe6397424e975205bfbe44614f5846033cad64b3f05"
308308
// An example of a valid tag-based image reference is "quay.io/operatorhubio/catalog:latest"
309309
//
310-
// +kubebuilder:validation:Required
310+
// +required
311311
// +kubebuilder:validation:MaxLength:=1000
312312
// +kubebuilder:validation:XValidation:rule="self.matches('^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])((\\\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(:[0-9]+)?\\\\b')",message="must start with a valid domain. valid domains must be alphanumeric characters (lowercase and uppercase) separated by the \".\" character."
313313
// +kubebuilder:validation:XValidation:rule="self.find('(\\\\/[a-z0-9]+((([._]|__|[-]*)[a-z0-9]+)+)?((\\\\/[a-z0-9]+((([._]|__|[-]*)[a-z0-9]+)+)?)+)?)') != \"\"",message="a valid name is required. valid names must contain lowercase alphanumeric characters separated only by the \".\", \"_\", \"__\", \"-\" characters."

api/v1/clusterextension_types.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type ClusterExtensionSpec struct {
6363
// +kubebuilder:validation:MaxLength:=63
6464
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="namespace is immutable"
6565
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$\")",message="namespace must be a valid DNS1123 label"
66-
// +kubebuilder:validation:Required
66+
// +required
6767
Namespace string `json:"namespace"`
6868

6969
// serviceAccount specifies a ServiceAccount used to perform all interactions with the cluster
@@ -72,7 +72,7 @@ type ClusterExtensionSpec struct {
7272
// The ServiceAccount must exist in the namespace referenced in the spec.
7373
// The serviceAccount field is required.
7474
//
75-
// +kubebuilder:validation:Required
75+
// +required
7676
ServiceAccount ServiceAccountReference `json:"serviceAccount"`
7777

7878
// source is required and selects the installation source of content for this ClusterExtension.
@@ -88,7 +88,7 @@ type ClusterExtensionSpec struct {
8888
// catalog:
8989
// packageName: example-package
9090
//
91-
// +kubebuilder:validation:Required
91+
// +required
9292
Source SourceConfig `json:"source"`
9393

9494
// install is optional and configures installation options for the ClusterExtension,
@@ -137,7 +137,7 @@ type SourceConfig struct {
137137
//
138138
// +unionDiscriminator
139139
// +kubebuilder:validation:Enum:="Catalog"
140-
// +kubebuilder:validation:Required
140+
// +required
141141
SourceType string `json:"sourceType"`
142142

143143
// catalog configures how information is sourced from a catalog.
@@ -177,7 +177,7 @@ type ClusterExtensionConfig struct {
177177
//
178178
// +unionDiscriminator
179179
// +kubebuilder:validation:Enum:="Inline"
180-
// +kubebuilder:validation:Required
180+
// +required
181181
ConfigType ClusterExtensionConfigType `json:"configType"`
182182

183183
// inline contains JSON or YAML values specified directly in the ClusterExtension.
@@ -220,7 +220,7 @@ type CatalogFilter struct {
220220
// +kubebuilder:validation:MaxLength:=253
221221
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="packageName is immutable"
222222
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="packageName must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
223-
// +kubebuilder:validation:Required
223+
// +required
224224
PackageName string `json:"packageName"`
225225

226226
// version is an optional semver constraint (a specific version or range of versions).
@@ -403,7 +403,7 @@ type ServiceAccountReference struct {
403403
// +kubebuilder:validation:MaxLength:=253
404404
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable"
405405
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="name must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
406-
// +kubebuilder:validation:Required
406+
// +required
407407
Name string `json:"name"`
408408
}
409409

@@ -431,7 +431,7 @@ type CRDUpgradeSafetyPreflightConfig struct {
431431
// When set to "Strict", the CRD Upgrade Safety pre-flight check runs during an upgrade operation.
432432
//
433433
// +kubebuilder:validation:Enum:="None";"Strict"
434-
// +kubebuilder:validation:Required
434+
// +required
435435
Enforcement CRDUpgradeSafetyEnforcement `json:"enforcement"`
436436
}
437437

@@ -455,14 +455,14 @@ type BundleMetadata struct {
455455
// It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.),
456456
// start and end with an alphanumeric character, and be no longer than 253 characters.
457457
//
458-
// +kubebuilder:validation:Required
458+
// +required
459459
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="packageName must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
460460
Name string `json:"name"`
461461

462462
// version is required and references the version that this bundle represents.
463463
// It follows the semantic versioning standard as defined in https://semver.org/.
464464
//
465-
// +kubebuilder:validation:Required
465+
// +required
466466
// +kubebuilder:validation:XValidation:rule="self.matches(\"^([0-9]+)(\\\\.[0-9]+)?(\\\\.[0-9]+)?(-([-0-9A-Za-z]+(\\\\.[-0-9A-Za-z]+)*))?(\\\\+([-0-9A-Za-z]+(-\\\\.[-0-9A-Za-z]+)*))?\")",message="version must be well-formed semver"
467467
Version string `json:"version"`
468468
}
@@ -533,7 +533,7 @@ type ClusterExtensionInstallStatus struct {
533533
// A "bundle" is a versioned set of content that represents the resources that need to be applied
534534
// to a cluster to install a package.
535535
//
536-
// +kubebuilder:validation:Required
536+
// +required
537537
Bundle BundleMetadata `json:"bundle"`
538538
}
539539

@@ -575,7 +575,7 @@ type ClusterExtensionList struct {
575575

576576
// items is a required list of ClusterExtension objects.
577577
//
578-
// +kubebuilder:validation:Required
578+
// +required
579579
Items []ClusterExtension `json:"items"`
580580
}
581581

api/v1/clusterextensionrevision_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type ClusterExtensionRevisionSpec struct {
6161
// Each ClusterExtensionRevision belonging to the same parent ClusterExtension must have a unique revision number.
6262
// The revision number must always be the previous revision number plus one, or 1 for the first revision.
6363
//
64-
// +kubebuilder:validation:Required
64+
// +required
6565
// +kubebuilder:validation:Minimum:=1
6666
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="revision is immutable"
6767
Revision int64 `json:"revision"`
@@ -253,7 +253,7 @@ type ClusterExtensionRevisionList struct {
253253

254254
// items is a required list of ClusterExtensionRevision objects.
255255
//
256-
// +kubebuilder:validation:Required
256+
// +required
257257
Items []ClusterExtensionRevision `json:"items"`
258258
}
259259

hack/tools/crd-generator/testdata/api/v1/clusterextension_types.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type ClusterExtensionSpec struct {
6060
// <opcon:standard:validation:XValidation:rule="self == oldSelf",message="namespace is immutable">
6161
// <opcon:experimental:validation:XValidation:rule="self == oldSelf",message="namespace really is immutable">
6262
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$\")",message="namespace must be a valid DNS1123 label"
63-
// +kubebuilder:validation:Required
63+
// +required
6464
Namespace string `json:"namespace"`
6565

6666
// serviceAccount is a reference to a ServiceAccount used to perform all interactions
@@ -69,7 +69,7 @@ type ClusterExtensionSpec struct {
6969
// The ServiceAccount must exist in the namespace referenced in the spec.
7070
// serviceAccount is required.
7171
//
72-
// +kubebuilder:validation:Required
72+
// +required
7373
ServiceAccount ServiceAccountReference `json:"serviceAccount"`
7474

7575
// source is a required field which selects the installation source of content
@@ -85,7 +85,7 @@ type ClusterExtensionSpec struct {
8585
// catalog:
8686
// packageName: example-package
8787
//
88-
// +kubebuilder:validation:Required
88+
// +required
8989
Source SourceConfig `json:"source"`
9090

9191
// install is an optional field used to configure the installation options
@@ -114,7 +114,7 @@ type SourceConfig struct {
114114
// +unionDiscriminator
115115
// <opcon:standard:validation:Enum=Catalog>
116116
// <opcon:experimental:validation:Enum=Catalog;NotCatalog>
117-
// +kubebuilder:validation:Required
117+
// +required
118118
SourceType string `json:"sourceType"`
119119

120120
// catalog is used to configure how information is sourced from a catalog.
@@ -180,7 +180,7 @@ type CatalogFilter struct {
180180
// +kubebuilder:validation:MaxLength:=253
181181
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="packageName is immutable"
182182
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="packageName must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
183-
// +kubebuilder:validation:Required
183+
// +required
184184
PackageName string `json:"packageName"`
185185

186186
// version is an optional semver constraint (a specific version or range of versions). When unspecified, the latest version available will be installed.
@@ -370,7 +370,7 @@ type ServiceAccountReference struct {
370370
// +kubebuilder:validation:MaxLength:=253
371371
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable"
372372
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="name must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
373-
// +kubebuilder:validation:Required
373+
// +required
374374
Name string `json:"name"`
375375
}
376376

@@ -400,7 +400,7 @@ type CRDUpgradeSafetyPreflightConfig struct {
400400
// performing an upgrade operation.
401401
//
402402
// +kubebuilder:validation:Enum:="None";"Strict"
403-
// +kubebuilder:validation:Required
403+
// +required
404404
Enforcement CRDUpgradeSafetyEnforcement `json:"enforcement"`
405405
}
406406

@@ -425,14 +425,14 @@ type BundleMetadata struct {
425425
// hyphens (-) or periods (.), start and end with an alphanumeric character,
426426
// and be no longer than 253 characters.
427427
//
428-
// +kubebuilder:validation:Required
428+
// +required
429429
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="packageName must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
430430
Name string `json:"name"`
431431

432432
// version is a required field and is a reference to the version that this bundle represents
433433
// version follows the semantic versioning standard as defined in https://semver.org/.
434434
//
435-
// +kubebuilder:validation:Required
435+
// +required
436436
// +kubebuilder:validation:XValidation:rule="self.matches(\"^([0-9]+)(\\\\.[0-9]+)?(\\\\.[0-9]+)?(-([-0-9A-Za-z]+(\\\\.[-0-9A-Za-z]+)*))?(\\\\+([-0-9A-Za-z]+(-\\\\.[-0-9A-Za-z]+)*))?\")",message="version must be well-formed semver"
437437
Version string `json:"version"`
438438
}
@@ -475,7 +475,7 @@ type ClusterExtensionInstallStatus struct {
475475
// A "bundle" is a versioned set of content that represents the resources that
476476
// need to be applied to a cluster to install a package.
477477
//
478-
// +kubebuilder:validation:Required
478+
// +required
479479
Bundle BundleMetadata `json:"bundle"`
480480
}
481481

@@ -513,7 +513,7 @@ type ClusterExtensionList struct {
513513

514514
// items is a required list of ClusterExtension objects.
515515
//
516-
// +kubebuilder:validation:Required
516+
// +required
517517
Items []ClusterExtension `json:"items"`
518518
}
519519

0 commit comments

Comments
 (0)