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

Issue #2316 - support deprecated 'helm.repositories' config #2405

Merged
merged 2 commits into from
Oct 3, 2019

Conversation

alexmt
Copy link
Collaborator

@alexmt alexmt commented Oct 2, 2019

No description provided.

@alexmt alexmt requested a review from alexec October 2, 2019 21:17
fmt.Sprintf("--from-literal=password=%s", GitPassword),
))
errors.FailOnErr(fixture.KubeClientset.CoreV1().Secrets(fixture.ArgoCDNamespace).Patch(
"helm-repo", types.MergePatchType, []byte(`{"metadata": { "labels": {"e2e.argoproj.io": "true"} }}`)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@@ -41,6 +42,9 @@ type ArgoDB interface {
CreateRepoCertificate(ctx context.Context, certificate *appv1.RepositoryCertificateList, upsert bool) (*appv1.RepositoryCertificateList, error)
// CreateRepoCertificate creates a new certificate entry
RemoveRepoCertificates(ctx context.Context, selector *CertificateListSelector) (*appv1.RepositoryCertificateList, error)

// ListHelmRepositories lists repositories
ListHelmRepositories(ctx context.Context) ([]*appv1.Repository, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// DERECATED

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is not really deprecated. Even after we remove legacy helm repos it still makes sense to use this method to get only repos with helm type. In one of our Argo CD instances, we have ~350 git repos and 0 helm repos. So it does not makes sense to send 350 repos to Repo Server, instead it is better to filter out non-helm repos on the client side.

Name: repoInfo.Name,
InsecureIgnoreHostKey: false,
Insecure: false,
EnableLFS: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

&repo.Username: repoInfo.UsernameSecret,
&repo.Password: repoInfo.PasswordSecret,
&repo.TLSClientCertData: repoInfo.CertSecret,
&repo.TLSClientCertKey: repoInfo.KeySecret,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about CA?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. It is impossible to support/migrate configured CA with the current design.

The good thing that CA support does not really work in helm itself: helm/helm#3384 . So unlikely anyone managed to configure custom CA in Argo CD and we don't have to worry about this case.

@@ -94,6 +94,15 @@ type OIDCConfig struct {
RequestedIDTokenClaims map[string]*oidc.Claim `json:"requestedIDTokenClaims,omitempty"`
}

type HelmRepoCredentials struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// deprecated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might be able to extend Repository in Go

util/settings/settings.go Show resolved Hide resolved
@alexmt alexmt force-pushed the 2316-helm-repo-migration branch from e08f604 to 1faf882 Compare October 2, 2019 21:49
@codecov
Copy link

codecov bot commented Oct 2, 2019

Codecov Report

Merging #2405 into master will decrease coverage by 0.15%.
The diff coverage is 4.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2405      +/-   ##
==========================================
- Coverage   38.25%   38.09%   -0.16%     
==========================================
  Files         103      104       +1     
  Lines       14530    14582      +52     
==========================================
- Hits         5558     5555       -3     
- Misses       8229     8284      +55     
  Partials      743      743
Impacted Files Coverage Δ
util/db/db.go 69.23% <ø> (ø) ⬆️
pkg/apis/application/v1alpha1/types.go 58.57% <0%> (-0.68%) ⬇️
server/application/application.go 25.09% <0%> (ø) ⬆️
util/argo/argo.go 26.85% <0%> (ø) ⬆️
util/settings/settings.go 31% <0%> (-0.68%) ⬇️
reposerver/repository/repository.go 58.03% <0%> (+0.12%) ⬆️
util/db/helmrepository.go 0% <0%> (ø)
controller/state.go 71.56% <100%> (ø) ⬆️
util/helm/helm.go 64.15% <20%> (-1.93%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 399a022...b1f7720. Read the comment docs.

@alexmt alexmt force-pushed the 2316-helm-repo-migration branch from 1faf882 to 3d1641a Compare October 3, 2019 15:51
@alexmt alexmt requested a review from alexec October 3, 2019 15:56
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments.

}
result[i] = repo
}
repos, err := db.ListRepositories(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good stuff

if err != nil {
return nil, err
}
for i := range repos {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to add a Filter func to Repositories?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea. added

@alexmt alexmt merged commit 16e645b into argoproj:master Oct 3, 2019
@alexmt alexmt deleted the 2316-helm-repo-migration branch October 3, 2019 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants