|
12 | 12 | using Newtonsoft.Json; |
13 | 13 | using Octopus.Tentacle.Configuration; |
14 | 14 | using Octopus.Tentacle.Configuration.Instances; |
15 | | -using Octopus.Tentacle.Contracts; |
16 | 15 | using Octopus.Tentacle.Contracts.KubernetesScriptServiceV1; |
17 | 16 | using Octopus.Tentacle.Core.Diagnostics; |
18 | 17 | using Octopus.Tentacle.Core.Services.Scripts.Locking; |
@@ -434,7 +433,7 @@ V1Affinity ParseScriptPodAffinity(InMemoryTentacleScriptLog tentacleScriptLog) |
434 | 433 | KubernetesConfig.PodAnnotationsJsonVariableName, |
435 | 434 | "pod annotations"); |
436 | 435 |
|
437 | | - Dictionary<string, string>? GetScriptPodAnnotations(InMemoryTentacleScriptLog tentacleScriptLog, StartKubernetesScriptCommandV1 command) |
| 436 | + Dictionary<string, string> GetScriptPodAnnotations(InMemoryTentacleScriptLog tentacleScriptLog, StartKubernetesScriptCommandV1 command) |
438 | 437 | { |
439 | 438 | var annotations = ParseScriptPodAnnotations(tentacleScriptLog) ?? new Dictionary<string, string>(); |
440 | 439 | annotations.AddRange(GetAuthContext(command)); |
@@ -478,6 +477,13 @@ static Dictionary<string, string> GetAuthContext(StartKubernetesScriptCommandV1 |
478 | 477 | ? HashValue(command.AuthContext.ProjectSlug) |
479 | 478 | : command.AuthContext.ProjectSlug; |
480 | 479 |
|
| 480 | + if (command.AuthContext.ProjectGroupSlug is not null) |
| 481 | + { |
| 482 | + dict[$"{KubernetesConfig.AgentLabelNamespace}/project-group"] = hash |
| 483 | + ? HashValue(command.AuthContext.ProjectGroupSlug) |
| 484 | + : command.AuthContext.ProjectGroupSlug; |
| 485 | + } |
| 486 | + |
481 | 487 | dict[$"{KubernetesConfig.AgentLabelNamespace}/environment"] = hash |
482 | 488 | ? HashValue(command.AuthContext.EnvironmentSlug) |
483 | 489 | : command.AuthContext.EnvironmentSlug; |
|
0 commit comments