Skip to content

Commit 0daccc6

Browse files
committed
Remove labels from HeartbeatRequest and worker struct
1 parent 3bbd64f commit 0daccc6

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

agent/models.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ type StatusReport struct {
7575
// HeartbeatRequest is sent periodically with agent metrics.
7676
type HeartbeatRequest struct {
7777
UUID string `json:"uuid,omitempty"`
78-
Labels string `json:"labels,omitempty"`
7978
CPUPercent float64 `json:"cpu_percent"`
8079
MemPercent float64 `json:"mem_percent"`
8180
MemUsedBytes int64 `json:"mem_used_bytes"`

agent/worker.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ type Worker struct {
2424
client *Client
2525
docker DockerConfig
2626
vcsOpts vcs.Options
27-
labels string
2827
pollInterval time.Duration
2928
uuid string
3029
slotCleanup func()
@@ -34,14 +33,13 @@ type Worker struct {
3433
lastCounters *RawCounters
3534
}
3635

37-
func NewWorker(client *Client, docker DockerConfig, vcsOpts vcs.Options, labels string) *Worker {
36+
func NewWorker(client *Client, docker DockerConfig, vcsOpts vcs.Options) *Worker {
3837
uuid, cleanup := acquireAgentSlot()
3938
client.SetUUID(uuid)
4039
return &Worker{
4140
client: client,
4241
docker: docker,
4342
vcsOpts: vcsOpts,
44-
labels: labels,
4543
pollInterval: 1 * time.Second,
4644
uuid: uuid,
4745
slotCleanup: cleanup,
@@ -630,13 +628,13 @@ func (w *Worker) buildHeartbeatRequest() HeartbeatRequest {
630628
snap, err := Snapshot()
631629
if err != nil {
632630
w.log.WithError(err).Warn("metrics snapshot error")
633-
return HeartbeatRequest{UUID: w.uuid, Labels: w.labels}
631+
return HeartbeatRequest{UUID: w.uuid}
634632
}
635633

636634
w.metricsMu.Lock()
637635
defer w.metricsMu.Unlock()
638636

639-
req := HeartbeatRequest{UUID: w.uuid, Labels: w.labels}
637+
req := HeartbeatRequest{UUID: w.uuid}
640638
if w.lastCounters != nil {
641639
// CPU percent
642640
if snap.CPUInstant {

cmd/cmd_agent.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
var (
1717
flagAgentServer string
1818
flagAgentToken string
19-
flagAgentLabels string
2019
flagAgentDockerDisabled bool
2120
flagAgentDockerDefaultImage string
2221
flagAgentP4Client string
@@ -36,7 +35,6 @@ func init() {
3635
if os.Getenv("ACT_AGENT_TOKEN") == "" {
3736
cmdAgent.MarkFlagRequired("token")
3837
}
39-
cmdAgent.Flags().StringVar(&flagAgentLabels, "labels", envOr("ACT_AGENT_LABELS", ""), "Comma-separated labels for job matching (env: ACT_AGENT_LABELS)")
4038
cmdAgent.Flags().BoolVar(&flagAgentDockerDisabled, "docker-disabled", envOrBool("ACT_AGENT_DOCKER_DISABLED", false), "Disable Docker execution, always run natively")
4139
cmdAgent.Flags().StringVar(&flagAgentDockerDefaultImage, "docker-default-image", envOr("ACT_AGENT_DOCKER_DEFAULT_IMAGE", ""), "Force this Docker image for all scripts")
4240
cmdAgent.Flags().StringVar(&flagAgentP4Client, "p4-client", envOr("ACT_AGENT_P4CLIENT", ""), "Reuse an existing Perforce workspace instead of creating a temporary one (env: ACT_AGENT_P4CLIENT)")
@@ -70,7 +68,7 @@ func cmdAgentRun(cmd *cobra.Command, args []string) {
7068
DefaultImage: flagAgentDockerDefaultImage,
7169
}, vcs.Options{
7270
P4Client: flagAgentP4Client,
73-
}, flagAgentLabels)
71+
})
7472

7573
log.WithField("server", serverURL).Info("connecting")
7674
err := w.Run(ctx)

0 commit comments

Comments
 (0)