Skip to content

Commit

Permalink
fix: Prevent segfault with empty kustomization (argoproj-labs#1020)
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Ongyerth <ongyerth@google.com>
Co-authored-by: Markus Ongyerth <ongy@ongy.net>
  • Loading branch information
Ongy and Markus Ongyerth authored Feb 12, 2025
1 parent 597aaa9 commit add409e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/argocd/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,18 @@ func writeKustomization(app *v1alpha1.Application, wbc *WriteBackConfig, gitC gi
if kustFile == "" {
return fmt.Errorf("could not find kustomization in %s", base), false
}
source := getApplicationSource(app)
if source == nil {
return fmt.Errorf("failed to find source for kustomization in %s", base), false
}

kustomize := source.Kustomize
images := v1alpha1.KustomizeImages{}
if kustomize != nil {
images = kustomize.Images
}

filterFunc, err := imagesFilter(getApplicationSource(app).Kustomize.Images)
filterFunc, err := imagesFilter(images)
if err != nil {
return err, false
}
Expand Down

0 comments on commit add409e

Please sign in to comment.