Skip to content
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
go-version-file: go.work
- name: Execute go-apidiff
uses: joelanford/[email protected]
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
go-version-file: go.work
id: go
- name: sync go modules
Expand All @@ -58,6 +59,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
go-version-file: go.work
id: go
- name: Lint
Expand All @@ -76,6 +78,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
go-version-file: go.work
id: go
- name: Test all modules
Expand All @@ -94,6 +97,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
go-version-file: go.work
id: go
- name: Test all modules
Expand All @@ -112,6 +116,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
go-version-file: go.work
id: go
- name: Test kyaml
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

run:
deadline: 5m
go: '1.22'
go: '1.24'

linters:
enable-all: true
Expand Down
2 changes: 1 addition & 1 deletion api/internal/builtins/AnnotationsTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/ConfigMapGenerator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/HashTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/HelmChartInflationGenerator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/IAMPolicyGenerator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/ImageTagTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/LabelTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/NamespaceTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/PatchJson6902Transformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/PatchStrategicMergeTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/PatchTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/PrefixTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/ReplacementTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/ReplicaCountTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/SecretGenerator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/SortOrderTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/SuffixTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/ValueAddTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 7 additions & 15 deletions cmd/config/docs/api-conventions/functions-impl.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,21 @@ directly using `docker run`.

Run `config help docs-fn-spec` to see the Configuration Functions Specification.

`kustomize fn run` is an example orchestrator for invoking Configuration
Functions. This document describes how to implement and invoke an example
function.
`kustomize fn run` is an example orchestrator for invoking Configuration Functions. This document describes how to implement and invoke an example function.

## Example Function Implementation

Following is an example for implementing an nginx abstraction using a
configuration function.
Following is an example for implementing an nginx abstraction using a configuration function.

### `nginx-template.sh`

`nginx-template.sh` is a simple bash script which uses a _heredoc_ as a
templating solution for generating Resources from the functionConfig input
fields.
`nginx-template.sh` is a simple bash script which uses a _heredoc_ as a templating solution for generating Resources from the functionConfig input fields.

The script wraps itself using `config run wrap -- $0` which will:

1. Parse the `ResourceList.functionConfig` (provided to the container stdin)
into env vars
1. Parse the `ResourceList.functionConfig` (provided to the container stdin) into env vars
2. Merge the stdout into the original list of Resources
3. Defaults filenames for newly generated Resources (if they are not set as
annotations) to `config/NAME_KIND.yaml`
3. Defaults filenames for newly generated Resources (if they are not set as annotations) to `config/NAME_KIND.yaml`
4. Format the output

```bash
Expand Down Expand Up @@ -86,11 +79,10 @@ End-of-message

### Dockerfile

`Dockerfile` installs `kustomize fn` and copies the script into the container
image.
`Dockerfile` installs `kustomize fn` and copies the script into the container image.

```
FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
RUN go get sigs.k8s.io/kustomize/cmd/config
RUN mv /go/bin/config /usr/bin/config
COPY nginx-template.sh /usr/bin/nginx-template.sh
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0

FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
ENV CGO_ENABLED=0
WORKDIR /go/src/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0

FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
ENV CGO_ENABLED=0
WORKDIR /go/src/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0

FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
ENV CGO_ENABLED=0
WORKDIR /go/src/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0

FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
ENV CGO_ENABLED=0
WORKDIR /go/src/

Expand Down
2 changes: 1 addition & 1 deletion cmd/config/internal/generateddocs/api/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/pluginator/internal/krmfunction/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (c *Converter) Convert() error {
}

