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

Adds support for Helm 1st-class. Closes #1145 #1865

Merged
merged 107 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
fce444f
Adds support for Helm 1st-class. Closes #1145
alexec Jul 2, 2019
47a36df
Removes ListRepoURLs
alexec Jul 2, 2019
c551a7e
Adds type field
alexec Jul 2, 2019
3a2983b
tidy up
alexec Jul 3, 2019
c14ebdb
clean up code
alexec Jul 3, 2019
af175df
refactor
alexec Jul 3, 2019
92b7378
Merge branch 'master' into helm-1st-class
alexec Jul 3, 2019
b9117ee
""title": "Repository is a repository holding appli..." to swagger.json
alexec Jul 3, 2019
45d73d4
""format": "boolean"," to swagger.json
alexec Jul 3, 2019
a21d524
"Either empty, "git" or "helm"." to repos-list.tsx
alexec Jul 3, 2019
b74212a
Merge branch 'master' into helm-1st-class
alexec Jul 3, 2019
78183cb
"" to Gopkg.lock
alexec Jul 3, 2019
6f1ce81
"for _, repo := range repos {" to repository.go
alexec Jul 8, 2019
d06706e
"out, err := m.runCmd("show", "-s", "--format=%an <..." to client.go
alexec Jul 8, 2019
9f718e3
"Example: `" to repo.go
alexec Jul 8, 2019
6aab157
"s.repoLock.Lock(client.LockKey())" to repository.go
alexec Jul 8, 2019
23df52f
"mockClient.On("LockKey").Return(root)" to repository_test.go
alexec Jul 8, 2019
2296017
"command.Flags().StringVar(&opts.revision, "revisio..." to app.go
alexec Jul 8, 2019
90d352d
"// return a key suitable for use for locking this ..." to client.go
alexec Jul 8, 2019
9f23468
""k8s.io/apimachinery/pkg/selection"," to Gopkg.lock
alexec Jul 8, 2019
ab3ead1
"return client.Revision(path)" to repository.go
alexec Jul 8, 2019
8f36c38
"revision, err := repo.Revision("wordpress")..." to client_test.go
alexec Jul 8, 2019
7d25e54
"client, err := s.clientFactory.NewClient(repo)..." to repository.go
alexec Jul 8, 2019
c1bb421
"Expect(OperationPhaseIs(OperationSucceeded))...." to helm_test.go
alexec Jul 8, 2019
1445725
works
alexec Jul 9, 2019
e2b88ff
helm
alexec Jul 9, 2019
5b57326
"- https://github.com/alexec/argo-cd/blob/helm-1st-..." to index.yaml
alexec Jul 9, 2019
eac5c4b
"Name: "testrepo"," to helm_test.go
alexec Jul 9, 2019
2bc7d63
"Name: "testrepo"," to helm_test.go
alexec Jul 9, 2019
d91964d
"action: () => props.syncApplication(app.metadata.n..." to applicatio…
alexec Jul 9, 2019
e67a39c
Merge branch 'master' into helm-1st-class
alexec Jul 12, 2019
4c95072
""operationId": "ListMixin6"," to swagger.json
alexec Jul 12, 2019
0d22ecb
"setString: map[string]string{}," to helm.go
alexec Jul 12, 2019
5888b7f
"Type: repo.Type," to repo.go
alexec Jul 12, 2019
5c5d558
"string type = 6;" to repository.proto
alexec Jul 12, 2019
cd0a480
"return fileDescriptor_repository_14cf0cb00b2c9f4b,..." to repository…
alexec Jul 12, 2019
b423194
Merge branch 'master' into helm-1st-class
alexec Jul 22, 2019
a3db83b
codegen
alexec Jul 22, 2019
ef50a8f
"_, _ = fmt.Fprintf(w, "TYPE\nREPO\tINSECURE\tLFS\t..." to repo.go
alexec Jul 22, 2019
6973412
"RepoURLTypeHelm = "helm"" to fixture.go
alexec Jul 22, 2019
0658fb0
"log.SetLevel(log.DebugLevel)" to client.go
alexec Jul 22, 2019
0e018c7
""github.com/argoproj/argo-cd/test/fixture/testrepo..." to fixture.go
alexec Jul 22, 2019
be910f9
Merge branch 'master' into helm-1st-class
alexec Aug 1, 2019
0c54819
""type": {" to swagger.json
alexec Aug 1, 2019
594a911
""tlsClientCaData": {" to swagger.json
alexec Aug 1, 2019
f3c05c9
"Repo: q.Repo," to repository.go
alexec Aug 1, 2019
e5514ba
"threshold: 10" to .codecov.yml
alexec Aug 1, 2019
d6b7993
"func (w *clientWrapper) Root() string {" to clientwrapper.go
alexec Aug 1, 2019
dfe7534
"" to helm.go
alexec Aug 1, 2019
942f008
Merge branch 'master' into helm-1st-class
alexec Aug 5, 2019
f6d09cc
"API rule violation: names_match,github.com/argopro..." to violation_…
alexec Aug 5, 2019
c638472
"repoclient "github.com/argoproj/argo-cd/util/depot..." to clientwrap…
alexec Aug 5, 2019
680ed13
"repofactory "github.com/argoproj/argo-cd/util/repo..." to main.go
alexec Aug 5, 2019
fb8a981
Merge branch 'master' into helm-1st-class
alexec Aug 12, 2019
fabfeda
""operationId": "ListMixin6"," to swagger.json
alexec Aug 12, 2019
2f933cd
"h, err := NewHelmApp("./testdata/redis", argoappv1..." to helm_test.go
alexec Aug 12, 2019
5bf8889
Merge branch 'master' into helm-1st-class
alexec Aug 17, 2019
30c92b6
"type RevisionMetadata struct {" to client.go
alexec Aug 17, 2019
fd74094
""github.com/argoproj/argo-cd/util/repofactory"..." to main.go
alexec Aug 17, 2019
25e7117
"if revision == "" {" to client.go
alexec Aug 17, 2019
2e8a905
"mockClient := gitmocks.Repo{}" to repository_test.go
alexec Aug 17, 2019
6336d32
Merge branch 'helm-1st-class' of github.com:alexec/argo-cd into helm-…
alexec Aug 17, 2019
50beb6f
"import (" to Client.go
alexec Aug 17, 2019
de8ccf0
""github.com/argoproj/argo-cd/util/repo/factory"..." to main.go
alexec Aug 19, 2019
f834709
""title": "HelmAppSpec contains helm app name in so..." to swagger.json
alexec Aug 20, 2019
454c410
"fmt.Printf(printOpFmtStr, "Sync Revision:", opStat..." to app.go
alexec Aug 20, 2019
0c831d9
"ctrl.normalizeApplication(origApp, app)" to appcontroller.go
alexec Aug 20, 2019
a80fa77
Merge branch 'master' into helm-1st-class
alexec Aug 20, 2019
ba43e6e
"return fileDescriptor_generated_fa7ecc5a98a60b16, ..." to generated.…
alexec Aug 20, 2019
b2f78e2
"<i className={'icon argo-icon-' + repo.type}/> <Re..." to repos-list…
alexec Aug 20, 2019
c8ecdb7
"res, err := repository.GenerateManifests(local, &r..." to app.go
alexec Aug 20, 2019
2735787
"res1, err = GenerateManifests("./testdata/empty-li..." to repository…
alexec Aug 20, 2019
27489f1
""path/filepath"" to cmd.go
alexec Aug 20, 2019
81bd450
"func (g gitRepo) Init() error {" to repo.go
alexec Aug 20, 2019
ec2d0ac
"return c.run("init", "--client-only", "--skip-refr..." to cmd.go
alexec Aug 20, 2019
0c81250
"func (w *repoWrapper) Init() error {" to repowrapper.go
alexec Aug 20, 2019
6bd41e0
"h := helm.NewHelmApp(appPath, q.Repos)" to repository.go
alexec Aug 20, 2019
db80ab6
"h, err := helm.NewHelmApp(appPath, q.Repos)..." to repository.go
alexec Aug 20, 2019
2f8a032
"plugins, err := s.plugins()" to application.go
alexec Aug 20, 2019
5eec4f8
""k8s.io/utils/pointer"," to Gopkg.lock
alexec Aug 20, 2019
0a5c657
"Expect(Error("", "unable to access 'https://localh..." to repo_creds…
alexec Aug 20, 2019
25a9c90
"Expect(Error("", "unable to access"))" to repo_creds_test.go
alexec Aug 20, 2019
93f81fa
Merge branch 'master' into helm-1st-class
alexec Sep 4, 2019
d142b88
"ctrl.normalizeApplication(origApp, app)" to appcontroller.go
alexec Sep 4, 2019
1b4a9f5
"import (" to account.pb.go
alexec Sep 4, 2019
a3608bc
Merge branch 'master' into helm-1st-class
alexec Sep 5, 2019
58dfe82
""github.com/argoproj/argo-cd/util/app/discovery"..." to repository.go
alexec Sep 5, 2019
df054a2
"// ListRepositories lists configured repositories..." to db.go
alexec Sep 5, 2019
b2acdbd
"inRepos, err := db.settingsMgr.GetRepositories()..." to repository.go
alexec Sep 5, 2019
a1cb2a9
"helmrepo "github.com/argoproj/argo-cd/util/helm/re..." to factory.go
alexec Sep 5, 2019
25176e0
"workDir, err := repo.WorkDir(url)" to repo.go
alexec Sep 5, 2019
89fc394
Merge branch 'master' into helm-1st-class
alexec Sep 5, 2019
f2eb226
"import (" to account.pb.go
alexec Sep 5, 2019
2e89655
"" to .golangci.yml
alexec Sep 5, 2019
f35e9fa
Merge branch 'master' into helm-1st-class
alexec Sep 5, 2019
0fccb1b
"factory factory.Factory" to metrics.go
alexec Sep 5, 2019
3a1fef5
"import (" to Factory.go
alexec Sep 6, 2019
8006421
rm
alexec Sep 6, 2019
6a57104
"conditions, err := argo.ValidateRepo(ctx, &app.Spe..." to applicatio…
alexec Sep 6, 2019
e5f66cd
"// ListApps returns list of apps in the repo..." to state.go
alexec Sep 6, 2019
f774b24
"// ListRepositories lists repositories" to db.go
alexec Sep 6, 2019
d50b886
"log.WithFields(log.Fields{"url": url}).Debug("helm..." to repo_facto…
alexec Sep 6, 2019
8fcae1e
"Repos: repos," to state.go
alexec Sep 6, 2019
33455fa
"import proto "github.com/gogo/protobuf/proto"..." to account.pb.go
alexec Sep 6, 2019
024c4f7
"mockRepoServiceClient.On("GetAppDetails", mock.Any..." to applicatio…
alexec Sep 6, 2019
11dd11e
"// Null out dest server to verify that destination..." to app_manage…
alexec Sep 6, 2019
46b2e4f
"import (" to account.pb.go
alexec Sep 6, 2019
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
23 changes: 23 additions & 0 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3137,13 +3137,32 @@
"type": "object",
"title": "Repository is a Git repository holding application configurations",
"properties": {
"caData": {
"type": "string",
"format": "byte",
"title": "only for Helm repos"
},
"certData": {
"type": "string",
"format": "byte",
"title": "only for Helm repos"
},
"connectionState": {
"$ref": "#/definitions/v1alpha1ConnectionState"
},
"insecureIgnoreHostKey": {
"type": "boolean",
"format": "boolean"
},
"keyData": {
"type": "string",
"format": "byte",
"title": "only for Helm repos"
},
"name": {
"type": "string",
"title": "only for Helm repos"
},
"password": {
"type": "string"
},
Expand All @@ -3153,6 +3172,10 @@
"sshPrivateKey": {
"type": "string"
},
"type": {
"type": "string",
"title": "type of the repo, maybe \"git or \"helm, \"git\" is assumed if empty or absent"
},
"username": {
"type": "string"
}
Expand Down
13 changes: 0 additions & 13 deletions cmd/argocd-util/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,6 @@ func getReferencedSecrets(un unstructured.Unstructured) map[string]bool {
if cred.UsernameSecret != nil {
referencedSecrets[cred.UsernameSecret.Name] = true
}
}
}
if helmReposRAW, ok := cm.Data["helm.repositories"]; ok {
helmRepoCreds := make([]settings.HelmRepoCredentials, 0)
err := yaml.Unmarshal([]byte(helmReposRAW), &helmRepoCreds)
errors.CheckError(err)
for _, cred := range helmRepoCreds {
if cred.CASecret != nil {
referencedSecrets[cred.CASecret.Name] = true
}
Expand All @@ -451,12 +444,6 @@ func getReferencedSecrets(un unstructured.Unstructured) map[string]bool {
if cred.KeySecret != nil {
referencedSecrets[cred.KeySecret.Name] = true
}
if cred.UsernameSecret != nil {
referencedSecrets[cred.UsernameSecret.Name] = true
}
if cred.PasswordSecret != nil {
referencedSecrets[cred.PasswordSecret.Name] = true
}
}
}
return referencedSecrets
Expand Down
4 changes: 2 additions & 2 deletions controller/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type appStateManager struct {
}

func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, source v1alpha1.ApplicationSource, appLabelKey, revision string, noCache bool) ([]*unstructured.Unstructured, []*unstructured.Unstructured, *repository.ManifestResponse, error) {
helmRepos, err := m.db.ListHelmRepos(context.Background())
repos, err := m.db.ListRepositories(context.Background())
if err != nil {
return nil, nil, nil, err
}
Expand Down Expand Up @@ -117,7 +117,7 @@ func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, source v1alpha1

manifestInfo, err := repoClient.GenerateManifest(context.Background(), &repository.ManifestRequest{
Repo: repo,
HelmRepos: helmRepos,
Copy link
Collaborator

@alexmt alexmt Sep 6, 2019

Choose a reason for hiding this comment

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

I would remove Repo field, since now we are passing all repositories and repo server just need to find matching one by URL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry - don't think it works like that

Copy link
Collaborator

Choose a reason for hiding this comment

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

repos field now contains all repositories ( git and helm ). Repository server already filters give repos by type for helm applications. In the same way repo server might filter repo by URL. Is not it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Repos: repos,
Revision: revision,
NoCache: noCache,
AppLabelKey: appLabelKey,
Expand Down
Loading