-
Notifications
You must be signed in to change notification settings - Fork 57
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
[v2] Consolidate go.mod #686
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
522e125
consolidate go.mod
blampe 702c90a
remove test directory
blampe 3b7fd04
rewrite imports
blampe d863a4b
fix docker
blampe ee79b61
Merge branch 'v2' of github.com:pulumi/pulumi-kubernetes-operator int…
blampe 384e38b
Merge branch 'v2' of github.com:pulumi/pulumi-kubernetes-operator int…
blampe 2e152b6
Dockerfile cleanup
blampe 59a35e6
Update operator/Makefile
blampe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Build a base image with modules cached. | ||
FROM --platform=${BUILDPLATFORM} golang:1.23 AS base | ||
|
||
COPY /go.mod go.mod | ||
COPY /go.sum go.sum | ||
|
||
ENV GOCACHE=/root/.cache/go-build | ||
ENV GOMODCACHE=/go/pkg/mod | ||
RUN --mount=type=cache,target=${GOMODCACHE} \ | ||
go mod download | ||
|
||
# Build the operator. | ||
FROM --platform=${BUILDPLATFORM} base AS op-builder | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ARG VERSION | ||
RUN --mount=type=cache,target=${GOCACHE} \ | ||
--mount=type=cache,target=${GOMODCACHE} \ | ||
--mount=type=bind,source=/agent,target=./agent \ | ||
--mount=type=bind,source=/operator,target=./operator \ | ||
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \ | ||
go build -a -o /manager -ldflags="-X github.com/pulumi/pulumi-kubernetes-operator/v2/operator/version.Version=${VERSION}" ./operator/cmd/main.go | ||
|
||
# Build the agent. | ||
FROM --platform=${BUILDPLATFORM} base AS agent-builder | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ARG VERSION | ||
RUN --mount=type=cache,target=${GOCACHE} \ | ||
--mount=type=cache,target=${GOMODCACHE} \ | ||
--mount=type=bind,source=/agent,target=./agent \ | ||
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \ | ||
go build -a -o /agent -ldflags "-X github.com/pulumi/pulumi-kubernetes-operator/v2/agent/version.Version=${VERSION}" ./agent/main.go | ||
|
||
# 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-debian12:debug-nonroot | ||
COPY --from=op-builder /manager /manager | ||
COPY --from=agent-builder /agent /agent | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/manager"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that goreleaser doesn't provide the necessary context or VERSION parameter for our Dockerfile, so this is probably not working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I also realized we're skipping the docker step during the dry run? Oh well not a big deal since we'll be getting rid of this anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should remove the
dockers
section of the goreleaser if it isn't expected to work.