Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for startOperation (0.2 sec)

  1. pkg/registry/core/service/portallocator/operation_test.go

    	toAllocate := []int{
    		10000,
    		10030,
    		10030,
    		10040,
    	}
    	expectedErrors := []error{
    		ErrAllocated,
    		nil,
    		ErrAllocated,
    		nil,
    	}
    	op := StartOperation(r, true)
    	for i, port := range toAllocate {
    		err := op.Allocate(port)
    		if err != expectedErrors[i] {
    			t.Errorf("%v: expected error %v but got %v", i, expectedErrors[i], err)
    		}
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Aug 15 23:44:12 UTC 2021
    - 3.1K bytes
    - Viewed (0)
  2. pkg/registry/core/service/portallocator/operation.go

    	shouldRollback  bool
    	dryRun          bool
    }
    
    // Creates a portAllocationOperation, tracking a set of allocations & releases
    // If dryRun is specified, never actually allocate or release anything
    func StartOperation(pa Interface, dryRun bool) *PortAllocationOperation {
    	op := &PortAllocationOperation{}
    	op.pa = pa
    	op.allocated = []int{}
    	op.releaseDeferred = []int{}
    	op.shouldRollback = true
    	op.dryRun = dryRun
    	return op
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 26 17:14:05 UTC 2022
    - 4.2K bytes
    - Viewed (0)
Back to top