Skip to content

Commit 1c11f86

Browse files
author
paul
committed
fix error handling
1 parent 64cb7d1 commit 1c11f86

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/model/deployment/deplactive/constructor.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ func ConstructDeployment(config Config) (deployment.Deployment, error) {
3232
}
3333
for {
3434
_, n, _ := activeToolkit.Options("Whats't next?", false,
35-
fmt.Sprintf("Set name : %s", depl.Name),
36-
fmt.Sprintf("Set replicas : %d", depl.Replicas),
37-
fmt.Sprintf("Edit containers: %v", activeToolkit.OrValue(depl.Containers, "none (required)")),
35+
fmt.Sprintf("Set name : %s", depl.Name),
36+
fmt.Sprintf("Set replicas : %d", depl.Replicas),
37+
fmt.Sprintf("Edit containers: %v", activeToolkit.OrValue(depl.Containers, "none (required)")),
3838
"From file",
3939
"Confirm",
4040
"Exit")
@@ -91,6 +91,9 @@ func validateDeployment(depl deployment.Deployment) error {
9191
errs = append(errs, fmt.Errorf("invalid container %q: %v", cont.Name, conterr))
9292
}
9393
}
94+
if len(errs) == 0 {
95+
return nil
96+
}
9497
return ErrInvalidDeployment.Wrap(errs...)
9598
}
9699

0 commit comments

Comments
 (0)