Skip to content

Commit

Permalink
fix: fixed Duplicate Webhook Patch Entries when Creating Multiple Ver…
Browse files Browse the repository at this point in the history
…sions of the Same Kind
  • Loading branch information
Bharadwajshivam28 committed Oct 16, 2024
1 parent e451dfe commit c7c70bb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ func (f *Kustomization) GetCodeFragments() machinery.CodeFragmentsMap {

if !f.Resource.Webhooks.IsEmpty() {
webhookPatch := fmt.Sprintf(webhookPatchCodeFragment, suffix)
fragments[machinery.NewMarkerFor(f.Path, webhookPatchMarker)] = []string{webhookPatch}

marker := machinery.NewMarkerFor(f.Path, webhookPatchMarker)
if _, exists := fragments[marker]; !exists {
fragments[marker] = []string{webhookPatch}
}
}

// Generate resource code fragments
Expand Down

0 comments on commit c7c70bb

Please sign in to comment.