Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hydrator): write credentials handling + UI #20166

Draft
wants to merge 2 commits into
base: hydrator-controller-changes
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
498 changes: 498 additions & 0 deletions assets/swagger.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions controller/hydrator/hydrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Dependencies interface {
GetProcessableAppProj(app *appv1.Application) (*appv1.AppProject, error)
GetProcessableApps() (*appv1.ApplicationList, error)
GetRepoObjs(app *appv1.Application, source appv1.ApplicationSource, revision string, project *appv1.AppProject) ([]*unstructured.Unstructured, *apiclient.ManifestResponse, error)
GetWriteCredentials(ctx context.Context, repoURL string) (*appv1.Repository, error)
GetWriteCredentials(ctx context.Context, repoURL string, project string) (*appv1.Repository, error)
ResolveGitRevision(repoURL, targetRevision string) (string, error)
RequestAppRefresh(appName string)
// TODO: only allow access to the hydrator status
Expand Down Expand Up @@ -288,7 +288,8 @@ func (h *Hydrator) hydrate(logCtx *log.Entry, apps []*appv1.Application, revisio
})
}

repo, err := h.dependencies.GetWriteCredentials(context.Background(), repoURL)
// FIXME: handle project-scoped credentials
repo, err := h.dependencies.GetWriteCredentials(context.Background(), repoURL, "")
if err != nil {
return "", fmt.Errorf("failed to get hydrator credentials: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions controller/hydrator_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func (ctrl *ApplicationController) GetRepoObjs(app *appv1.Application, source ap
return objs, resp[0], nil
}

func (ctrl *ApplicationController) GetWriteCredentials(ctx context.Context, repoURL string) (*appv1.Repository, error) {
return ctrl.db.GetWriteCredentials(ctx, repoURL)
func (ctrl *ApplicationController) GetWriteCredentials(ctx context.Context, repoURL string, project string) (*appv1.Repository, error) {
return ctrl.db.GetWriteRepository(ctx, repoURL, project)
}

func (ctrl *ApplicationController) ResolveGitRevision(repoURL, targetRevision string) (string, error) {
Expand Down
4 changes: 2 additions & 2 deletions controller/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *v1
if hasMultipleSources {
return &comparisonResult{
syncStatus: &v1alpha1.SyncStatus{
ComparedTo: v1alpha1.ComparedTo{Destination: app.Spec.Destination, Sources: sources, IgnoreDifferences: app.Spec.IgnoreDifferences},
ComparedTo: app.Spec.BuildComparedToStatus(),
Status: v1alpha1.SyncStatusCodeUnknown,
Revisions: revisions,
},
Expand All @@ -491,7 +491,7 @@ func (m *appStateManager) CompareAppState(app *v1alpha1.Application, project *v1
} else {
return &comparisonResult{
syncStatus: &v1alpha1.SyncStatus{
ComparedTo: v1alpha1.ComparedTo{Source: sources[0], Destination: app.Spec.Destination, IgnoreDifferences: app.Spec.IgnoreDifferences},
ComparedTo: app.Spec.BuildComparedToStatus(),
Status: v1alpha1.SyncStatusCodeUnknown,
Revision: revisions[0],
},
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/commands/argocd_account_can-i.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions manifests/core-install-with-hydrator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4568,6 +4568,8 @@ spec:
type: string
namespace:
type: string
requiresDeletionConfirmation:
type: boolean
requiresPruning:
type: boolean
status:
Expand Down Expand Up @@ -22870,6 +22872,8 @@ spec:
type: string
namespace:
type: string
requiresDeletionConfirmation:
type: boolean
requiresPruning:
type: boolean
status:
Expand Down
4 changes: 4 additions & 0 deletions manifests/ha/install-with-hydrator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4568,6 +4568,8 @@ spec:
type: string
namespace:
type: string
requiresDeletionConfirmation:
type: boolean
requiresPruning:
type: boolean
status:
Expand Down Expand Up @@ -22870,6 +22872,8 @@ spec:
type: string
namespace:
type: string
requiresDeletionConfirmation:
type: boolean
requiresPruning:
type: boolean
status:
Expand Down
4 changes: 4 additions & 0 deletions manifests/install-with-hydrator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4568,6 +4568,8 @@ spec:
type: string
namespace:
type: string
requiresDeletionConfirmation:
type: boolean
requiresPruning:
type: boolean
status:
Expand Down Expand Up @@ -22870,6 +22872,8 @@ spec:
type: string
namespace:
type: string
requiresDeletionConfirmation:
type: boolean
requiresPruning:
type: boolean
status:
Expand Down
4 changes: 4 additions & 0 deletions manifests/namespace-install-with-hydrator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4568,6 +4568,8 @@ spec:
type: string
namespace:
type: string
requiresDeletionConfirmation:
type: boolean
requiresPruning:
type: boolean
status:
Expand Down Expand Up @@ -22870,6 +22872,8 @@ spec:
type: string
namespace:
type: string
requiresDeletionConfirmation:
type: boolean
requiresPruning:
type: boolean
status:
Expand Down
Loading
Loading