From 9432caf41acdcfdbf09464dbd97ffbda9d8a3332 Mon Sep 17 00:00:00 2001 From: Kareena Hirani Date: Thu, 18 Nov 2021 10:45:57 -0800 Subject: [PATCH] fix: Modify Experiment collision naming from dot-notation to dash (#1646) Signed-off-by: khhirani --- rollout/experiment.go | 2 +- rollout/experiment_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rollout/experiment.go b/rollout/experiment.go index 807d44ddb7..a000fe014e 100644 --- a/rollout/experiment.go +++ b/rollout/experiment.go @@ -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++ } } diff --git a/rollout/experiment_test.go b/rollout/experiment_test.go index 48c05e4233..6ba0ca43b0 100644 --- a/rollout/experiment_test.go +++ b/rollout/experiment_test.go @@ -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": {