Skip to content

Commit

Permalink
Merge pull request #4220 from Bharadwajshivam28/fix/Duplicate_Webhook
Browse files Browse the repository at this point in the history
🐛 fixed Duplicate Webhook Patch Entries when Creating Multiple Ver…
  • Loading branch information
k8s-ci-robot authored Oct 17, 2024
2 parents b756c7d + c7c70bb commit bde03b7
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 bde03b7

Please sign in to comment.