(CAT-2052) Pass target container URI instead of container SHA ID to add_feature_to_node() method #574
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
There is a bug in the 'install_agent' task.
It is supposed to install the agent on a host (a VM or a docker container) using bolt and then add the 'puppet-agent' feature to the host in the litmus_inventory file.
Bolt returns the SHA ID of the container instead of the localhost URI after it installs the agent. The feature is added through the add_feature_to_node() method.
The last parameter of the method is being sent as result["target"]. This is fine in the case of VMs since its their IPv4 address and the method is expecting just that.
But in case of docker containers it is their SHA container ID and the method expecting the localhost:{port} URI. This results in the feature not being added to the host.
Since bolt is returning the results in the same order it is provided the input 'targets', we can add the feature by indexing the 'targets' array in that order.
Additional Context
See https://perforce.atlassian.net/browse/CAT-2052?focusedCommentId=2970824
The puppetlabs-package nightlies are failing due to this on all the docker provisioned VMs.
Related Issues (if any)
Mention any related issues or pull requests.
Checklist