unlock unlimited code runs for $79, limited time →
NOSSLETTER.techLIVE
back to archive

feat: add oci generator for applicationsets

Language: Go+45287 -19489feature
concepts demonstrated
gRPC APIsCode reuse via utility functionsAPI design and versioningParallel method implementation
The Issue & Context

ApplicationSets in Argo CD previously supported Git repositories for generating applications, but lacked support for OCI artifacts, limiting deployment sources. The existing repo-server gRPC APIs were Git-specific, making OCI integration non-trivial.

Root Cause Analysis

The repo-server's gRPC API was designed exclusively for Git repositories, and reusing these APIs for OCI artifacts would blur API boundaries and complicate maintenance. Generalizing the APIs would break backward compatibility and impact clients relying on the current interface.

Solution Strategy & Architectural Pattern

Introduced dedicated OCI-specific gRPC methods (GetOciDirectories and GetOciFiles) in the repo-server that mirror the Git API structure, while sharing common logic through utility functions. This preserves API clarity and stability, enabling ApplicationSets to generate from OCI artifacts without disrupting existing Git workflows.

Key Takeaway for Contributors

Maintaining clear API boundaries while maximizing code reuse can be achieved by adding parallel specialized endpoints rather than overloading or breaking existing APIs, especially in widely used open-source projects.