diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 631606ce1..572c204c6 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -106,9 +106,11 @@ providers or images are used to create them). Example:: providers: - name: provider1 -The `name`, `image`, and `min-ready` keys are required. The -`providers` list is also required if any nodes should actually be -created (e.g., the label is not currently disabled). +The `name` and `image` keys are required. The `providers` list is +also required if any nodes should actually be created (e.g., the +label is not currently disabled). The `min-ready` key is optional +and defaults to 2. If the value is -1 the label is considered +disabled. The `subnodes` key is used to configure multi-node support. If a `subnodes` key is supplied to an image, it indicates that the specified diff --git a/nodepool/nodepool.py b/nodepool/nodepool.py index 31a038e5c..507dc4d84 100644 --- a/nodepool/nodepool.py +++ b/nodepool/nodepool.py @@ -975,7 +975,7 @@ class NodePool(threading.Thread): l.name = label['name'] newconfig.labels[l.name] = l l.image = label['image'] - l.min_ready = label['min-ready'] + l.min_ready = label.get('min-ready', 2) l.subnodes = label.get('subnodes', 0) l.ready_script = label.get('ready-script') l.providers = {} @@ -1386,7 +1386,8 @@ class NodePool(threading.Thread): # outside of its schedule. self.log.debug("Checking missing images.") for label in self.config.labels.values(): - if not label.min_ready: + if label.min_ready < 0: + # Label is configured to be disabled, skip creating the image. continue for provider_name in label.providers: found = False