Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for hasNodeCondition (0.15 sec)

  1. pkg/kubelet/eviction/eviction_manager.go

    func (m *managerImpl) IsUnderMemoryPressure() bool {
    	m.RLock()
    	defer m.RUnlock()
    	return hasNodeCondition(m.nodeConditions, v1.NodeMemoryPressure)
    }
    
    // IsUnderDiskPressure returns true if the node is under disk pressure.
    func (m *managerImpl) IsUnderDiskPressure() bool {
    	m.RLock()
    	defer m.RUnlock()
    	return hasNodeCondition(m.nodeConditions, v1.NodeDiskPressure)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 27 18:55:56 UTC 2024
    - 24.6K bytes
    - Viewed (0)
  2. pkg/kubelet/eviction/helpers.go

    	for _, input := range inputs {
    		if input == item {
    			return true
    		}
    	}
    	return false
    }
    
    // hasNodeCondition returns true if the node condition is in the input list
    func hasNodeCondition(inputs []v1.NodeConditionType, item v1.NodeConditionType) bool {
    	for _, input := range inputs {
    		if input == item {
    			return true
    		}
    	}
    	return false
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 01 18:46:33 UTC 2023
    - 53.6K bytes
    - Viewed (0)
  3. pkg/kubelet/eviction/helpers_test.go

    			inputs: []v1.NodeConditionType{v1.NodeReady, v1.NodeDiskPressure},
    			item:   v1.NodeMemoryPressure,
    			result: false,
    		},
    	}
    	for testName, testCase := range testCases {
    		if actual := hasNodeCondition(testCase.inputs, testCase.item); actual != testCase.result {
    			t.Errorf("Test case: %s, expected: %v, actual: %v", testName, testCase.result, actual)
    		}
    	}
    }
    
    func TestParsePercentage(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 15 23:14:12 UTC 2024
    - 106.7K bytes
    - Viewed (0)
Back to top