Skip to content

Commit

Permalink
Bump Go version to 1.21
Browse files Browse the repository at this point in the history
* bump in go.mod (base and api)
* bump go-toolset in Dockerfile
* bump in github jobs ('.github/workflows')
* Bump the golangci-lint version in the .pre-commit-config.yaml to v1.59.1 (1.60 >= golang 1.22; 1.61 >= golang 1.23)
* Bump build_root_image in .ci-operator.yaml to ci-build-root-golang-1.21-sdk-1.31

Jira: OSPRH-6501
Signed-off-by: Brendan Shephard <bshephar@redhat.com>
  • Loading branch information
bshephar committed Sep 17, 2024
1 parent 9c3e4ba commit b069b29
Show file tree
Hide file tree
Showing 12 changed files with 355 additions and 110 deletions.
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: tools
namespace: openstack-k8s-operators
tag: ci-build-root-golang-1.20-sdk-1.31
tag: ci-build-root-golang-1.21-sdk-1.31
2 changes: 1 addition & 1 deletion .github/workflows/build-horizon-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/reusable-build-operator.yaml@main
with:
operator_name: horizon
go_version: 1.20.x
go_version: 1.21.x
operator_sdk_version: 1.31.0
secrets:
IMAGENAMESPACE: ${{ secrets.IMAGENAMESPACE }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
- id: go-mod-tidy

- repo: https://github.com/golangci/golangci-lint
rev: v1.55.2
rev: v1.59.1
hooks:
- id: golangci-lint-full
args: ["-v"]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.20
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.21
ARG OPERATOR_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi-minimal:latest

# Build the manager binary
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ OPERATOR_SDK_VERSION ?= v1.31.0
DEFAULT_IMG ?= quay.io/openstack-k8s-operators/horizon-operator:latest
IMG ?= $(DEFAULT_IMG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.28
ENVTEST_K8S_VERSION = 1.29

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down
170 changes: 142 additions & 28 deletions api/bases/horizon.openstack.org_horizons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -778,34 +778,6 @@ spec:
recorded in the status field of the
claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources'
properties:
claims:
description: "Claims lists the names
of resources, defined in spec.resourceClaims,
that are used by this container.
\n This is an alpha field and
requires enabling the DynamicResourceAllocation
feature gate. \n This field is
immutable. It can only be set
for containers."
items:
description: ResourceClaim references
one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match
the name of one entry in
pod.spec.resourceClaims
of the Pod where this field
is used. It makes that resource
available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand Down Expand Up @@ -901,6 +873,34 @@ spec:
name of the StorageClass required
by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1'
type: string
volumeAttributesClassName:
description: 'volumeAttributesClassName
may be used to set the VolumeAttributesClass
used by this claim. If specified,
the CSI driver will create or update
the volume with the attributes defined
in the corresponding VolumeAttributesClass.
This has a different purpose than
storageClassName, it can be changed
after the claim is created. An empty
string value means that no VolumeAttributesClass
will be applied to the claim but it''s
not allowed to reset this field to
empty string once it is set. If unspecified
and the PersistentVolumeClaim is unbound,
the default VolumeAttributesClass
will be set by the persistentvolume
controller if it exists. If the resource
referred to by volumeAttributesClass
does not exist, this PersistentVolumeClaim
will be set to a Pending state, as
reflected by the modifyVolumeStatus
field, until such as a resource exists.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#volumeattributesclass
(Alpha) Using this field requires
the VolumeAttributesClass feature
gate to be enabled.'
type: string
volumeMode:
description: volumeMode defines what
type of volume is required by the
Expand Down Expand Up @@ -1316,6 +1316,120 @@ spec:
description: Projection that may be projected
along with other supported volume types
properties:
clusterTrustBundle:
description: "ClusterTrustBundle allows
a pod to access the `.spec.trustBundle`
field of ClusterTrustBundle objects
in an auto-updating file. \n Alpha,
gated by the ClusterTrustBundleProjection
feature gate. \n ClusterTrustBundle
objects can either be selected by name,
or by the combination of signer name
and a label selector. \n Kubelet performs
aggressive normalization of the PEM
contents written into the pod filesystem.
\ Esoteric PEM features such as inter-block
comments and block headers are stripped.
\ Certificates are deduplicated. The
ordering of certificates within the
file is arbitrary, and Kubelet may change
the order over time."
properties:
labelSelector:
description: Select all ClusterTrustBundles
that match this label selector. Only
has effect if signerName is set. Mutually-exclusive
with name. If unset, interpreted
as "match nothing". If set but
empty, interpreted as "match everything".
properties:
matchExpressions:
description: matchExpressions
is a list of label selector
requirements. The requirements
are ANDed.
items:
description: A label selector
requirement is a selector
that contains values, a key,
and an operator that relates
the key and values.
properties:
key:
description: key is the
label key that the selector
applies to.
type: string
operator:
description: operator represents
a key's relationship to
a set of values. Valid
operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an
array of string values.
If the operator is In
or NotIn, the values array
must be non-empty. If
the operator is Exists
or DoesNotExist, the values
array must be empty. This
array is replaced during
a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a
map of {key,value} pairs. A
single {key,value} in the matchLabels
map is equivalent to an element
of matchExpressions, whose key
field is "key", the operator
is "In", and the values array
contains only "value". The requirements
are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
name:
description: Select a single ClusterTrustBundle
by object name. Mutually-exclusive
with signerName and labelSelector.
type: string
optional:
description: If true, don't block
pod startup if the referenced ClusterTrustBundle(s)
aren't available. If using name,
then the named ClusterTrustBundle
is allowed not to exist. If using
signerName, then the combination
of signerName and labelSelector
is allowed to match zero ClusterTrustBundles.
type: boolean
path:
description: Relative path from the
volume root to write the bundle.
type: string
signerName:
description: Select all ClusterTrustBundles
that match this signer name. Mutually-exclusive
with name. The contents of all
selected ClusterTrustBundles will
be unified and deduplicated.
type: string
required:
- path
type: object
configMap:
description: configMap information about
the configMap data to project
Expand Down
16 changes: 7 additions & 9 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/openstack-k8s-operators/horizon-operator/api

go 1.20
go 1.21

require (
github.com/openstack-k8s-operators/lib-common/modules/common v0.4.1-0.20240905123813-174296c09ec6
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.0
k8s.io/api v0.28.13
k8s.io/apimachinery v0.28.13
sigs.k8s.io/controller-runtime v0.16.6
k8s.io/api v0.29.2
k8s.io/apimachinery v0.29.2
sigs.k8s.io/controller-runtime v0.17.6
)

require (
Expand All @@ -18,7 +18,6 @@ require (
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.9 // indirect
Expand All @@ -42,7 +41,6 @@ require (
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/goleak v1.3.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
Expand All @@ -56,9 +54,9 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.28.13 // indirect
k8s.io/client-go v0.28.13 // indirect
k8s.io/component-base v0.28.13 // indirect
k8s.io/apiextensions-apiserver v0.29.2 // indirect
k8s.io/client-go v0.29.2 // indirect
k8s.io/component-base v0.29.2 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
Expand Down
Loading

0 comments on commit b069b29

Please sign in to comment.