Skip to content

Commit

Permalink
Revert "lxc/init: Add error handling for launching container when ima…
Browse files Browse the repository at this point in the history
…ge is of type VM" (#14167)

Reverting additional error handling included in
#14137 to avoid introducing
regressions to `lxd-ci`. We can keep the test included in
#14137.
  • Loading branch information
tomponline committed Sep 26, 2024
2 parents 85392b1 + 3f815a5 commit 9fd5f34
Show file tree
Hide file tree
Showing 41 changed files with 284 additions and 445 deletions.
4 changes: 0 additions & 4 deletions lxc/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,6 @@ func (c *cmdInit) create(conf *config.Config, args []string, launch bool) (lxd.I
return nil, "", errors.New(i18n.G("Asked for a VM but image is of type container"))
}

if imgInfo.Type != "container" && !c.flagVM {
return nil, "", errors.New(i18n.G("Asked for a container but image is of type VM"))
}

req.Type = api.InstanceType(imgInfo.Type)
}

Expand Down
18 changes: 7 additions & 11 deletions po/ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: lxd\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2024-09-19 13:11-0600\n"
"POT-Creation-Date: 2024-09-26 11:55-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
Expand Down Expand Up @@ -770,10 +770,6 @@ msgstr ""
msgid "Asked for a VM but image is of type container"
msgstr ""

#: lxc/init.go:346
msgid "Asked for a container but image is of type VM"
msgstr ""

#: lxc/cluster_group.go:84 lxc/cluster_group.go:85
msgid "Assign sets of groups to cluster members"
msgstr ""
Expand Down Expand Up @@ -1818,7 +1814,7 @@ msgstr ""
msgid "Device: %s"
msgstr ""

#: lxc/init.go:406
#: lxc/init.go:402
msgid "Didn't get any affected image, instance or snapshot from server"
msgstr ""

Expand Down Expand Up @@ -2866,7 +2862,7 @@ msgstr ""
msgid "Instance name is mandatory"
msgstr ""

#: lxc/init.go:417
#: lxc/init.go:413
#, c-format
msgid "Instance name is: %s"
msgstr ""
Expand Down Expand Up @@ -4942,7 +4938,7 @@ msgstr ""
msgid "Retrieve the container's console log"
msgstr ""

#: lxc/init.go:360
#: lxc/init.go:356
#, c-format
msgid "Retrieving image: %s"
msgstr ""
Expand Down Expand Up @@ -5782,7 +5778,7 @@ msgid ""
"restarted"
msgstr ""

#: lxc/init.go:438
#: lxc/init.go:434
msgid "The instance you are starting doesn't have any network attached to it."
msgstr ""

Expand Down Expand Up @@ -5943,11 +5939,11 @@ msgstr ""
msgid "Timestamps:"
msgstr ""

#: lxc/init.go:440
#: lxc/init.go:436
msgid "To attach a network to an instance, use: lxc network attach"
msgstr ""

#: lxc/init.go:439
#: lxc/init.go:435
msgid "To create a new network, use: lxc network create"
msgstr ""

Expand Down
18 changes: 7 additions & 11 deletions po/ber.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: lxd\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2024-09-19 13:11-0600\n"
"POT-Creation-Date: 2024-09-26 11:55-0600\n"
"PO-Revision-Date: 2022-03-10 15:10+0000\n"
"Last-Translator: Anonymous <[email protected]>\n"
"Language-Team: Berber <https://hosted.weblate.org/projects/linux-containers/"
Expand Down Expand Up @@ -773,10 +773,6 @@ msgstr ""
msgid "Asked for a VM but image is of type container"
msgstr ""

#: lxc/init.go:346
msgid "Asked for a container but image is of type VM"
msgstr ""

#: lxc/cluster_group.go:84 lxc/cluster_group.go:85
msgid "Assign sets of groups to cluster members"
msgstr ""
Expand Down Expand Up @@ -1821,7 +1817,7 @@ msgstr ""
msgid "Device: %s"
msgstr ""

