Skip to content

Commit 6e022ac

Browse files
authored
[Feature] Add spec validation for MLExtension (#1807)
1 parent e3d9fc0 commit 6e022ac

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
- (Bugfix) Fix ArangoRoute Target switch in case of temporary error
5555
- (Bugfix) Fix IntOrString Schema Type
5656
- (Feature) Enable Operator Handler StackTraces
57+
- (Feature) Add spec validation for MLExtension
5758

5859
## [1.2.43](https://github.com/arangodb/kube-arangodb/tree/1.2.43) (2024-10-14)
5960
- (Feature) ArangoRoute CRD

pkg/apis/ml/v1beta1/extension_spec.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,17 @@ func (a *ArangoMLExtensionSpec) Validate() error {
112112

113113
return shared.WithErrors(shared.PrefixResourceErrors("spec",
114114
shared.PrefixResourceErrors("metadataService", a.GetMetadataService().Validate()),
115-
shared.PrefixResourceErrors("storage", shared.ValidateOptionalInterface(a.GetStorage())),
115+
shared.PrefixResourceErrors("storage", func() error {
116+
if a.GetStorageType() == ArangoMLExtensionSpecStorageTypeExtension {
117+
return shared.ValidateRequiredInterface(a.Storage)
118+
}
119+
120+
return nil
121+
}()),
116122
shared.PrefixResourceErrors("init", a.GetInit().Validate()),
117123
shared.PrefixResourceErrors("deployment", a.GetDeployment().Validate()),
118124
shared.PrefixResourceErrors("jobsTemplates", a.GetJobsTemplates().Validate()),
119125
shared.PrefixResourceErrors("integrationSidecar", a.GetIntegrationSidecar().Validate()),
126+
shared.PrefixResourceErrors("storageType", shared.ValidateOptionalInterface(a.StorageType)),
120127
))
121128
}

0 commit comments

Comments
 (0)