mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 13:55:55 +00:00
Cleanup unnecessary normalizing method (#11169)
This commit is contained in:
parent
bf2a3f6e79
commit
5c37819d09
@ -75,7 +75,7 @@ func TestIntentionApply_new(t *testing.T) {
|
|||||||
//nolint:staticcheck
|
//nolint:staticcheck
|
||||||
ixn.Intention.UpdatePrecedence()
|
ixn.Intention.UpdatePrecedence()
|
||||||
// Partition fields will be normalized on Intention.Get
|
// Partition fields will be normalized on Intention.Get
|
||||||
ixn.Intention.NormalizePartitionFields()
|
ixn.Intention.FillPartitionAndNamespace(nil, true)
|
||||||
require.Equal(t, ixn.Intention, actual)
|
require.Equal(t, ixn.Intention, actual)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ func TestIntentionApply_updateGood(t *testing.T) {
|
|||||||
//nolint:staticcheck
|
//nolint:staticcheck
|
||||||
ixn.Intention.UpdatePrecedence()
|
ixn.Intention.UpdatePrecedence()
|
||||||
// Partition fields will be normalized on Intention.Get
|
// Partition fields will be normalized on Intention.Get
|
||||||
ixn.Intention.NormalizePartitionFields()
|
ixn.Intention.FillPartitionAndNamespace(nil, true)
|
||||||
require.Equal(t, ixn.Intention, actual)
|
require.Equal(t, ixn.Intention, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ func TestStore_IntentionSetGet_basic(t *testing.T) {
|
|||||||
//nolint:staticcheck
|
//nolint:staticcheck
|
||||||
expected.SetHash()
|
expected.SetHash()
|
||||||
|
|
||||||
expected.NormalizePartitionFields()
|
expected.FillPartitionAndNamespace(nil, true)
|
||||||
}
|
}
|
||||||
require.True(t, watchFired(ws), "watch fired")
|
require.True(t, watchFired(ws), "watch fired")
|
||||||
|
|
||||||
@ -1098,7 +1098,7 @@ func TestStore_IntentionsList(t *testing.T) {
|
|||||||
UpdatedAt: testTimeA,
|
UpdatedAt: testTimeA,
|
||||||
}
|
}
|
||||||
if !legacy {
|
if !legacy {
|
||||||
ret.NormalizePartitionFields()
|
ret.FillPartitionAndNamespace(nil, true)
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,3 @@ func (ixn *Intention) FillPartitionAndNamespace(entMeta *EnterpriseMeta, fillDef
|
|||||||
ixn.SourcePartition = ""
|
ixn.SourcePartition = ""
|
||||||
ixn.DestinationPartition = ""
|
ixn.DestinationPartition = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ixn *Intention) NormalizePartitionFields() {
|
|
||||||
ixn.SourcePartition = ""
|
|
||||||
ixn.DestinationPartition = ""
|
|
||||||
}
|
|
||||||
|
@ -15,6 +15,6 @@ func TestIntention(t testing.T) *Intention {
|
|||||||
SourceType: IntentionSourceConsul,
|
SourceType: IntentionSourceConsul,
|
||||||
Meta: map[string]string{},
|
Meta: map[string]string{},
|
||||||
}
|
}
|
||||||
ixn.NormalizePartitionFields()
|
ixn.FillPartitionAndNamespace(nil, true)
|
||||||
return ixn
|
return ixn
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user