Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/virtwork/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func runE(cmd *cobra.Command, args []string) error {
}
w, err := registry.Get(name, wlCfg, registryOpts...)
if err != nil {
continue
return fmt.Errorf("creating workload %q for service check: %w", name, err)
}
if w.RequiresService() {
svc := w.ServiceSpec()
Expand Down
19 changes: 19 additions & 0 deletions cmd/virtwork/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,25 @@ var _ = Describe("CLI end-to-end scenarios", func() {
})
})

var _ = Describe("Service creation loop error handling", func() {
It("should return error from registry for unknown workload", func() {
registry := workloads.DefaultRegistry()
cfg := config.WorkloadConfig{
Enabled: config.BoolPtr(true),
VMCount: 1,
CPUCores: constants.DefaultCPUCores,
Memory: constants.DefaultMemory,
}

_, err := registry.Get("nonexistent-workload", cfg,
workloads.WithNamespace(constants.DefaultNamespace),
workloads.WithSSHCredentials(constants.DefaultSSHUser, "", nil),
)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("nonexistent-workload"))
})
})

var _ = Describe("DataVolume namespacing for multi-VM deployments", func() {
// nolint: dupl
Context("when deploying multiple VMs of disk workload", func() {
Expand Down
Loading