From 1e312ebc21d7d1de7e923b163975b427986bf1b3 Mon Sep 17 00:00:00 2001 From: outscale-mgo Date: Mon, 22 Mar 2021 09:05:10 +0100 Subject: [PATCH] Fix description that was ignored in Osc builder (#10792) Signed-off-by: Matthias Gatto --- builder/osc/bsu/step_create_omi.go | 3 +++ builder/osc/bsusurrogate/step_register_omi.go | 3 +++ builder/osc/chroot/step_create_omi.go | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/builder/osc/bsu/step_create_omi.go b/builder/osc/bsu/step_create_omi.go index d2ba7c02d..74ddb36ce 100644 --- a/builder/osc/bsu/step_create_omi.go +++ b/builder/osc/bsu/step_create_omi.go @@ -32,6 +32,9 @@ func (s *stepCreateOMI) Run(ctx context.Context, state multistep.StateBag) multi ImageName: omiName, BlockDeviceMappings: config.BlockDevices.BuildOscOMIDevices(), } + if config.OMIDescription != "" { + createOpts.Description = config.OMIDescription + } resp, _, err := oscconn.ImageApi.CreateImage(context.Background(), &osc.CreateImageOpts{ CreateImageRequest: optional.NewInterface(createOpts), diff --git a/builder/osc/bsusurrogate/step_register_omi.go b/builder/osc/bsusurrogate/step_register_omi.go index 8f6bb1cfb..4b14fa2d3 100644 --- a/builder/osc/bsusurrogate/step_register_omi.go +++ b/builder/osc/bsusurrogate/step_register_omi.go @@ -37,6 +37,9 @@ func (s *StepRegisterOMI) Run(ctx context.Context, state multistep.StateBag) mul BlockDeviceMappings: blockDevices, } + if config.OMIDescription != "" { + registerOpts.Description = config.OMIDescription + } registerResp, _, err := oscconn.ImageApi.CreateImage(context.Background(), &osc.CreateImageOpts{ CreateImageRequest: optional.NewInterface(registerOpts), }) diff --git a/builder/osc/chroot/step_create_omi.go b/builder/osc/chroot/step_create_omi.go index 62afb7c32..00bfe090b 100644 --- a/builder/osc/chroot/step_create_omi.go +++ b/builder/osc/chroot/step_create_omi.go @@ -75,6 +75,10 @@ func (s *StepCreateOMI) Run(ctx context.Context, state multistep.StateBag) multi registerOpts = buildRegisterOpts(config, image, newMappings) } + if config.OMIDescription != "" { + registerOpts.Description = config.OMIDescription + } + registerResp, _, err := osconn.ImageApi.CreateImage(context.Background(), &osc.CreateImageOpts{ CreateImageRequest: optional.NewInterface(registerOpts), })