Skip to content

Commit 6ee523c

Browse files
Merge pull request #423 from rolandmkunkel/OSD-28476-cad-should-put-chgm-in-limited-support
OSD-28476: CAD puts CHGM in limited support if instances were stopped…
2 parents e912bb8 + 31ef615 commit 6ee523c

File tree

2 files changed

+46
-50
lines changed

2 files changed

+46
-50
lines changed

pkg/investigations/chgm/chgm.go

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,9 @@ import (
2222
)
2323

2424
var (
25-
chgmSL = ocm.ServiceLog{
26-
Severity: "Critical",
27-
Summary: "Action required: cluster not checking in",
28-
ServiceName: "SREManualAction",
29-
Description: "Your cluster is no longer checking in with Red Hat OpenShift Cluster Manager. Possible causes include stopped instances or a networking misconfiguration. If you have stopped the cluster instances, please start them again - stopping instances is not supported. If you intended to terminate this cluster then please delete the cluster in the Red Hat console",
30-
InternalOnly: false,
25+
stoppedInfraLS = ocm.LimitedSupportReason{
26+
Summary: "Cluster is in Limited Support due to unsupported cloud provider configuration",
27+
Details: "Your cluster is no longer checking in with Red Hat OpenShift Cluster Manager due to stopped or terminated instances. If the instances were stopped, please restart them, as stopping instances is not supported. If you intended to terminate the cluster, please delete it in the Red Hat console",
3128
}
3229

3330
egressLS = ocm.LimitedSupportReason{
@@ -54,9 +51,9 @@ func (c *Investiation) Run(r *investigation.Resources) (investigation.Investigat
5451
if !res.UserAuthorized {
5552
logging.Infof("Instances were stopped by unauthorized user: %s / arn: %s", res.User.UserName, res.User.IssuerUserName)
5653
return result, utils.WithRetries(func() error {
57-
err := postChgmSLAndSilence(r.Cluster.ID(), r.OcmClient, r.PdClient)
54+
err := postStoppedInfraLimitedSupport(r.Cluster.ID(), r.OcmClient, r.PdClient)
5855
// XXX: metrics.Inc(metrics.ServicelogSent, investigationName)
59-
result.ServiceLogSent = investigation.InvestigationStep{Performed: true, Labels: nil}
56+
result.LimitedSupportSet = investigation.InvestigationStep{Performed: true, Labels: []string{"StoppedInstances"}}
6057

6158
return err
6259
})
@@ -308,7 +305,7 @@ func investigateStoppedInstances(cluster *cmv1.Cluster, clusterDeployment *hivev
308305
return output, nil
309306
}
310307

311-
// GetRunningNodesCount return the number of running nodes that are currently running in the cluster
308+
// GetRunningNodesCount return the number of nodes that are currently running in the cluster
312309
func getRunningNodesCount(infraID string, awsCli aws.Client) (*runningNodesCount, error) {
313310
instances, err := awsCli.ListRunningInstances(infraID)
314311
if err != nil {
@@ -341,12 +338,11 @@ func getRunningNodesCount(infraID string, awsCli aws.Client) (*runningNodesCount
341338
return runningNodesCount, nil
342339
}
343340

344-
// GetExpectedNodesCount returns the mininum number of nodes that are supposed to be in the cluster
341+
// GetExpectedNodesCount returns the minimum number of nodes that are supposed to be in the cluster
345342
// We do not use nodes.GetTotal() here, because total seems to be always 0.
346343
func getExpectedNodesCount(cluster *cmv1.Cluster, ocmCli ocm.Client) (*expectedNodesCount, error) {
347344
nodes, ok := cluster.GetNodes()
348345
if !ok {
349-
// We do not error out here, because we do not want to fail the whole run, because of one missing metric
350346
logging.Errorf("node data is missing, dumping cluster object: %#v", cluster)
351347
return nil, fmt.Errorf("failed to retrieve cluster node data")
352348
}
@@ -452,9 +448,9 @@ func extractUserDetails(cloudTrailEvent *string) (CloudTrailEventRaw, error) {
452448
return res, nil
453449
}
454450

455-
// postChgmSLAndSilence will send the CHGM SL and silence the alert
456-
func postChgmSLAndSilence(clusterID string, ocmCli ocm.Client, pdCli pagerduty.Client) error {
457-
err := ocmCli.PostServiceLog(clusterID, &chgmSL)
451+
// postStoppedInfraLimitedSupport will put the cluster on limited support because the user has stopped instances
452+
func postStoppedInfraLimitedSupport(clusterID string, ocmCli ocm.Client, pdCli pagerduty.Client) error {
453+
err := ocmCli.PostLimitedSupportReason(&stoppedInfraLS, clusterID)
458454
if err != nil {
459455
return fmt.Errorf("failed sending service log: %w", err)
460456
}

pkg/investigations/chgm/chgm_test.go

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var _ = Describe("chgm", func() {
9595

9696
Describe("Triggered", func() {
9797
When("Triggered finds instances stopped by the customer", func() {
98-
It("should send a service log and silence the alert", func() {
98+
It("should put the cluster on limited support", func() {
9999
event := cloudtrailv2types.Event{
100100
Username: awsv2.String("12345"),
101101
CloudTrailEvent: awsv2.String(`{"eventVersion":"1.08", "userIdentity":{"type":"AssumedRole", "sessionContext":{"sessionIssuer":{"type":"Role", "userName": "654321"}}}}`),
@@ -105,19 +105,19 @@ var _ = Describe("chgm", func() {
105105
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{masterInstance, infraInstance}, nil)
106106
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
107107
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
108-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
108+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
109109
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any())
110110

111111
result, gotErr := inv.Run(r)
112112

113113
Expect(gotErr).NotTo(HaveOccurred())
114114
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
115-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
116-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
115+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
116+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
117117
})
118118
})
119119
When("Triggered finds instances stopped by the customer with CloudTrail eventVersion 1.99", func() {
120-
It("should still send a service log and silence the alert", func() {
120+
It("should still put the cluster on limited support", func() {
121121
event := cloudtrailv2types.Event{
122122
Username: awsv2.String("12345"),
123123
CloudTrailEvent: awsv2.String(`{"eventVersion":"1.99", "userIdentity":{"type":"AssumedRole", "sessionContext":{"sessionIssuer":{"type":"Role", "userName": "654321"}}}}`),
@@ -127,15 +127,15 @@ var _ = Describe("chgm", func() {
127127
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{masterInstance, infraInstance}, nil)
128128
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
129129
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
130-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
130+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
131131
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any())
132132

133133
result, gotErr := inv.Run(r)
134134

135135
Expect(gotErr).NotTo(HaveOccurred())
136136
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
137-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
138-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
137+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
138+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
139139
})
140140
})
141141
When("Triggered errors", func() {
@@ -203,21 +203,21 @@ var _ = Describe("chgm", func() {
203203
})
204204
})
205205
When("the returned CloudTrailEventRaw base data is correct, but the sessionissue's username is not an authorized user", func() {
206-
It("should send a service log and silence the alert", func() {
206+
It("should put the cluster on limited support", func() {
207207
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
208208
r.AwsClient.(*awsmock.MockClient).EXPECT().ListNonRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
209209
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
210210
event.CloudTrailEvent = awsv2.String(`{"eventVersion":"1.08", "userIdentity":{"type":"AssumedRole", "sessionContext":{"sessionIssuer":{"type":"Role", "userName": "654321"}}}}`)
211211
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
212-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
212+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
213213
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any()).Return(nil)
214214
// Act
215215
result, gotErr := inv.Run(r)
216216
// Assert
217217
Expect(gotErr).NotTo(HaveOccurred())
218218
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
219-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
220-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
219+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
220+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
221221
})
222222
})
223223
When("issuer user is authorized (openshift-machine-api-aws)", func() {
@@ -424,106 +424,106 @@ var _ = Describe("chgm", func() {
424424
})
425425
})
426426
When("the returned CloudTrailEventRaw has an empty userIdentity", func() {
427-
It("should send a service log and silence the alert", func() {
427+
It("should put the cluster on limited support", func() {
428428
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
429429
r.AwsClient.(*awsmock.MockClient).EXPECT().ListNonRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
430430
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
431431
event.CloudTrailEvent = awsv2.String(`{"eventVersion":"1.08", "userIdentity":{}}`)
432432
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
433-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
433+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
434434
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any()).Return(nil)
435435

436436
result, gotErr := inv.Run(r)
437437
Expect(gotErr).NotTo(HaveOccurred())
438438
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
439-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
440-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
439+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
440+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
441441
})
442442
})
443443
When("issuer user is unauthorized (testuser assumed role)", func() {
444-
It("should send a service log and silence the alert", func() {
444+
It("should put the cluster on limited support", func() {
445445
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
446446
r.AwsClient.(*awsmock.MockClient).EXPECT().ListNonRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
447447
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
448448
event.CloudTrailEvent = awsv2.String(`{"eventVersion":"1.08","userIdentity":{"type":"AssumedRole","principalId":"REDACTED:OCM","arn":"arn:aws:sts::1234:assumed-role/testuser/OCM","accountId":"1234","accessKeyId":"REDACTED","sessionContext":{"sessionIssuer":{"type":"Role","principalId":"REDACTED","arn":"arn:aws:iam::1234:role/testuser","accountId":"1234","userName":"testuser"},"webIdFederationData":{},"attributes":{"creationDate":"2023-02-21T04:08:01Z","mfaAuthenticated":"false"}}},"eventTime":"2023-02-21T04:10:40Z","eventSource":"ec2v2types.amazonawsv2.com","eventName":"TerminateInstances","awsRegion":"ap-southeast-1","sourceIPAddress":"192.168.0.0","userAgent":"aws-sdk-go-v2/1.17.3 os/linux lang/go/1.19.5 md/GOOS/linux md/GOARCH/amd64 api/ec2/1.25.0","requestParameters":{"instancesSet":{"items":[{"instanceId":"i-00c1f1234567"}]}},"responseElements":{"requestId":"credacted","instancesSet":{"items":[{"instanceId":"i-00c1f1234567","currentState":{"code":32,"name":"shutting-down"},"previousState":{"code":16,"name":"running"}}]}},"requestID":"credacted","eventID":"e55a8a64-9949-47a9-9fff-12345678","readOnly":false,"eventType":"AwsApiCall","managementEvent":true,"recipientAccountId":"1234","eventCategory":"Management","tlsDetails":{"tlsVersion":"TLSv1.2","cipherSuite":"ECDHE-RSA-AES128-GCM-SHA256","clientProvidedHostHeader":"ec2v2types.ap-southeast-1.amazonawsv2.com"}}`)
449449
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
450-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
450+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
451451
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any()).Return(nil)
452452

453453
result, gotErr := inv.Run(r)
454454
Expect(gotErr).NotTo(HaveOccurred())
455455
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
456-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
457-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
456+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
457+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
458458
})
459459
})
460460
When("the returned CloudTrailEventRaw base data is correct, but the sessionissue's role is not role", func() {
461-
It("should send a service log and silence the alert", func() {
461+
It("should put the cluster on limited support", func() {
462462
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
463463
r.AwsClient.(*awsmock.MockClient).EXPECT().ListNonRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
464464
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
465465
event.CloudTrailEvent = awsv2.String(`{"eventVersion":"1.08", "userIdentity":{"type":"AssumedRole", "sessionContext":{"sessionIssuer":{"type":"test"}}}}`)
466466
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
467-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
467+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
468468
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any()).Return(nil)
469469

470470
result, gotErr := inv.Run(r)
471471
Expect(gotErr).NotTo(HaveOccurred())
472472
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
473-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
474-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
473+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
474+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
475475
})
476476
})
477477
When("the returned CloudTrailEventRaw has no data", func() {
478-
It("should send a service log and silence the alert", func() {
478+
It("should put the cluster on limited support", func() {
479479
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
480480
r.AwsClient.(*awsmock.MockClient).EXPECT().ListNonRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
481481
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
482482
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
483-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
483+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
484484
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any()).Return(nil)
485485

486486
result, gotErr := inv.Run(r)
487487
Expect(gotErr).NotTo(HaveOccurred())
488488
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
489-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
490-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
489+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
490+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
491491
})
492492
})
493493

494494
When("the returned CloudTrailEventRaw has an empty userIdentity", func() {
495-
It("should send a service log and silence the alert", func() {
495+
It("should put the cluster on limited support", func() {
496496
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
497497
r.AwsClient.(*awsmock.MockClient).EXPECT().ListNonRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
498498
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
499499
event.CloudTrailEvent = awsv2.String(`{"eventVersion":"1.08", "userIdentity":{}}`)
500500
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
501-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
501+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
502502
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any()).Return(nil)
503503

504504
result, gotErr := inv.Run(r)
505505
Expect(gotErr).NotTo(HaveOccurred())
506506
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
507-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
508-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
507+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
508+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
509509
})
510510
})
511511

512512
When("the returned CloudTrailEventRaw has a userIdentity is an iam user", func() {
513-
It("should send a service log and silence the alert", func() {
513+
It("should put the cluster on limited support", func() {
514514
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
515515
r.AwsClient.(*awsmock.MockClient).EXPECT().ListNonRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
516516
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
517517
event.CloudTrailEvent = awsv2.String(`{"eventVersion":"1.08", "userIdentity":{"type":"IAMUser"}}`)
518518
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
519-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
519+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
520520
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any()).Return(nil)
521521

522522
result, gotErr := inv.Run(r)
523523
Expect(gotErr).NotTo(HaveOccurred())
524524
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
525-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
526-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
525+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
526+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
527527
})
528528
})
529529
When("the returned CloudTrailEvent has more than one resource", func() {

0 commit comments

Comments
 (0)