Fix description that was ignored in Osc builder (#10792)

Signed-off-by: Matthias Gatto <matthias.gatto@outscale.com>
This commit is contained in:
outscale-mgo 2021-03-22 09:05:10 +01:00 committed by GitHub
parent 667f930d3d
commit 1e312ebc21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -32,6 +32,9 @@ func (s *stepCreateOMI) Run(ctx context.Context, state multistep.StateBag) multi
ImageName: omiName, ImageName: omiName,
BlockDeviceMappings: config.BlockDevices.BuildOscOMIDevices(), BlockDeviceMappings: config.BlockDevices.BuildOscOMIDevices(),
} }
if config.OMIDescription != "" {
createOpts.Description = config.OMIDescription
}
resp, _, err := oscconn.ImageApi.CreateImage(context.Background(), &osc.CreateImageOpts{ resp, _, err := oscconn.ImageApi.CreateImage(context.Background(), &osc.CreateImageOpts{
CreateImageRequest: optional.NewInterface(createOpts), CreateImageRequest: optional.NewInterface(createOpts),

View File

@ -37,6 +37,9 @@ func (s *StepRegisterOMI) Run(ctx context.Context, state multistep.StateBag) mul
BlockDeviceMappings: blockDevices, BlockDeviceMappings: blockDevices,
} }
if config.OMIDescription != "" {
registerOpts.Description = config.OMIDescription
}
registerResp, _, err := oscconn.ImageApi.CreateImage(context.Background(), &osc.CreateImageOpts{ registerResp, _, err := oscconn.ImageApi.CreateImage(context.Background(), &osc.CreateImageOpts{
CreateImageRequest: optional.NewInterface(registerOpts), CreateImageRequest: optional.NewInterface(registerOpts),
}) })

View File

@ -75,6 +75,10 @@ func (s *StepCreateOMI) Run(ctx context.Context, state multistep.StateBag) multi
registerOpts = buildRegisterOpts(config, image, newMappings) registerOpts = buildRegisterOpts(config, image, newMappings)
} }
if config.OMIDescription != "" {
registerOpts.Description = config.OMIDescription
}
registerResp, _, err := osconn.ImageApi.CreateImage(context.Background(), &osc.CreateImageOpts{ registerResp, _, err := osconn.ImageApi.CreateImage(context.Background(), &osc.CreateImageOpts{
CreateImageRequest: optional.NewInterface(registerOpts), CreateImageRequest: optional.NewInterface(registerOpts),
}) })