cleanning up annotations on each deployment check

pull/26/head
Karolis Rusenas 2017-07-04 07:04:06 +01:00
parent 294f50dd68
commit d39b601c2b
1 changed files with 6 additions and 1 deletions

View File

@ -22,7 +22,7 @@ const ProviderName = "kubernetes"
var versionreg = regexp.MustCompile(`:[^:]*$`)
// annotation used to specify which image to force pull
const forceUpdateImageAnnotation = "keel.sh/updateImage"
const forceUpdateImageAnnotation = "keel.sh/update-image"
// Provider - kubernetes provider for auto update
type Provider struct {
@ -260,6 +260,11 @@ func (p *Provider) impactedDeployments(repo *types.Repository) ([]v1beta1.Deploy
continue
}
// annotation cleanup
annotations := deployment.GetAnnotations()
delete(annotations, forceUpdateImageAnnotation)
deployment.SetAnnotations(annotations)
newVersion, err := version.GetVersion(repo.Tag)
if err != nil {
// failed to get new version tag