@@ -22,11 +22,12 @@ import (
2222 argoio "github.com/argoproj/gitops-engine/pkg/utils/io"
2323 "github.com/argoproj/gitops-engine/pkg/utils/text"
2424 "github.com/bradleyfalzon/ghinstallation/v2"
25- log "github.com/sirupsen/logrus"
2625
2726 "github.com/argoproj/argo-cd/v3/common"
2827 certutil "github.com/argoproj/argo-cd/v3/util/cert"
2928 argoioutils "github.com/argoproj/argo-cd/v3/util/io"
29+
30+ "github.com/argoproj-labs/argocd-image-updater/registry-scanner/pkg/log"
3031)
3132
3233var (
@@ -286,10 +287,10 @@ func (c SSHCreds) Environ() (io.Closer, []string, error) {
286287 }
287288 defer func () {
288289 if err = file .Close (); err != nil {
289- log .WithFields (log. Fields {
290- common .SecurityField : common .SecurityMedium ,
291- common .SecurityCWEField : common .SecurityCWEMissingReleaseOfFileDescriptor ,
292- }). Errorf ("error closing file %q: %v" , file .Name (), err )
290+ log .WithContext ().
291+ AddField ( common .SecurityField , common .SecurityMedium ).
292+ AddField ( common .SecurityCWEField , common .SecurityCWEMissingReleaseOfFileDescriptor ).
293+ Errorf ("error closing file %q: %v" , file .Name (), err )
293294 }
294295 }()
295296
@@ -304,7 +305,7 @@ func (c SSHCreds) Environ() (io.Closer, []string, error) {
304305 env = append (env , fmt .Sprintf ("GIT_SSL_CAINFO=%s" , c .caPath ))
305306 }
306307 if c .insecure {
307- log .Warn ("temporarily disabling strict host key checking (i.e. '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'), please don't use in production" )
308+ log .Warnf ("temporarily disabling strict host key checking (i.e. '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'), please don't use in production" )
308309 // StrictHostKeyChecking will add the host to the knownhosts file, we don't want that - a security issue really,
309310 // UserKnownHostsFile=/dev/null is therefore used so we write the new insecure host to /dev/null
310311 args = append (args , "-o" , "StrictHostKeyChecking=no" , "-o" , "UserKnownHostsFile=/dev/null" )
0 commit comments