@@ -13,14 +13,13 @@ import (
1313 "time"
1414
1515 "github.com/1debit/mani-diffy/pkg/helm"
16+ "github.com/1debit/mani-diffy/pkg/kustomize"
1617
1718 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
1819)
1920
2021const InfiniteDepth = - 1
2122
22- var ErrKustomizeNotSupported = errors .New ("kustomize not supported" )
23-
2423// Renderer is a function that can render an Argo application.
2524type Renderer func (* v1alpha1.Application , string ) error
2625
@@ -127,19 +126,24 @@ func (w *Walker) walk(inputPath, outputPath string, depth, maxDepth int, visited
127126 if err != nil {
128127 return err
129128 }
129+
130130 hashGenerated , err := w .GenerateHash (crd )
131131 if err != nil {
132+ if errors .Is (err , kustomize .ErrNotSupported ) {
133+ continue
134+ }
132135 return err
133136 }
134137
135138 emptyManifest , err := helm .EmptyManifest (filepath .Join (path , "manifest.yaml" ))
136139 if err != nil {
137140 return err
138141 }
142+
139143 if hashGenerated != hash || emptyManifest {
140144 log .Printf ("No match detected. Render: %s\n " , crd .ObjectMeta .Name )
141145 if err := w .Render (crd , path ); err != nil {
142- if errors .Is (err , ErrKustomizeNotSupported ) {
146+ if errors .Is (err , kustomize . ErrNotSupported ) {
143147 continue
144148 }
145149 return err
@@ -169,7 +173,7 @@ func (w *Walker) Render(application *v1alpha1.Application, output string) error
169173 render = w .HelmTemplate
170174 case application .Spec .Source .Kustomize != nil :
171175 log .Println ("WARNING: kustomize not supported" )
172- return ErrKustomizeNotSupported
176+ return kustomize . ErrNotSupported
173177 default :
174178 render = w .CopySource
175179 }
0 commit comments