Skip to content

Commit cd5567e

Browse files
fix(main): prevent building on pulled image
1 parent da38821 commit cd5567e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

soos.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,26 +226,27 @@ func main() {
226226

227227
localImageIsPresent := checkImagePresence(imageReference)
228228

229-
localImageIsPresent2 := false
229+
localImageIsBuild := false
230230

231231
if !localImageIsPresent {
232232
fmt.Printf("<-> Image is missing, trying to pull...")
233233
pullImage(imageReference)
234-
localImageIsPresent2 := checkImagePresence(imageReference)
235-
fmt.Printf("<-> result: %t done\n", localImageIsPresent2)
234+
localImageIsPresent = checkImagePresence(imageReference)
235+
fmt.Printf("<-> result: %t done\n", localImageIsPresent)
236236
}
237237

238-
if !localImageIsPresent && !localImageIsPresent2 {
238+
if !localImageIsPresent {
239239
fmt.Printf("<-> Image is missing, building...")
240240
buildImage(imageReference)
241+
localImageIsBuild = true
241242
fmt.Printf("<-> done\n")
242243
}
243244

244245
fmt.Printf("<-> Running image...\n\n")
245246
runImage(imageReference)
246247
fmt.Printf("\n\ndone\n")
247248

248-
if !localImageIsPresent && !localImageIsPresent2 {
249+
if localImageIsBuild {
249250
fmt.Printf("<-> Pushing image...")
250251
pushImage(imageReference)
251252
fmt.Printf("done\n")

0 commit comments

Comments
 (0)