Skip to content

Commit d0755c6

Browse files
committed
extracting out chart repository methods
1 parent 4661653 commit d0755c6

File tree

11 files changed

+738
-626
lines changed

11 files changed

+738
-626
lines changed

Wire.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ func InitializeApp() (*App, error) {
949949
wire.Bind(new(common.DeploymentConfigService), new(*common.DeploymentConfigServiceImpl)),
950950

951951
argoRepositoryCreds.NewRepositorySecret,
952-
wire.Bind(new(argoRepositoryCreds.RepositorySecret), new(*argoRepositoryCreds.RepositorySecretImpl)),
952+
wire.Bind(new(argoRepositoryCreds.RepositoryCreds), new(*argoRepositoryCreds.RepositorySecretImpl)),
953953

954954
repocreds.NewServiceClientImpl,
955955
wire.Bind(new(repocreds.ServiceClient), new(*repocreds.ServiceClientImpl)),

cmd/external-app/wire.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func InitializeApp() (*App, error) {
257257
wire.Bind(new(util4.K8sService), new(*util4.K8sServiceImpl)),
258258

259259
argoRepositoryCreds.NewRepositorySecret,
260-
wire.Bind(new(argoRepositoryCreds.RepositorySecret), new(*argoRepositoryCreds.RepositorySecretImpl)),
260+
wire.Bind(new(argoRepositoryCreds.RepositoryCreds), new(*argoRepositoryCreds.RepositorySecretImpl)),
261261

262262
dbMigration.NewDbMigrationServiceImpl,
263263
wire.Bind(new(dbMigration.DbMigration), new(*dbMigration.DbMigrationServiceImpl)),

cmd/external-app/wire_gen.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/appStore/installedApp/service/FullMode/deployment/FullModeDeploymentService.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ type FullModeDeploymentServiceImpl struct {
9999
environmentRepository repository5.EnvironmentRepository
100100
deploymentConfigService common.DeploymentConfigService
101101
chartTemplateService util.ChartTemplateService
102-
RepositorySecretService argoRepositoryCreds.RepositorySecret
102+
RepositorySecretService argoRepositoryCreds.RepositoryCreds
103103
}
104104

105105
func NewFullModeDeploymentServiceImpl(
@@ -126,7 +126,7 @@ func NewFullModeDeploymentServiceImpl(
126126
environmentRepository repository5.EnvironmentRepository,
127127
deploymentConfigService common.DeploymentConfigService,
128128
chartTemplateService util.ChartTemplateService,
129-
RepositorySecretService argoRepositoryCreds.RepositorySecret) *FullModeDeploymentServiceImpl {
129+
RepositorySecretService argoRepositoryCreds.RepositoryCreds) *FullModeDeploymentServiceImpl {
130130
return &FullModeDeploymentServiceImpl{
131131
Logger: logger,
132132
acdClient: acdClient,

pkg/appStore/installedApp/service/FullMode/deployment/InstalledAppGitOpsService.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func (impl *FullModeDeploymentServiceImpl) CreateArgoRepoSecretIfNeeded(appStore
406406
appStore := appStoreApplicationVersion.AppStore
407407
dockerArtifactStore := appStoreApplicationVersion.AppStore.DockerArtifactStore
408408

409-
err = impl.RepositorySecretService.CreateArgoRepositorySecret(
409+
err = impl.RepositorySecretService.CreateOrUpdateArgoRepositorySecretForOCI(
410410
dockerArtifactStore.Username,
411411
dockerArtifactStore.Password,
412412
dockerArtifactStore.OCIRegistryConfig[0].Id,

pkg/argoRepositoryCreds/bean/bean.go

+40
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,44 @@ const (
1010
REPOSITORY_TYPE_HELM = "helm"
1111
ARGOCD_REPOSITORY_SECRET_KEY = "argocd.argoproj.io/secret-type"
1212
ARGOCD_REPOSITORY_SECRET_VALUE = "repository"
13+
REPOSITORY_SECRET_INSECURE_KEY = "insecure"
1314
)
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)