Skip to content

Commit de8652b

Browse files
authored
chore: Argocd repository secret creation service refactoring (#6229)
* extracting out chart repository methods * moving repository creation to argocd client package and secret delete code for oci
1 parent 69097b9 commit de8652b

File tree

13 files changed

+796
-649
lines changed

13 files changed

+796
-649
lines changed

Wire.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ import (
8282
"github.com/devtron-labs/devtron/client/argocdServer/certificate"
8383
cluster2 "github.com/devtron-labs/devtron/client/argocdServer/cluster"
8484
"github.com/devtron-labs/devtron/client/argocdServer/connection"
85+
"github.com/devtron-labs/devtron/client/argocdServer/repoCredsK8sClient"
8586
repocreds "github.com/devtron-labs/devtron/client/argocdServer/repocreds"
8687
repository2 "github.com/devtron-labs/devtron/client/argocdServer/repository"
8788
session2 "github.com/devtron-labs/devtron/client/argocdServer/session"
@@ -118,7 +119,6 @@ import (
118119
repository9 "github.com/devtron-labs/devtron/pkg/appStore/installedApp/repository"
119120
deployment3 "github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode/deployment"
120121
"github.com/devtron-labs/devtron/pkg/appWorkflow"
121-
"github.com/devtron-labs/devtron/pkg/argoRepositoryCreds"
122122
"github.com/devtron-labs/devtron/pkg/asyncProvider"
123123
"github.com/devtron-labs/devtron/pkg/attributes"
124124
"github.com/devtron-labs/devtron/pkg/build"
@@ -950,8 +950,8 @@ func InitializeApp() (*App, error) {
950950
common.NewDeploymentConfigServiceImpl,
951951
wire.Bind(new(common.DeploymentConfigService), new(*common.DeploymentConfigServiceImpl)),
952952

953-
argoRepositoryCreds.NewRepositorySecret,
954-
wire.Bind(new(argoRepositoryCreds.RepositorySecret), new(*argoRepositoryCreds.RepositorySecretImpl)),
953+
repoCredsK8sClient.NewRepositorySecret,
954+
wire.Bind(new(repoCredsK8sClient.RepositoryCreds), new(*repoCredsK8sClient.RepositorySecretImpl)),
955955

956956
repocreds.NewServiceClientImpl,
957957
wire.Bind(new(repocreds.ServiceClient), new(*repocreds.ServiceClientImpl)),
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package bean
2+
3+
const (
4+
REPOSITORY_SECRET_NAME_KEY = "name"
5+
REPOSITORY_SECRET_URL_KEY = "url"
6+
REPOSITORY_SECRET_USERNAME_KEY = "username"
7+
REPOSITORY_SECRET_PASSWORD_KEY = "password"
8+
REPOSITORY_SECRET_ENABLE_OCI_KEY = "enableOCI"
9+
REPOSITORY_SECRET_TYPE_KEY = "type"
10+
REPOSITORY_TYPE_HELM = "helm"
11+
ARGOCD_REPOSITORY_SECRET_KEY = "argocd.argoproj.io/secret-type"
12+
ARGOCD_REPOSITORY_SECRET_VALUE = "repository"
13+
REPOSITORY_SECRET_INSECURE_KEY = "insecure"
14+
)
15+
16+
type ChartRepositoryAddRequest struct {
17+
Name string
18+
Username string
19+
Password string
20+
URL string
21+
AllowInsecureConnection bool
22+
IsPrivateChart bool
23+
}
24+
25+
type ChartRepositoryUpdateRequest struct {
26+
PreviousName string
27+
PreviousURL string
28+
Name string
29+
AuthMode string
30+
Username string
31+
Password string
32+
SSHKey string
33+
URL string
34+
AllowInsecureConnection bool
35+
IsPrivateChart bool
36+
}
37+
38+
type KeyDto struct {
39+
Name string `json:"name,omitempty"`
40+
Key string `json:"key,omitempty"`
41+
Url string `json:"url,omitempty"`
42+
}
43+
44+
type AcdConfigMapRepositoriesDto struct {
45+
Type string `json:"type,omitempty"`
46+
Name string `json:"name,omitempty"`
47+
Url string `json:"url,omitempty"`
48+
UsernameSecret *KeyDto `json:"usernameSecret,omitempty"`
49+
PasswordSecret *KeyDto `json:"passwordSecret,omitempty"`
50+
CaSecret *KeyDto `json:"caSecret,omitempty"`
51+
CertSecret *KeyDto `json:"certSecret,omitempty"`
52+
KeySecret *KeyDto `json:"keySecret,omitempty"`
53+
}

0 commit comments

Comments
 (0)