func (c *Converter) getDockerfile() string {
return `FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
return `FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
ENV CGO_ENABLED=0
WORKDIR /go/src/
COPY . .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module main

go 1.22.7
go 1.24.4

require (
github.com/spf13/cobra v1.4.0
Expand Down
2 changes: 1 addition & 1 deletion functions/examples/application-cr/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0

FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
ENV CGO_ENABLED=0
WORKDIR /go/src/
COPY go.mod .
Expand Down
13 changes: 5 additions & 8 deletions functions/examples/injection-tshirt-sizes/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0

FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
ENV CGO_ENABLED=0
WORKDIR /go/src/
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY main.go .
RUN go build -v -o /usr/local/bin/config-function ./
COPY . .
RUN go build -v -o /usr/local/bin/function ./

FROM alpine:latest
COPY --from=0 /usr/local/bin/config-function /usr/local/bin/config-function
CMD ["config-function"]
COPY --from=0 /usr/local/bin/function /usr/local/bin/function
CMD ["function"]
2 changes: 1 addition & 1 deletion functions/examples/template-go-nginx/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0

FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
ENV CGO_ENABLED=0
WORKDIR /go/src/
COPY go.mod .
Expand Down
2 changes: 1 addition & 1 deletion functions/examples/validator-kubeval/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM alpine:latest as schemas
RUN apk --no-cache add git
RUN git clone --depth 1 https://github.com/instrumenta/kubernetes-json-schema.git

FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye as function
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye as function
ENV CGO_ENABLED=0
WORKDIR /go/src/
COPY go.mod .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0

FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye
ENV CGO_ENABLED=0
WORKDIR /go/src/
COPY go.mod .
Expand Down
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
go 1.22.7
toolchain go1.24.4

use (
./api
Expand Down
3 changes: 1 addition & 2 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dX
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/GoogleCloudPlatform/cloudsql-proxy v1.33.9 h1:YjE60yhoMx231GwDrJgeBWSTbTbazZAuK89H0iuXJlM=
github.com/GoogleCloudPlatform/cloudsql-proxy v1.33.9/go.mod h1:+FaFzlKsx+X/2dR5Rjr6EN9ZzuYDW950s4MmFILchJM=
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.0/go.mod h1:dppbR7CwXD4pgtV9t3wD1812RaLDcBjtblcDF5f1vI0=
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1/go.mod h1:itPGVDKf9cC/ov4MdvJ2QZ0khw4bfoo9jzwTJlaxy2k=
github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
Expand Down Expand Up @@ -1645,5 +1646,3 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 h1:TgtAeesdhpm2S
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y=
sigs.k8s.io/kustomize/cmd/config v0.19.0/go.mod h1:29Vvdl26PidPLUDi7nfjYa/I0wHBkwCZp15Nlcc4y98=
sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU=
sigs.k8s.io/yaml v1.5.0 h1:M10b2U7aEUY6hRtU870n2VTPgR5RZiL/I6Lcc2F4NUQ=
sigs.k8s.io/yaml v1.5.0/go.mod h1:wZs27Rbxoai4C0f8/9urLZtZtF3avA3gKvGyPdDqTO4=
2 changes: 1 addition & 1 deletion kustomize.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

# build
FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye AS builder
FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye AS builder
ARG VERSION
ARG DATE
RUN mkdir /build
Expand Down
2 changes: 1 addition & 1 deletion kyaml/fn/framework/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func AddGenerateDockerfile(cmd *cobra.Command) {
Use: "gen [DIR]",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
if err := os.WriteFile(filepath.Join(args[0], "Dockerfile"), []byte(`FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye as builder
if err := os.WriteFile(filepath.Join(args[0], "Dockerfile"), []byte(`FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye as builder
ENV CGO_ENABLED=0
WORKDIR /go/src/
COPY go.mod go.sum ./
Expand Down
2 changes: 1 addition & 1 deletion kyaml/fn/framework/command/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestCommand_dockerfile(t *testing.T) {
t.FailNow()
}

expected := `FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye as builder
expected := `FROM public.ecr.aws/docker/library/golang:1.24.4-bullseye as builder
ENV CGO_ENABLED=0
WORKDIR /go/src/
COPY go.mod go.sum ./
Expand Down
Loading