MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / buildDefaultService

Function buildDefaultService

pkg/specs/services.go:229–240  ·  view source on GitHub ↗
(cluster apiv1.Cluster, serviceConf apiv1.ManagedService)

Source from the content-addressed store, hash-verified

227}
228
229func buildDefaultService(cluster apiv1.Cluster, serviceConf apiv1.ManagedService) (*corev1.Service, error) {
230 switch serviceConf.SelectorType {
231 case apiv1.ServiceSelectorTypeRO:
232 return CreateClusterReadOnlyService(cluster), nil
233 case apiv1.ServiceSelectorTypeRW:
234 return CreateClusterReadWriteService(cluster), nil
235 case apiv1.ServiceSelectorTypeR:
236 return CreateClusterReadService(cluster), nil
237 default:
238 return nil, fmt.Errorf("unknown service type: %s", serviceConf.SelectorType)
239 }
240}

Callers 1

BuildManagedServicesFunction · 0.85

Calls 3

CreateClusterReadServiceFunction · 0.85

Tested by

no test coverage detected