Skip to content

Commit

Permalink
fix: config filepath with repo path as prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastocorp committed Sep 2, 2024
1 parent 9078adb commit 85c7681
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o co

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# FROM gcr.io/distroless/static:nonroot
FROM debian:bullseye-slim
WORKDIR /
COPY --from=builder /workspace/combi .
RUN mkdir -p /root/.ssh && touch /root/.ssh/known_hosts
RUN apt update && \
apt install --yes openssh-client && \
mkdir -p ~/.ssh && \
ssh-keyscan -H github.com >> ~/.ssh/known_hosts

ENTRYPOINT ["/combi"]
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
- $(CONTAINER_TOOL) buildx rm project-builder
rm Dockerfile.cross

docker-kind-build:
docker build --tag '$(BINARY):test' .
kind load docker-image $(BINARY):test

.PHONY: build
build: fmt vet ## Build manager binary.
go build -o bin/combi cmd/combi/main.go
Expand Down
3 changes: 2 additions & 1 deletion internal/source/git/git.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package git

import (
"fmt"
"os"
"reflect"

Expand All @@ -27,7 +28,7 @@ func (s *GitT) Init(f flags.DaemonFlagsT) {
s.RepoSshUrl = f.GitSshUrl
s.RepoBranch = f.GitBranch
s.RepoPath = f.TmpDir + "/repo"
s.ConfigFilepath = f.SourcePath
s.ConfigFilepath = fmt.Sprintf("%s/%s", s.RepoPath, f.SourcePath)
}

func (s *GitT) GetConfig() (config []byte, err error) {
Expand Down

0 comments on commit 85c7681

Please sign in to comment.