Skip to content

Commit

Permalink
fix: Modify Experiment collision naming from dot-notation to dash (#1646
Browse files Browse the repository at this point in the history
)

Signed-off-by: khhirani <[email protected]>
  • Loading branch information
khhirani authored and alexmt committed Nov 29, 2021
1 parent ec00dd6 commit 9432caf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rollout/experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (c *rolloutContext) createExperimentWithCollisionHandling(newEx *v1alpha1.E
// we likely reconciled the rollout with a stale cache (quite common).
return existingEx, nil
}
newEx.Name = fmt.Sprintf("%s.%d", baseName, collisionCount)
newEx.Name = fmt.Sprintf("%s-%d", baseName, collisionCount)
collisionCount++
}
}
Expand Down
2 changes: 1 addition & 1 deletion rollout/experiment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func TestCreateExperimentWithCollision(t *testing.T) {

f.run(getKey(r2, t))
createdEx := f.getCreatedExperiment(createExIndex)
assert.Equal(t, ex.Name+".1", createdEx.Name)
assert.Equal(t, ex.Name+"-1", createdEx.Name)
patch := f.getPatchedRollout(patchIndex)
expectedPatch := `{
"status": {
Expand Down

0 comments on commit 9432caf

Please sign in to comment.