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

Extend alertstore to support read/write of clusterpb.FullState. #4020

Merged
merged 2 commits into from
Mar 30, 2021
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
243 changes: 225 additions & 18 deletions pkg/alertmanager/alertspb/alerts.pb.go

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

12 changes: 10 additions & 2 deletions pkg/alertmanager/alertspb/alerts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ syntax = "proto3";

package alerts;

import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "gogoproto/gogo.proto";
import "github.com/prometheus/alertmanager/cluster/clusterpb/cluster.proto";

option go_package = "alertspb";
option (gogoproto.marshaler_all) = true;
Expand All @@ -18,4 +19,11 @@ message AlertConfigDesc {
message TemplateDesc {
string filename = 1;
string body = 2;
}
}

message FullStateDesc {
// Alertmanager (clusterpb) types do not have Equal methods.
option (gogoproto.equal) = false;

clusterpb.FullState state = 1;
}
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertspb/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package alertspb
import "errors"

var (
ErrNotFound = errors.New("alertmanager config not found")
ErrNotFound = errors.New("alertmanager storage object not found")
)

// ToProto transforms a yaml Alertmanager config and map of template files to an AlertConfigDesc
Expand Down
Loading