Skip to content

Commit

Permalink
Make Kubernetes dependencies and Go version consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaSchwarze0 committed Aug 22, 2024
1 parent 8448594 commit 131af56
Show file tree
Hide file tree
Showing 104 changed files with 2,554 additions and 1,185 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
cache: true
check-latest: true
- name: Install Trivy
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
cache: true
check-latest: true
- name: Install Ko
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
cache: true
check-latest: true
- name: Install kubectl
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mirror-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
library/golang:1.19 \
library/golang:1.20 \
library/golang:1.21 \
library/golang:1.22 \
library/maven:3-jdk-8-openj9 \
library/node:12 \
library/node:14 \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
cache: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fetch-depth: 0 # Fetch all history, needed for release note generation.
- uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
cache: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-tekton-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
cache: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
cache: true
check-latest: true
cache-dependency-path: go/src/github.com/shipwright-io/build
Expand Down
2 changes: 1 addition & 1 deletion HACK.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In the near future, the above would be setup by the controller.
make clean && make build
```

* This project uses Golang 1.21 and controller-gen v0.12.1.
* This project uses Golang 1.22 and controller-gen v0.12.1.
* The controllers create/watch Tekton objects.

# Testing
Expand Down
8 changes: 5 additions & 3 deletions cmd/shipwright-build-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

buildconfig "github.com/shipwright-io/build/pkg/config"
"github.com/shipwright-io/build/pkg/controller"
Expand Down Expand Up @@ -90,8 +91,9 @@ func main() {
LeaseDuration: buildCfg.ManagerOptions.LeaseDuration,
RenewDeadline: buildCfg.ManagerOptions.RenewDeadline,
RetryPeriod: buildCfg.ManagerOptions.RetryPeriod,
Namespace: "",
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Metrics: server.Options{
BindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
},
})
if err != nil {
ctxlog.Error(ctx, err, "")
Expand Down Expand Up @@ -122,7 +124,7 @@ func main() {
// Add optionally configured extra handlers to metrics endpoint
for path, handler := range buildMetrics.ExtraHandlers() {
ctxlog.Info(ctx, "Adding metrics extra handler path", "path", path)
if err := mgr.AddMetricsExtraHandler(path, handler); err != nil {
if err := mgr.AddMetricsServerExtraHandler(path, handler); err != nil {
ctxlog.Error(ctx, err, "")
os.Exit(2)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/buildstrategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ The build strategy provides the following parameters that you can set in a Build
| Parameter | Description | Default |
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|
| `go-flags` | Value for the GOFLAGS environment variable. | Empty |
| `go-version` | Version of Go, must match a tag from [the golang image](https://hub.docker.com/_/golang?tab=tags) | `1.21` |
| `go-version` | Version of Go, must match a tag from [the golang image](https://hub.docker.com/_/golang?tab=tags) | `1.22` |
| `ko-version` | Version of ko, must be either `latest` for the newest release, or a [ko release name](https://github.com/ko-build/ko/releases) | `latest` |
| `package-directory` | The directory inside the context directory containing the main package. | `.` |
| `target-platform` | Target platform to be built. For example: `linux/arm64`. Multiple platforms can be provided separated by comma, for example: `linux/arm64,linux/amd64`. The value `all` will build all platforms supported by the base image. The value `current` will build the platform on which the build runs. | `current` |
Expand Down
16 changes: 7 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/shipwright-io/build

go 1.22

toolchain go1.22.6

require (
github.com/docker/cli v27.1.2+incompatible
github.com/go-git/go-git/v5 v5.12.0
Expand All @@ -19,15 +17,15 @@ require (
github.com/spf13/pflag v1.0.5
github.com/tektoncd/pipeline v0.62.1
go.uber.org/zap v1.27.0
k8s.io/api v0.29.6
k8s.io/apiextensions-apiserver v0.29.2
k8s.io/api v0.29.7
k8s.io/apiextensions-apiserver v0.29.7
k8s.io/apimachinery v0.29.7
k8s.io/client-go v0.29.6
k8s.io/client-go v0.29.7
k8s.io/code-generator v0.29.7
k8s.io/kubectl v0.27.11
k8s.io/kubectl v0.29.7
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
knative.dev/pkg v0.0.0-20240416145024-0f34a8815650
sigs.k8s.io/controller-runtime v0.15.3
sigs.k8s.io/controller-runtime v0.17.6
sigs.k8s.io/yaml v1.4.0
)

Expand Down Expand Up @@ -57,7 +55,7 @@ require (
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
Expand Down Expand Up @@ -121,7 +119,7 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.29.2 // indirect
k8s.io/component-base v0.29.7 // indirect
k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
Expand Down
Loading

0 comments on commit 131af56

Please sign in to comment.