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

chore: Argocd repository secret creation service refactoring #6229

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions Wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import (
"github.com/devtron-labs/devtron/client/argocdServer/certificate"
cluster2 "github.com/devtron-labs/devtron/client/argocdServer/cluster"
"github.com/devtron-labs/devtron/client/argocdServer/connection"
"github.com/devtron-labs/devtron/client/argocdServer/repoCredsK8sClient"
repocreds "github.com/devtron-labs/devtron/client/argocdServer/repocreds"
repository2 "github.com/devtron-labs/devtron/client/argocdServer/repository"
session2 "github.com/devtron-labs/devtron/client/argocdServer/session"
Expand Down Expand Up @@ -118,7 +119,6 @@ import (
repository9 "github.com/devtron-labs/devtron/pkg/appStore/installedApp/repository"
deployment3 "github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/FullMode/deployment"
"github.com/devtron-labs/devtron/pkg/appWorkflow"
"github.com/devtron-labs/devtron/pkg/argoRepositoryCreds"
"github.com/devtron-labs/devtron/pkg/asyncProvider"
"github.com/devtron-labs/devtron/pkg/attributes"
"github.com/devtron-labs/devtron/pkg/build"
Expand Down Expand Up @@ -950,8 +950,8 @@ func InitializeApp() (*App, error) {
common.NewDeploymentConfigServiceImpl,
wire.Bind(new(common.DeploymentConfigService), new(*common.DeploymentConfigServiceImpl)),

argoRepositoryCreds.NewRepositorySecret,
wire.Bind(new(argoRepositoryCreds.RepositorySecret), new(*argoRepositoryCreds.RepositorySecretImpl)),
repoCredsK8sClient.NewRepositorySecret,
wire.Bind(new(repoCredsK8sClient.RepositoryCreds), new(*repoCredsK8sClient.RepositorySecretImpl)),

repocreds.NewServiceClientImpl,
wire.Bind(new(repocreds.ServiceClient), new(*repocreds.ServiceClientImpl)),
Expand Down
53 changes: 53 additions & 0 deletions client/argocdServer/repoCredsK8sClient/bean/bean.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package bean

const (
REPOSITORY_SECRET_NAME_KEY = "name"
REPOSITORY_SECRET_URL_KEY = "url"
REPOSITORY_SECRET_USERNAME_KEY = "username"
REPOSITORY_SECRET_PASSWORD_KEY = "password"
REPOSITORY_SECRET_ENABLE_OCI_KEY = "enableOCI"
REPOSITORY_SECRET_TYPE_KEY = "type"
REPOSITORY_TYPE_HELM = "helm"
ARGOCD_REPOSITORY_SECRET_KEY = "argocd.argoproj.io/secret-type"
ARGOCD_REPOSITORY_SECRET_VALUE = "repository"
REPOSITORY_SECRET_INSECURE_KEY = "insecure"
)

type ChartRepositoryAddRequest struct {
Name string
Username string
Password string
URL string
AllowInsecureConnection bool
IsPrivateChart bool
}

type ChartRepositoryUpdateRequest struct {
PreviousName string
PreviousURL string
Name string
AuthMode string
Username string
Password string
SSHKey string
URL string
AllowInsecureConnection bool
IsPrivateChart bool
}

type KeyDto struct {
Name string `json:"name,omitempty"`
Key string `json:"key,omitempty"`
Url string `json:"url,omitempty"`
}

type AcdConfigMapRepositoriesDto struct {
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Url string `json:"url,omitempty"`
UsernameSecret *KeyDto `json:"usernameSecret,omitempty"`
PasswordSecret *KeyDto `json:"passwordSecret,omitempty"`
CaSecret *KeyDto `json:"caSecret,omitempty"`
CertSecret *KeyDto `json:"certSecret,omitempty"`
KeySecret *KeyDto `json:"keySecret,omitempty"`
}
Loading
Loading