Skip to content

Commit 3903b9f

Browse files
committed
Added format options to match by PluginReference
1 parent 411d085 commit 3903b9f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

manifests/plugin.pp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
})
8080

8181
$exec_install = "${docker_command} install ${docker_plugin_install_flags}"
82-
$unless_install = "${docker_command} ls | grep -w ${plugin_name}"
82+
$unless_install = "${docker_command} ls --format='{{.PluginReference}}' | grep -w ${plugin_name}"
8383

8484
exec { "plugin install ${plugin_name}":
8585
command => $exec_install,
@@ -95,7 +95,7 @@
9595
})
9696

9797
$exec_rm = "${docker_command} rm ${docker_plugin_remove_flags}"
98-
$onlyif_rm = "${docker_command} ls | grep -w ${plugin_name}"
98+
$onlyif_rm = "${docker_command} ls --format='{{.PluginReference}}' | grep -w ${plugin_name}"
9999

100100
exec { "plugin remove ${plugin_name}":
101101
command => $exec_rm,
@@ -109,11 +109,12 @@
109109
if $enabled {
110110
$docker_plugin_enable_flags = docker_plugin_enable_flags({
111111
plugin_name => $plugin_name,
112+
plugin_alias => $plugin_alias,
112113
timeout => $timeout,
113114
})
114115

115116
$exec_enable = "${docker_command} enable ${docker_plugin_enable_flags}"
116-
$onlyif_enable = "${docker_command} ls -f enabled=false | grep -w ${plugin_name}"
117+
$onlyif_enable = "${docker_command} ls -f enabled=false --format='{{.PluginReference}}' | grep -w ${plugin_name}"
117118

118119
exec { "plugin enable ${plugin_name}":
119120
command => $exec_enable,
@@ -129,7 +130,7 @@
129130
environment => 'HOME=/root',
130131
path => ['/bin', '/usr/bin'],
131132
timeout => 0,
132-
unless => "${docker_command} ls -f enabled=false | grep -w ${plugin_name}",
133+
unless => "${docker_command} ls -f enabled=false --format='{{.PluginReference}}' | grep -w ${plugin_name}",
133134
}
134135
}
135136
}

0 commit comments

Comments
 (0)