mirror of
https://github.com/status-im/consul.git
synced 2025-01-24 04:31:12 +00:00
Default partition in match endpoint
This commit is contained in:
parent
77681b9f6c
commit
99c6e4fe41
@ -585,7 +585,7 @@ func (s *Intention) Match(args *structs.IntentionQueryRequest, reply *structs.In
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finish defaulting the namespace fields.
|
// Finish defaulting the namespace and partition fields.
|
||||||
for i := range args.Match.Entries {
|
for i := range args.Match.Entries {
|
||||||
if args.Match.Entries[i].Namespace == "" {
|
if args.Match.Entries[i].Namespace == "" {
|
||||||
args.Match.Entries[i].Namespace = entMeta.NamespaceOrDefault()
|
args.Match.Entries[i].Namespace = entMeta.NamespaceOrDefault()
|
||||||
@ -594,6 +594,14 @@ func (s *Intention) Match(args *structs.IntentionQueryRequest, reply *structs.In
|
|||||||
return fmt.Errorf("Invalid match entry namespace %q: %v",
|
return fmt.Errorf("Invalid match entry namespace %q: %v",
|
||||||
args.Match.Entries[i].Namespace, err)
|
args.Match.Entries[i].Namespace, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if args.Match.Entries[i].Partition == "" {
|
||||||
|
args.Match.Entries[i].Partition = entMeta.PartitionOrDefault()
|
||||||
|
}
|
||||||
|
if err := s.srv.validateEnterpriseIntentionPartition(args.Match.Entries[i].Partition); err != nil {
|
||||||
|
return fmt.Errorf("Invalid match entry partition %q: %v",
|
||||||
|
args.Match.Entries[i].Partition, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var authzContext acl.AuthorizerContext
|
var authzContext acl.AuthorizerContext
|
||||||
|
@ -911,6 +911,7 @@ func intentionMatchOneTxn(tx ReadTxn, ws memdb.WatchSet,
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(partitions): Update for partitions
|
||||||
// intentionMatchGetParams returns the tx.Get parameters to find all the
|
// intentionMatchGetParams returns the tx.Get parameters to find all the
|
||||||
// intentions for a certain entry.
|
// intentions for a certain entry.
|
||||||
func intentionMatchGetParams(entry structs.IntentionMatchEntry) ([][]interface{}, error) {
|
func intentionMatchGetParams(entry structs.IntentionMatchEntry) ([][]interface{}, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user