none.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. Copyright 2017 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Package reconcilers a noop based reconciler
  14. package reconcilers
  15. import (
  16. "net"
  17. corev1 "k8s.io/api/core/v1"
  18. )
  19. // NoneEndpointReconciler allows for the endpoint reconciler to be disabled
  20. type noneEndpointReconciler struct{}
  21. // NewNoneEndpointReconciler creates a new EndpointReconciler that reconciles based on a
  22. // nothing. It is a no-op.
  23. func NewNoneEndpointReconciler() EndpointReconciler {
  24. return &noneEndpointReconciler{}
  25. }
  26. // ReconcileEndpoints noop reconcile
  27. func (r *noneEndpointReconciler) ReconcileEndpoints(serviceName string, ip net.IP, endpointPorts []corev1.EndpointPort, reconcilePorts bool) error {
  28. return nil
  29. }
  30. // RemoveEndpoints noop reconcile
  31. func (r *noneEndpointReconciler) RemoveEndpoints(serviceName string, ip net.IP, endpointPorts []corev1.EndpointPort) error {
  32. return nil
  33. }
  34. func (r *noneEndpointReconciler) StopReconciling() {
  35. }