From 8679c977ba0eb6743ac9f0235d36ed320637a40f Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Mon, 9 Sep 2024 12:48:46 +0100 Subject: [PATCH] Update to Go 1.23 (#3917) * lint Signed-off-by: Chris Martin * lint Signed-off-by: Chris Martin * update go-swagger Signed-off-by: Chris Martin * regen proto Signed-off-by: Chris Martin --------- Signed-off-by: Chris Martin --- .github/actions/setup-go-cache/action.yml | 4 +-- .goreleaser.yml | 2 +- docs/developer.md | 2 +- go.mod | 4 +-- magefiles/cmd.go | 2 +- magefiles/go.go | 2 +- pkg/api/api.swagger.go | 39 +++++++++++++++++------ pkg/api/api.swagger.json | 39 +++++++++++++++++------ pkg/api/binoculars/api.swagger.go | 11 ++----- pkg/api/binoculars/api.swagger.json | 11 ++----- tools.yaml | 2 +- 11 files changed, 73 insertions(+), 45 deletions(-) diff --git a/.github/actions/setup-go-cache/action.yml b/.github/actions/setup-go-cache/action.yml index 53d21cde1a1..c518423f820 100644 --- a/.github/actions/setup-go-cache/action.yml +++ b/.github/actions/setup-go-cache/action.yml @@ -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 diff --git a/.goreleaser.yml b/.goreleaser.yml index 4ec1e6beefc..aca21d51163 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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] diff --git a/docs/developer.md b/docs/developer.md index 8e2f5b4a8c8..315f7e5bfa7 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -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/) diff --git a/go.mod b/go.mod index d23c92d5a56..05c45d5c116 100644 --- a/go.mod +++ b/go.mod @@ -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, diff --git a/magefiles/cmd.go b/magefiles/cmd.go index 3531d35a9b0..dc67d63e0ab 100644 --- a/magefiles/cmd.go +++ b/magefiles/cmd.go @@ -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 } diff --git a/magefiles/go.go b/magefiles/go.go index 15bdf2c3364..7c8e7479eb1 100644 --- a/magefiles/go.go +++ b/magefiles/go.go @@ -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") diff --git a/pkg/api/api.swagger.go b/pkg/api/api.swagger.go index 89ed2667b1a..384e472a92a 100644 --- a/pkg/api/api.swagger.go +++ b/pkg/api/api.swagger.go @@ -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" + @@ -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" + @@ -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" + @@ -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" + @@ -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" + @@ -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" + diff --git a/pkg/api/api.swagger.json b/pkg/api/api.swagger.json index 38db0a3c2fc..cd2f0e96c1c 100644 --- a/pkg/api/api.swagger.json +++ b/pkg/api/api.swagger.json @@ -3659,7 +3659,9 @@ "x-go-name": "Subresource" }, "time": { - "$ref": "#/definitions/v1Time" + "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", + "type": "string", + "x-go-name": "Time" } }, "x-go-package": "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -3823,7 +3825,9 @@ "x-go-name": "Annotations" }, "creationTimestamp": { - "$ref": "#/definitions/v1Time" + "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", + "type": "string", + "x-go-name": "CreationTimestamp" }, "deletionGracePeriodSeconds": { "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", @@ -3832,7 +3836,9 @@ "x-go-name": "DeletionGracePeriodSeconds" }, "deletionTimestamp": { - "$ref": "#/definitions/v1Time" + "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", + "type": "string", + "x-go-name": "DeletionTimestamp" }, "finalizers": { "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", @@ -3996,7 +4002,9 @@ "x-go-name": "Annotations" }, "creationTimestamp": { - "$ref": "#/definitions/v1Time" + "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", + "type": "string", + "x-go-name": "CreationTimestamp" }, "deletionGracePeriodSeconds": { "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", @@ -4005,7 +4013,9 @@ "x-go-name": "DeletionGracePeriodSeconds" }, "deletionTimestamp": { - "$ref": "#/definitions/v1Time" + "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", + "type": "string", + "x-go-name": "DeletionTimestamp" }, "finalizers": { "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", @@ -5444,11 +5454,20 @@ "x-go-package": "k8s.io/api/core/v1" }, "v1Time": { - "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.", - "type": "string", - "format": "date-time", - "title": "A Time represents an instant in time with nanosecond precision.", - "x-go-package": "k8s.io/apimachinery/pkg/apis/meta/v1" + "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", + "type": "object", + "properties": { + "nanos": { + "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.", + "type": "integer", + "format": "int32" + }, + "seconds": { + "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.", + "type": "string", + "format": "int64" + } + } }, "v1Toleration": { "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.", diff --git a/pkg/api/binoculars/api.swagger.go b/pkg/api/binoculars/api.swagger.go index 206e611b3c9..0beb8342379 100644 --- a/pkg/api/binoculars/api.swagger.go +++ b/pkg/api/binoculars/api.swagger.go @@ -221,7 +221,9 @@ func SwaggerJsonTemplate() string { " \"x-go-name\": \"SinceSeconds\"\n" + " },\n" + " \"sinceTime\": {\n" + - " \"$ref\": \"#/definitions/v1Time\"\n" + + " \"description\": \"An RFC3339 timestamp from which to show logs. If this value\\nprecedes the time a pod was started, only logs since the pod start will be returned.\\nIf this value is in the future, no logs will be returned.\\nOnly one of sinceSeconds or sinceTime may be specified.\\n+optional\",\n" + + " \"type\": \"string\",\n" + + " \"x-go-name\": \"SinceTime\"\n" + " },\n" + " \"tailLines\": {\n" + " \"description\": \"If set, the number of lines from the end of the logs to show. If not specified,\\nlogs are shown from the creation of the container or sinceSeconds or sinceTime\\n+optional\",\n" + @@ -236,13 +238,6 @@ func SwaggerJsonTemplate() string { " }\n" + " },\n" + " \"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" + " }\n" + " }\n" + "}" diff --git a/pkg/api/binoculars/api.swagger.json b/pkg/api/binoculars/api.swagger.json index e1ee15d781b..7544c70d38a 100644 --- a/pkg/api/binoculars/api.swagger.json +++ b/pkg/api/binoculars/api.swagger.json @@ -210,7 +210,9 @@ "x-go-name": "SinceSeconds" }, "sinceTime": { - "$ref": "#/definitions/v1Time" + "description": "An RFC3339 timestamp from which to show logs. If this value\nprecedes the time a pod was started, only logs since the pod start will be returned.\nIf this value is in the future, no logs will be returned.\nOnly one of sinceSeconds or sinceTime may be specified.\n+optional", + "type": "string", + "x-go-name": "SinceTime" }, "tailLines": { "description": "If set, the number of lines from the end of the logs to show. If not specified,\nlogs are shown from the creation of the container or sinceSeconds or sinceTime\n+optional", @@ -225,13 +227,6 @@ } }, "x-go-package": "k8s.io/api/core/v1" - }, - "v1Time": { - "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.", - "type": "string", - "format": "date-time", - "title": "A Time represents an instant in time with nanosecond precision.", - "x-go-package": "k8s.io/apimachinery/pkg/apis/meta/v1" } } } \ No newline at end of file diff --git a/tools.yaml b/tools.yaml index f055c4d8420..d8ff3701f13 100644 --- a/tools.yaml +++ b/tools.yaml @@ -1,7 +1,7 @@ # Tools used to build and release Armada # TODO: Use latest goreleaser. After upgrading k8s.io packages. tools: -- github.com/go-swagger/go-swagger/cmd/swagger@v0.29.0 +- github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 - github.com/golang/mock/mockgen@v1.6.0 - github.com/gordonklaus/ineffassign@v0.0.0-20210914165742-4cc7213b9bc8 - github.com/goreleaser/goreleaser@v1.20.0