Skip to content

Commit 3e8b973

Browse files
committed
Add comment to stageAllTargets
1 parent 9aa9cab commit 3e8b973

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal/cmd/cli/target.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ func (t *Target) Run(cmd *cobra.Command, args []string) error {
177177
// stageAllTargets overrides maxNew to the total number of matched targets so
178178
// that UpdatePartitions stages a deployment for every target, not just the
179179
// first target.DefaultMaxNew.
180+
//
181+
// NOTE: mutating bundle.Spec.RolloutStrategy is visible to UpdatePartitions
182+
// because target.Manager.Targets() stores the same bundle pointer in every
183+
// target's Bundle field, and UpdatePartitions reads MaxNew from
184+
// targets[0].Bundle.Spec.RolloutStrategy.
180185
func stageAllTargets(bundle *v1alpha1.Bundle, matchedTargets []*target.Target) error {
181186
count := len(matchedTargets)
182187
if bundle.Spec.RolloutStrategy == nil {

0 commit comments

Comments
 (0)