#: lxc/init.go:406
#: lxc/init.go:402
msgid "Didn't get any affected image, instance or snapshot from server"
msgstr ""

Expand Down Expand Up @@ -2869,7 +2865,7 @@ msgstr ""
msgid "Instance name is mandatory"
msgstr ""

#: lxc/init.go:417
#: lxc/init.go:413
#, c-format
msgid "Instance name is: %s"
msgstr ""
Expand Down Expand Up @@ -4945,7 +4941,7 @@ msgstr ""
msgid "Retrieve the container's console log"
msgstr ""

#: lxc/init.go:360
#: lxc/init.go:356
#, c-format
msgid "Retrieving image: %s"
msgstr ""
Expand Down Expand Up @@ -5785,7 +5781,7 @@ msgid ""
"restarted"
msgstr ""

#: lxc/init.go:438
#: lxc/init.go:434
msgid "The instance you are starting doesn't have any network attached to it."
msgstr ""

Expand Down Expand Up @@ -5946,11 +5942,11 @@ msgstr ""
msgid "Timestamps:"
msgstr ""

#: lxc/init.go:440
#: lxc/init.go:436
msgid "To attach a network to an instance, use: lxc network attach"
msgstr ""

#: lxc/init.go:439
#: lxc/init.go:435
msgid "To create a new network, use: lxc network create"
msgstr ""

Expand Down
18 changes: 7 additions & 11 deletions po/bg.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: lxd\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2024-09-19 13:11-0600\n"
"POT-Creation-Date: 2024-09-26 11:55-0600\n"
"PO-Revision-Date: 2022-03-10 15:09+0000\n"
"Last-Translator: Anonymous <[email protected]>\n"
"Language-Team: Bulgarian <https://hosted.weblate.org/projects/linux-"
Expand Down Expand Up @@ -773,10 +773,6 @@ msgstr ""
msgid "Asked for a VM but image is of type container"
msgstr ""

#: lxc/init.go:346
msgid "Asked for a container but image is of type VM"
msgstr ""

#: lxc/cluster_group.go:84 lxc/cluster_group.go:85
msgid "Assign sets of groups to cluster members"
msgstr ""
Expand Down Expand Up @@ -1821,7 +1817,7 @@ msgstr ""
msgid "Device: %s"
msgstr ""

#: lxc/init.go:406
#: lxc/init.go:402
msgid "Didn't get any affected image, instance or snapshot from server"
msgstr ""

Expand Down Expand Up @@ -2869,7 +2865,7 @@ msgstr ""
msgid "Instance name is mandatory"
msgstr ""

#: lxc/init.go:417
#: lxc/init.go:413
#, c-format
msgid "Instance name is: %s"
msgstr ""
Expand Down Expand Up @@ -4945,7 +4941,7 @@ msgstr ""
msgid "Retrieve the container's console log"
msgstr ""

#: lxc/init.go:360
#: lxc/init.go:356
#, c-format
msgid "Retrieving image: %s"
msgstr ""
Expand Down Expand Up @@ -5785,7 +5781,7 @@ msgid ""
"restarted"
msgstr ""

#: lxc/init.go:438
#: lxc/init.go:434
msgid "The instance you are starting doesn't have any network attached to it."
msgstr ""

Expand Down Expand Up @@ -5946,11 +5942,11 @@ msgstr ""
msgid "Timestamps:"
msgstr ""

#: lxc/init.go:440
#: lxc/init.go:436
msgid "To attach a network to an instance, use: lxc network attach"
msgstr ""

#: lxc/init.go:439
#: lxc/init.go:435
msgid "To create a new network, use: lxc network create"
msgstr ""

Expand Down
18 changes: 7 additions & 11 deletions po/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: lxd\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2024-09-19 13:11-0600\n"
"POT-Creation-Date: 2024-09-26 11:55-0600\n"
"PO-Revision-Date: 2022-03-10 15:10+0000\n"
"Last-Translator: Anonymous <[email protected]>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/linux-containers/"
Expand Down Expand Up @@ -773,10 +773,6 @@ msgstr ""
msgid "Asked for a VM but image is of type container"
msgstr ""

