diff --git a/hydrate-orchestrator/modules/hydrate-kubernetes/previous_images.go b/hydrate-orchestrator/modules/hydrate-kubernetes/previous_images.go index 9c75fe63..b4fcf9f5 100644 --- a/hydrate-orchestrator/modules/hydrate-kubernetes/previous_images.go +++ b/hydrate-orchestrator/modules/hydrate-kubernetes/previous_images.go @@ -87,6 +87,14 @@ func (m *HydrateKubernetes) BuildPreviousImagesApp( } + artifact.Metadata.Annotations.PreviousImage = artifact.Metadata.Annotations.Image + + updatedFileContents, err := yaml.Marshal(artifact) + if err != nil { + return "", err + } + + m.WetRepoDir.WithNewFile(targetDir+"/"+manifest, string(updatedFileContents)) } marshaled, err := yaml.Marshal(mapImages) diff --git a/hydrate-orchestrator/modules/hydrate-kubernetes/types.go b/hydrate-orchestrator/modules/hydrate-kubernetes/types.go index d625fa68..0a762728 100644 --- a/hydrate-orchestrator/modules/hydrate-kubernetes/types.go +++ b/hydrate-orchestrator/modules/hydrate-kubernetes/types.go @@ -10,9 +10,9 @@ type Metadata struct { } type Annotations struct { - MicroService string `yaml:"firestartr.dev/microservice"` - - Image string `yaml:"firestartr.dev/image"` + MicroService string `yaml:"firestartr.dev/microservice"` + Image string `yaml:"firestartr.dev/image"` + PreviousImage string `yaml:"firestartr.dev/previous-image"` } type ImageMatrix struct {