Skip to content

Commit 31ef615

Browse files
committed
OSD-28476: CAD puts CHGM in limited support if instances were stopped by unauthorized user
1 parent 53d07dc commit 31ef615

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
@@ -96,7 +96,7 @@ var _ = Describe("chgm", func() {
9696

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

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

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

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

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

437437
result, gotErr := inv.Run(r)
438438
Expect(gotErr).NotTo(HaveOccurred())
439439
Expect(result.ServiceLogPrepared.Performed).To(BeFalse())
440-
Expect(result.ServiceLogSent.Performed).To(BeTrue())
441-
Expect(result.LimitedSupportSet.Performed).To(BeFalse())
440+
Expect(result.ServiceLogSent.Performed).To(BeFalse())
441+
Expect(result.LimitedSupportSet.Performed).To(BeTrue())
442442
})
443443
})
444444
When("issuer user is unauthorized (testuser assumed role)", func() {
445-
It("should send a service log and silence the alert", func() {
445+
It("should put the cluster on limited support", func() {
446446
r.OcmClient.(*ocmmock.MockClient).EXPECT().GetClusterMachinePools(gomock.Any()).Return(machinePools, nil)
447447
r.AwsClient.(*awsmock.MockClient).EXPECT().ListNonRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
448448
r.AwsClient.(*awsmock.MockClient).EXPECT().ListRunningInstances(gomock.Eq(infraID)).Return([]ec2v2types.Instance{instance}, nil)
449449
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"}}`)
450450
r.AwsClient.(*awsmock.MockClient).EXPECT().PollInstanceStopEventsFor(gomock.Any(), gomock.Any()).Return([]cloudtrailv2types.Event{event}, nil)
451-
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostServiceLog(gomock.Eq(cluster.ID()), gomock.Eq(&chgmSL)).Return(nil)
451+
r.OcmClient.(*ocmmock.MockClient).EXPECT().PostLimitedSupportReason(gomock.Eq(&stoppedInfraLS), gomock.Eq(cluster.ID())).Return(nil)
452452
r.PdClient.(*pdmock.MockClient).EXPECT().SilenceIncidentWithNote(gomock.Any()).Return(nil)
453453

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)