Skip to content

Commit

Permalink
fix nil reference and key mismatch bugs; add more logs (#6)
Browse files Browse the repository at this point in the history
* fix nil reference and key mismatch bugs; add more logs
* remove temporary comment
* addressed the lint failure and added chart to RefTargeRevisionMapping
* normalize git repo (#7)
* do not leak lock releases
* prevent deadlock
* allow spec update
* move settings fetch outside loop
* cache busing
* return err instead of logging it
* no caching in test
* fix cache key marshaling

Signed-off-by: Michael Crenshaw <[email protected]>

Rebase with master

Signed-off-by: ishitasequeira <[email protected]>
  • Loading branch information
crenshaw-dev authored and ishitasequeira committed Dec 14, 2022
1 parent 62ced60 commit da1b020
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 36 deletions.
17 changes: 8 additions & 9 deletions pkg/apis/application/v1alpha1/generated.pb.go

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

4 changes: 0 additions & 4 deletions pkg/apis/application/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ func (a *ApplicationSource) GetRefVariableName(namespace, appName string) string
return fmt.Sprintf("$%s_%s_%s", namespace, appName, a.Ref)
}

func (a *ApplicationSource) GetRefVariableName(namespace, appName string) string {
return fmt.Sprintf("$%s_%s_%s", namespace, appName, a.Ref)
}

// ApplicationSourceHelm holds helm specific options
type ApplicationSourceHelm struct {
// ValuesFiles is a list of Helm value files to use when generating a template
Expand Down
14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/fake/register.go

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

14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/scheme/register.go

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

4 changes: 1 addition & 3 deletions reposerver/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func (s *Service) GenerateManifest(ctx context.Context, q *apiclient.ManifestReq
var res *apiclient.ManifestResponse
var err error
cacheFn := func(cacheKey string, firstInvocation bool) (bool, error) {
ok, resp, err := s.getManifestCacheEntry(cacheKey, q, q.ApplicationSource, firstInvocation)
ok, resp, err := s.getManifestCacheEntry(cacheKey, q, firstInvocation)
res = resp
return ok, err
}
Expand Down Expand Up @@ -609,8 +609,6 @@ func (s *Service) runManifestGenAsync(ctx context.Context, repoRoot, commitSHA,
// key. Overrides will break the cache anyway, because changes to overrides will change the revision.
appSourceCopy := q.ApplicationSource.DeepCopy()

repoLocks := make(map[string]goio.Closer)

var manifestGenResult *apiclient.ManifestResponse
opContext, err := opContextSrc()
if err == nil {
Expand Down
12 changes: 6 additions & 6 deletions reposerver/repository/repository.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ message ManifestRequest {
// Name of the application for which the request is triggered
string appName = 5;
string namespace = 8;
jackfan.us.kg.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.ApplicationSource applicationSource = 11;
repeated jackfan.us.kg.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.Repository repos = 12;
repeated jackfan.us.kg.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.ConfigManagementPlugin plugins = 13;
jackfan.us.kg.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.KustomizeOptions kustomizeOptions = 14;
string kubeVersion = 15;
repeated string apiVersions = 16;
jackfan.us.kg.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.ApplicationSource applicationSource = 10;
repeated jackfan.us.kg.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.Repository repos = 11;
repeated jackfan.us.kg.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.ConfigManagementPlugin plugins = 12;
jackfan.us.kg.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.KustomizeOptions kustomizeOptions = 13;
string kubeVersion = 14;
repeated string apiVersions = 15;
// Request to verify the signature when generating the manifests (only for Git repositories)
bool verifySignature = 16;
repeated jackfan.us.kg.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.RepoCreds helmRepoCreds = 17;
Expand Down

0 comments on commit da1b020

Please sign in to comment.