diff --git a/agent/consul/intention_endpoint_test.go b/agent/consul/intention_endpoint_test.go index 7ddf7d9d6c..64bb466f97 100644 --- a/agent/consul/intention_endpoint_test.go +++ b/agent/consul/intention_endpoint_test.go @@ -75,7 +75,7 @@ func TestIntentionApply_new(t *testing.T) { //nolint:staticcheck ixn.Intention.UpdatePrecedence() // Partition fields will be normalized on Intention.Get - ixn.Intention.NormalizePartitionFields() + ixn.Intention.FillPartitionAndNamespace(nil, true) require.Equal(t, ixn.Intention, actual) } @@ -269,7 +269,7 @@ func TestIntentionApply_updateGood(t *testing.T) { //nolint:staticcheck ixn.Intention.UpdatePrecedence() // Partition fields will be normalized on Intention.Get - ixn.Intention.NormalizePartitionFields() + ixn.Intention.FillPartitionAndNamespace(nil, true) require.Equal(t, ixn.Intention, actual) } } diff --git a/agent/consul/state/intention_test.go b/agent/consul/state/intention_test.go index 7ddd4c5a9a..f2a5f87867 100644 --- a/agent/consul/state/intention_test.go +++ b/agent/consul/state/intention_test.go @@ -156,7 +156,7 @@ func TestStore_IntentionSetGet_basic(t *testing.T) { //nolint:staticcheck expected.SetHash() - expected.NormalizePartitionFields() + expected.FillPartitionAndNamespace(nil, true) } require.True(t, watchFired(ws), "watch fired") @@ -1098,7 +1098,7 @@ func TestStore_IntentionsList(t *testing.T) { UpdatedAt: testTimeA, } if !legacy { - ret.NormalizePartitionFields() + ret.FillPartitionAndNamespace(nil, true) } return ret } diff --git a/agent/structs/intention_oss.go b/agent/structs/intention_oss.go index 274f799d65..0c445b0a89 100644 --- a/agent/structs/intention_oss.go +++ b/agent/structs/intention_oss.go @@ -74,8 +74,3 @@ func (ixn *Intention) FillPartitionAndNamespace(entMeta *EnterpriseMeta, fillDef ixn.SourcePartition = "" ixn.DestinationPartition = "" } - -func (ixn *Intention) NormalizePartitionFields() { - ixn.SourcePartition = "" - ixn.DestinationPartition = "" -} diff --git a/agent/structs/testing_intention.go b/agent/structs/testing_intention.go index 3497ba2fcd..c8a42d7916 100644 --- a/agent/structs/testing_intention.go +++ b/agent/structs/testing_intention.go @@ -15,6 +15,6 @@ func TestIntention(t testing.T) *Intention { SourceType: IntentionSourceConsul, Meta: map[string]string{}, } - ixn.NormalizePartitionFields() + ixn.FillPartitionAndNamespace(nil, true) return ixn }