Merge "Update tests for node-attributes"
This commit is contained in:
commit
7aae1ca834
@ -1301,6 +1301,12 @@ Selecting the kubernetes driver adds the following options to the
|
||||
|
||||
Namespaces are prefixed with the pool's name.
|
||||
|
||||
.. attr:: node-attributes
|
||||
:type: dict
|
||||
|
||||
A dictionary of key-value pairs that will be stored with the node data
|
||||
in ZooKeeper. The keys and values can be any arbitrary string.
|
||||
|
||||
.. attr:: labels
|
||||
:type: list
|
||||
|
||||
@ -1427,6 +1433,12 @@ Selecting the openshift driver adds the following options to the
|
||||
|
||||
Project's name are prefixed with the pool's name.
|
||||
|
||||
.. attr:: node-attributes
|
||||
:type: dict
|
||||
|
||||
A dictionary of key-value pairs that will be stored with the node data
|
||||
in ZooKeeper. The keys and values can be any arbitrary string.
|
||||
|
||||
.. attr:: labels
|
||||
:type: list
|
||||
|
||||
@ -1557,6 +1569,12 @@ Selecting the openshift pods driver adds the following options to the
|
||||
|
||||
The project's name that will be used to create the pods.
|
||||
|
||||
.. attr:: node-attributes
|
||||
:type: dict
|
||||
|
||||
A dictionary of key-value pairs that will be stored with the node data
|
||||
in ZooKeeper. The keys and values can be any arbitrary string.
|
||||
|
||||
.. attr:: labels
|
||||
:type: list
|
||||
|
||||
@ -1789,6 +1807,12 @@ section of the configuration.
|
||||
|
||||
A unique name within the provider for this pool of resources.
|
||||
|
||||
.. attr:: node-attributes
|
||||
:type: dict
|
||||
|
||||
A dictionary of key-value pairs that will be stored with the node data
|
||||
in ZooKeeper. The keys and values can be any arbitrary string.
|
||||
|
||||
.. attr:: subnet-id
|
||||
|
||||
If provided, specifies the subnet to assign to the primary network
|
||||
@ -2079,6 +2103,12 @@ section of the configuration.
|
||||
|
||||
A unique name within the provider for this pool of resources.
|
||||
|
||||
.. attr:: node-attributes
|
||||
:type: dict
|
||||
|
||||
A dictionary of key-value pairs that will be stored with the node data
|
||||
in ZooKeeper. The keys and values can be any arbitrary string.
|
||||
|
||||
.. attr:: host-key-checking
|
||||
:type: bool
|
||||
:default: True
|
||||
|
@ -109,10 +109,11 @@ class OpenshiftProviderConfig(ProviderConfig):
|
||||
'python-path': str,
|
||||
}
|
||||
|
||||
pool = {
|
||||
pool = ConfigPool.getCommonSchemaDict()
|
||||
pool.update({
|
||||
v.Required('name'): str,
|
||||
v.Required('labels'): [openshift_label],
|
||||
}
|
||||
})
|
||||
|
||||
schema = ProviderConfig.getCommonSchemaDict()
|
||||
schema.update({
|
||||
|
@ -17,6 +17,7 @@
|
||||
import math
|
||||
import voluptuous as v
|
||||
|
||||
from nodepool.driver import ConfigPool
|
||||
from nodepool.driver.openshift.config import OpenshiftPool
|
||||
from nodepool.driver.openshift.config import OpenshiftProviderConfig
|
||||
|
||||
@ -52,10 +53,11 @@ class OpenshiftPodsProviderConfig(OpenshiftProviderConfig):
|
||||
'python-path': str,
|
||||
}
|
||||
|
||||
pool = {
|
||||
pool = ConfigPool.getCommonSchemaDict()
|
||||
pool.update({
|
||||
v.Required('name'): str,
|
||||
v.Required('labels'): [openshift_label],
|
||||
}
|
||||
})
|
||||
|
||||
schema = OpenshiftProviderConfig.getCommonSchemaDict()
|
||||
schema.update({
|
||||
|
18
nodepool/tests/fixtures/aws.yaml
vendored
18
nodepool/tests/fixtures/aws.yaml
vendored
@ -51,6 +51,9 @@ providers:
|
||||
max-servers: 1
|
||||
subnet-id: null
|
||||
security-group-id: null
|
||||
node-attributes:
|
||||
key1: value1
|
||||
key2: value2
|
||||
labels:
|
||||
- name: ubuntu1404-ebs-optimized
|
||||
cloud-image: ubuntu1404
|
||||
@ -61,6 +64,9 @@ providers:
|
||||
max-servers: 1
|
||||
subnet-id: null
|
||||
security-group-id: null
|
||||
node-attributes:
|
||||
key1: value1
|
||||
key2: value2
|
||||
labels:
|
||||
- name: ubuntu1404
|
||||
cloud-image: ubuntu1404
|
||||
@ -92,6 +98,9 @@ providers:
|
||||
subnet-id: null
|
||||
security-group-id: null
|
||||
host-key-checking: false
|
||||
node-attributes:
|
||||
key1: value1
|
||||
key2: value2
|
||||
labels:
|
||||
- name: ubuntu1404-non-host-key-checking
|
||||
cloud-image: ubuntu1404
|
||||
@ -102,6 +111,9 @@ providers:
|
||||
subnet-id: null
|
||||
security-group-id: null
|
||||
public-ip-address: false
|
||||
node-attributes:
|
||||
key1: value1
|
||||
key2: value2
|
||||
labels:
|
||||
- name: ubuntu1404-private-ip
|
||||
cloud-image: ubuntu1404
|
||||
@ -111,6 +123,9 @@ providers:
|
||||
max-servers: 1
|
||||
subnet-id: null
|
||||
security-group-id: null
|
||||
node-attributes:
|
||||
key1: value1
|
||||
key2: value2
|
||||
labels:
|
||||
- name: ubuntu1404-with-tags
|
||||
cloud-image: ubuntu1404
|
||||
@ -122,6 +137,9 @@ providers:
|
||||
max-servers: 1
|
||||
subnet-id: null
|
||||
security-group-id: null
|
||||
node-attributes:
|
||||
key1: value1
|
||||
key2: value2
|
||||
labels:
|
||||
- name: ubuntu1404-with-name-tag
|
||||
cloud-image: ubuntu1404
|
||||
|
3
nodepool/tests/fixtures/kubernetes.yaml
vendored
3
nodepool/tests/fixtures/kubernetes.yaml
vendored
@ -13,6 +13,9 @@ providers:
|
||||
context: admin-cluster.local
|
||||
pools:
|
||||
- name: main
|
||||
node-attributes:
|
||||
key1: value1
|
||||
key2: value2
|
||||
labels:
|
||||
- name: kubernetes-namespace
|
||||
type: namespace
|
||||
|
3
nodepool/tests/fixtures/openshift.yaml
vendored
3
nodepool/tests/fixtures/openshift.yaml
vendored
@ -13,6 +13,9 @@ providers:
|
||||
context: admin-cluster.local
|
||||
pools:
|
||||
- name: main
|
||||
node-attributes:
|
||||
key1: value1
|
||||
key2: value2
|
||||
labels:
|
||||
- name: openshift-project
|
||||
type: project
|
||||
|
3
nodepool/tests/fixtures/openshiftpods.yaml
vendored
3
nodepool/tests/fixtures/openshiftpods.yaml
vendored
@ -12,6 +12,9 @@ providers:
|
||||
context: service-account.local
|
||||
pools:
|
||||
- name: main
|
||||
node-attributes:
|
||||
key1: value1
|
||||
key2: value2
|
||||
labels:
|
||||
- name: pod-fedora
|
||||
image: docker.io/fedora:28
|
||||
|
@ -145,6 +145,8 @@ class TestDriverAws(tests.DBTestCase):
|
||||
self.assertEqual(node.state, zk.READY)
|
||||
self.assertIsNotNone(node.launcher)
|
||||
self.assertEqual(node.connection_type, 'ssh')
|
||||
self.assertEqual(node.attributes,
|
||||
{'key1': 'value1', 'key2': 'value2'})
|
||||
if host_key_checking:
|
||||
nodescan.assert_called_with(
|
||||
node.interface_ip,
|
||||
|
@ -122,6 +122,8 @@ class TestDriverKubernetes(tests.DBTestCase):
|
||||
self.assertIsNotNone(node.launcher)
|
||||
self.assertEqual(node.connection_type, 'kubectl')
|
||||
self.assertEqual(node.connection_port.get('token'), 'fake-token')
|
||||
self.assertEqual(node.attributes,
|
||||
{'key1': 'value1', 'key2': 'value2'})
|
||||
|
||||
node.state = zk.DELETING
|
||||
self.zk.storeNode(node)
|
||||
|
@ -120,6 +120,8 @@ class TestDriverOpenshift(tests.DBTestCase):
|
||||
self.assertEqual(node.connection_type, 'kubectl')
|
||||
self.assertEqual(node.connection_port.get('token'), 'fake-token')
|
||||
self.assertEqual(node.python_path, '/usr/bin/python3')
|
||||
self.assertEqual(node.attributes,
|
||||
{'key1': 'value1', 'key2': 'value2'})
|
||||
|
||||
node.state = zk.DELETING
|
||||
self.zk.storeNode(node)
|
||||
|
@ -103,6 +103,8 @@ class TestDriverOpenshiftPods(tests.DBTestCase):
|
||||
self.assertIsNotNone(node.launcher)
|
||||
self.assertEqual(node.connection_type, 'kubectl')
|
||||
self.assertEqual(node.connection_port.get('token'), 'fake-token')
|
||||
self.assertEqual(node.attributes,
|
||||
{'key1': 'value1', 'key2': 'value2'})
|
||||
|
||||
node.state = zk.DELETING
|
||||
self.zk.storeNode(node)
|
||||
|
Loading…
x
Reference in New Issue
Block a user