kubernetes/staging/src/k8s.io/cloud-provider/controllers/service/controller_test.go

const region

type serviceTweak

func newService(name string, serviceType v1.ServiceType, tweaks ...serviceTweak) *v1.Service {}

func copyService(oldSvc *v1.Service, tweaks ...serviceTweak) *v1.Service {}

func tweakAddETP(etpType v1.ServiceExternalTrafficPolicyType) serviceTweak {}

func tweakAddLBIngress(ip string) serviceTweak {}

func makeServicePort(protocol v1.Protocol, targetPort int) []v1.ServicePort {}

func tweakAddPorts(protocol v1.Protocol, targetPort int) serviceTweak {}

func tweakAddLBClass(loadBalancerClass *string) serviceTweak {}

func tweakAddFinalizers(finalizers ...string) serviceTweak {}

func tweakAddDeletionTimestamp(time time.Time) serviceTweak {}

func tweakAddAppProtocol(appProtocol string) serviceTweak {}

func tweakSetIPFamilies(families ...v1.IPFamily) serviceTweak {}

// Wrap newService so that you don't have to call default arguments again and again.
func defaultExternalService() *v1.Service {}

// newController creates a new service controller. Callers have the option to
// specify `stopChan` for test cases which might require running the
// node/service informers and reacting to resource events. Callers can also
// specify `objects` which represent the initial state of objects, used to
// populate the client set / informer cache at start-up.
func newController(ctx context.Context, objects ...runtime.Object) (*Controller, *fakecloud.Cloud, *fake.Clientset) {}

// TODO(@MrHohn): Verify the end state when below issue is resolved:
// https://github.com/kubernetes/client-go/issues/607
func TestSyncLoadBalancerIfNeeded(t *testing.T) {}

// TODO: Finish converting and update comments
func TestUpdateNodesInExternalLoadBalancer(t *testing.T) {}

func TestNodeChangesForStableNodeSetEnabled(t *testing.T) {}

func TestNodeChangesInExternalLoadBalancer(t *testing.T) {}

// compareUpdateCalls compares if the same update calls were made in both left and right inputs despite the order.
func compareUpdateCalls(t *testing.T, left, right []fakecloud.UpdateBalancerCall) {}

// compareHostSets compares if the nodes in left are in right, despite the order.
func compareHostSets(t *testing.T, left, right []*v1.Node) bool {}

func TestNodesNotEqual(t *testing.T) {}

func TestProcessServiceCreateOrUpdate(t *testing.T) {}

// TestProcessServiceCreateOrUpdateK8sError tests processServiceCreateOrUpdate
// with various kubernetes errors when patching status.
func TestProcessServiceCreateOrUpdateK8sError(t *testing.T) {}

func TestSyncService(t *testing.T) {}

func TestProcessServiceDeletion(t *testing.T) {}

// Test cases:
// index    finalizer    timestamp    wantLB  |  clean-up
//
//	0         0           0            0     |   false    (No finalizer, no clean up)
//	1         0           0            1     |   false    (Ignored as same with case 0)
//	2         0           1            0     |   false    (Ignored as same with case 0)
//	3         0           1            1     |   false    (Ignored as same with case 0)
//	4         1           0            0     |   true
//	5         1           0            1     |   false
//	6         1           1            0     |   true    (Service is deleted, needs clean up)
//	7         1           1            1     |   true    (Ignored as same with case 6)
func TestNeedsCleanup(t *testing.T) {}

// This tests a service update while a slow node sync is happening. If we have multiple
// services to process from a node sync: each service will experience a sync delta.
// If a new Node is added and a service is synced while this happens: we want to
// make sure that the slow node sync never removes the Node from LB set because it
// has stale data.
func TestSlowNodeSync(t *testing.T) {}

func TestNeedsUpdate(t *testing.T) {}

// All the test cases for ServiceCache uses a single cache, these below test cases should be run in order,
// as tc1 (addCache would add elements to the cache)
// and tc2 (delCache would remove element from the cache without it adding automatically)
// Please keep this in mind while adding new test cases.
func TestServiceCache(t *testing.T) {}

// TODO(@MrHohn): Verify the end state when below issue is resolved:
// https://github.com/kubernetes/client-go/issues/607
func TestAddFinalizer(t *testing.T) {}

// TODO(@MrHohn): Verify the end state when below issue is resolved:
// https://github.com/kubernetes/client-go/issues/607
func TestRemoveFinalizer(t *testing.T) {}

// TODO(@MrHohn): Verify the end state when below issue is resolved:
// https://github.com/kubernetes/client-go/issues/607
func TestPatchStatus(t *testing.T) {}

func Test_respectsPredicates(t *testing.T) {}

func TestListWithPredicate(t *testing.T) {}

var providerID

type nodeTweak

// TODO: use this pattern in all the tests above.
func makeNode(tweaks ...nodeTweak) *v1.Node {}

func tweakName(name string) nodeTweak {}

func tweakAddTaint(key string) nodeTweak {}

func tweakSetLabel(key, val string) nodeTweak {}

func tweakSetCondition(condType v1.NodeConditionType, condStatus v1.ConditionStatus) nodeTweak {}

func tweakSetReady(val bool) nodeTweak {}

func tweakUnsetCondition(condType v1.NodeConditionType) nodeTweak {}

func tweakDeleted() nodeTweak {}

func tweakProviderID(id string) nodeTweak {}

func Test_shouldSyncUpdatedNode_individualPredicates(t *testing.T) {}

func Test_shouldSyncUpdatedNode_compoundedPredicates(t *testing.T) {}

func TestServiceQueueDelay(t *testing.T) {}

type fakeNodeLister

func newFakeNodeLister(err error, nodes ...*v1.Node) *fakeNodeLister {}

// List lists all Nodes in the indexer.
// Objects returned here must be treated as read-only.
func (l *fakeNodeLister) List(selector labels.Selector) (ret []*v1.Node, err error) {}

// Get retrieves the Node from the index for a given name.
// Objects returned here must be treated as read-only.
func (l *fakeNodeLister) Get(name string) (*v1.Node, error) {}

type spyWorkQueue

type spyQueueItem

// AddAfter is like workqueue.RateLimitingInterface.AddAfter but records the
// added key and delay internally.
func (f *spyWorkQueue) AddAfter(key string, delay time.Duration) {}

// getItems returns all items that were recorded.
func (f *spyWorkQueue) getItems() []spyQueueItem {}