Skip to content

Commit

Permalink
Merge pull request #1404 from kaytu-io/fix-steampipe-upgrade
Browse files Browse the repository at this point in the history
fix: add logs for migrator
  • Loading branch information
artaasadi authored Aug 1, 2024
2 parents 113e563 + b18c472 commit d088c51
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions services/migrator/job/migrations/compliance/git_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ func (g *GitParser) ExtractControls(complianceControlsPath string, controlEnrich
g.logger.Info("loaded cli remediation", zap.Int("count", len(cliRemediationMap)))
}

g.logger.Info("extracting controls", zap.Int("manualRemediationMap", len(manualRemediationMap)),
zap.Int("cliRemediationMap", len(cliRemediationMap)), zap.Int("guardrailRemediationMap", len(guardrailRemediationMap)),
zap.Int("programmaticRemediationMap", len(programmaticRemediationMap)), zap.Int("noncomplianceCostMap", len(noncomplianceCostMap)),
zap.Int("usefulnessExampleMap", len(usefulnessExampleMap)), zap.Int("explanationMap", len(explanationMap)))

return filepath.WalkDir(complianceControlsPath, func(path string, d fs.DirEntry, err error) error {
if strings.HasSuffix(path, ".yaml") {
content, err := os.ReadFile(path)
Expand Down Expand Up @@ -242,6 +247,7 @@ func (g *GitParser) ExtractBenchmarks(complianceBenchmarksPath string) error {
if err != nil {
return err
}
g.logger.Info("Extracted benchmarks 1", zap.Int("count", len(benchmarks)))

children := map[string][]string{}
for _, o := range benchmarks {
Expand Down Expand Up @@ -299,6 +305,7 @@ func (g *GitParser) ExtractBenchmarks(complianceBenchmarksPath string) error {
g.benchmarks = append(g.benchmarks, b)
children[o.ID] = o.Children
}
g.logger.Info("Extracted benchmarks 2", zap.Int("count", len(g.benchmarks)))

for idx, benchmark := range g.benchmarks {
for _, childID := range children[benchmark.ID] {
Expand All @@ -314,7 +321,11 @@ func (g *GitParser) ExtractBenchmarks(complianceBenchmarksPath string) error {
}
g.benchmarks[idx] = benchmark
}
g.logger.Info("Extracted benchmarks 3", zap.Int("count", len(g.benchmarks)))

g.benchmarks, _ = fillBenchmarksConnectors(g.benchmarks)
g.logger.Info("Extracted benchmarks 4", zap.Int("count", len(g.benchmarks)))

return nil
}

Expand Down

0 comments on commit d088c51

Please sign in to comment.