Skip to content

Commit

Permalink
fix: fix slice init length
Browse files Browse the repository at this point in the history
  • Loading branch information
cuishuang authored Oct 4, 2024
1 parent cdec347 commit 664584a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/argocd/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (h *applicationHealth) GetApplicationHealth(
// considered unhealthy as they may indicate a problem which can result in
// e.g. the health status result to become unreliable.
if errConditions := filterAppConditions(app, healthErrorConditions...); len(errConditions) > 0 {
issues := make([]error, len(errConditions))
issues := make([]error, 0, len(errConditions))
for _, condition := range errConditions {
issues = append(issues, fmt.Errorf(
"Argo CD Application %q in namespace %q has %q condition: %s",
Expand Down
2 changes: 1 addition & 1 deletion internal/directives/argocd_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (a *argocdUpdater) getApplicationHealth(
// considered unhealthy as they may indicate a problem which can result in
// e.g. the health status result to become unreliable.
if errConditions := a.filterAppConditions(app, healthErrorConditions...); len(errConditions) > 0 {
issues := make([]error, len(errConditions))
issues := make([]error, 0, len(errConditions))
for _, condition := range errConditions {
issues = append(issues, fmt.Errorf(
"Argo CD Application %q in namespace %q has %q condition: %s",
Expand Down

0 comments on commit 664584a

Please sign in to comment.