Skip to content

Commit

Permalink
Revert "fix: repository folder was mounted and didn't have proper own…
Browse files Browse the repository at this point in the history
…ership sets (#207)"

This reverts commit 1a88ae8.
  • Loading branch information
Alan-pad committed Dec 13, 2023
1 parent 1a88ae8 commit 7ab069f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a \

FROM docker.io/library/alpine:3.18.2@sha256:82d1e9d7ed48a7523bdebc18cf6290bdb97b82302a8a9c27d4fe885949ea94d1

WORKDIR /repository
WORKDIR /home/burrito

# Install required packages
RUN apk add --update --no-cache git bash openssh
Expand All @@ -70,7 +70,7 @@ RUN addgroup \
adduser \
--disabled-password \
--no-create-home \
--home /home/burrito \
--home $(pwd) \
--uid $UID \
--ingroup $GROUP \
$USER
Expand All @@ -79,7 +79,6 @@ RUN addgroup \
COPY --from=builder /workspace/bin/burrito /usr/local/bin/burrito

RUN chmod +x /usr/local/bin/burrito
RUN chown -R burrito:burrito /repository

# Use an unprivileged user
USER 65532:65532
Expand Down
15 changes: 12 additions & 3 deletions internal/controllers/terraformrun/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ func mergeMaps(a, b map[string]string) map[string]string {
func defaultPodSpec(config *config.Config, layer *configv1alpha1.TerraformLayer, repository *configv1alpha1.TerraformRepository) corev1.PodSpec {
return corev1.PodSpec{
Volumes: []corev1.Volume{
{
Name: "repository",
VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}},
},
{
Name: "ssh-known-hosts",
VolumeSource: corev1.VolumeSource{
Expand All @@ -174,10 +178,15 @@ func defaultPodSpec(config *config.Config, layer *configv1alpha1.TerraformLayer,
ServiceAccountName: "burrito-runner",
Containers: []corev1.Container{
{
Name: "runner",
Image: fmt.Sprintf("ghcr.io/padok-team/burrito:%s", version.Version),
Args: []string{"runner", "start"},
Name: "runner",
Image: fmt.Sprintf("ghcr.io/padok-team/burrito:%s", version.Version),
WorkingDir: "/repository",
Args: []string{"runner", "start"},
VolumeMounts: []corev1.VolumeMount{
{
Name: "repository",
MountPath: "/repository",
},
{
MountPath: "/home/burrito/.ssh/known_hosts",
Name: "ssh-known-hosts",
Expand Down

0 comments on commit 7ab069f

Please sign in to comment.