-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Conversation
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"} }}`))) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// DERECATED
There was a problem hiding this comment.
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.
util/db/helmrepository.go
Outdated
Name: repoInfo.Name, | ||
InsecureIgnoreHostKey: false, | ||
Insecure: false, | ||
EnableLFS: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about CA?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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
e08f604
to
1faf882
Compare
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
1faf882
to
3d1641a
Compare
There was a problem hiding this 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good stuff
util/db/helmrepository.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
for i := range repos { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
No description provided.