Skip to content

Commit 40e61d8

Browse files
authored
Merge pull request kubernetes#90365 from janosi/createsctpservice
e2e test framework change for the SCTP e2e tests
2 parents 56ad0ce + af33c2f commit 40e61d8

File tree

1 file changed

+15
-0
lines changed
  • test/e2e/framework/service

1 file changed

+15
-0
lines changed

test/e2e/framework/service/jig.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,3 +962,18 @@ func (j *TestJig) CreateTCPUDPServicePods(replica int) error {
962962
}
963963
return e2erc.RunRC(config)
964964
}
965+
966+
// CreateSCTPServiceWithPort creates a new SCTP Service with given port based on the
967+
// j's defaults. Callers can provide a function to tweak the Service object before
968+
// it is created.
969+
func (j *TestJig) CreateSCTPServiceWithPort(tweak func(svc *v1.Service), port int32) (*v1.Service, error) {
970+
svc := j.newServiceTemplate(v1.ProtocolSCTP, port)
971+
if tweak != nil {
972+
tweak(svc)
973+
}
974+
result, err := j.Client.CoreV1().Services(j.Namespace).Create(context.TODO(), svc, metav1.CreateOptions{})
975+
if err != nil {
976+
return nil, fmt.Errorf("failed to create SCTP Service %q: %v", svc.Name, err)
977+
}
978+
return j.sanityCheckService(result, svc.Spec.Type)
979+
}

0 commit comments

Comments
 (0)