Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmadhankumar committed Sep 22, 2023
1 parent 3709ab4 commit b8defe5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/kapp/diff/resource_with_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
)

const (
AppliedResAnnKey = "kapp.k14s.io/original"
AppliedResDiffMD5AnnKey = "kapp.k14s.io/original-diff-md5"
appliedResAnnKey = "kapp.k14s.io/original"
appliedResDiffMD5AnnKey = "kapp.k14s.io/original-diff-md5"

// Following fields useful for debugging:
debugAppliedResDiffAnnKey = "kapp.k14s.io/original-diff"
Expand Down Expand Up @@ -86,8 +86,8 @@ func (r ResourceWithHistory) RecordLastAppliedResource(appliedChange Change) (st
}

annsKVS := map[string]string{
AppliedResAnnKey: string(appliedResBytes),
AppliedResDiffMD5AnnKey: diff.MinimalMD5(),
appliedResAnnKey: string(appliedResBytes),
appliedResDiffMD5AnnKey: diff.MinimalMD5(),

// Following fields useful for debugging:
// debugAppliedResDiffAnnKey: diff.MinimalString(),
Expand Down Expand Up @@ -125,8 +125,8 @@ func (r ResourceWithHistory) CalculateChange(appliedRes ctlres.Resource) (Change
}

func (r ResourceWithHistory) recalculateLastAppliedChange() ([]Change, string, string) {
lastAppliedResBytes := r.resource.Annotations()[AppliedResAnnKey]
lastAppliedDiffMD5 := r.resource.Annotations()[AppliedResDiffMD5AnnKey]
lastAppliedResBytes := r.resource.Annotations()[appliedResAnnKey]
lastAppliedDiffMD5 := r.resource.Annotations()[appliedResDiffMD5AnnKey]

if len(lastAppliedResBytes) == 0 || len(lastAppliedDiffMD5) == 0 {
return nil, "", ""
Expand Down Expand Up @@ -191,15 +191,15 @@ func (ResourceWithoutHistory) removeAppliedResAnnKeysMods() []ctlres.ResourceMod
return []ctlres.ResourceMod{
ctlres.FieldRemoveMod{
ResourceMatcher: ctlres.AllMatcher{},
Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", AppliedResAnnKey}),
Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", appliedResAnnKey}),
},
ctlres.FieldRemoveMod{
ResourceMatcher: ctlres.AllMatcher{},
Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", debugAppliedResDiffAnnKey}),
},
ctlres.FieldRemoveMod{
ResourceMatcher: ctlres.AllMatcher{},
Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", AppliedResDiffMD5AnnKey}),
Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", appliedResDiffMD5AnnKey}),
},
ctlres.FieldRemoveMod{
ResourceMatcher: ctlres.AllMatcher{},
Expand Down

0 comments on commit b8defe5

Please sign in to comment.