Skip to content
Permalink
Browse files
feat(build): add report Image.NAME.Rebuilt field
Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Aug 4, 2022
1 parent 9e4a1c4 commit be6fba79ead32409cf85185323a9bad616cd40af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
@@ -150,6 +150,7 @@ type ReportImageRecord struct {
DockerImageID string
DockerImageDigest string
DockerImageName string
Rebuilt bool
}

func (phase *BuildPhase) Name() string {
@@ -181,6 +182,7 @@ func (phase *BuildPhase) createReport(ctx context.Context) error {
DockerImageID: desc.Info.ID,
DockerImageDigest: desc.Info.RepoDigest,
DockerImageName: desc.Info.Name,
Rebuilt: img.GetRebuilt(),
})
}

@@ -818,6 +820,8 @@ func (phase *BuildPhase) atomicBuildStageImage(ctx context.Context, img *Image,
stageImage.Image.SetStageDescription(desc)
}

img.SetRebuilt(true)

return nil
}); err != nil {
return err
@@ -35,6 +35,7 @@ type Image struct {
contentDigest string
isArtifact bool
isDockerfileImage bool
rebuilt bool

baseImageType BaseImageType
stageAsBaseImage stage.Interface
@@ -122,6 +123,14 @@ func (i *Image) GetLogName() string {
return i.LogName()
}

func (i *Image) SetRebuilt(rebuilt bool) {
i.rebuilt = rebuilt
}

func (i *Image) GetRebuilt() bool {
return i.rebuilt
}

func (i *Image) SetupBaseImage(c *Conveyor) {
if i.baseImageImageName != "" {
i.baseImageType = StageAsBaseImage

0 comments on commit be6fba7

Please sign in to comment.