Skip to content

Commit 949b420

Browse files
committed
Use app.QualifiedName, add back trace statements
Use `app.QualifiedName()` instead of creating a namespace/name string. In addition, I had erroneously removed trace statements, which are now back. Signed-off-by: Ian Delahorne <[email protected]>
1 parent b378e4b commit 949b420

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pkg/argocd/argocd.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,37 +176,38 @@ func FilterApplicationsForUpdate(apps []v1alpha1.Application, patterns []string,
176176
var appsForUpdate = make(map[string]ApplicationImages)
177177

178178
for _, app := range apps {
179-
appNSName := fmt.Sprintf("%s/%s", app.GetNamespace(), app.GetName())
180179
logCtx := log.WithContext().AddField("application", app.GetName()).AddField("namespace", app.GetNamespace())
181180
// Check whether application has our annotation set
182181
annotations := app.GetAnnotations()
183182
if _, ok := annotations[common.ImageUpdaterAnnotation]; !ok {
183+
logCtx.Tracef("skipping app '%s' of type '%s' because required annotation is missing", app.QualifiedName(), app.Status.SourceType)
184184
continue
185185
}
186186

187187
// Check for valid application type
188188
if !IsValidApplicationType(&app) {
189+
logCtx.Warnf("skipping app '%s' of type '%s' because it's not of supported source type", app.QualifiedName(), app.Status.SourceType)
189190
continue
190191
}
191192

192193
// Check if application name matches requested patterns
193194
if !nameMatchesPattern(app.GetName(), patterns) {
194-
logCtx.Debugf("Skipping app '%s' because it does not match requested patterns", app.GetName())
195+
logCtx.Debugf("Skipping app '%s' because it does not match requested patterns", app.QualifiedName())
195196
continue
196197
}
197198

198199
// Check if application carries requested label
199200
if !matchAppLabels(app.GetName(), app.GetLabels(), appLabel) {
200-
logCtx.Debugf("Skipping app '%s' because it does not carry requested label", appNSName)
201+
logCtx.Debugf("Skipping app '%s' because it does not carry requested label", app.QualifiedName())
201202
continue
202203
}
203204

204-
logCtx.Tracef("processing app '%s' of type '%v'", appNSName, app.Status.SourceType)
205+
logCtx.Tracef("processing app '%s' of type '%v'", app.QualifiedName(), app.Status.SourceType)
205206
imageList := parseImageList(annotations)
206207
appImages := ApplicationImages{}
207208
appImages.Application = app
208209
appImages.Images = *imageList
209-
appsForUpdate[appNSName] = appImages
210+
appsForUpdate[app.QualifiedName()] = appImages
210211
}
211212

212213
return appsForUpdate, nil

0 commit comments

Comments
 (0)