Skip to content

Improve error propagation in ApplicationSet command generation #2014

@coderabbitai

Description

@coderabbitai

Description

Currently, getArgoApplicationSetCommand logs errors from getApplicationSetSourceNamespaces but continues execution, potentially creating a deployment without the --applicationset-namespaces flag. This can silently disable the ApplicationSet feature when namespace retrieval fails.

Proposed Solution

Update getArgoApplicationSetCommand to return ([]string, error) and propagate errors up to the reconciler instead of swallowing them. This will allow:

  • Early return when getApplicationSetSourceNamespaces fails
  • Proper error handling for getSourceNamespaces failures
  • Reconciliation retry on transient errors
  • Surfacing issues instead of hiding them

Scope

This change will require updates to:

  • getArgoApplicationSetCommand function signature
  • All callers of getArgoApplicationSetCommand to handle errors
  • Related error handling logic in the reconciliation flow

Context

This improvement was identified during PR #1988 (wildcard support for ApplicationSet source namespaces) but deferred to keep that PR focused on pattern matching functionality.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions