mirror of
https://github.com/docker/compose.git
synced 2025-07-24 22:24:41 +02:00
Explicit error message saying we don’t support labels in compose file. (See ACI limitations: https://github.com/docker/desktop-microsoft/issues/33)
This commit is contained in:
parent
ba6e5e9098
commit
8fb16cea63
@ -95,6 +95,9 @@ func ToContainerGroup(aciContext store.AciContext, p types.Project) (containerin
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return containerinstance.ContainerGroup{}, err
|
return containerinstance.ContainerGroup{}, err
|
||||||
}
|
}
|
||||||
|
if service.Labels != nil && len(service.Labels) > 0 {
|
||||||
|
return containerinstance.ContainerGroup{}, errors.New("ACI integration does not support labels in compose applications")
|
||||||
|
}
|
||||||
if service.Ports != nil {
|
if service.Ports != nil {
|
||||||
var containerPorts []containerinstance.ContainerPort
|
var containerPorts []containerinstance.ContainerPort
|
||||||
for _, portConfig := range service.Ports {
|
for _, portConfig := range service.Ports {
|
||||||
|
@ -235,6 +235,23 @@ func TestComposeInconsistentMultiContainerRestartPolicy(t *testing.T) {
|
|||||||
assert.Error(t, err, "ACI integration does not support specifying different restart policies on containers in the same compose application")
|
assert.Error(t, err, "ACI integration does not support specifying different restart policies on containers in the same compose application")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestLabelsErrorMessage(t *testing.T) {
|
||||||
|
project := types.Project{
|
||||||
|
Services: []types.ServiceConfig{
|
||||||
|
{
|
||||||
|
Name: "service1",
|
||||||
|
Image: "image1",
|
||||||
|
Labels: map[string]string{
|
||||||
|
"label1": "value1",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := ToContainerGroup(convertCtx, project)
|
||||||
|
assert.Error(t, err, "ACI integration does not support labels in compose applications")
|
||||||
|
}
|
||||||
|
|
||||||
func TestComposeSingleContainerGroupToContainerDefaultRestartPolicy(t *testing.T) {
|
func TestComposeSingleContainerGroupToContainerDefaultRestartPolicy(t *testing.T) {
|
||||||
project := types.Project{
|
project := types.Project{
|
||||||
Services: []types.ServiceConfig{
|
Services: []types.ServiceConfig{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user