| 120 | } |
| 121 | |
| 122 | func getLabelsForInstance(instance params.Instance) []string { |
| 123 | jitEnabled := len(instance.JitConfiguration) > 0 |
| 124 | if jitEnabled { |
| 125 | return []string{} |
| 126 | } |
| 127 | |
| 128 | if instance.ScaleSetID > 0 { |
| 129 | return []string{} |
| 130 | } |
| 131 | |
| 132 | pool, ok := cache.GetPoolByID(instance.PoolID) |
| 133 | if !ok { |
| 134 | return []string{} |
| 135 | } |
| 136 | var labels []string |
| 137 | for _, val := range pool.Tags { |
| 138 | labels = append(labels, val.Name) |
| 139 | } |
| 140 | |
| 141 | labels = append(labels, fmt.Sprintf("%s=%s", controllerLabelPrefix, cache.ControllerInfo().ControllerID.String())) |
| 142 | labels = append(labels, fmt.Sprintf("%s=%s", poolIDLabelprefix, instance.PoolID)) |
| 143 | return labels |
| 144 | } |
| 145 | |
| 146 | func (r *Runner) getRunnerInstallTemplateContext(instance params.Instance, entity params.ForgeEntity, token string, extraContext map[string]string) (cloudconfig.InstallRunnerParams, error) { |
| 147 | tools, err := cache.GetGithubToolsCache(entity.ID) |