|
|
@ -28,14 +28,14 @@ import (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
const (
|
|
|
|
swarmLabelTaskPrefix = swarmLabel + "task_"
|
|
|
|
swarmLabelTaskPrefix = swarmLabel + "task_"
|
|
|
|
swarmLabelTaskID = swarmLabelTaskPrefix + "id"
|
|
|
|
swarmLabelTaskID = swarmLabelTaskPrefix + "id"
|
|
|
|
swarmLabelTaskLabelPrefix = swarmLabelTaskPrefix + "label_"
|
|
|
|
swarmLabelTaskDesiredState = swarmLabelTaskPrefix + "desired_state"
|
|
|
|
swarmLabelTaskDesiredState = swarmLabelTaskPrefix + "desired_state"
|
|
|
|
swarmLabelTaskStatus = swarmLabelTaskPrefix + "state"
|
|
|
|
swarmLabelTaskStatus = swarmLabelTaskPrefix + "state"
|
|
|
|
swarmLabelTaskContainerID = swarmLabelTaskPrefix + "container_id"
|
|
|
|
swarmLabelTaskContainerID = swarmLabelTaskPrefix + "container_id"
|
|
|
|
swarmLabelTaskSlot = swarmLabelTaskPrefix + "slot"
|
|
|
|
swarmLabelTaskSlot = swarmLabelTaskPrefix + "slot"
|
|
|
|
swarmLabelTaskPortMode = swarmLabelTaskPrefix + "port_publish_mode"
|
|
|
|
swarmLabelTaskPortMode = swarmLabelTaskPrefix + "port_publish_mode"
|
|
|
|
swarmLabelContainerLabelPrefix = swarmLabel + "container_label_"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func (d *Discovery) refreshTasks(ctx context.Context) ([]*targetgroup.Group, error) {
|
|
|
|
func (d *Discovery) refreshTasks(ctx context.Context) ([]*targetgroup.Group, error) {
|
|
|
@ -75,9 +75,11 @@ func (d *Discovery) refreshTasks(ctx context.Context) ([]*targetgroup.Group, err
|
|
|
|
commonLabels[swarmLabelTaskContainerID] = s.Status.ContainerStatus.ContainerID
|
|
|
|
commonLabels[swarmLabelTaskContainerID] = s.Status.ContainerStatus.ContainerID
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for k, v := range s.Labels {
|
|
|
|
if s.Spec.ContainerSpec != nil {
|
|
|
|
ln := strutil.SanitizeLabelName(k)
|
|
|
|
for k, v := range s.Spec.ContainerSpec.Labels {
|
|
|
|
commonLabels[swarmLabelTaskLabelPrefix+ln] = v
|
|
|
|
ln := strutil.SanitizeLabelName(k)
|
|
|
|
|
|
|
|
commonLabels[swarmLabelContainerLabelPrefix+ln] = v
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for k, v := range serviceLabels[s.ServiceID] {
|
|
|
|
for k, v := range serviceLabels[s.ServiceID] {
|
|
|
|