Skip to content

Commit

Permalink
Update to Go 1.23 (#3917)
Browse files Browse the repository at this point in the history
* lint

Signed-off-by: Chris Martin <chris@cmartinit.co.uk>

* lint

Signed-off-by: Chris Martin <chris@cmartinit.co.uk>

* update go-swagger

Signed-off-by: Chris Martin <chris@cmartinit.co.uk>

* regen proto

Signed-off-by: Chris Martin <chris@cmartinit.co.uk>

---------

Signed-off-by: Chris Martin <chris@cmartinit.co.uk>
  • Loading branch information
d80tb7 committed Sep 9, 2024
1 parent 49ddb5c commit 8679c97
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-go-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ inputs:
description: "Prefix for the cache key"
required: true
go-version:
description: "Version of Go. Default 1.21"
description: "Version of Go. Default 1.23"
required: false
default: "1.21"
default: "1.23"
cache-tools:
description: "True/false flag to cache tools"
required: false
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
# To use a builder other than "default", set this variable.
# Necessary for, e.g., GitHub actions cache integration.
- DOCKER_BUILDX_BUILDER={{ if index .Env "DOCKER_BUILDX_BUILDER" }}{{ .Env.DOCKER_BUILDX_BUILDER }}{{ else }}default{{ end }}
- GOVERSION={{ if index .Env "GOVERSION" }}{{ .Env.GOVERSION }}{{ else }}go1.21{{ end }}
- GOVERSION={{ if index .Env "GOVERSION" }}{{ .Env.GOVERSION }}{{ else }}go1.23{{ end }}

builds:
- env: [CGO_ENABLED=0]
Expand Down
2 changes: 1 addition & 1 deletion docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Please see these documents for more information about Armadas Design:

## Pre-requisites

- [Go](https://go.dev/doc/install) (version 1.21 or later)
- [Go](https://go.dev/doc/install) (version 1.23 or later)
- gcc (for Windows, see, e.g., [tdm-gcc](https://jmeubank.github.io/tdm-gcc/))
- [mage](https://magefile.org/)
- [docker](https://docs.docker.com/get-docker/)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/armadaproject/armada

go 1.21
go 1.23

toolchain go1.21.10
toolchain go1.23.1

// athenz@v1.10.5 and onwards bundle encrypted signing keys with the source code.
// Because corporate proxies may block go get commands that pull in encrypted data,
Expand Down
2 changes: 1 addition & 1 deletion magefiles/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func go_CMD() ([]string, error) {
"GARCH=amd64",
"-v",
fmt.Sprintf("%s:/go", DOCKER_GOPATH_DIR),
"golang:1.21-bookworm",
"golang:1.23-bookworm",
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion magefiles/go.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/pkg/errors"
)

const GO_VERSION_CONSTRAINT = ">= 1.21.0"
const GO_VERSION_CONSTRAINT = ">= 1.23.0"

func goBinary() string {
return binaryWithExt("go")
Expand Down
39 changes: 29 additions & 10 deletions pkg/api/api.swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3670,7 +3670,9 @@ func SwaggerJsonTemplate() string {
" \"x-go-name\": \"Subresource\"\n" +
" },\n" +
" \"time\": {\n" +
" \"$ref\": \"#/definitions/v1Time\"\n" +
" \"description\": \"Time is the timestamp of when the ManagedFields entry was added. The\\ntimestamp will also be updated if a field is added, the manager\\nchanges any of the owned fields value or removes a field. The\\ntimestamp does not update when a field is removed from the entry\\nbecause another manager took it over.\\n+optional\",\n" +
" \"type\": \"string\",\n" +
" \"x-go-name\": \"Time\"\n" +
" }\n" +
" },\n" +
" \"x-go-package\": \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n" +
Expand Down Expand Up @@ -3834,7 +3836,9 @@ func SwaggerJsonTemplate() string {
" \"x-go-name\": \"Annotations\"\n" +
" },\n" +
" \"creationTimestamp\": {\n" +
" \"$ref\": \"#/definitions/v1Time\"\n" +
" \"description\": \"CreationTimestamp is a timestamp representing the server time when this object was\\ncreated. It is not guaranteed to be set in happens-before order across separate operations.\\nClients may not set this value. It is represented in RFC3339 form and is in UTC.\\n\\nPopulated by the system.\\nRead-only.\\nNull for lists.\\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\\n+optional\",\n" +
" \"type\": \"string\",\n" +
" \"x-go-name\": \"CreationTimestamp\"\n" +
" },\n" +
" \"deletionGracePeriodSeconds\": {\n" +
" \"description\": \"Number of seconds allowed for this object to gracefully terminate before\\nit will be removed from the system. Only set when deletionTimestamp is also set.\\nMay only be shortened.\\nRead-only.\\n+optional\",\n" +
Expand All @@ -3843,7 +3847,9 @@ func SwaggerJsonTemplate() string {
" \"x-go-name\": \"DeletionGracePeriodSeconds\"\n" +
" },\n" +
" \"deletionTimestamp\": {\n" +
" \"$ref\": \"#/definitions/v1Time\"\n" +
" \"description\": \"DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This\\nfield is set by the server when a graceful deletion is requested by the user, and is not\\ndirectly settable by a client. The resource is expected to be deleted (no longer visible\\nfrom resource lists, and not reachable by name) after the time in this field, once the\\nfinalizers list is empty. As long as the finalizers list contains items, deletion is blocked.\\nOnce the deletionTimestamp is set, this value may not be unset or be set further into the\\nfuture, although it may be shortened or the resource may be deleted prior to this time.\\nFor example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react\\nby sending a graceful termination signal to the containers in the pod. After that 30 seconds,\\nthe Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup,\\nremove the pod from the API. In the presence of network partitions, this object may still\\nexist after this timestamp, until an administrator or automated process can determine the\\nresource is fully terminated.\\nIf not set, graceful deletion of the object has not been requested.\\n\\nPopulated by the system when a graceful deletion is requested.\\nRead-only.\\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\\n+optional\",\n" +
" \"type\": \"string\",\n" +
" \"x-go-name\": \"DeletionTimestamp\"\n" +
" },\n" +
" \"finalizers\": {\n" +
" \"description\": \"Must be empty before the object is deleted from the registry. Each entry\\nis an identifier for the responsible component that will remove the entry\\nfrom the list. If the deletionTimestamp of the object is non-nil, entries\\nin this list can only be removed.\\nFinalizers may be processed and removed in any order. Order is NOT enforced\\nbecause it introduces significant risk of stuck finalizers.\\nfinalizers is a shared field, any actor with permission can reorder it.\\nIf the finalizer list is processed in order, then this can lead to a situation\\nin which the component responsible for the first finalizer in the list is\\nwaiting for a signal (field value, external system, or other) produced by a\\ncomponent responsible for a finalizer later in the list, resulting in a deadlock.\\nWithout enforced ordering finalizers are free to order amongst themselves and\\nare not vulnerable to ordering changes in the list.\\n+optional\\n+patchStrategy=merge\",\n" +
Expand Down Expand Up @@ -4007,7 +4013,9 @@ func SwaggerJsonTemplate() string {
" \"x-go-name\": \"Annotations\"\n" +
" },\n" +
" \"creationTimestamp\": {\n" +
" \"$ref\": \"#/definitions/v1Time\"\n" +
" \"description\": \"CreationTimestamp is a timestamp representing the server time when this object was\\ncreated. It is not guaranteed to be set in happens-before order across separate operations.\\nClients may not set this value. It is represented in RFC3339 form and is in UTC.\\n\\nPopulated by the system.\\nRead-only.\\nNull for lists.\\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\\n+optional\",\n" +
" \"type\": \"string\",\n" +
" \"x-go-name\": \"CreationTimestamp\"\n" +
" },\n" +
" \"deletionGracePeriodSeconds\": {\n" +
" \"description\": \"Number of seconds allowed for this object to gracefully terminate before\\nit will be removed from the system. Only set when deletionTimestamp is also set.\\nMay only be shortened.\\nRead-only.\\n+optional\",\n" +
Expand All @@ -4016,7 +4024,9 @@ func SwaggerJsonTemplate() string {
" \"x-go-name\": \"DeletionGracePeriodSeconds\"\n" +
" },\n" +
" \"deletionTimestamp\": {\n" +
" \"$ref\": \"#/definitions/v1Time\"\n" +
" \"description\": \"DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This\\nfield is set by the server when a graceful deletion is requested by the user, and is not\\ndirectly settable by a client. The resource is expected to be deleted (no longer visible\\nfrom resource lists, and not reachable by name) after the time in this field, once the\\nfinalizers list is empty. As long as the finalizers list contains items, deletion is blocked.\\nOnce the deletionTimestamp is set, this value may not be unset or be set further into the\\nfuture, although it may be shortened or the resource may be deleted prior to this time.\\nFor example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react\\nby sending a graceful termination signal to the containers in the pod. After that 30 seconds,\\nthe Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup,\\nremove the pod from the API. In the presence of network partitions, this object may still\\nexist after this timestamp, until an administrator or automated process can determine the\\nresource is fully terminated.\\nIf not set, graceful deletion of the object has not been requested.\\n\\nPopulated by the system when a graceful deletion is requested.\\nRead-only.\\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata\\n+optional\",\n" +
" \"type\": \"string\",\n" +
" \"x-go-name\": \"DeletionTimestamp\"\n" +
" },\n" +
" \"finalizers\": {\n" +
" \"description\": \"Must be empty before the object is deleted from the registry. Each entry\\nis an identifier for the responsible component that will remove the entry\\nfrom the list. If the deletionTimestamp of the object is non-nil, entries\\nin this list can only be removed.\\nFinalizers may be processed and removed in any order. Order is NOT enforced\\nbecause it introduces significant risk of stuck finalizers.\\nfinalizers is a shared field, any actor with permission can reorder it.\\nIf the finalizer list is processed in order, then this can lead to a situation\\nin which the component responsible for the first finalizer in the list is\\nwaiting for a signal (field value, external system, or other) produced by a\\ncomponent responsible for a finalizer later in the list, resulting in a deadlock.\\nWithout enforced ordering finalizers are free to order amongst themselves and\\nare not vulnerable to ordering changes in the list.\\n+optional\\n+patchStrategy=merge\",\n" +
Expand Down Expand Up @@ -5455,11 +5465,20 @@ func SwaggerJsonTemplate() string {
" \"x-go-package\": \"k8s.io/api/core/v1\"\n" +
" },\n" +
" \"v1Time\": {\n" +
" \"description\": \"Programs using times should typically store and pass them as values,\\nnot pointers. That is, time variables and struct fields should be of\\ntype time.Time, not *time.Time.\\n\\nA Time value can be used by multiple goroutines simultaneously except\\nthat the methods GobDecode, UnmarshalBinary, UnmarshalJSON and\\nUnmarshalText are not concurrency-safe.\\n\\nTime instants can be compared using the Before, After, and Equal methods.\\nThe Sub method subtracts two instants, producing a Duration.\\nThe Add method adds a Time and a Duration, producing a Time.\\n\\nThe zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC.\\nAs this time is unlikely to come up in practice, the IsZero method gives\\na simple way of detecting a time that has not been initialized explicitly.\\n\\nEach Time has associated with it a Location, consulted when computing the\\npresentation form of the time, such as in the Format, Hour, and Year methods.\\nThe methods Local, UTC, and In return a Time with a specific location.\\nChanging the location in this way changes only the presentation; it does not\\nchange the instant in time being denoted and therefore does not affect the\\ncomputations described in earlier paragraphs.\\n\\nRepresentations of a Time value saved by the GobEncode, MarshalBinary,\\nMarshalJSON, and MarshalText methods store the Time.Location's offset, but not\\nthe location name. They therefore lose information about Daylight Saving Time.\\n\\nIn addition to the required “wall clock” reading, a Time may contain an optional\\nreading of the current process's monotonic clock, to provide additional precision\\nfor comparison or subtraction.\\nSee the “Monotonic Clocks” section in the package documentation for details.\\n\\nNote that the Go == operator compares not just the time instant but also the\\nLocation and the monotonic clock reading. Therefore, Time values should not\\nbe used as map or database keys without first guaranteeing that the\\nidentical Location has been set for all values, which can be achieved\\nthrough use of the UTC or Local method, and that the monotonic clock reading\\nhas been stripped by setting t = t.Round(0). In general, prefer t.Equal(u)\\nto t == u, since t.Equal uses the most accurate comparison available and\\ncorrectly handles the case when only one of its arguments has a monotonic\\nclock reading.\",\n" +
" \"type\": \"string\",\n" +
" \"format\": \"date-time\",\n" +
" \"title\": \"A Time represents an instant in time with nanosecond precision.\",\n" +
" \"x-go-package\": \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n" +
" \"description\": \"Time is a wrapper around time.Time which supports correct\\nmarshaling to YAML and JSON. Wrappers are provided for many\\nof the factory methods that the time package offers.\\n\\n+protobuf.options.marshal=false\\n+protobuf.as=Timestamp\\n+protobuf.options.(gogoproto.goproto_stringer)=false\",\n" +
" \"type\": \"object\",\n" +
" \"properties\": {\n" +
" \"nanos\": {\n" +
" \"description\": \"Non-negative fractions of a second at nanosecond resolution. Negative\\nsecond values with fractions must still have non-negative nanos values\\nthat count forward in time. Must be from 0 to 999,999,999\\ninclusive. This field may be limited in precision depending on context.\",\n" +
" \"type\": \"integer\",\n" +
" \"format\": \"int32\"\n" +
" },\n" +
" \"seconds\": {\n" +
" \"description\": \"Represents seconds of UTC time since Unix epoch\\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n9999-12-31T23:59:59Z inclusive.\",\n" +
" \"type\": \"string\",\n" +
" \"format\": \"int64\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"v1Toleration\": {\n" +
" \"description\": \"The pod this Toleration is attached to tolerates any taint that matches\\nthe triple \\u003ckey,value,effect\\u003e using the matching operator \\u003coperator\\u003e.\",\n" +
Expand Down
Loading

0 comments on commit 8679c97

Please sign in to comment.