refactor: e2e tests for container config validation

This commit is contained in:
Pavel Sviderski
2025-02-19 15:19:00 +10:00
parent bcb5a2a173
commit bcb67a4073
4 changed files with 171 additions and 19 deletions
+7
View File
@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/distribution/reference"
"reflect"
"regexp"
"uncloud/internal/machine/api/pb"
)
@@ -43,6 +44,12 @@ func (s *ServiceSpec) Equals(spec ServiceSpec) bool {
return reflect.DeepEqual(*s, spec)
}
var serviceIDRegexp = regexp.MustCompile("^[0-9a-f]{32}$")
func ValidateServiceID(id string) bool {
return serviceIDRegexp.MatchString(id)
}
type ContainerSpec struct {
Command []string
Image string