Move instance name validation to handlers

This commit is contained in:
2025-10-22 18:40:39 +02:00
parent 0f2c14d3ed
commit c794e4f98b
3 changed files with 65 additions and 103 deletions

View File

@@ -4,7 +4,6 @@ import (
"context"
"fmt"
"llamactl/pkg/instance"
"llamactl/pkg/validation"
"log"
)
@@ -58,12 +57,7 @@ func (im *instanceManager) CreateInstance(name string, options *instance.Options
return nil, fmt.Errorf("instance options cannot be nil")
}
name, err := validation.ValidateInstanceName(name)
if err != nil {
return nil, err
}
err = options.BackendOptions.ValidateInstanceOptions()
err := options.BackendOptions.ValidateInstanceOptions()
if err != nil {
return nil, err
}