Change single container tag to `docker-single-container` ; added tag `docker-compose-application`. The compose tag is not used yet, can be useful for metrics, and maybe other things later on.
@@ -42,7 +42,8 @@ import (
)
const (
- singleContainerTag = "single--container--aci"
+ singleContainerTag = "docker-single-container"
+ composeContainerTag = "docker-compose-application"
composeContainerSeparator = "_"
statusUnknown = "Unknown"
)
@@ -182,13 +183,16 @@ func (cs *aciContainerService) Run(ctx context.Context, r containers.ContainerCo
if err != nil {
return err
}
+ addTag(groupDefinition, singleContainerTag)
+ return createACIContainers(ctx, cs.ctx, groupDefinition)
+}
+
+func addTag(groupDefinition containerinstance.ContainerGroup, tagName string) {
if groupDefinition.Tags == nil {
groupDefinition.Tags = make(map[string]*string, 1)
}
- groupDefinition.Tags[singleContainerTag] = to.StringPtr("")
-
- return createACIContainers(ctx, cs.ctx, groupDefinition)
+ groupDefinition.Tags[tagName] = to.StringPtr("")
}
func (cs *aciContainerService) Stop(ctx context.Context, containerName string, timeout *uint32) error {
@@ -315,6 +319,7 @@ func (cs *aciComposeService) Up(ctx context.Context, opts cli.ProjectOptions) er
}
logrus.Debugf("Up on project with name %q\n", project.Name)
groupDefinition, err := convert.ToContainerGroup(cs.ctx, *project)
+ addTag(groupDefinition, composeContainerTag)
if err != nil {
return err
