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 <kareena.hirani@gmail.com>
  • Loading branch information
khhirani authored Nov 18, 2021
1 parent 30f0e7d commit 74e4be4
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 74e4be4

Please sign in to comment.