Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logging - add kustomize to the image #68

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading