MCPcopy
hub / github.com/kubernetes/kops / Validate

Method Validate

pkg/instancegroups/rollingupdate_test.go:1442–1462  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

1440}
1441
1442func (t *alreadyDetachedTest) Validate(ctx context.Context) (*validation.ValidationCluster, error) {
1443 t.mutex.Lock()
1444 defer t.mutex.Unlock()
1445
1446 t.numValidations++
1447 switch t.numValidations {
1448 case 1, 2, 3:
1449 assert.Equal(t.t, t.numValidations, len(t.detached), "numnber of detached instances")
1450 case 4:
1451 t.mutex.Unlock()
1452 time.Sleep(postTerminationValidationDelay)
1453 t.mutex.Lock()
1454 assert.Equal(t.t, 1, t.terminationRequestsLeft, "terminations left")
1455 case 5:
1456 assert.Equal(t.t, 0, t.terminationRequestsLeft, "terminations left")
1457 case 6:
1458 t.t.Error("unexpected sixth call to Validate")
1459 }
1460
1461 return &validation.ValidationCluster{}, nil
1462}
1463
1464func (t *alreadyDetachedTest) TerminateInstances(ctx context.Context, input *ec2.TerminateInstancesInput, optFns ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error) {
1465 if input.DryRun != nil && *input.DryRun {

Callers

nothing calls this directly

Calls 4

LockMethod · 0.65
UnlockMethod · 0.65
EqualMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected