Cleanup unnecessary normalizing method (#11169)
This commit is contained in:
parent
4ed9476a61
commit
3f79aaf509
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -74,8 +74,3 @@ func (ixn *Intention) FillPartitionAndNamespace(entMeta *EnterpriseMeta, fillDef
|
|||
ixn.SourcePartition = ""
|
||||
ixn.DestinationPartition = ""
|
||||
}
|
||||
|
||||
func (ixn *Intention) NormalizePartitionFields() {
|
||||
ixn.SourcePartition = ""
|
||||
ixn.DestinationPartition = ""
|
||||
}
|
||||
|
|
|
@ -15,6 +15,6 @@ func TestIntention(t testing.T) *Intention {
|
|||
SourceType: IntentionSourceConsul,
|
||||
Meta: map[string]string{},
|
||||
}
|
||||
ixn.NormalizePartitionFields()
|
||||
ixn.FillPartitionAndNamespace(nil, true)
|
||||
return ixn
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue