Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, c client.Client, svc *corev1.Service, equal EqualityFunc, mutate MutateFunc) error
CreateOrUpdate attempts first to get the given service. If the service does not exist, the service will be created. Otherwise, if the service exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder represents the struct to build k8s services
func (*Builder) WithAnnotations ¶
WithAnnotations set the object meta annotations.
func (*Builder) WithPublishNotReady ¶
WithPublishNotReady sets the spec PublishNotReadyAddresses flag.
func (*Builder) WithSelector ¶
WithSelector sets the service selector.
func (*Builder) WithServicePorts ¶
func (b *Builder) WithServicePorts(sp ...corev1.ServicePort) *Builder
WithServicePorts appends service ports to the service spec.
type EqualityFunc ¶
EqualityFunc is the type for functions that compare two services. Return true if two services are equal.
type MutateFunc ¶
MutateFunc is the type for functions that mutate the current service by applying the values from the desired service.