Skip to content

Commit 1ecaf39

Browse files
authored
[spacelift_stack_processor]: Update Spacelift labels (#41)
1 parent 1f9ad82 commit 1ecaf39

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,13 @@ Like this project? Please give it a ★ on [our GitHub](https://github.com/cloud
240240
Are you using this project or any of our other projects? Consider [leaving a testimonial][testimonial]. =)
241241
242242
243+
243244
## Related Projects
244245
245246
Check out these related projects.
246247
247248
248249
249-
250-
251250
## References
252251
253252
For additional context, refer to some of these links.

internal/spacelift/spacelift_stack_processor.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,9 @@ func TransformStackConfigToSpaceliftStacks(
139139
labels = append(labels, fmt.Sprintf("deps:"+stackConfigPathTemplate, v))
140140
}
141141
labels = append(labels, fmt.Sprintf("folder:component/%s", component))
142+
// Split on the first `-` and get the two parts: environment and stage
142143
stackNameParts := strings.SplitN(stackName, "-", 2)
143144
stackNamePartsLen := len(stackNameParts)
144-
if stackNamePartsLen > 0 {
145-
labels = append(labels, fmt.Sprintf("folder:%s", stackNameParts[0]))
146-
}
147145
if stackNamePartsLen == 2 {
148146
labels = append(labels, fmt.Sprintf("folder:%s/%s", stackNameParts[0], stackNameParts[1]))
149147
}

0 commit comments

Comments
 (0)