#: lxc/init.go:346
msgid "Asked for a container but image is of type VM"
msgstr ""

#: lxc/cluster_group.go:84 lxc/cluster_group.go:85
msgid "Assign sets of groups to cluster members"
msgstr ""
Expand Down Expand Up @@ -1821,7 +1817,7 @@ msgstr ""
msgid "Device: %s"
msgstr ""

#: lxc/init.go:406
#: lxc/init.go:402
msgid "Didn't get any affected image, instance or snapshot from server"
msgstr ""

Expand Down Expand Up @@ -2869,7 +2865,7 @@ msgstr ""
msgid "Instance name is mandatory"
msgstr ""

#: lxc/init.go:417
#: lxc/init.go:413
#, c-format
msgid "Instance name is: %s"
msgstr ""
Expand Down Expand Up @@ -4945,7 +4941,7 @@ msgstr ""
msgid "Retrieve the container's console log"
msgstr ""

#: lxc/init.go:360
#: lxc/init.go:356
#, c-format
msgid "Retrieving image: %s"
msgstr ""
Expand Down Expand Up @@ -5785,7 +5781,7 @@ msgid ""
"restarted"
msgstr ""

#: lxc/init.go:438
#: lxc/init.go:434
msgid "The instance you are starting doesn't have any network attached to it."
msgstr ""

Expand Down Expand Up @@ -5946,11 +5942,11 @@ msgstr ""
msgid "Timestamps:"
msgstr ""

#: lxc/init.go:440
#: lxc/init.go:436
msgid "To attach a network to an instance, use: lxc network attach"
msgstr ""

#: lxc/init.go:439
#: lxc/init.go:435
msgid "To create a new network, use: lxc network create"
msgstr ""

Expand Down
18 changes: 7 additions & 11 deletions po/cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: lxd\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2024-09-19 13:11-0600\n"
"POT-Creation-Date: 2024-09-26 11:55-0600\n"
"PO-Revision-Date: 2022-03-10 15:11+0000\n"
"Last-Translator: Anonymous <[email protected]>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/linux-containers/"
Expand Down Expand Up @@ -773,10 +773,6 @@ msgstr ""
msgid "Asked for a VM but image is of type container"
msgstr ""

#: lxc/init.go:346
msgid "Asked for a container but image is of type VM"
msgstr ""

#: lxc/cluster_group.go:84 lxc/cluster_group.go:85
msgid "Assign sets of groups to cluster members"
msgstr ""
Expand Down Expand Up @@ -1821,7 +1817,7 @@ msgstr ""
msgid "Device: %s"
msgstr ""

#: lxc/init.go:406
#: lxc/init.go:402
msgid "Didn't get any affected image, instance or snapshot from server"
msgstr ""

Expand Down Expand Up @@ -2869,7 +2865,7 @@ msgstr ""
msgid "Instance name is mandatory"
msgstr ""

#: lxc/init.go:417
#: lxc/init.go:413
#, c-format
msgid "Instance name is: %s"
msgstr ""
Expand Down Expand Up @@ -4945,7 +4941,7 @@ msgstr ""
msgid "Retrieve the container's console log"
msgstr ""

#: lxc/init.go:360
#: lxc/init.go:356
#, c-format
msgid "Retrieving image: %s"
msgstr ""
Expand Down Expand Up @@ -5785,7 +5781,7 @@ msgid ""
"restarted"
msgstr ""

#: lxc/init.go:438
#: lxc/init.go:434
msgid "The instance you are starting doesn't have any network attached to it."
msgstr ""

Expand Down Expand Up @@ -5946,11 +5942,11 @@ msgstr ""
msgid "Timestamps:"
msgstr ""

#: lxc/init.go:440
#: lxc/init.go:436
msgid "To attach a network to an instance, use: lxc network attach"
msgstr ""

#: lxc/init.go:439
#: lxc/init.go:435
msgid "To create a new network, use: lxc network create"
msgstr ""

Expand Down
Loading

0 comments on commit 9fd5f34

Please sign in to comment.