Add condition for docker pull operation
By default, when docker plugin is used in pipelines
we always pull image as a separate action. Sometimes it may hurt
i.e. when registry is accessible only with username and password.
This w/a will implement a switch that can enable or disable pull.
Related-PROD: PROD-31909
Change-Id: I611a1328da4996d839096796e6e148f35eb91763
diff --git a/src/com/mirantis/mk/SaltModelTesting.groovy b/src/com/mirantis/mk/SaltModelTesting.groovy
index 8fe116f..1b9b3e8 100644
--- a/src/com/mirantis/mk/SaltModelTesting.groovy
+++ b/src/com/mirantis/mk/SaltModelTesting.groovy
@@ -118,7 +118,11 @@
}
def img = docker.image(dockerImageName)
- img.pull()
+ def pull_enabled = config.get('dockerPull', true)
+
+ if ( pull_enabled ) {
+ img.pull()
+ }
try {
img.inside(dockerOptsFinal) {