Skip to content

Commit 630b291

Browse files
committed
Make model format optional for e2e
1 parent 8176655 commit 630b291

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/operator/api/userconfig/apis.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ var apiValidation = &cr.StructValidation{
6363
{
6464
StructField: "ModelFormat",
6565
StringValidation: &cr.StringValidation{
66-
Required: true,
67-
AllowedValues: ModelFormatStrings(),
66+
Required: false,
67+
AllowEmpty: true,
68+
AllowedValues: append(ModelFormatStrings(), ""),
6869
},
6970
Parser: func(str string) (interface{}, error) {
7071
return ModelFormatFromString(str), nil
@@ -115,7 +116,13 @@ func (apis APIs) Validate() error {
115116
}
116117

117118
func (api *API) Validate() error {
118-
if !yaml.StartsWithEscapedAtSymbol(api.Model) {
119+
if yaml.StartsWithEscapedAtSymbol(api.Model) {
120+
api.ModelFormat = TensorFlowModelFormat
121+
} else {
122+
if api.ModelFormat == UnknownModelFormat {
123+
return errors.Wrap(cr.ErrorMustBeDefined(), Identify(api), ModelFormatKey)
124+
}
125+
119126
if !aws.IsValidS3Path(api.Model) {
120127
return errors.Wrap(ErrorInvalidS3PathOrResourceReference(api.Model), Identify(api), ModelKey)
121128
}

0 commit comments

Comments
 (0)