reposerverextract

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package reposerverextract provides an alternative to pkg/extract that renders Argo CD Application manifests by streaming local source files directly to the Argo CD repo server via gRPC, instead of deploying Applications to the cluster and polling until they are reconciled.

This approach is faster and simpler: no cluster-side Application objects are created, there is no reconciliation loop to wait for, and manifests are returned synchronously.

The entry point is RenderApplicationsFromBothBranches, which has the same return type as extract.RenderApplicationsFromBothBranches so callers can switch between the two with minimal code changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderApplicationsFromBothBranches

func RenderApplicationsFromBothBranches(
	argocd *argocdPkg.ArgoCDInstallation,
	baseBranch *git.Branch,
	targetBranch *git.Branch,
	timeout uint64,
	maxConcurrency uint,
	baseApps []argoapplication.ArgoResource,
	targetApps []argoapplication.ArgoResource,
	prRepo string,
) ([]extract.ExtractedApp, []extract.ExtractedApp, time.Duration, error)

RenderApplicationsFromBothBranches renders manifests for all supplied base and target Applications by streaming their local source directories to the Argo CD repo server via gRPC.

baseBranch / targetBranch identify the local folders that hold each branch's checked-out source files (e.g. "base-branch/" or "target-branch/").

prRepo is the URL of the pull-request repository (e.g. "https://github.com/org/repo.git"). Sources whose repoURL does not match this URL point at a different repository whose files are not checked out locally; those sources are rendered via the remote GenerateManifest RPC so the repo server fetches them itself.

The return type is identical to extract.RenderApplicationsFromBothBranches so that callers can swap implementations with minimal changes.

Types

type RepoCreds

type RepoCreds struct {
	// contains filtered or unexported fields
}

RepoCreds is a pre-fetched snapshot of all repository credentials registered in the ArgoCD installation. It is built once and shared across all concurrent rendering goroutines (it is read-only after construction).

func FetchRepoCreds

func FetchRepoCreds(ctx context.Context, k8sClient *k8s.Client, namespace string) (*RepoCreds, error)

FetchRepoCreds connects to the cluster via the ArgoCD DB layer and fetches all repository and credential information registered under the given ArgoCD namespace. The returned RepoCreds is safe for concurrent read access.

func (*RepoCreds) GetRepo

func (rc *RepoCreds) GetRepo(repoURL string) *v1alpha1.Repository

GetRepo returns the credential-enriched Repository for the given URL. If no registered repository matches the URL exactly, it returns a stub Repository with just the URL set (the same bare-URL behaviour as before this fix, so callers can always proceed).

func (*RepoCreds) HelmRepoCreds

func (rc *RepoCreds) HelmRepoCreds(source *v1alpha1.ApplicationSource) []*v1alpha1.RepoCreds

HelmRepoCreds returns the Helm + OCI credential templates to pass as ManifestRequest.HelmRepoCreds. For OCI primary sources the OCI creds are merged in (mirrors controller/state.go behaviour).

func (*RepoCreds) HelmRepos

func (rc *RepoCreds) HelmRepos(source *v1alpha1.ApplicationSource) []*v1alpha1.Repository

HelmRepos returns the Helm + OCI repository lists to pass as ManifestRequest.Repos. For OCI primary sources the OCI list is merged in (mirrors controller/state.go behaviour).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL