mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 01:16:31 -06:00
Alerting: Remove OrgID() from the Alertmanager interface (#77398)
This commit is contained in:
parent
b8105caa05
commit
a6b9b27673
@ -395,10 +395,6 @@ func (am *alertmanager) PutAlerts(_ context.Context, postableAlerts apimodels.Po
|
||||
return am.Base.PutAlerts(alerts)
|
||||
}
|
||||
|
||||
func (am *alertmanager) OrgID() int64 {
|
||||
return am.orgID
|
||||
}
|
||||
|
||||
// CleanUp removes the directory containing the alertmanager files from disk.
|
||||
func (am *alertmanager) CleanUp() {
|
||||
am.fileStore.CleanUp()
|
||||
|
@ -57,7 +57,6 @@ type Alertmanager interface {
|
||||
CleanUp()
|
||||
StopAndWait()
|
||||
Ready() bool
|
||||
OrgID() int64
|
||||
}
|
||||
|
||||
type MultiOrgAlertmanager struct {
|
||||
|
@ -286,8 +286,10 @@ func TestMultiOrgAlertmanager_AlertmanagerFor(t *testing.T) {
|
||||
{
|
||||
am, err := mam.AlertmanagerFor(2)
|
||||
require.NoError(t, err)
|
||||
internalAm, ok := am.(*alertmanager)
|
||||
require.True(t, ok)
|
||||
require.Equal(t, "N/A", *am.GetStatus().VersionInfo.Version)
|
||||
require.Equal(t, int64(2), am.OrgID())
|
||||
require.Equal(t, int64(2), internalAm.orgID)
|
||||
}
|
||||
|
||||
// Let's now remove the previous queried organization.
|
||||
|
@ -297,10 +297,6 @@ func (am *Alertmanager) Ready() bool {
|
||||
// We don't have files on disk, no-op.
|
||||
func (am *Alertmanager) CleanUp() {}
|
||||
|
||||
func (am *Alertmanager) OrgID() int64 {
|
||||
return am.orgID
|
||||
}
|
||||
|
||||
type roundTripper struct {
|
||||
tenantID string
|
||||
basicAuthPassword string
|
||||
|
@ -59,7 +59,7 @@ func TestNewAlertmanager(t *testing.T) {
|
||||
require.NoError(tt, err)
|
||||
require.Equal(tt, am.tenantID, test.tenantID)
|
||||
require.Equal(tt, am.url, test.url)
|
||||
require.Equal(tt, am.OrgID(), test.orgID)
|
||||
require.Equal(tt, am.orgID, test.orgID)
|
||||
require.NotNil(tt, am.amClient)
|
||||
require.NotNil(tt, am.httpClient)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user