fix: spec validation when name is empty, race in e2e tests

This commit is contained in:
Pasha Sviderski
2026-04-09 14:39:12 +10:00
parent eff1bc88d8
commit cd149e4506
2 changed files with 16 additions and 11 deletions
+1 -1
View File
@@ -337,7 +337,7 @@ func (d *Deployment) Validate(ctx context.Context) error {
return fmt.Errorf("invalid service spec: %w", err)
}
if d.Service == nil {
if d.Service == nil && d.Spec.Name != "" {
svc, err := d.cli.InspectService(ctx, d.Spec.Name)
if err == nil {
d.Service = &svc