Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(backend): rename mapper to match alertmanager version #672

Merged
merged 2 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ Alertmanager `0.16.x` is **NOT** supported by karma due to changes
in the API, see [this issue](https://github.com/prymitive/karma/issues/115)
for details.
A new API endpoint
[was added](https://github.com/prometheus/alertmanager/pull/1791) and will be
available in the next Alertmanager release (`>=0.17.0`). This new endpoint is
supported by karma.

tl;dr skip Alertmanager `0.16.x` and wait for `0.17.0` if you wish to use it
with karma
[was added for 0.17.0](https://github.com/prometheus/alertmanager/pull/1791) and
alertmanager `>=0.17.0` is supported.

---

Expand Down
6 changes: 3 additions & 3 deletions internal/alertmanager/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package alertmanager

import (
"github.com/prymitive/karma/internal/mapper"
v016 "github.com/prymitive/karma/internal/mapper/v016"
v017 "github.com/prymitive/karma/internal/mapper/v017"
v04 "github.com/prymitive/karma/internal/mapper/v04"
v05 "github.com/prymitive/karma/internal/mapper/v05"
v061 "github.com/prymitive/karma/internal/mapper/v061"
Expand All @@ -17,6 +17,6 @@ func init() {
mapper.RegisterAlertMapper(v062.AlertMapper{})
mapper.RegisterSilenceMapper(v04.SilenceMapper{})
mapper.RegisterSilenceMapper(v05.SilenceMapper{})
mapper.RegisterAlertMapper(v016.AlertMapper{})
mapper.RegisterSilenceMapper(v016.SilenceMapper{})
mapper.RegisterAlertMapper(v017.AlertMapper{})
mapper.RegisterSilenceMapper(v017.SilenceMapper{})
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ALERTMANAGER_VERSION := 2fa210d0e3c86bea44a38f4131c069752738a6cb
ALERTMANAGER_VERSION := v0.17.0
API_VERSION := v2
PACKAGE := v016
PACKAGE := v017
TARGET_DIR := /go/src/github.com/prymitive/karma/internal/mapper/$(PACKAGE)
IMAGE_NAME := openapi_client_$(PACKAGE)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v016
package v017

import (
"net/http"
Expand Down Expand Up @@ -28,7 +28,7 @@ func (m AlertMapper) QueryArgs() string {

// IsSupported returns true if given version string is supported
func (m AlertMapper) IsSupported(version string) bool {
versionRange := semver.MustParseRange(">=0.16.1")
versionRange := semver.MustParseRange(">=0.17.0")
return versionRange(semver.MustParse(version))
}

Expand Down
8 changes: 4 additions & 4 deletions internal/mapper/v016/api.go → internal/mapper/v017/api.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v016
package v017

import (
"net/http"
Expand All @@ -10,9 +10,9 @@ import (
httptransport "github.com/go-openapi/runtime/client"

"github.com/prymitive/karma/internal/mapper"
"github.com/prymitive/karma/internal/mapper/v016/client"
"github.com/prymitive/karma/internal/mapper/v016/client/alertgroup"
"github.com/prymitive/karma/internal/mapper/v016/client/silence"
"github.com/prymitive/karma/internal/mapper/v017/client"
"github.com/prymitive/karma/internal/mapper/v017/client/alertgroup"
"github.com/prymitive/karma/internal/mapper/v017/client/silence"
"github.com/prymitive/karma/internal/models"
)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v016
package v017

import (
"net/http"
Expand Down Expand Up @@ -27,7 +27,7 @@ func (m SilenceMapper) QueryArgs() string {

// IsSupported returns true if given version string is supported
func (m SilenceMapper) IsSupported(version string) bool {
versionRange := semver.MustParseRange(">=0.16.0")
versionRange := semver.MustParseRange(">=0.17.0")
return versionRange(semver.MustParse(version))
}

Expand Down