various changes

This commit is contained in:
2026-09-08 10:35:18 +02:00
parent 4188bea061
commit dfae78af71
2871 changed files with 280 additions and 732763 deletions

View File

@@ -1139,6 +1139,61 @@ class K8sClientTest extends Specification {
result.metadata.name == 'test-node'
}
def 'should get node external IP with ExternalIP address' () {
given:
def JSON = '''
{
"kind": "Node",
"apiVersion": "v1",
"metadata": {
"name": "test-node"
},
"status": {
"addresses": [
{"type": "InternalIP", "address": "192.168.1.100"},
{"type": "ExternalIP", "address": "203.0.113.10"}
]
}
}
'''
def client = Spy(K8sClient)
final NODE_NAME = 'test-node'
when:
def result = client.getNodeExternalIp(NODE_NAME)
then:
1 * client.nodeDescribe(NODE_NAME) >> new K8sResponseJson(JSON)
result == '203.0.113.10'
}
def 'should get node external IP fallback to InternalIP' () {
given:
def JSON = '''
{
"kind": "Node",
"apiVersion": "v1",
"metadata": {
"name": "test-node"
},
"status": {
"addresses": [
{"type": "InternalIP", "address": "192.168.1.100"}
]
}
}
'''
def client = Spy(K8sClient)
final NODE_NAME = 'test-node'
when:
def result = client.getNodeExternalIp(NODE_NAME)
then:
1 * client.nodeDescribe(NODE_NAME) >> new K8sResponseJson(JSON)
result == '192.168.1.100'
}
def 'should get node CPU capacity' () {
given:
def JSON = '''