Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
  • Loading branch information
JorTurFer committed Apr 9, 2024
1 parent fce53b9 commit 867fbcc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions reposerver/repository/repository_test.go
Expand Up @@ -540,7 +540,10 @@ func TestHelmChartReferencingExternalValues_InvalidRefs(t *testing.T) {
// Empty refsource
service := newService(t, ".")

refSources, err := argo.GetRefSources(context.Background(), spec, repoDB)
refSources, err := argo.GetRefSources(context.Background(), argo.GetRefSourcesOptions{
Sources: spec.Sources,
Db: repoDB,
})
require.NoError(t, err)

request := &apiclient.ManifestRequest{Repo: &argoappv1.Repository{}, ApplicationSource: &spec.Sources[0], NoCache: true, RefSources: refSources, HasMultipleSources: true, ProjectName: "something",
Expand All @@ -553,7 +556,10 @@ func TestHelmChartReferencingExternalValues_InvalidRefs(t *testing.T) {
service = newService(t, ".")

spec.Sources[1].Ref = "Invalid"
refSources, err = argo.GetRefSources(context.Background(), spec, repoDB)
refSources, err = argo.GetRefSources(context.Background(), argo.GetRefSourcesOptions{
Sources: spec.Sources,
Db: repoDB,
})
require.NoError(t, err)

request = &apiclient.ManifestRequest{Repo: &argoappv1.Repository{}, ApplicationSource: &spec.Sources[0], NoCache: true, RefSources: refSources, HasMultipleSources: true, ProjectName: "something",
Expand All @@ -567,7 +573,10 @@ func TestHelmChartReferencingExternalValues_InvalidRefs(t *testing.T) {

spec.Sources[1].Ref = "ref"
spec.Sources[1].Chart = "helm-chart"
refSources, err = argo.GetRefSources(context.Background(), spec, repoDB)
refSources, err = argo.GetRefSources(context.Background(), argo.GetRefSourcesOptions{
Sources: spec.Sources,
Db: repoDB,
})
require.NoError(t, err)

request = &apiclient.ManifestRequest{Repo: &argoappv1.Repository{}, ApplicationSource: &spec.Sources[0], NoCache: true, RefSources: refSources, HasMultipleSources: true, ProjectName: "something",
Expand Down
2 changes: 1 addition & 1 deletion server/application/application.go
Expand Up @@ -1486,7 +1486,7 @@ func (s *Server) RevisionMetadata(ctx context.Context, q *application.RevisionMe

var source *v1alpha1.ApplicationSource
if a.Spec.HasMultipleSources() {
// If the historical data is empty (because the app hasn't been synced yet)
// If the historical data is empty (because the app hasn't been synced yet)
// we can use the source, if not (the app has been synced at least once)
// we have to use the history because sources can be added/removed
if len(a.Status.History) == 0 {
Expand Down

0 comments on commit 867fbcc

Please sign in to comment.