diff --git a/Dockerfile b/Dockerfile index fb17224..9c75dc4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,8 +19,13 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o hydros c # TODO(jeremy): This won't be able to run Syncer until we update syncer to use GoGit and get rid of shelling # out to other tools. -FROM ${RUNTIME_IMAGE} +# FROM ${RUNTIME_IMAGE} +FROM alpine:3.14 + +RUN apk update && \ + apk add --no-cache git openssh-client COPY --from=builder /workspace/hydros / +COPY kustomize /usr/local/bin/kustomize ENTRYPOINT ["/hydros"] diff --git a/images.yaml b/images.yaml index 2a67fa5..40cd29e 100644 --- a/images.yaml +++ b/images.yaml @@ -16,6 +16,11 @@ spec: - src: "cmd/**/*.go" - src: "pkg/**/*.go" - src: "test/**/*.go" + # Pull in kustomize from its docker image + - uri: docker://registry.k8s.io/kustomize/kustomize:v5.0.0 + mappings: + - src: /app/kustomize + strip: app builder: gcb: project: dev-sailplane diff --git a/pkg/gitops/repocontroller.go b/pkg/gitops/repocontroller.go index fa32262..6150fc7 100644 --- a/pkg/gitops/repocontroller.go +++ b/pkg/gitops/repocontroller.go @@ -133,7 +133,7 @@ func (c *RepoController) Reconcile(ctx context.Context) error { wg.Add(1) go func(rNode *resource) { if err := c.applyResource(ctx, rNode); err != nil { - log.Error(err, "Error applying resource", "path", r.path, "name", r.node.GetName()) + log.Error(err, "Error applying resource", "path", rNode.path, "name", rNode.node.GetName()) } wg.Done() }(r) diff --git a/pkg/images/controller.go b/pkg/images/controller.go index 4a804e5..1a1532d 100644 --- a/pkg/images/controller.go +++ b/pkg/images/controller.go @@ -238,6 +238,8 @@ func (c *Controller) Reconcile(ctx context.Context, image *v1alpha1.Image) error op, err := c.cbClient.CreateBuild(context.Background(), req) if err != nil { + err := errors.Wrapf(err, "Failed to create Google Cloud Build") + log.Error(err, "Failed to create Google Cloud Build", "project", project, "build", build) return err }