Skip to content

Commit

Permalink
refactor(controller): fix slice init length (akuity#2648)
Browse files Browse the repository at this point in the history
Signed-off-by: cuishuang <imcusg@gmail.com>
  • Loading branch information
cuishuang authored Oct 4, 2024
1 parent e6b2329 commit 4b19a86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions internal/argocd/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ func (h *applicationHealth) GetApplicationHealth(
// e.g. the health status result to become unreliable.
if errConditions := filterAppConditions(app, healthErrorConditions...); len(errConditions) > 0 {
issues := make([]error, len(errConditions))
for _, condition := range errConditions {
issues = append(issues, fmt.Errorf(
for i, condition := range errConditions {
issues[i] = fmt.Errorf(
"Argo CD Application %q in namespace %q has %q condition: %s",
appKey.Name,
appKey.Namespace,
condition.Type,
condition.Message,
))
)
}
return kargoapi.HealthStateUnhealthy, healthStatus, syncStatus, errors.Join(issues...)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/directives/argocd_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ func (a *argocdUpdater) getApplicationHealth(
// e.g. the health status result to become unreliable.
if errConditions := a.filterAppConditions(app, healthErrorConditions...); len(errConditions) > 0 {
issues := make([]error, len(errConditions))
for _, condition := range errConditions {
issues = append(issues, fmt.Errorf(
for i, condition := range errConditions {
issues[i] = fmt.Errorf(
"Argo CD Application %q in namespace %q has %q condition: %s",
appKey.Name,
appKey.Namespace,
condition.Type,
condition.Message,
))
)
}
return kargoapi.HealthStateUnhealthy, appStatus, errors.Join(issues...)
}
Expand Down

0 comments on commit 4b19a86

Please sign in to comment.