Skip to content

Commit

Permalink
fix imports after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandreLamarre committed Oct 25, 2022
1 parent e359a54 commit dfd3f03
Show file tree
Hide file tree
Showing 6 changed files with 313 additions and 317 deletions.
18 changes: 8 additions & 10 deletions pkg/alerting/backend/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import (
"fmt"
"time"

"time"

alertingv1 "github.com/rancher/opni/pkg/apis/alerting/v1"
corev1 "github.com/rancher/opni/pkg/apis/core/v1"
alertingv1alpha "github.com/rancher/opni/plugins/alerting/pkg/apis/common"

"github.com/go-openapi/strfmt"
)
Expand Down Expand Up @@ -210,15 +208,15 @@ func (p *PostableSilence) Must() error {
}

func ConvertEndpointIdsToRoutingNode(
endpointList *alertingv1alpha.AlertEndpointList,
req *alertingv1alpha.AttachedEndpoints,
endpointList *alertingv1.AlertEndpointList,
req *alertingv1.AttachedEndpoints,
conditionId string,

) (*alertingv1alpha.RoutingNode, error) {
routingNode := &alertingv1alpha.RoutingNode{
) (*alertingv1.RoutingNode, error) {
routingNode := &alertingv1.RoutingNode{
ConditionId: &corev1.Reference{Id: conditionId},
FullAttachedEndpoints: &alertingv1alpha.FullAttachedEndpoints{
Items: []*alertingv1alpha.FullAttachedEndpoint{},
FullAttachedEndpoints: &alertingv1.FullAttachedEndpoints{
Items: []*alertingv1.FullAttachedEndpoint{},
InitialDelay: req.InitialDelay,
RepeatInterval: req.RepeatInterval,
ThrottlingDuration: req.ThrottlingDuration,
Expand All @@ -230,7 +228,7 @@ func ConvertEndpointIdsToRoutingNode(
if endpointItem.Id.Id == expectedEndpoint.EndpointId {
routingNode.FullAttachedEndpoints.Items = append(
routingNode.FullAttachedEndpoints.Items,
&alertingv1alpha.FullAttachedEndpoint{
&alertingv1.FullAttachedEndpoint{
EndpointId: endpointItem.Id.Id,
AlertEndpoint: endpointItem.Endpoint,
Details: req.Details,
Expand Down
4 changes: 1 addition & 3 deletions plugins/alerting/pkg/alerting/api_conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"sync"
"time"

"github.com/rancher/opni/plugins/alerting/pkg/apis/common"

"github.com/prometheus/alertmanager/api/v2/models"
"github.com/prometheus/common/model"
"github.com/rancher/opni/pkg/alerting/backend"
Expand Down Expand Up @@ -191,7 +189,7 @@ func (p *Plugin) DeleteAlertCondition(ctx context.Context, ref *corev1.Reference
return nil, err
}
lg.Debugf("Deleted condition %s must clean up its existing endpoint implementation", ref.Id)
if common.ShouldDeleteRoutingNode(nil, existing.AttachedEndpoints) {
if alertingv1.ShouldDeleteRoutingNode(nil, existing.AttachedEndpoints) {
_, err = p.DeleteConditionRoutingNode(ctx, ref)
if err != nil {
return nil, err
Expand Down
Loading

0 comments on commit dfd3f03

Please sign in to comment.