Skip to content

Commit

Permalink
remove commented code and update comments
Browse files Browse the repository at this point in the history
Signed-off-by: zachaller <[email protected]>
  • Loading branch information
zachaller committed Feb 23, 2023
1 parent debcb60 commit d8c78f7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rollout/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1949,12 +1949,9 @@ func TestWriteBackToInformer(t *testing.T) {
assert.NoError(t, err)
assert.True(t, exists)

// Want to keep this code for future reference, this commented code would randomly fail to do the type cast
// using json marshalling to convert to a map[string]interface{} fixes the issue. The type returned from
// c.rolloutsIndexer.GetByKey is not always the same type it switches between *unstructured.Unstructured and
// *v1alpha1.Rollout the underlying cause is not fully known.
//un, ok := obj.(*unstructured.Unstructured)
//assert.True(t, ok)
// The type returned from c.rolloutsIndexer.GetByKey is not always the same type it switches between
// *unstructured.Unstructured and *v1alpha1.Rollout the underlying cause is not fully known. We use the
// runtime.DefaultUnstructuredConverter to account for this.
unObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj)
assert.NoError(t, err)

Expand Down

0 comments on commit d8c78f7

Please sign in to comment.