From 823b957a1fb544ac66848c3231fecccfee4dd9a1 Mon Sep 17 00:00:00 2001 From: PacoDw <__pm@outlook.com> Date: Mon, 17 Aug 2020 10:06:27 -0500 Subject: [PATCH] :chore: implemented OSC connection in pre_validate file --- builder/osc/common/step_pre_validate.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/builder/osc/common/step_pre_validate.go b/builder/osc/common/step_pre_validate.go index 31efae31a..5fa2b8936 100644 --- a/builder/osc/common/step_pre_validate.go +++ b/builder/osc/common/step_pre_validate.go @@ -16,6 +16,7 @@ import ( type StepPreValidate struct { DestOmiName string ForceDeregister bool + API string } func (s *StepPreValidate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { @@ -60,7 +61,13 @@ func (s *StepPreValidate) Run(_ context.Context, state multistep.StateBag) multi return multistep.ActionHalt } - return multistep.ActionContinue + for _, omi := range resp.Images { + if omi.ImageName == imageName { + images = append(images, omi) + } + } + + return images, nil } func (s *StepPreValidate) Cleanup(multistep.StateBag) {}