-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Skaffold post renderer (#9203)
* feat: skaffold post render support through post render hooks * chore: fix test issues and nits * chore: fix windows test * chore: fix windows test * chore: fix test * chore: test * chore: test * chore: test
- Loading branch information
1 parent
ffe769c
commit f83583b
Showing
24 changed files
with
841 additions
and
93 deletions.
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
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,13 @@ | ||
FROM golang:1.18 as builder | ||
WORKDIR /code | ||
COPY main.go . | ||
# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations | ||
ARG SKAFFOLD_GO_GCFLAGS | ||
RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -trimpath -o /app main.go | ||
|
||
FROM alpine:3 | ||
# Define GOTRACEBACK to mark this container as using the Go language runtime | ||
# for `skaffold debug` (https://skaffold.dev/docs/workflows/debug/). | ||
ENV GOTRACEBACK=single | ||
CMD ["./app"] | ||
COPY --from=builder /app . |
11 changes: 11 additions & 0 deletions
11
integration/testdata/post-render-hooks/module1/k8s/k8s-pod.yaml
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,11 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: module1 | ||
labels: | ||
app1: before-change-1 | ||
app2: before-change-2 | ||
spec: | ||
containers: | ||
- name: module1 | ||
image: multi-config-module1 |
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,15 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"runtime" | ||
"time" | ||
) | ||
|
||
func main() { | ||
for { | ||
fmt.Printf("Hello module-1! Running on %s/%s\n", runtime.GOOS, runtime.GOARCH) | ||
|
||
time.Sleep(time.Second * 1) | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
integration/testdata/post-render-hooks/module1/skaffold.yaml
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,50 @@ | ||
apiVersion: skaffold/v4beta9 | ||
kind: Config | ||
metadata: | ||
name: m1 | ||
build: | ||
artifacts: | ||
- image: multi-config-module1 | ||
context: . | ||
manifests: | ||
rawYaml: | ||
- k8s/k8s-pod.yaml | ||
deploy: | ||
kubectl: {} | ||
profiles: | ||
- name: change1 | ||
manifests: | ||
hooks: | ||
after: | ||
- host: | ||
command: | ||
- "sed" | ||
- "s/before-change-1/after-change-1/g" | ||
withChange: true | ||
- name: two-changes | ||
manifests: | ||
hooks: | ||
after: | ||
- host: | ||
command: | ||
- "sed" | ||
- "s/before-change-2/after-change-2/g" | ||
withChange: true | ||
- host: | ||
command: | ||
- "sed" | ||
- "s/before-change-1/after-change-1/g" | ||
withChange: true | ||
- name: one-change-one-not | ||
manifests: | ||
hooks: | ||
after: | ||
- host: | ||
command: | ||
- "sed" | ||
- "s/before-change-2/after-change-2/g" | ||
withChange: true | ||
- host: | ||
command: | ||
- "sed" | ||
- "s/before-change-1/after-change-1/g" |
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,13 @@ | ||
FROM golang:1.18 as builder | ||
WORKDIR /code | ||
COPY main.go . | ||
# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations | ||
ARG SKAFFOLD_GO_GCFLAGS | ||
RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -trimpath -o /app main.go | ||
|
||
FROM alpine:3 | ||
# Define GOTRACEBACK to mark this container as using the Go language runtime | ||
# for `skaffold debug` (https://skaffold.dev/docs/workflows/debug/). | ||
ENV GOTRACEBACK=single | ||
CMD ["./app"] | ||
COPY --from=builder /app . |
Oops, something went wrong.