Skip to content

Commit

Permalink
Do not update repo bases if GitSSHSecretRef is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
ffilippopoulos committed Mar 22, 2024
1 parent 7e51a11 commit d675ecb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20-alpine AS build
FROM golang:1.22-alpine AS build

WORKDIR /src

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/utilitywarehouse/kube-applier

go 1.20
go 1.22

require (
github.com/go-test/deep v1.0.5
Expand Down
6 changes: 4 additions & 2 deletions run/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,10 @@ func (r *Runner) setupRepositoryClone(ctx context.Context, waybill *kubeapplierv
return "", "", err
}
// Rewrite repo addresses for those that want to use SSH keys to clone
if err := r.updateRepoBaseAddresses(tmpRepoDir); err != nil {
return "", "", err
if waybill.Spec.GitSSHSecretRef != nil {
if err := r.updateRepoBaseAddresses(tmpRepoDir); err != nil {
return "", "", err
}
}
return filepath.Join(tmpRepoDir, r.RepoPath), hash, nil
}
Expand Down
1 change: 1 addition & 0 deletions testdata/manifests/app-d-kustomize/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bases:
# kube-applier: key_should_be_ignored
- ssh://github.com/utilitywarehouse/kube-applier//testdata/bases/simple-deployment?ref=master
resources:
- 00-namespace.yaml

0 comments on commit d675ecb

Please sign in to comment.