diff --git a/pkg/argo_client/client.go b/pkg/argo_client/client.go index 015201dd..b11247de 100644 --- a/pkg/argo_client/client.go +++ b/pkg/argo_client/client.go @@ -30,6 +30,7 @@ type ArgoClient struct { k8s kubernetes.Interface k8sConfig *rest.Config sendFullRepository bool + includeDotGit bool } func NewArgoClient( @@ -74,6 +75,7 @@ func NewArgoClient( k8s: k8s.ClientSet(), k8sConfig: k8s.Config(), sendFullRepository: cfg.ArgoCDSendFullRepository, + includeDotGit: cfg.ArgoCDIncludeDotGit, }, nil } diff --git a/pkg/argo_client/manifests.go b/pkg/argo_client/manifests.go index 27cd4ba4..ac87d0c2 100644 --- a/pkg/argo_client/manifests.go +++ b/pkg/argo_client/manifests.go @@ -153,7 +153,13 @@ func (a *ArgoClient) generateManifests(ctx context.Context, app v1alpha1.Applica } log.Info().Msg("compressing files") - f, filesWritten, checksum, err := tgzstream.CompressFiles(packageDir, []string{"*"}, []string{".git"}) + + exclude := []string{} + if !a.includeDotGit { + exclude = append(exclude, ".git") + } + + f, filesWritten, checksum, err := tgzstream.CompressFiles(packageDir, []string{"*"}, exclude) if err != nil { return nil, fmt.Errorf("failed to compress files: %w", err) } diff --git a/pkg/config/config.go b/pkg/config/config.go index 0163ed4a..4f82b24e 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -27,6 +27,7 @@ type ServerConfig struct { ArgoCDRepositoryEndpoint string `mapstructure:"argocd-repository-endpoint"` ArgoCDRepositoryInsecure bool `mapstructure:"argocd-repository-insecure"` ArgoCDSendFullRepository bool `mapstructure:"argocd-send-full-repository"` + ArgoCDIncludeDotGit bool `mapstructure:"argocd-include-dot-git"` KubernetesConfig string `mapstructure:"kubernetes-config"` KubernetesType string `mapstructure:"kubernetes-type"` KubernetesClusterID string `mapstructure:"kubernetes-clusterid"`