-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show unused environments #140
Comments
Show unused envsThe actual state of HDM works as follows: Now we want to also show unused Puppet environments. 2nd use case:Which hiera data does the node retrieve if the node switches its environment? Solution:As we want to achieve different results for different use cases we came up with the following proposal:
API endpoints to use: https://www.puppet.com/docs/puppetdb/7/api/query/v4/nodes.html#pdbqueryv4nodesnodefacts |
I am currently struggling with our test data here as we reuse node names between environments. So just to confirm: In an actual production environment a node can only belong to one environment, correct? |
The trouble with the test data goes even deeper than I feared. With this change, we would need to query for a node's facts without specifying an environment. We already talked about how that is possible. But in our test data we have node facts in yaml files per environment. This would make it impossible (or at least ugly) to access the correct node data in tests. I would proprose that we move out the node fact yaml files from the individual environments and into a single folder, e.g. Each file should contain the current environment of the node. This means we will no longer have all nodes in all environments that they were previously in. I would try to see which ones are actually used in tests and thus important to be in a specific environment and try to divide the remaining ones up equally between those environments where it makes sense to have many nodes. @tuxmea, since you created most of this test data, do you see any problem with this approach? |
In addition to environments from puppetdb, hdm will now also query the file system and distinguish between environments that are in use (i.e. known by puppetdb) and unused (only present in the file system).
This includes a huge shuffling around of test data as node names can no longer be reused in different environments. Also includes an update to the vendored slim-select js library.
I believe my assumption above is OK, so I went ahead and moved test data around a lot, but with a different approach as outlined above: I put all existing nodes in the Tests work fine so far, so I created #146. |
…ts (#146) * Consider unused environments #140 In addition to environments from puppetdb, hdm will now also query the file system and distinguish between environments that are in use (i.e. known by puppetdb) and unused (only present in the file system). * Allow selection of nodes from different env #140 This includes a huge shuffling around of test data as node names can no longer be reused in different environments. Also includes an update to the vendored slim-select js library. * Fix bug introduced by blindly trusting rubocop #140
get all environments from puppetdb even if no node is running against it
The text was updated successfully, but these errors were encountered: