sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (#9589)
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
This commit is contained in:
parent
1cdd61fb94
commit
ac8dd3dd53
8 changed files with 18 additions and 18 deletions
|
|
@ -80,7 +80,7 @@ type SocketCollector struct {
|
|||
|
||||
metricMapping map[string]interface{}
|
||||
|
||||
hosts sets.String
|
||||
hosts sets.Set[string]
|
||||
|
||||
metricsPerHost bool
|
||||
reportStatusClasses bool
|
||||
|
|
@ -505,7 +505,7 @@ func (sc SocketCollector) Collect(ch chan<- prometheus.Metric) {
|
|||
|
||||
// SetHosts sets the hostnames that are being served by the ingress controller
|
||||
// This set of hostnames is used to filter the metrics to be exposed
|
||||
func (sc *SocketCollector) SetHosts(hosts sets.String) {
|
||||
func (sc *SocketCollector) SetHosts(hosts sets.Set[string]) {
|
||||
sc.hosts = hosts
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -485,7 +485,7 @@ func TestCollector(t *testing.T) {
|
|||
t.Errorf("registering collector failed: %s", err)
|
||||
}
|
||||
|
||||
sc.SetHosts(sets.NewString("testshop.com"))
|
||||
sc.SetHosts(sets.New[string]("testshop.com"))
|
||||
|
||||
for _, d := range c.data {
|
||||
sc.handleMessage([]byte(d))
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ func (dc DummyCollector) SetSSLInfo([]*ingress.Server) {}
|
|||
func (dc DummyCollector) SetSSLExpireTime([]*ingress.Server) {}
|
||||
|
||||
// SetHosts ...
|
||||
func (dc DummyCollector) SetHosts(hosts sets.String) {}
|
||||
func (dc DummyCollector) SetHosts(hosts sets.Set[string]) {}
|
||||
|
||||
// OnStartedLeading indicates the pod is not the current leader
|
||||
func (dc DummyCollector) OnStartedLeading(electionID string) {}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ type Collector interface {
|
|||
SetSSLInfo(servers []*ingress.Server)
|
||||
|
||||
// SetHosts sets the hostnames that are being served by the ingress controller
|
||||
SetHosts(sets.String)
|
||||
SetHosts(set sets.Set[string])
|
||||
|
||||
Start(string)
|
||||
Stop(string)
|
||||
|
|
@ -191,7 +191,7 @@ func (c *collector) DecOrphanIngress(namespace string, name string, orphanityTyp
|
|||
c.ingressController.DecOrphanIngress(namespace, name, orphanityType)
|
||||
}
|
||||
|
||||
func (c *collector) SetHosts(hosts sets.String) {
|
||||
func (c *collector) SetHosts(hosts sets.Set[string]) {
|
||||
c.socket.SetHosts(hosts)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue