mirror of https://github.com/status-im/consul.git
delete all v2 resources type when deleting a namespace (CE) (#18621)
* add namespace scope to ServiceV1Alpha1Type * add CE portion of namespace deletion
This commit is contained in:
parent
255aa158db
commit
f8d77f027a
|
@ -7,6 +7,9 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/hashicorp/consul/internal/catalog"
|
||||
"github.com/hashicorp/consul/internal/mesh"
|
||||
"github.com/hashicorp/consul/internal/resource/demo"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
|
@ -559,6 +562,10 @@ func newDefaultDeps(t *testing.T, c *Config) Deps {
|
|||
RPCHoldTimeout: c.RPCHoldTimeout,
|
||||
}
|
||||
connPool.SetRPCClientTimeout(c.RPCClientTimeout)
|
||||
registry := resource.NewRegistry()
|
||||
demo.RegisterTypes(registry)
|
||||
mesh.RegisterTypes(registry)
|
||||
catalog.RegisterTypes(registry)
|
||||
return Deps{
|
||||
EventPublisher: stream.NewEventPublisher(10 * time.Second),
|
||||
Logger: logger,
|
||||
|
@ -578,7 +585,7 @@ func newDefaultDeps(t *testing.T, c *Config) Deps {
|
|||
GetNetRPCInterceptorFunc: middleware.GetNetRPCInterceptor,
|
||||
EnterpriseDeps: newDefaultDepsEnterprise(t, logger, c),
|
||||
XDSStreamLimiter: limiter.NewSessionLimiter(),
|
||||
Registry: resource.NewRegistry(),
|
||||
Registry: registry,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -461,6 +461,8 @@ type Server struct {
|
|||
|
||||
// handles metrics reporting to HashiCorp
|
||||
reportingManager *reporting.ReportingManager
|
||||
|
||||
registry resource.Registry
|
||||
}
|
||||
|
||||
func (s *Server) DecrementBlockingQueries() uint64 {
|
||||
|
@ -547,6 +549,7 @@ func NewServer(config *Config, flat Deps, externalGRPCServer *grpc.Server,
|
|||
publisher: flat.EventPublisher,
|
||||
incomingRPCLimiter: incomingRPCLimiter,
|
||||
routineManager: routine.NewManager(logger.Named(logging.ConsulServer)),
|
||||
registry: flat.Registry,
|
||||
}
|
||||
incomingRPCLimiter.Register(s)
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ func RegisterService(r resource.Registry) {
|
|||
Type: ServiceV1Alpha1Type,
|
||||
Proto: &pbcatalog.Service{},
|
||||
Validate: ValidateService,
|
||||
Scope: resource.ScopeNamespace,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue