Skip to content

Commit 402c82a

Browse files
committed
artifact processing enhancements for non-standard artifact types
Signed-off-by: Kyle Quest <kcq.public@gmail.com>
1 parent 6dbfe5c commit 402c82a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pkg/app/sensor/artifact/artifact.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,10 @@ func (p *store) prepareArtifact(artifactFileName string) {
675675
case srcLinkFileInfo.Mode().IsDir():
676676
log.Debugf("prepareArtifact - is a directory (shouldn't see it) - %v", artifactFileName)
677677
props.FileType = report.DirArtifactType
678+
p.rawNames[artifactFileName] = props
678679
default:
679680
log.Debugf("prepareArtifact - other type (shouldn't see it) - %v", artifactFileName)
681+
p.rawNames[artifactFileName] = props
680682
}
681683
}
682684

@@ -692,13 +694,16 @@ func (p *store) prepareArtifacts() {
692694
log.Debug("prepareArtifacts - ptMonReport.Enabled")
693695
for artifactFileName, fsaInfo := range p.ptMonReport.FSActivity {
694696
artifactInfo, found := p.rawNames[artifactFileName]
695-
if found {
697+
if found && artifactInfo != nil {
696698
artifactInfo.FSActivity = fsaInfo
697699
} else {
698-
log.Debugf("prepareArtifacts - fsa artifact => %v", artifactFileName)
700+
log.Debugf("prepareArtifacts [%v] - fsa artifact => %v", found, artifactFileName)
701+
if found && artifactInfo == nil {
702+
log.Debugf("prepareArtifacts - fsa artifact (found, but no info) => %v", artifactFileName)
703+
}
699704
p.prepareArtifact(artifactFileName)
700705
artifactInfo, found := p.rawNames[artifactFileName]
701-
if found {
706+
if found && artifactInfo != nil {
702707
artifactInfo.FSActivity = fsaInfo
703708
} else {
704709
log.Debugf("[warn] prepareArtifacts - fsa artifact - missing in rawNames => %v", artifactFileName)

0 commit comments

Comments
 (0)