Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Rename tag parameter to label
Browse files Browse the repository at this point in the history
Remove this error message that pops up when validation the code:
puppet-syntax: tag is a metaparam; this value will inherit to all contained resources
  • Loading branch information
Phil Friderici committed Sep 20, 2023
1 parent 4fc19df commit 373b166
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions manifests/image.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# @param image
# TODO: add documentation
#
# @param tag
# @param label
# TODO: add documentation
#
define docker::image (
Enum['present', 'absent'] $ensure = 'present',
String[1] $image = $name,
String[1] $tag = 'latest', # TODO tag is a metaparameter and needs to get renamed
String[1] $label = 'latest',
) {
$image_real = "${image}:${tag}"
$image_real = "${image}:${label}"
$image_cond = "images=`docker images | grep \"${image}\" | awk 'BEGIN{ OFS=\":\" } { print \$1, \$2 }'` && exist='false' && for img in \${images} ; do if [ \${img} == \"${image_real}\" ]; then exist='true' ; fi ; done && test \${exist} == 'true'" #lint:ignore:140chars

if $ensure == 'present' {
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
end
end

context 'with tag set to valid value' do
let(:params) { { tag: '2.4.2' } }
context 'with label set to valid value' do
let(:params) { { label: '2.4.2' } }

it { is_expected.to contain_exec('docker_image_test-title_pull').with_command('docker pull test-title:2.4.2') }
end
Expand Down

0 comments on commit 373b166

Please sign in to comment.