Skip to content

Commit

Permalink
feat: add flag to include .git (#354)
Browse files Browse the repository at this point in the history
Signed-off-by: clstb <[email protected]>
  • Loading branch information
clstb authored Jan 29, 2025
1 parent 9b88633 commit 29f0344
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/argo_client/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,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.cfg.ArgoCDIncludeDotGit {
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)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit 29f0344

Please sign in to comment.