Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End Of Life problem calculation #79

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moves problem write
Blaize Kaye committed Apr 16, 2024
commit b6ef3676a1f0b31c953dd4a774cb67df57958ba7
1 change: 0 additions & 1 deletion internal/handler/insightsParserFilter.go
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@ func processSbomInsightsData(h *Messaging, insights InsightsData, v string, apiC
}

// we process the SBOM here
// TODO: This should actually live in its own function somewhere else.
if h.ProblemsFromSBOM == true {
isAlive, err := IsTrivyServerIsAlive(h.TrivyServerEndpoint)
if err != nil {
14 changes: 13 additions & 1 deletion internal/handler/main.go
Original file line number Diff line number Diff line change
@@ -400,7 +400,19 @@ func (h *Messaging) deleteExistingFactsBySource(apiClient graphql.Client, enviro
}

func (h *Messaging) SendProblemSliceToLagoon(result []lagoonclient.LagoonProblem, resource ResourceDestination, source string) error {
slog.Info(fmt.Sprintf("Found the following problems for Project '%v', environment '%v', source '%v"), resource.Project, resource.Environment, source)

apiClient := h.getApiClient()
_, environment, apiErr := determineResourceFromLagoonAPI(apiClient, resource)

if apiErr != nil {
return apiErr
}

slog.Info(fmt.Sprintf("Found the following problems for Project '%v', environment '%v', source '%v", resource.Project, resource.Environment, source))
err := writeProblemsArrayToApi(apiClient, environment.Id, problemSource, resource.Service, result)
if err != nil {
return fmt.Errorf("unable to write problems to api: %v", err.Error())
}
return nil
}

4 changes: 0 additions & 4 deletions internal/handler/trivyProcessing.go
Original file line number Diff line number Diff line change
@@ -29,10 +29,6 @@ func SbomToProblems(apiClient graphql.Client, trivyRemoteAddress string, bomWrit
problemsArray[i].Source = problemSource
}

err = writeProblemsArrayToApi(apiClient, environmentId, problemSource, service, problemsArray)
if err != nil {
return problemsArray, fmt.Errorf("unable to execute trivy processing- writing problems to api: %v", err.Error())
}
return problemsArray, nil
}