Documentation
¶
Overview ¶
Package servicespec contains various utilities to deal with Service Specs
Index ¶
- type Builder
- func (builder *Builder) Build() *apiv1.ServiceTemplateSpec
- func (builder *Builder) SetPGBouncerSelector(name string) *Builder
- func (builder *Builder) SetSelectors(selectors map[string]string) *Builder
- func (builder *Builder) WithAnnotation(name, value string) *Builder
- func (builder *Builder) WithLabel(name, value string) *Builder
- func (builder *Builder) WithServicePort(value *corev1.ServicePort) *Builder
- func (builder *Builder) WithServicePortNoOverwrite(value *corev1.ServicePort) *Builder
- func (builder *Builder) WithServiceType(serviceType corev1.ServiceType, overwrite bool) *Builder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder enables users to create a serviceTemplate starting from a baseline and adding patches
func NewFrom ¶
func NewFrom(serviceTemplate *apiv1.ServiceTemplateSpec) *Builder
NewFrom creates a serviceTemplate builder from a certain Service template
func (*Builder) Build ¶
func (builder *Builder) Build() *apiv1.ServiceTemplateSpec
Build gets the final ServiceTemplate
func (*Builder) SetPGBouncerSelector ¶ added in v1.24.0
SetPGBouncerSelector overwrites the selectors field with the PgbouncerNameLabel selector.
func (*Builder) SetSelectors ¶ added in v1.24.0
SetSelectors overwrites the selector fields
func (*Builder) WithAnnotation ¶
WithAnnotation adds an annotation to the current status
func (*Builder) WithServicePort ¶
func (builder *Builder) WithServicePort(value *corev1.ServicePort) *Builder
WithServicePort adds a port to the current service
func (*Builder) WithServicePortNoOverwrite ¶ added in v1.23.3
func (builder *Builder) WithServicePortNoOverwrite(value *corev1.ServicePort) *Builder
WithServicePortNoOverwrite adds a ServicePort to the current service if no ServicePort that matches the name or port value is found
func (*Builder) WithServiceType ¶
func (builder *Builder) WithServiceType(serviceType corev1.ServiceType, overwrite bool) *Builder
WithServiceType adds a service type to the current status