diff --git a/aci/convert/convert.go b/aci/convert/convert.go index 54043a90c..c8134b7c4 100644 --- a/aci/convert/convert.go +++ b/aci/convert/convert.go @@ -95,6 +95,9 @@ func ToContainerGroup(aciContext store.AciContext, p types.Project) (containerin if err != nil { 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 { var containerPorts []containerinstance.ContainerPort for _, portConfig := range service.Ports { diff --git a/aci/convert/convert_test.go b/aci/convert/convert_test.go index c802082fe..2667e8756 100644 --- a/aci/convert/convert_test.go +++ b/aci/convert/convert_test.go @@ -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") } +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) { project := types.Project{ Services: []types.ServiceConfig{