(CDPE-6220) Fix variable references in run.pp#977
Open
eputnam wants to merge 1 commit intopuppetlabs:mainfrom
Open
(CDPE-6220) Fix variable references in run.pp#977eputnam wants to merge 1 commit intopuppetlabs:mainfrom
eputnam wants to merge 1 commit intopuppetlabs:mainfrom
Conversation
Currently, CD4PE is using this module as part of the version 5 installation. When we use docker::run, we're getting warnings like this in the customer-facing terminal output: Unknown variable: 'docker::docker_group'. (file: /Users/eric.putnam/ws/cd4pe/PipelinesInfra/deploy/envs/cdpe6633/.modules/docker/manifests/run.pp, line: 268, column: 19) Unknown variable: 'docker::service_name'. (file: /Users/eric.putnam/ws/cd4pe/PipelinesInfra/deploy/envs/cdpe6633/.modules/docker/manifests/run.pp, line: 267, column: 19) This doesn't make for a very good customer experience. Since these vars are in docker::params, I added "::params" to the two lines where docker_group and service_name are assigned and that seemed to take care of the warnings. Please correct me if I'm wrong about this change, our main goal is to get rid of these warnings.
smortex
requested changes
Apr 18, 2024
Collaborator
smortex
left a comment
There was a problem hiding this comment.
Directly using $docker::params::* is not correct because it contain a default value for a parameter the end user may have provided a specific one.
I added details and a better approach in in-line comments.
Thanks!
Comment on lines
+267
to
+268
| $service_name = $docker::params::service_name | ||
| $docker_group = $docker::params::docker_group |
Collaborator
There was a problem hiding this comment.
The docker class inherits form docker::params and allow personalization of these parameters (using the values from docker::params for default values if not provided).
In order to access $docker::* variables, including this class should be enough:
include docker
Contributor
|
Also, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Currently, CD4PE is using this module as part of the version 5 installation. When we use docker::run, as part of starting up the application containers, we're getting warnings like this in the customer-facing terminal output:
Unknown variable: 'docker::docker_group'. (file: /Users/eric.putnam/ws/cd4pe/PipelinesInfra/deploy/envs/cdpe6633/.modules/docker/manifests/run.pp, line: 268, column: 19)
Unknown variable: 'docker::service_name'. (file: /Users/eric.putnam/ws/cd4pe/PipelinesInfra/deploy/envs/cdpe6633/.modules/docker/manifests/run.pp, line: 267, column: 19)
This doesn't make for a very good customer experience. Since these vars are in docker::params, I added "::params" to the two lines where docker_group and service_name are assigned and that seemed to take care of the warnings. Please correct me if I'm wrong about this change, our main goal is to get rid of these warnings.
Additional Context
Add any additional context about the problem here.
These warnings can be seen by running the following bolt plan, which requires this module:
Related Issues (if any)
Mention any related issues or pull requests.
Checklist
puppet apply)