Skip to content

Commit

Permalink
Fix logging - add kustomize to the image (#68)
Browse files Browse the repository at this point in the history
Fix #67
  • Loading branch information
jlewi authored Jan 30, 2024
1 parent 7a6a0fe commit 09500ae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
5 changes: 5 additions & 0 deletions images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/gitops/repocontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pkg/images/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 09500ae

Please sign in to comment.