Default the partition in ixn check

This commit is contained in:
freddygv 2021-09-16 13:52:06 -06:00
parent caafc1905e
commit b5a8935bb8
1 changed files with 6 additions and 0 deletions

View File

@ -678,6 +678,12 @@ func (s *Intention) Check(args *structs.IntentionQueryRequest, reply *structs.In
if query.DestinationNS == "" {
query.DestinationNS = entMeta.NamespaceOrDefault()
}
if query.SourcePartition == "" {
query.SourcePartition = entMeta.PartitionOrDefault()
}
if query.DestinationPartition == "" {
query.DestinationPartition = entMeta.PartitionOrDefault()
}
if err := s.srv.validateEnterpriseIntentionNamespace(query.SourceNS, false); err != nil {
return fmt.Errorf("Invalid source namespace %q: %v", query.SourceNS, err)