From 5e532070096937443691662600a2b9cd2028c7be Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 28 Feb 2024 15:20:46 -0500 Subject: [PATCH] fix: ensure we pass global labels --- plugins/scheduler-k3s/template.go | 1 + plugins/scheduler-k3s/triggers.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/plugins/scheduler-k3s/template.go b/plugins/scheduler-k3s/template.go index 8a2f9b35f..1af9c8445 100644 --- a/plugins/scheduler-k3s/template.go +++ b/plugins/scheduler-k3s/template.go @@ -37,6 +37,7 @@ type GlobalValues struct { AppName string `yaml:"app_name"` DeploymentID string `yaml:"deploment_id"` Image GlobalImage `yaml:"image"` + Labels ProcessLabels `yaml:"labels,omitempty"` Namespace string `yaml:"namespace"` Network GlobalNetwork `yaml:"network"` Secrets map[string]string `yaml:"secrets,omitempty"` diff --git a/plugins/scheduler-k3s/triggers.go b/plugins/scheduler-k3s/triggers.go index abf5ace4c..24be9066e 100644 --- a/plugins/scheduler-k3s/triggers.go +++ b/plugins/scheduler-k3s/triggers.go @@ -261,6 +261,11 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e return fmt.Errorf("Error getting global annotations: %w", err) } + globalLabels, err := getGlobalLabel(appName) + if err != nil { + return fmt.Errorf("Error getting global labels: %w", err) + } + values := &AppValues{ Global: GlobalValues{ Annotations: globalAnnotations, @@ -273,6 +278,7 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e Type: imageSourceType, WorkingDir: workingDir, }, + Labels: globalLabels, Namespace: namespace, Network: GlobalNetwork{ IngressClass: getGlobalIngressClass(),