Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
Signed-off-by: Mmadu Manasseh <[email protected]>
  • Loading branch information
MeNsaaH committed Feb 7, 2025
1 parent 953967e commit 94c80b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions localdev/kubechecks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ configMap:
# KUBECHECKS_SCHEMAS_LOCATION: https://github.com/zapier/kubecheck-schemas.git
KUBECHECKS_TIDY_OUTDATED_COMMENTS_MODE: "delete"
KUBECHECKS_ENABLE_CONFTEST: "false"
KUBECHECKS_ENABLE_SHALLOW_CLONE: "true"


deployment:
Expand Down
16 changes: 10 additions & 6 deletions pkg/git/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ func (r *Repo) Clone(ctx context.Context) error {

var err error

r.Directory, err = os.MkdirTemp("/tmp", "kubechecks-repo-")
if err != nil {
return errors.Wrap(err, "failed to make temp dir")
if r.Directory == "" {
r.Directory, err = os.MkdirTemp("/tmp", "kubechecks-repo-")
if err != nil {
return errors.Wrap(err, "failed to make temp dir")
}
}

log.Info().
Expand Down Expand Up @@ -93,9 +95,11 @@ func (r *Repo) Clone(ctx context.Context) error {
func (r *Repo) ShallowClone(ctx context.Context) error {
var err error

r.Directory, err = os.MkdirTemp("/tmp", "kubechecks-repo-")
if err != nil {
return errors.Wrap(err, "failed to make temp dir")
if r.Directory == "" {
r.Directory, err = os.MkdirTemp("/tmp", "kubechecks-repo-")
if err != nil {
return errors.Wrap(err, "failed to make temp dir")
}
}

log.Info().
Expand Down

0 comments on commit 94c80b5

Please sign in to comment.